<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	                   http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<bean id="vistaPersistenceManagerFactory" class="gov.va.med.cds.persistence.hibernate.SiteSpecificHibernateReadPersistenceManagerFactory">
		<property name="sessionFactoryPropertyHolderMap" ref="vistaSessionFactoryMap"/>
		<property name="dataSourceBindingsLocator" ref="vistaDataSourceBindingsLocator"/>
		<property name="rules" ref="defaultVistaRules"/>
		<property name="templateQueryStrategyMap" ref="vistaTemplateQueryStrategyMap"/>
		<property name="vistaExcludedTemplateIdsList" ref="excludedClientTemplateIdsList"/>
		<property name="pointInTimeUserType" value="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType"/>
		<property name="managerIdentifierFormat" value="VISTA-{0}-R"/>
		<property name="workManager" ref="workManager"/>
		<property name="queryThreadWorkManager" ref="queryThreadWorkManager"/>
		<property name="templateTimeoutMap" ref="templateTimeoutMap"/>
		<property name="defaultCDSResponse" ref="clinicalDataResponse400"/>
		<property name="preQueryExecutionMap" ref="vistaPreQueryExecuteMap"/> 
		<property name="marshallerUnmarshaller" ref="marshallerUnmarshaller"/>
	</bean>
		
	<util:map id="vistaSessionFactoryMap">
		<entry key="AllergiesRead40010" value-ref="allergiesRead40010SessionFactoryPropertyHolder"/>
		<entry key="AllergyAssessmentRead40010" value-ref="allergyAssessmentRead40010SessionFactoryPropertyHolder"/>
		<entry key="VWAllergiesRead40010" value-ref="vwAllergiesRead40010SessionFactoryPropertyHolder"/>
		<entry key="IntoleranceConditionRead40010" value-ref="intoleranceConditionRead40010SessionFactoryPropertyHolder"/>
		<entry key="IntoleranceConditionReducedRead40011" value-ref="intoleranceConditionReducedRead40011SessionFactoryPropertyHolder"/>
		<entry key="VWIntoleranceConditionRead40010" value-ref="vwIntoleranceConditionRead40010SessionFactoryPropertyHolder"/>
		<entry key="MHVIntoleranceConditionRead40011" value-ref="mhvIntoleranceConditionRead40011SessionFactoryPropertyHolder"/>
		
		<entry key="TiuDocumentListRead2" value-ref="tiuDocumentRead2SessionFactoryPropertyHolder"/>
		<entry key="TiuDocumentDetailRead2" value-ref="tiuDocumentRead2SessionFactoryPropertyHolder"/>
		<entry key="VWVitalsignsRead40010" value-ref="vwVistaVitalsRead40010SessionFactory"/>
		<!-- 
		<entry key="LabChemHemRead1" value-ref="labChemHemRead1SessionFactory"/>
		<entry key="MHVLabChemHemRead1" value-ref="mhvLabChemHemRead1SessionFactory"/>
		<entry key="MHVLabRead40011" value-ref="mhvLabRead40011SessionFactory"/>
		 -->
		<entry key="NonVAMedicationsRead2" value-ref="nonVAMedicationsRead2SessionFactory"/>
		<entry key="SkintestRead3" value-ref="skintestRead3SessionFactory"/>
		<entry key="ImmunizationRead3" value-ref="immunizationRead3SessionFactory"/>
		<entry key="ProblemListRead2" value-ref="problemListRead2SessionFactory"/>
		<!-- <entry key="DemographicsRead1" value-ref="storedProcedureSessionFactory"/>-->
		<entry key="PatientAlertListRead1" value-ref="storedProcedureSessionFactory"/>
		<entry key="PatientAlertDetailRead1" value-ref="storedProcedureSessionFactory"/>
		<!-- 
		<entry key="ClinicalRemindersRead1" value-ref="storedProcedureSessionFactory"/>
		<entry key="ReleaseOfInformationRead1" value-ref="requestsAndExamsRead1Read2SessionFactory"/>
		-->
		<entry key="RequestsAndExamsRead1" value-ref="requestsAndExamsRead1Read2SessionFactory"/>
		<entry key="RequestsAndExamsRead2" value-ref="requestsAndExamsRead1Read2SessionFactory"/>
		<entry key="AppointmentsRead1" value-ref="requestsAndExamsRead1Read2SessionFactory"/>
		<entry key="AppointmentLetter1" value-ref="storedProcedureSessionFactory"/>
		<entry key="VistaUsersRead1" value-ref="vistaUsersRead1SessionFactoryPropertyHolder"/>
		<entry key="SensitivePatientAccessCreate1" value-ref="sensitivePatientAccessCreate1SessionFactory"/>
		
		<!--
		<entry key="OutpatientPharmacyRead1" value-ref="outpatientPharmacyRead1SessionFactoryPropertyHolder"/>
		<entry key="PharmacyRead40010" value-ref="outpatientMedicationPromiseRead40010SessionFactory"/> 
		<entry key="RDIIntoleranceConditionPharmacyRead40010" value-ref="rdiIntoleranceConditionPharmacyRead40010SessionFactory"/>
		<entry key="RDIIntoleranceConditionPharmacyRead40011" value-ref="rdiIntoleranceConditionPharmacyRead40011SessionFactory"/>
		<entry key="RDIIntoleranceConditionPharmacyRead40012" value-ref="rdiIntoleranceConditionPharmacyRead40010SessionFactory"/>
		<entry key="RDIAllergiesPharmacyRead40013" value-ref="rdiAllergiesPharmacyRead40013SessionFactory"/>		
		-->		
		<entry key="GenericObservationRead1" value-ref="genericObservationRead1SessionFactory"/>
	</util:map>

	<util:list id="excludedClientTemplateIdsList">
		<value>VWOutpatientPharmacyRead1-OutpatientMedicationPromise</value>
		<value>VWOutpatientPharmacyDetailRead1-OutpatientMedicationPromise</value>
		<value>VWPharmacyRead40010-OutpatientMedicationPromise</value>
		<value>VWPharmacyDetailRead40010-OutpatientMedicationPromise</value>
		<value>OutpatientPharmacyRead1-OutpatientMedicationPromise</value>
		<value>PharmacyRead40010-OutpatientMedicationPromise</value>
		<value>RDIIntoleranceConditionPharmacyRead40010-OutpatientMedicationPromise</value>
		<value>RDIIntoleranceConditionPharmacyRead40010-IntoleranceCondition</value>
		<value>RDIIntoleranceConditionPharmacyRead40011-OutpatientMedicationPromise</value>
		<value>RDIIntoleranceConditionPharmacyRead40011-IntoleranceCondition</value>
		<value>RDIIntoleranceConditionPharmacyRead40012-OutpatientMedicationPromise</value>
		<value>RDIIntoleranceConditionPharmacyRead40012-IntoleranceCondition</value>		
		<value>RDIAllergiesPharmacyRead40013-OutpatientMedicationPromise</value>
		<value>RDIAllergiesPharmacyRead40013-IntoleranceCondition</value>
		<value>RDIAllergiesPharmacyRead40013-AllergyAssessment</value>
		<value>MHVVitalsignsRead40010-VitalSignObservationEvent</value>
		<value>MHVLabRead40011-LabTestPromise</value>
		<value>NonVAMedicationsRead3-NonVaMedicationEvent</value>
		<value>VitalsignsRead40010-VitalSignObservationEvent</value>
	</util:list>

	<util:map id="vistaPreQueryExecuteMap">
		<entry key="RDIAllergiesPharmacyRead40013-OutpatientMedicationPromise" value-ref="rdiAllergiesPharmacyRead40013PreQueryExecution"/>
		<entry key="RDIIntoleranceConditionPharmacyRead40010-OutpatientMedicationPromise" value-ref="rdiAllergiesPharmacyRead40013PreQueryExecution"/>
		<entry key="RDIIntoleranceConditionPharmacyRead40011-OutpatientMedicationPromise" value-ref="rdiAllergiesPharmacyRead40013PreQueryExecution"/>
		<entry key="RDIIntoleranceConditionPharmacyRead40012-OutpatientMedicationPromise" value-ref="rdiAllergiesPharmacyRead40013PreQueryExecution"/>
		<entry key="PharmacyRead40010-OutpatientMedicationPromise" value-ref="pharmacyRead40010PreQueryExecution"/>
		<entry key="OutpatientPharmacyRead1-OutpatientMedicationPromise" value-ref="outpatientPharmacyRead1PreQueryExecution"/>
	</util:map>
	
	<bean id="rdiAllergiesPharmacyRead40013PreQueryExecution" class="gov.va.med.cds.persistence.hibernate.common.OutpatientPharmacyPreQueryExecution">
	   <property name="namedQuery" value="OutpatientMedicationPromise.storedprocedure.rowids.date" />
	   <property name="domainEntryPoint" value="OutpatientMedicationPromise" />
	   <property name="resultColumnName" value="OPRX_ID" />
    </bean>

	<bean id="pharmacyRead40010PreQueryExecution" class="gov.va.med.cds.persistence.hibernate.common.OutpatientPharmacyPreQueryExecution">
	   <property name="namedQuery" value="OutpatientMedicationPromise.storedprocedure.rowids" />
	   <property name="domainEntryPoint" value="OutpatientMedicationPromise" />
	   <property name="resultColumnName" value="OPRX_ID" />
    </bean>

	<bean id="outpatientPharmacyRead1PreQueryExecution" class="gov.va.med.cds.persistence.hibernate.common.OutpatientPharmacyPreQueryExecution">
	   <property name="namedQuery" value="OutpatientMedicationPromise.storedprocedure.rowids" />
	   <property name="domainEntryPoint" value="OutpatientMedicationPromise" />
	   <property name="resultColumnName" value="OPRX_ID" />
    </bean>
   
     <bean id= "databaseConnectionHandler" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" lazy-init="false">
		<property name="staticMethod" value="gov.va.med.cds.persistence.DBConnectionHandler.setDbLoginTimeout" />
		<property name="arguments">
			<list>
				<value>5</value>
			</list>
		</property>
	</bean>  
	
	<bean abstract="true" id="abstractVistaHibernateProperties" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<!-- <prop key="hibernate.default_entity_mode">dom4j</prop> -->
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
				<prop key="hibernate.prepare_sql">${hibernate.prepare_sql}</prop>
				<prop key="hibernate.connection.release_mode">after_statement</prop>
			</props>
		</property>
	</bean>
	
	<bean abstract="true" id="abstractVistaHibernatePropertiesPojo" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
				<prop key="hibernate.prepare_sql">${hibernate.prepare_sql}</prop>
				<prop key="hibernate.connection.release_mode">after_statement</prop>
			</props>
		</property>
	</bean>

	<bean id="tiuDocumentRead2SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- Tiu -->
				<value>gov/va/med/cds/persistence/hibernate/tiu/vista/TiuDocumentListRead2.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/tiu/vista/TiuDocumentDetailRead2.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/tiu/vista/Image.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/tiu/vista/DocumentUpdateEvent.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/tiu/vista/TiuManagedPractitionerParticipationLite.hbm.xml</value>

			</list>
		</property>
	</bean>
	
	<bean id="vistaUsersRead1SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- VistaUser -->
				<value>gov/va/med/cds/persistence/hibernate/vistauser/vista/VistaUserRead1.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="allergiesRead40010SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- Allergies -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergiesRead40010AA.hbm.xml</value>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergiesRead40010IC.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationIdBandMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationChartMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>

			</list>
		</property>
	</bean>


	<bean id="allergyAssessmentRead40010SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- AllergyAssessment -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyAssessmentRead40010.hbm.xml</value>
				<!-- <value>gov/va/med/cds/persistence/hibernate/allergy/vista/AuthorPractitionerParticipationLite.hbm.xml</value> -->
				<!-- <value>gov/va/med/cds/persistence/hibernate/allergy/vista/Patient.hbm.xml</value> -->

			</list>
		</property>
	</bean>


	<bean id="vwAllergiesRead40010SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<!-- Allergies -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/VWAllergiesRead40010.hbm.xml</value>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/VWAllergiesRead40010_IntoleranceConditionRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>

			</list>
		</property>
	</bean>


	<bean id="intoleranceConditionRead40010SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/IntoleranceConditionRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationIdBandMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationChartMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>
			</list>
		</property>
	</bean>


	<bean id="intoleranceConditionReducedRead40011SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/IntoleranceConditionReducedRead40011.hbm.xml</value>
			</list>
		</property>
	</bean>


	<bean id="vwIntoleranceConditionRead40010SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/VWIntoleranceConditionRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationIdBandMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationChartMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>
			</list>
		</property>
	</bean>


	<bean id="mhvIntoleranceConditionRead40011SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/MHVIntoleranceConditionRead40011.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="vistaVitalsRead40010SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/vital/vista/VitalsignsRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/vital/vista/ErrorReason.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/vital/vista/VitalSignQualifier.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="vwVistaVitalsRead40010SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/vital/vista/VWVitalsignsRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/vital/vista/VitalSignQualifier.hbm.xml</value>
			</list>
		</property>
	</bean>

	
