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


	<bean id="hxReadable" class="gov.va.med.cds.persistence.hibernate.ReadableHibernatePersistenceManager">
		<property name="managerIdentifier" value="HDR-HX-RO"/>
		<property name="sessionFactory" ref="hxSessionFactory"/>
		<property name="exceptionHandler" ref="exceptionHandler"/>
		<property name="rules">
			<list>
				<bean class="gov.va.med.cds.rules.CdsPersistenceFilterRule">
					<property name="entryPoint" value="IntoleranceCondition"/>
				</bean>
				<bean class="gov.va.med.cds.rules.CdsPersistenceFilterRule">
					<property name="entryPoint" value="AllergyAssessment"/>
				</bean>
				<bean class="gov.va.med.cds.rules.CdsPersistenceFilterRule">
					<property name="entryPoint" value="OutpatientMedicationPromise"/>
					<property name="dataEndDate" value="20060101"/>
				</bean>
				<bean class="gov.va.med.cds.rules.CdsPersistenceFilterRule">
					<property name="entryPoint" value="VitalSignObservationEvent"/>
					<property name="dataEndDate" value="20060101"/>
				</bean>
			</list>
		</property>
        <property name="customReadDataManagers">
      		<map>
        		<entry key="VWPharmacyRead40010">
					<bean class="gov.va.med.cds.persistence.hibernate.pharmacy.custom.RxHibernateCustomDataManager" />
				</entry>
				<entry key="VWPharmacyDetailRead40010">
					<bean class="gov.va.med.cds.persistence.hibernate.pharmacy.custom.RxHibernateCustomDataManager" />
				</entry>
     		</map>
    	</property>
	</bean>

	<bean id="hxTransactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="hxSessionFactory"/>
	</bean>

	<bean id="hxSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="hxDataSource" />
		<property name="mappingResources">
			<list>
				<!-- Major component mapping files -->

				<!-- Common -->
				<value>gov/va/med/cds/persistence/hibernate/historical/HxCommon.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxPractitionerParticipation.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxPatientIdentity.hbm.xml</value>

				<!-- Allergy -->
				<value>gov/va/med/cds/persistence/hibernate/historical/HxIntoleranceCondition.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxReactionObservationEvent.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxAllergyAssessment.hbm.xml</value>

				<!-- Pharmacy -->
				<value>gov/va/med/cds/persistence/hibernate/historical/HxOutpatientMedicationPromise.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxMedicationInstructionComponent.hbm.xml</value>

				<!-- Vitals -->
				<value>gov/va/med/cds/persistence/hibernate/historical/HxVital.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxNullificationReason.hbm.xml</value>
				<value>gov/va/med/cds/persistence/hibernate/historical/HxVitalSignQualifier.hbm.xml</value>

			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
				<prop key="hibernate.show_sql">${hibernate.show.sql}</prop>
			</props>
		</property>
	</bean>

</beans>
