<?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-3.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

	<bean id="vr12PersistenceManager" class="gov.va.med.cds.ars.persistence.VR12ReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<!--property name="vr12DataQuery" value="SurveyReports.vr12.data"/-->
		<property name="vr12DataQuery" value="SurveyReports.vr12.data.mv"/>
	</bean>
	
	<bean id="distributionPersistenceManager" class="gov.va.med.cds.ars.persistence.DistributionReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="distributionQuery" value="SurveyReports.distribution"/>
	</bean>
	
	<bean id="satisfactionPersistenceManager" class="gov.va.med.cds.ars.persistence.SatisfactionReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="satisfactionQuery" value="SurveyReports.patientSatisfaction"/>
		<property name="acceptedSurveyCountQuery" value="SurveyReports.countSurveys"/>
	</bean>
	
	<bean id="trendsPersistenceManager" class="gov.va.med.cds.ars.persistence.TrendsReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="trendsQuery" value="SurveyReports.trends"/>
	</bean>
	
	<bean id="nationalDistributionPersistenceManager" class="gov.va.med.cds.ars.persistence.NationalDistributionReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<!--property name="nationalDistributionQuery" value="SurveyReports.nationalDistribution"/-->
		<property name="nationalDistributionQuery" value="SurveyReports.nationalDistribution.mv"/>
		<!--property name="acceptedSurveyCountQuery" value="SurveyReports.countSurveysNationalDist"/-->
		<property name="acceptedSurveyCountQuery" value="SurveyReports.countSurveysNationalDist.mv"/>
	</bean>
	
	<bean id="dmpUniqueICNReportsPersistenceManager" class="gov.va.med.cds.ars.persistence.DMPUniqueICNReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="countDMPsUniqueICNQuery" value="SurveyReports.countDMPsUniqueICN"/>
	</bean>
	
	<bean id="dmpTitleReportPersistenceManager" class="gov.va.med.cds.ars.persistence.DMPTitleReportsPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="dMPTitlesQuery" value="SurveyReports.DMPTitles"/>
	</bean>

	<!-- 	 add census report -->

	<bean id="censusWeeklyVendorStatusReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusWeeklyVendorStatusReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusWeeklyVendorStatusReportQuery" value="SurveyReports.censusWeeklyVendorStatusReport"/>
	</bean>
 	
	<bean id="censusPostProcessingStatusReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusPostProcessingStatusReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusPostProcessingStatusReportQuery" value="SurveyReports.censusPostProcessingStatusReport"/>
	</bean>
	
	<bean id="visnFacilityReportPersistenceManager" class="gov.va.med.cds.ars.persistence.VISNFacilityReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="vISNFacilityQuery" value="SurveyReports.VISNFacility"/>
	</bean>
	
	<bean id="vendorReportPersistenceManager" class="gov.va.med.cds.ars.persistence.VendorReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="vendorQuery" value="SurveyReports.Vendor"/>
	</bean>
	
	<bean id="censusStartEndDatesReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusStartEndDatesReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusStartEndDatesQuery" value="SurveyReports.CensusStartEndDates"/>
	</bean>
	
	<bean id="censusTransmittalModeReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusTransmittalModeReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="transmittalModeQuery" value="SurveyReports.CensusTransmittalMode"/>
	                                             
	</bean>     
	
	<bean id="censusPatientCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusPatientCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusPatientCountReportQuery" value="SurveyReports.censusPatientCountReport"/>
	</bean>
	
	<bean id="censusDMPCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusDMPCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusDMPCountReportQuery" value="SurveyReports.censusDMPCountReport"/>
	</bean>
	
	<bean id="censusMedDevCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusMedDevCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusMedDevCountReportQuery" value="SurveyReports.censusMedDevCountReport"/>
	</bean>
	
	<bean id="censusIVRCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusIVRCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusIVRCountReportQuery" value="SurveyReports.censusIVRCountReport"/>
	</bean>
	
	<bean id="censusBrowserCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusBrowserCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusBrowserCountReportQuery" value="SurveyReports.censusBrowserCountReport"/>
	</bean>
	
	<bean id="censusNotAssignedCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusNotAssignedCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusNotAssignedCountReportQuery" value="SurveyReports.censusNotAssignedCountReport"/>
	</bean>
	
	<bean id="censusMeasurementCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusMeasurementCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusMeasurementCountReportQuery" value="SurveyReports.censusMeasurementCountReport"/>
	</bean>
	
	<bean id="censusVideoCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusVideoCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusVideoCountReportQuery" value="SurveyReports.censusVideoCountReport"/>
	</bean>
	
	<bean id="censusCellCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCellCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCellCountReportQuery" value="SurveyReports.censusCellCountReport"/>
	</bean>
	
	<bean id="censusSatelliteCountReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusSatelliteCountReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusSatelliteCountReportQuery" value="SurveyReports.censusSatelliteCountReport"/>
	</bean>
	
	<!-- ============================================== -->
	<!-- =====      Start of Census Reports 3.12  ===== -->
	<!-- ============================================== -->
	
	<bean id="censusLevelOfCareReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusLevelOfCareReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="levelOfCareQuery" value="SurveyReports.LevelOfCare"/>                                     
	</bean>     
	
	<bean id="censusCocTotalPtNICReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCocTotalPtNICReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCocTotalPtNICReportQuery" value="SurveyReports.censusCocTotalPtNICReport"/>
	</bean>
	
	<bean id="censusCoCTotalPtCCMReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCoCTotalPtCCMReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCoCTotalPtCCMReportQuery" value="SurveyReports.censusCoCTotalPtCCMReport"/>
	</bean>
	
	<bean id="censusCoCTotalPtACMReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCoCTotalPtACMReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCoCTotalPtACMReportQuery" value="SurveyReports.censusCoCTotalPtACMReport"/>
	</bean>
	
	<bean id="censusCoCTotalPtHPDPReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCoCTotalPtHPDPReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCoCTotalPtHPDPReportQuery" value="SurveyReports.censusCoCTotalPtHPDPReport"/>
	</bean>
	
	<bean id="censusCoCTotalPtL2ReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusCoCTotalPtL2ReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusCoCTotalPtL2ReportQuery" value="SurveyReports.censusCoCTotalPtL2Report"/>
	</bean>
	
	<bean id="censusRrTotalFullRespRportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalFullRespRportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalFullRespRportQuery" value="SurveyReports.censusRrTotalFullRespRport"/>
	</bean>
	
	<bean id="censusRrTotalPartRespRportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalPartRespRportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalPartRespRportQuery" value="SurveyReports.censusRrTotalPartRespRport"/>
	</bean>
	
	<bean id="censusRrTotalNonRespRportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalNonRespRportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalNonRespRportQuery" value="SurveyReports.censusRrTotalNonRespRport"/>
	</bean>
	
	<bean id="censusRrTotalUnkRespRportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalUnkRespRportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalUnkRespRportQuery" value="SurveyReports.censusRrTotalUnkRespRport"/>
	</bean>
	
	<bean id="censusRrTotalNonRespGT30RportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalNonRespGT30RportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalNonRespGT30RportQuery" value="SurveyReports.censusRrTotalNonRespGT30Rport"/>
	</bean>
	
	<bean id="censusRrTotalNonRespMaxRportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRrTotalNonRespMaxRportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="censusRrTotalNonRespMaxRportQuery" value="SurveyReports.censusRrTotalNonRespMaxRport"/>
	</bean>
	
	<!-- End of Census report 3.12 -->
	
	<!-- ============================================== -->
	<!-- =====      Start of Census Reports 3.14  ===== -->
	<!-- ============================================== -->

	<bean id="hthCumMonYearReportsPersistenceManager" class="gov.va.med.cds.ars.persistence.HthCumulativeMonYearReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthCumMonYearDataQuery" value="CensusReports.hthCumulativemonthyearReport"/>
	</bean>
	
	<bean id="hthFiscalYearQuarterReportsPersistenceManager" class="gov.va.med.cds.ars.persistence.HthFiscalYearQuarterReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthQtrYearDataQuery" value="CensusReports.hthFYQtrReport"/>
	</bean>
	
	<bean id="censusNICADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusNICADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthNICADCDataQuery" value="CensusReports.NicAdcReport"/>
	</bean>

	<bean id="censusTotalRuralVISNADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusTotalRuralVISNADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthVISNADCDataQuery" value="SurveyReports.TotalRuralvisnAdcReport"/>
	</bean>
	
	<bean id="censusRuralVISNADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRuralVISNADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthRuralVISNADCDataQuery" value="SurveyReports.RuralvisnAdcReport"/>
	</bean>
	
	<bean id="censusHighlyRuralVISNADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusHighlyRuralVISNADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthHighlyRuralVISNADCDataQuery" value="SurveyReports.HighlyruralvisnAdcReport"/>
	</bean>
	
	<bean id="censusUrbanVISNADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusUrbanVISNADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthUrbanVISNADCDataQuery" value="SurveyReports.UrbanvisnAdcReport"/>
	</bean>
	
	<bean id="censusUnknownVISNADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusUnknownVISNADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthUnknownVISNADCDataQuery" value="SurveyReports.UnknownvisnAdcReport"/>
	</bean>
	
	<bean id="censusTotalRuralFacilityADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusTotalRuralFacilityADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthTotalRuralFacilityADCDataQuery" value="SurveyReports.TotalRuralfacilityAdcReport"/>
	</bean>
	
	<bean id="censusRuralFacilityADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusRuralFacilityADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthRuralFacilityADCDataQuery" value="SurveyReports.RuralfacilityAdcReport"/>
	</bean>
	
	<bean id="censusHighlyRuralFacilityADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusHighlyRuralFacilityADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthHighlyRuralFacilityADCDataQuery" value="SurveyReports.HighlyruralfacilityAdcReport"/>
	</bean>
	
	<bean id="censusUrbanFacilityADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusUrbanFacilityADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthUrbanFacilityADCDataQuery" value="SurveyReports.UrbanFacilityADCReport"/>
	</bean>
	
	<bean id="censusUnknownFacilityADCReportPersistenceManager" class="gov.va.med.cds.ars.persistence.CensusUnknownFacilityADCReportPersistenceManager">
		<property name="managerIdentifier" value="ARS-R"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="hthUnknownFacilityADCDataQuery" value="SurveyReports.UnknownfacilityAdcReport"/>
	</bean>
	<!-- End of Census report 3.14 -->

	<!-- 
		<aop:config>
			<aop:pointcut id="arsWriteTxMethods" expression="execution(* gov.va.med.cds.ars.subscription.persistence.WritePersistenceManagerInterface.*(..))"/>
			<aop:advisor advice-ref="arsWriteTxAdvice"  pointcut-ref="arsWriteTxMethods" order="1"/>
		</aop:config>
	
		<tx:advice id="arsWriteTxAdvice" transaction-manager="hdrTransactionManager">
			<tx:attributes>
				<tx:method name="storeSubscriptionList" propagation="REQUIRED" isolation="READ_COMMITTED" />
				<tx:method name="deletePatients" propagation="REQUIRED" isolation="READ_COMMITTED" />
				<tx:method name="replaceSubscriptionList" propagation="REQUIRED" isolation="READ_COMMITTED" />
				<tx:method name="updateSubscriptionListDates" propagation="REQUIRED" isolation="READ_COMMITTED" />
			</tx:attributes>
		</tx:advice>
	-->
 
	<aop:config>
		<aop:pointcut id="arsReadTxMethods" expression="execution(* gov.va.med.cds.ars.persistence.ReadableReportsPersistenceManagerInterface.*(..))"/>
		<aop:advisor advice-ref="arsReadTxAdvice"  pointcut-ref="arsReadTxMethods" order="1"/>
	</aop:config>

	<tx:advice id="arsReadTxAdvice" transaction-manager="hdrTransactionManager">
		<tx:attributes>
			<tx:method name="performReadReportAggregate" propagation="SUPPORTS" isolation="READ_COMMITTED" read-only="true" />
		</tx:attributes>
	</tx:advice>

	<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="hdrDataSource" />
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/ars/persistence/SurveyReporting.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
				<prop key="hibernate.show_sql">false</prop> 
				<!-- <prop key="hibernate.show_sql">true</prop> -->
			</props>
		</property>
	</bean>
 
</beans>
