<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">


	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
	</bean>


	<util:constant id="defaultLogLevel" static-field="org.apache.mina.filter.logging.LogLevel.INFO" />

	<bean id="minaMllpCodecFactory" class="gov.va.med.cds.socket.server.handler.MinaMllpCodecFactory" />

	<bean id="minaMllpProtocolFilter" class="org.apache.mina.filter.codec.ProtocolCodecFilter">
		<constructor-arg index="0" ref="minaMllpCodecFactory" />
	</bean>

	<bean id="loggingFilter" class="org.apache.mina.filter.logging.LoggingFilter" />

	<bean id="filterChainBuilder" class="org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder">
		<property name="filters">
			<map>
				<entry key="minaMllpProtocolFilter" value-ref="minaMllpProtocolFilter" />
			</map>
		</property>
	</bean>

	<bean id="socketAddress" class="java.net.InetSocketAddress">
		<constructor-arg>
			<bean class="java.lang.Integer" factory-method="parseInt">
				<constructor-arg type="java.lang.String" value="5001" />
			</bean>
		</constructor-arg>
	</bean>

	<bean id="minaServer" class="org.apache.mina.transport.socket.nio.NioSocketAcceptor" destroy-method="unbind">
		<property name="filterChainBuilder" ref="filterChainBuilder" />
		<property name="handler" ref="minaMllpHandler" />
	</bean>

	<bean id="acceptorMBean" class="org.apache.mina.integration.jmx.IoServiceMBean">
		<constructor-arg ref="minaServer" />
	</bean>

	<bean id="minaServerManager" class="gov.va.med.cds.socket.server.MinaServerManager" init-method="init">
		<property name="minaServer" ref="minaServer" />
		<property name="socketAddress" ref="socketAddress" />
		<property name="acceptorMBean" ref="acceptorMBean" />
		<property name="defaultLogLevel" ref="defaultLogLevel" />
	</bean>

	<bean name="minaMllpHandler" class="gov.va.med.cds.socket.server.handler.MinaMllpHandler">
		<property name="accessValidator" ref="accessValidator" />
		<property name="messageUtil" ref="messageUtil" />
		<property name="processLabMessage" value="${process.lab.message}" />
		<property name="messageMediatorDispatcher">
			<bean class="gov.va.med.cds.socket.server.handler.MessageMediatorDispatcher">
				<property name="messageTypeMediatorMap">
					<map>
						<entry key="LA7LAB~ORU">
							<ref bean="asyncMessageMediator" />
						</entry>
						<!-- Adding for HTH -->
						<entry key="HDRVTLS-HTH~ORU">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="HTAPPL-PS1.0~MDM">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="HTAPPL-PS2.0~MDM">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="HTAPPL-ADL~MDM">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="HTAPPL-DMP~MDM">
							<ref bean="asyncMessageMediator" />
						</entry>
						<!-- entry key="CHDR~QBP"> <ref bean="syncMessageMediator" /> </entry> <entry key="CHDR SENDER~QBP"> <ref bean="syncMessageMediator" /> </entry -->
						<entry key="HTAPPL-CENSUS~MDM">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="TIUHL7~ACK">
							<ref bean="asyncMessageMediator" />
						</entry>
						<entry key="TIUHL7~ACK~T02">
							<ref bean="asyncMessageMediator" />
						</entry>
					</map>
				</property>
			</bean>
		</property>

		<property name="responseGenerator">
			<bean class="gov.va.med.cds.socket.server.handler.MappingResponseGenerator">
				<property name="responseGeneratorMap">
					<map>
						<entry key="DEFAULT">
							<bean class="gov.va.med.cds.socket.server.handler.SimpleVistACommitAckResponseGenerator" />
						</entry>
						<entry key="LA7LAB~ORU">
							<bean class="gov.va.med.cds.socket.server.handler.SimpleVistACommitAckResponseGenerator" />
						</entry>
						<entry key="CHDR~QBP">
							<bean class="gov.va.med.cds.socket.server.handler.ChdrLegacyResponseGenerator" />
						</entry>
						<entry key="CHDR SENDER~QBP">
							<bean class="gov.va.med.cds.socket.server.handler.ChdrLegacyResponseGenerator" />
						</entry>
					</map>
				</property>
			</bean>
		</property>

	</bean>

	<bean id="messageUtil" class="gov.va.med.cds.socket.server.handler.MessageUtil"></bean>

	<!-- Synchronous Message Mediator UDDI Configuration -->
	<!-- bean id="mPJaxrUtil" class="gov.va.med.cds.registry.JAXRUtility"> <property name="connectionProperties"> <props> <prop key="javax.xml.registry.queryManagerURL">${mediator_uddi_listener_url}</prop> 
		</props> </property> <property name="factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl" /> </bean> <bean id="messageMediatorFactory" 
		class="${cds_mediator_factory_class}" lazy-init="true"> <property name="serviceBindingId" value="${mediator_uddi_service_bind_id}" /> <property name="jaxrUtility" 
		ref="mPJaxrUtil" /> </bean -->

	<!-- bean id="syncMessageMediator" factory-bean="messageMediatorFactory" factory-method="create" lazy-init="true" / -->

	<!-- End - Synchronous Message Mediator UDDI Configuration -->


	<!-- Asynchronous Non-CAIP Message Mediator configuration. -->
	<bean id="asyncMessageMediator" class="gov.va.med.mediator.client.messagemediator.JmsMessageMediatorDelegate">
		<property name="sendingOrganization" value="${cds.sending.organization}" />
		<property name="sendingApplicationToJmsTemplateMap">
			<util:map>
				<entry key="TIUHL7">
					<bean parent="vistaBaseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="vistaJndiTemplate" />
								<property name="jndiName" value="jms/fpds/DefaultHl7AckQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<!--TODO both HDRFTP and FTP map to the same destination - unsure which one will be the final value -->
				<entry key="HDRFTP">
					<bean parent="vistaBaseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="vistaJndiTemplate" />
								<property name="jndiName" value="jms/fpds/FtpHl7AckQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="FTP">
					<bean parent="vistaBaseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="vistaJndiTemplate" />
								<property name="jndiName" value="jms/fpds/FtpHl7AckQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRALGY">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/AllergiesQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRADAS">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/AllergyAssessmentQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRPRES">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/PharmacyFullQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRPPAR">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/PharmacyPartialQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRPREF">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/PharmacyRefillQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HDRVTLS">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/VitalsQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<!-- Adding for HTH -->
				<entry key="HDRVTLS-HTH">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/HomeTeleHealthQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="HTAPPL">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/HomeTeleHealthSurveyQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<entry key="LA7LAB">
					<bean parent="baseJmsTemplate">
						<property name="defaultDestination">
							<bean class="org.springframework.jndi.JndiObjectFactoryBean">
								<property name="jndiTemplate" ref="jndiTemplate" />
								<property name="jndiName" value="jms/cds/LabQueue" />
							</bean>
						</property>
					</bean>
				</entry>
				<!-- migrated to VHIM <entry key="CHDR_QUEUE"> <bean parent="baseJmsTemplate"> <property name="defaultDestination"> <bean class="org.springframework.jndi.JndiObjectFactoryBean" 
					> <property name="jndiTemplate" ref="jndiTemplate"/> <property name="jndiName" value="jms/cds/ChdrQueue"/> </bean> </property> </bean> </entry> -->
			</util:map>
		</property>
	</bean>

	<!-- Spring JMS Template -->
	<bean id="baseJmsTemplate" class="org.springframework.jms.core.JmsTemplate" abstract="true">
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="receiveTimeout" value="10000" />
	</bean>

	<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiTemplate" ref="jndiTemplate" />
		<property name="jndiName" value="jms/cds/CDSClinicalJMSConnectionFactory" />
	</bean>

	<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
		<property name="environment">
			<props>
				<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
				<prop key="java.naming.provider.url">${environment.cds.weblogic.provider.url}</prop>
				<prop key="java.naming.security.principal">${environment.cds.weblogic.security.principle}</prop>
				<prop key="java.naming.security.credentials">${environment.cds.weblogic.security.password}</prop>
			</props>
		</property>
	</bean>

	<!-- VistA Spring JMS Template -->
	<bean id="vistaBaseJmsTemplate" class="org.springframework.jms.core.JmsTemplate" abstract="true">
		<property name="connectionFactory" ref="vistaJmsConnectionFactory" />
		<property name="receiveTimeout" value="10000" />
	</bean>

	<bean id="vistaJmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiTemplate" ref="vistaJndiTemplate" />
		<property name="jndiName" value="jms/fpds/FpdsConnectionFactory" />
	</bean>

	<bean id="vistaJndiTemplate" class="org.springframework.jndi.JndiTemplate">
		<property name="environment">
			<props>
				<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
				<prop key="java.naming.provider.url">${vista.environment.cds.weblogic.provider.url}</prop>
				<prop key="java.naming.security.principal">${vista.environment.cds.weblogic.security.principle}</prop>
				<prop key="java.naming.security.credentials">${vista.environment.cds.weblogic.security.password}</prop>
			</props>
		</property>
	</bean>
	<bean name="accessValidator" class="gov.va.med.cds.socket.server.handler.MllpAccessValidator">
		<property name="allowableParameterValues" ref="allowableParameterValues" />
	</bean>

	<util:map id="allowableParameterValues">
		<entry key="TIUHL7">
			<util:map id="allowableParameterValuesTIUHL7">
				<entry key="/MSH-3">
					<list>
						<value>TIUHL7</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>ACK</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
			</util:map>
		</entry>
		<entry key="CHDR">
			<util:map id="allowableParameterValuesCHDR">
				<entry key="/MSH-3">
					<list>
						<value>CHDR</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>QBP</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<entry key="CHDR SENDER">
			<util:map id="allowableParameterValuesCHDRSender">
				<entry key="/MSH-3">
					<list>
						<value>CHDR</value>
						<value>CHDR SENDER</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>QBP</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<!-- List of allowable Parameter Values for VistA Lab writes -->
		<entry key="LA7LAB">
			<util:map id="allowableParameterValuesVistA">
				<!-- REQ 4.1 Sending Applications (MSH-3)- LA7LAB -->
				<entry key="/MSH-3">
					<list>
						<value>LA7LAB</value>
					</list>
				</entry>
				<!-- REQ 4.3 Message Type (MSH-9) - ORU -->
				<entry key="/MSH-9-1">
					<list>
						<value>ORU</value>
					</list>
				</entry>
				<!-- REQ 4.2 Receiving Application (MSH-5) - LA7HDR -->
				<entry key="/MSH-5">
					<list>
						<value>LA7HDR</value>
					</list>
				</entry>
				<!-- REQ 4.4 Message Processing ID (MSH-11) - P or T -->
				<entry key="/MSH-11">
					<list>
						<value>P</value>
						<value>T</value>
					</list>
				</entry>
				<!-- REQ 4.5 Version (MSH-12) - 2.4 -->
				<entry key="/MSH-12">
					<list>
						<value>2.4</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<!-- List of allowable Parameter Values for HTH -->
		<entry key="HDRVTLS-HTH">
			<util:map id="allowableParameterValuesHTH">
				<entry key="/MSH-3">
					<list>
						<value>HDRVTLS</value>
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HTH HDR</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>ORU</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
						<value>T</value>
					</list>
				</entry>
				<entry key="/MSH-12">
					<list>
						<value>2.4</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<entry key="HTAPPL-PS1.0">
			<util:map id="allowableParameterValuesPS1.0">
				<entry key="/MSH-3">
					<list>
						<value>HTAPPL</value>
					</list>
				</entry>
				<entry key="/MSH-4-1">
					<list>
						<value>200TX</value>  <!-- Home Telehealth emulator -->
						<value>200T1</value>  <!-- Health Hero (current vendor – a Bosch company) -->
						<value>200T2</value>  <!-- AMD (used by the program for testing and operational monitoring) -->
						<value>200T3</value>  <!-- Carematix (used by the program for testing and operational monitoring) -->
						<value>200T4</value>  <!-- ViTel Net/ViTelCare (current vendor – underwent name change – a Bosch company) -->
						<value>200T5</value>  <!-- Viterion (current vendor) -->
						<value>200T6</value>  <!-- ATI (current vendor) -->
						<value>200T7</value>  <!-- Cardiocom (new vendor – will be coming online in February) -->
						<value>200T8</value>  <!-- Authentidate (new vendor – will be coming online in March) -->
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HDR HTPS</value>
					</list>
				</entry>
				<entry key="/MSH-6-1">
					<list>
						<value>200HD</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>MDM</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
						<value>T</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<entry key="HTAPPL-PS2.0">
			<util:map id="allowableParameterValuesPS2.0">
				<entry key="/MSH-3">
					<list>
						<value>HTAPPL</value>
					</list>
				</entry>
				<entry key="/MSH-4-1">
					<list>
						<value>200TX</value>  <!-- Home Telehealth emulator -->
						<value>200T1</value>  <!-- Health Hero (current vendor – a Bosch company) -->
						<value>200T2</value>  <!-- AMD (used by the program for testing and operational monitoring) -->
						<value>200T3</value>  <!-- Carematix (used by the program for testing and operational monitoring) -->
						<value>200T4</value>  <!-- ViTel Net/ViTelCare (current vendor – underwent name change – a Bosch company) -->
						<value>200T5</value>  <!-- Viterion (current vendor) -->
						<value>200T6</value>  <!-- ATI (current vendor) -->
						<value>200T7</value>  <!-- Cardiocom (new vendor – will be coming online in February) -->
						<value>200T8</value>  <!-- Authentidate (new vendor – will be coming online in March) -->
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HDR HTPS</value>
					</list>
				</entry>
				<entry key="/MSH-6-1">
					<list>
						<value>200HD</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>MDM</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
						<value>T</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<entry key="HTAPPL-ADL">
			<util:map id="allowableParameterValuesADL">
				<entry key="/MSH-3">
					<list>
						<value>HTAPPL</value>
					</list>
				</entry>
				<entry key="/MSH-4-1">
					<list>
						<value>200TX</value>  <!-- Home Telehealth emulator -->
						<value>200T1</value>  <!-- Health Hero (current vendor – a Bosch company) -->
						<value>200T2</value>  <!-- AMD (used by the program for testing and operational monitoring) -->
						<value>200T3</value>  <!-- Carematix (used by the program for testing and operational monitoring) -->
						<value>200T4</value>  <!-- ViTel Net/ViTelCare (current vendor – underwent name change – a Bosch company) -->
						<value>200T5</value>  <!-- Viterion (current vendor) -->
						<value>200T6</value>  <!-- ATI (current vendor) -->
						<value>200T7</value>  <!-- Cardiocom (new vendor – will be coming online in February) -->
						<value>200T8</value>  <!-- Authentidate (new vendor – will be coming online in March) -->
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HDR HTADL</value>
					</list>
				</entry>
				<entry key="/MSH-6-1">
					<list>
						<value>200HD</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>MDM</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
						<value>T</value>
					</list>
				</entry>
			</util:map>
		</entry>

		<entry key="HTAPPL-DMP">
			<util:map id="allowableParameterValuesDMP">
				<entry key="/MSH-3">
					<list>
						<value>HTAPPL</value>
					</list>
				</entry>
				<entry key="/MSH-4-1">
					<list>
						<value>200TX</value>  <!-- Home Telehealth emulator -->
						<value>200T1</value>  <!-- Health Hero (current vendor – a Bosch company) -->
						<value>200T2</value>  <!-- AMD (used by the program for testing and operational monitoring) -->
						<value>200T3</value>  <!-- Carematix (used by the program for testing and operational monitoring) -->
						<value>200T4</value>  <!-- ViTel Net/ViTelCare (current vendor – underwent name change – a Bosch company) -->
						<value>200T5</value>  <!-- Viterion (current vendor) -->
						<value>200T6</value>  <!-- ATI (current vendor) -->
						<value>200T7</value>  <!-- Cardiocom (new vendor – will be coming online in February) -->
						<value>200T8</value>  <!-- Authentidate (new vendor – will be coming online in March) -->
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HDR HTDMP</value>
					</list>
				</entry>
				<entry key="/MSH-6-1">
					<list>
						<value>200HD</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>MDM</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
					</list>
				</entry>
			</util:map>
		</entry>
		<entry key="HTAPPL-CENSUS">
			<util:map id="allowableParameterValuesCensus">
				<entry key="/MSH-3">
					<list>
						<value>HTAPPL</value>
					</list>
				</entry>
				<entry key="/MSH-4-1">
					<list>
						<value>200TX</value>  <!-- Home Telehealth emulator -->
						<value>200T1</value>  <!-- Health Hero (current vendor – a Bosch company) -->
						<value>200T2</value>  <!-- AMD (used by the program for testing and operational monitoring) -->
						<value>200T3</value>  <!-- Carematix (used by the program for testing and operational monitoring) -->
						<value>200T4</value>  <!-- ViTel Net/ViTelCare (current vendor – underwent name change – a Bosch company) -->
						<value>200T5</value>  <!-- Viterion (current vendor) -->
						<value>200T6</value>  <!-- ATI (current vendor) -->
						<value>200T7</value>  <!-- Cardiocom (new vendor – will be coming online in February) -->
						<value>200T8</value>  <!-- Authentidate (new vendor – will be coming online in March) -->
					</list>
				</entry>
				<entry key="/MSH-5">
					<list>
						<value>HT CENSUS</value>
					</list>
				</entry>
				<entry key="/MSH-6-1">
					<list>
						<value>200HD</value>
					</list>
				</entry>
				<entry key="/MSH-9-1">
					<list>
						<value>MDM</value>
					</list>
				</entry>
				<entry key="/MSH-9-2">
					<list>
						<value>T02</value>
					</list>
				</entry>
				<entry key="/MSH-11">
					<list>
						<value>P</value>
					</list>
				</entry>
			</util:map>
		</entry>

	</util:map>

	<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" lazy-init="false">
		<property name="locateExistingServerIfPossible" value="true" />
	</bean>

	<bean id="mbeanAdapter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
		<property name="beans">
			<map>
				<entry key="gov.va.med.cds.adapter.socket:name=ServerManager" value-ref="minaServerManager" />
			</map>
		</property>
		<property name="assembler">
			<bean class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler">
				<property name="managedMethods">
					<value>shutdown</value>
				</property>
			</bean>
		</property>
		<property name="server" ref="mbeanServer" />
	</bean>

	<bean id="hl7Utility" class="gov.va.med.cds.hapi.HL7Utility">
		<property name="jdbcTemplateForMessageControlId" ref="jdbcTemplateForMessageControlId" />
		<property name="facilityIdMap" ref="facilityIdMap" />
	</bean>

	<tx:advice id="txAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="createMessageControlId" read-only="true" />
		</tx:attributes>
	</tx:advice>

	<aop:config proxy-target-class="false">
		<aop:pointcut id="createMessageControlIdOperation" expression="execution(* gov.va.med.cds.hapi.HL7Utility.createMessageControlId*(..))" />
		<aop:advisor advice-ref="txAdvice" pointcut-ref="createMessageControlIdOperation" />
	</aop:config>

	<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="hdr2DataSourceForMessageControlIdGeneration" />
	</bean>


	<bean id="jdbcTemplateForMessageControlId" class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="false">
		<property name="dataSource" ref="hdr2DataSourceForMessageControlIdGeneration" />
		<property name="queryTimeout" value="3" />
	</bean>

	<bean id="hdr2DataSourceForMessageControlIdGeneration" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" lazy-init="false">
		<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
		<property name="url" value="${environment.cds.jdbc.url}" />
		<property name="username" value="${environment.cds.jdbc.username}" />
		<property name="password" value="${environment.cds.jdbc.password}" />
		<property name="defaultAutoCommit" value="true" />
		<property name="testOnBorrow" value="true" />
		<property name="validationQuery">
			<value>select 1 from dual</value>
		</property>
		<property name="testWhileIdle">
			<value>true</value>
		</property>
		<property name="minEvictableIdleTimeMillis">
			<value>300000</value>
		</property>
		<property name="timeBetweenEvictionRunsMillis">
			<value>600000</value>
		</property>
		<property name="numTestsPerEvictionRun" value="8" />

	</bean>
	<!--End HL7Utility.createMessageControlId( )configuration settings -->

	<util:map id="facilityIdMap" map-class="java.util.HashMap">
		<entry key="521" value="BIRMINGHAM.MED.DNS   " />
		<entry key="619" value="CENTRAL-ALABAMA.MED.DNS   " />
		<entry key="679" value="TUSCALOOSA.MED.DNS   " />
		<entry key="463" value="ANCHORAGE.MED.DNS   " />
		<entry key="644" value="PHOENIX.MED.DNS   " />
		<entry key="649" value="PRESCOTT.MED.DNS   " />
		<entry key="678" value="TUCSON.MED.DNS   " />
		<entry key="564" value="FAYETTVL-AR.MED.DNS   " />
		<entry key="598" value="LITTLE-ROCK.MED.DNS   " />
		<entry key="570" value="FRESNO.MED.DNS   " />
		<entry key="605" value="LOMA-LINDA.MED.DNS   " />
		<entry key="600" value="LONG-BEACH.MED.DNS   " />
		<entry key="612" value="MARTINEZ.MED.DNS   " />
		<entry key="640" value="PALO-ALTO.MED.DNS   " />
		<entry key="664" value="SAN-DIEGO.MED.DNS   " />
		<entry key="662" value="SANFRANCISCO.MED.DNS   " />
		<entry key="691" value="WEST-LA.MED.DNS   " />
		<entry key="554" value="DENVER.MED.DNS   " />
		<entry key="575" value="GRAND-JUNCT.MED.DNS   " />
		<entry key="689" value="WEST-HAVEN.MED.DNS   " />
		<entry key="460" value="WILMINGTON.MED.DNS   " />
		<entry key="516" value="BAY-PINES.MED.DNS   " />
		<entry key="546" value="MIAMI.MED.DNS   " />
		<entry key="573" value="NORTH-FLORIDA.MED.DNS   " />
		<entry key="673" value="TAMPA.MED.DNS   " />
		<entry key="548" value="WEST-PALM.MED.DNS   " />
		<entry key="508" value="ATLANTA.MED.DNS   " />
		<entry key="509" value="AUGUSTA.MED.DNS   " />
		<entry key="557" value="DUBLIN.MED.DNS   " />
		<entry key="459" value="HONOLULU.MED.DNS   " />
		<entry key="531" value="BOISE.MED.DNS   " />
		<entry key="537" value="CHICAGO-WEST.MED.DNS   " />
		<entry key="550" value="DANVILLE.MED.DNS   " />
		<entry key="578" value="HINES.MED.DNS   " />
		<entry key="556" value="N-CHICAGO.MED.DNS   " />
		<entry key="610" value="NORTHERN-INDIANA.MED.DNS   " />
		<entry key="583" value="INDIANAPOLIS.MED.DNS   " />
		<entry key="596" value="LEXINGTON.MED.DNS   " />
		<entry key="603" value="LOUISVILLE.MED.DNS   " />
		<entry key="502" value="ALEXANDRIA.MED.DNS   " />
		<entry key="629" value="NEW-ORLEANS.MED.DNS   " />
		<entry key="667" value="SHREVEPORT.MED.DNS   " />
		<entry key="402" value="TOGUS.MED.DNS   " />
		<entry key="512" value="BALTIMORE.MED.DNS   " />
		<entry key="518" value="BEDFORD.DNS   " />
		<entry key="523" value="BOSTON.MED.DNS   " />
		<entry key="631" value="NORTHAMPTON.MED.DNS   " />
		<entry key="506" value="ANN-ARBOR.MED.DNS   " />
		<entry key="515" value="BATTLE-CREEK.MED.DNS   " />
		<entry key="553" value="DETROIT.MED.DNS   " />
		<entry key="585" value="IRON-MTN.MED.DNS   " />
		<entry key="655" value="SAGINAW.MED.DNS   " />
		<entry key="618" value="MINNEAPOLIS.MED.DNS   " />
		<entry key="656" value="ST-CLOUD.MED.DNS   " />
		<entry key="520" value="BILOXI.MED.DNS   " />
		<entry key="586" value="JACKSON.MED.DNS   " />
		<entry key="589" value="KANSAS-CITY.MED.DNS   " />
		<entry key="657" value="ST-LOUIS.MED.DNS   " />
		<entry key="436" value="MONTANA.MED.DNS   " />
		<entry key="636" value="CENTRAL-PLAINS.MED.DNS   " />
		<entry key="593" value="LAS-VEGAS.MED.DNS   " />
		<entry key="654" value="RENO.MED.DNS   " />
		<entry key="608" value="MANCHESTER.MED.DNS   " />
		<entry key="561" value="EAST-ORANGE.MED.DNS   " />
		<entry key="501" value="ALBUQUERQUE.MED.DNS   " />
		<entry key="526" value="BRONX.MED.DNS   " />
		<entry key="620" value="MONTROSE.MED.DNS   " />
		<entry key="632" value="NORTHPORT.MED.DNS   " />
		<entry key="630" value="NY-HARBOR.MED.DNS   " />
		<entry key="528" value="V02.MED.DNS   " />
		<entry key="637" value="ASHEVILLE.MED.DNS   " />
		<entry key="558" value="DURHAM.MED.DNS   " />
		<entry key="565" value="FAYETTVL-NC.MED.DNS   " />
		<entry key="659" value="SALISBURY.MED.DNS   " />
		<entry key="437" value="FARGO.MED.DNS   " />
		<entry key="538" value="CHILLICOTHE.MED.DNS   " />
		<entry key="539" value="CINCINNATI.MED.DNS   " />
		<entry key="541" value="CLEVELAND.MED.DNS   " />
		<entry key="757" value="COLUMBUS.MED.DNS   " />
		<entry key="552" value="DAYTON.MED.DNS   " />
		<entry key="623" value="MUSKOGEE.MED.DNS   " />
		<entry key="635" value="OKLAHOMA.MED.DNS   " />
		<entry key="648" value="PORTLAND.MED.DNS   " />
		<entry key="653" value="ROSEBURG.MED.DNS   " />
		<entry key="692" value="WHITE-CITY.MED.DNS   " />
		<entry key="503" value="ALTOONA.MED.DNS   " />
		<entry key="529" value="BUTLER.MED.DNS   " />
		<entry key="542" value="COATESVILLE.MED.DNS   " />
		<entry key="562" value="ERIE.MED.DNS   " />
		<entry key="595" value="LEBANON.MED.DNS   " />
		<entry key="642" value="PHILADELPHIA.MED.DNS   " />
		<entry key="646" value="PITTSBURGH.MED.DNS   " />
		<entry key="693" value="WILKES-BARRE.MED.DNS   " />
		<entry key="650" value="PROVIDENCE.MED.DNS   " />
		<entry key="534" value="CHARLESTON.MED.DNS   " />
		<entry key="544" value="COLUMBIA-SC.MED.DNS   " />
		<entry key="568" value="BLACK-HILLS.MED.DNS   " />
		<entry key="438" value="SIOUX-FALLS.MED.DNS   " />
		<entry key="614" value="MEMPHIS.MED.DNS   " />
		<entry key="621" value="MTN-HOME.MED.DNS   " />
		<entry key="626" value="TENNESSEEVALLEY.MED.DNS   " />
		<entry key="504" value="AMARILLO.MED.DNS   " />
		<entry key="519" value="BIG-SPRING.MED.DNS   " />
		<entry key="674" value="CENTRAL-TEXAS.MED.DNS   " />
		<entry key="549" value="DALLAS.MED.DNS   " />
		<entry key="756" value="EL-PASO.MED.DNS   " />
		<entry key="580" value="HOUSTON.MED.DNS   " />
		<entry key="671" value="SAN-ANTONIO.MED.DNS   " />
		<entry key="660" value="SALT-LAKE.MED.DNS   " />
		<entry key="405" value="WHITE-RIVER.MED.DNS   " />
		<entry key="590" value="HAMPTON.MED.DNS   " />
		<entry key="652" value="RICHMOND.MED.DNS   " />
		<entry key="658" value="SALEM.MED.DNS   " />
		<entry key="663" value="PUGET-SOUND.MED.DNS   " />
		<entry key="668" value="SPOKANE.MED.DNS   " />
		<entry key="687" value="WALLA-WALLA.MED.DNS   " />
		<entry key="517" value="BECKLEY.MED.DNS   " />
		<entry key="540" value="CLARKSBURG.MED.DNS   " />
		<entry key="581" value="HUNTINGTON.MED.DNS   " />
		<entry key="613" value="MARTINSBURG.MED.DNS   " />
		<entry key="607" value="MADISON.MED.DNS   " />
		<entry key="695" value="MILWAUKEE.MED.DNS   " />
		<entry key="676" value="TOMAH.MED.DNS   " />
		<entry key="442" value="CHEYENNE.MED.DNS   " />
		<entry key="666" value="SHERIDAN.MED.DNS   " />
		<entry key="688" value="WASHINGTON.MED.DNS   " />
		<entry key="358" value="MANILA.MED.DNS   " />
		<entry key="672" value="SAN-JUAN.MED.DNS   " />
		<entry key="675" value="ORLANDO.MED.DNS   " />
		<entry key="992" value="DNS   5.DNS        .MED.DNS   " />
		<entry key="993" value="CHYETS.DNS        .MED.DNS   " />
		<entry key="0" value="DNS  VITERION.CC.MED.DNS   " />
	</util:map>

</beans>