<!-- 	<bean id="labChemHemRead1SessionFactory" parent="abstractVistaHibernateProperties"> -->
<!-- 		<property name="mappingResources"> -->
<!-- 			<list> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabChemHemRead1.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabComment.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LaboratoryTest60.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/SiteSpecimen6001.hbm.xml</value> -->
				<!-- <value>gov/va/med/cds/persistence/hibernate/lab/vista/LabInterpretation6007.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabAccessionArea6011.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabLoinc953.hbm.xml</value> -->
<!-- 			</list> -->
<!-- 		</property> -->
<!-- 	</bean> -->
<!-- 	<bean id="mhvLabChemHemRead1SessionFactory" parent="abstractVistaHibernateProperties"> -->
<!-- 		<property name="mappingResources"> -->
<!-- 			<list> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabChemHemRead1.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabComment.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLaboratoryTest60.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVSiteSpecimen6001.hbm.xml</value> -->
				<!-- <value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabInterpretation6007.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabAccessionArea6011.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabLoinc953.hbm.xml</value> -->
<!-- 			</list> -->
<!-- 		</property> -->
<!-- 	</bean> -->
	
<!-- 	<bean id="mhvLabRead40011SessionFactory" parent="abstractVistaHibernateProperties"> -->
<!-- 		<property name="mappingResources"> -->
<!-- 			<list> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011Comment.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011LaboratoryTest60.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011SiteSpecimen6001.hbm.xml</value> -->
				<!-- <value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011LabInterpretation6007.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabAccessionArea6011.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/LabLoinc953.hbm.xml</value> -->
<!-- 				<value>gov/va/med/cds/persistence/hibernate/lab/vista/MHVLabRead40011LaboratoryTest60ForNLT.hbm.xml</value> -->
<!-- 			</list> -->
<!-- 		</property> -->
<!-- 	</bean> -->
	 

	<bean id="nonVAMedicationsRead2SessionFactory" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/nonvameds/vista/NonVAMedicationsRead2.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/nonvameds/vista/DetectedIssueEvent.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
			</props>
		</property>
	</bean>

	<bean id="outpatientPharmacyRead1SessionFactoryPropertyHolder" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/OutpatientPharmacyRead1.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/ActivityLog.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/MedicationInstruction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/PartialDispense.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/RefillDispense.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="outpatientMedicationPromiseRead40010SessionFactory" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/OutpatientMedicationPromise.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/RefillDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/PartialDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/MedicationInstruction40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/ActivityLog40010.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
			</props>
		</property>
	</bean>

	<bean id="rdiIntoleranceConditionPharmacyRead40010SessionFactory" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="mappingResources">
			<list>
				<!-- OutpatientPharmacy -->
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/OutpatientMedicationPromise.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/RefillDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/PartialDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/MedicationInstruction40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/ActivityLog40010.hbm.xml</value>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/IntoleranceConditionRead40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationIdBandMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyPractitionerParticipationChartMarker.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/CommentEvents.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<!-- <prop key="hibernate.default_entity_mode">dom4j</prop> -->
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
			</props>
		</property>
	</bean>

	<bean id="rdiIntoleranceConditionPharmacyRead40011SessionFactory" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="mappingResources">
			<list>
				<!-- OutpatientPharmacy -->
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/OutpatientMedicationPromise.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/RefillDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/PartialDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/MedicationInstruction40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/ActivityLog40010.hbm.xml</value>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/RDIIntoleranceConditionRead40011.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<!-- <prop key="hibernate.default_entity_mode">dom4j</prop> -->
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
			</props>
		</property>
	</bean>
	
	<bean id="rdiAllergiesPharmacyRead40013SessionFactory" class="gov.va.med.cds.persistence.hibernate.SpringHibernateLocalSessionFactoryPropertyHolder">
		<property name="mappingResources">
			<list>
				<!-- OutpatientPharmacy -->
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/OutpatientMedicationPromise.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/RefillDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/PartialDispense40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/MedicationInstruction40010.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/pharmacy/vista/ActivityLog40010.hbm.xml</value>

				<!-- IntoleranceCondition -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/RDIIntoleranceConditionRead40013.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/Reaction.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugClass.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/DrugIngredient.hbm.xml</value>
				
				<!-- AllergyAssessment -->
				<value>gov/va/med/cds/persistence/hibernate/allergy/vista/AllergyAssessmentRead40010.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
				<!-- <prop key="hibernate.default_entity_mode">dom4j</prop> -->
				<prop key="hibernate.dialect">org.hibernate.dialect.Cache71Dialect</prop>
				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
				<prop key="hibernate.query.plan_cache_max_strong_references">${hibernate.query.plan_cache_max_strong_references.size}</prop>
				<prop key="hibernate.query.plan_cache_max_soft_references">${hibernate.query.plan_cache_max_soft_references.size}</prop>
				<prop key="hibernate.statement_cache.size">${hibernate.statement_cache.size}</prop>
			</props>
		</property>
	</bean>
	
	<bean id="skintestRead3SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/immskintest/vista/SkintestRead3.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="immunizationRead3SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/immskintest/vista/ImmunizationRead3.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="problemListRead2SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/persistence/hibernate/problemlist/vista/ProblemListRead2.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/problemlist/vista/HealthConcernNoteEvent.hbm.xml</value>
			</list>
		</property>
	</bean>

	<bean id="requestsAndExamsRead1Read2SessionFactory" parent="abstractVistaHibernatePropertiesPojo">
		<!-- 		<property name="mappingResources">  -->
		<!-- 			<list>  -->
		<!-- 				<value>gov/va/med/cds/persistence/hibernate/vrm/vista/AppointmentsRead1.hbm.xml</value>  -->
		<!-- 				<value>gov/va/med/cds/persistence/hibernate/vrm/vista/RequestsAndExamsRead1ER.hbm.xml</value>  -->
		<!-- 				<value>gov/va/med/cds/persistence/hibernate/vrm/vista/RequestsAndExamsRead1EX.hbm.xml</value>  -->
		<!-- 			</list>  -->
		<!-- 		</property>  -->
	</bean>
	
	<bean id="storedProcedureSessionFactory" parent="abstractVistaHibernateProperties"/>
	<bean id="sensitivePatientAccessCreate1SessionFactory" parent="abstractVistaHibernateProperties"/>	
	<bean id="genericObservationRead1SessionFactory" parent="abstractVistaHibernateProperties">
	</bean>
	
	<!-- Needed for the MBean support -->
	<bean id="dbLoginTimeoutHandler" class="gov.va.med.cds.persistence.DBConnectionHandler"/>
	
	<bean id="dbLoginTimeoutMBeanExporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
		<property name="beans">
			<map>
				<entry key="gov.va.med.cds.persistence:name=cds-db-login-timeout-updater" value-ref="dbLoginTimeoutHandler" />
			</map>
		</property>
		<property name="assembler">
			<bean class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler">
				<property name="managedMethods">				
					<list>
         				 <value>getDbLoginTimeout</value>
          				 <value>setDbLoginTimeout</value>
					</list>
				</property>
			</bean>
		</property>
		<property name="server" ref="mbeanServer" />
		<property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" />
	</bean>			
</beans>
