<?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-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
	
	<import resource="classpath:gov/va/med/cds/mediator/config/message-mediator-context.xml"/>
	<import resource="classpath:gov/va/med/cds/mediator/config/message-mediator-persistence-context.xml"/>
	
	<bean id="auditLogPersistenceManager" class="gov.va.med.cds.audit.persistence.hibernate.HibernateAuditLogPersistenceManager">
		<property name="appName" value="CDS3" />
		<property name="hibernateTemplate" ref="auditLogHibernateTemplate"/>
	</bean>
	
	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
		<property name="locations">
			<list>
				<value>file:${REP_ROOT}/mediator/resources/properties/mediator.properties</value>
			</list>
		</property>
	</bean>

	<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" lazy-init="false">
		<property name="staticMethod" value="gov.va.med.cds.testharness.xml.XmlValidator.setTemplateCachePath" />
		<property name="arguments" value="${cds.test.templatecache}" />
	</bean>
	
	<bean id="clinicalDataServiceFactory" class="gov.va.med.cds.mediator.work.cds.MockClinicalDataServiceFactory"
		lazy-init="true"/>
	
	<bean id="cdsServiceExt" factory-bean="clinicalDataServiceFactory" factory-method="create" lazy-init="true"/>
	
	<!-- <bean id="xsltHelper" class="gov.va.med.cds.xml.transform.XsltHelper">
		<property name="xsltLocations">
			<list>
				<value> file:./src/main/resources/xslts/vhim400/*.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/response/*.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/*.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/AllergySinglePatientAllDataFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/ChdrAllergySinglePatientFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/ChdrRxSinglePatientFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/ChdrLabSinglePatientFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/RxSinglePatientAllDataFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/filter/VitalSinglePatientAllDataFilter.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToPharmacy.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToHTH.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToVitalSigns.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToAllergyIntoleranceCondition.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToAllergyAssement.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToLabChemHem.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7CommonTemplates.xsl</value>			
				<value> file:./src/main/resources/xslts/vhim400/HL7ToADLSurveyCreate40024.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToDMPSurvey.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToDMPSurveyCreate40024.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToCensusSurveyCreate40024.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToPSSurveyCreate40021.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToPSSurveyCreate40023.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToPSSurveyCreate40024.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToSurvey.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/HL7ToSurveyCreate40024.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/SurveyCommonTemplates.xsl</value> 
				<value> file:./src/main/resources/xslts/vhim400/VHIMIntoleranceConditionToHL7.xsl</value> 
				<value> file:./src/main/resources/xslts/vhim400/VHIMLabChemHemToHL7.xsl</value>
				<value> file:./src/main/resources/xslts/vhim400/VHIMPharmacyToHL7.xsl</value>			
			</list>
		</property>
	</bean> -->
	
	<bean id="xsltHelper" class="gov.va.med.cds.xml.transform.XsltHelper">
		<constructor-arg index="0" ref="xsltLocations"/>
		<constructor-arg index="1" ref="extensionFunctions"/>
	</bean>
	
	<util:list id="xsltLocations" value-type="java.lang.String">
		<value> file:./src/main/resources/xslts/vhim400/*.xsl</value>
		<value> file:./src/main/resources/xslts/vhim400/response/*.xsl</value>
		<value> file:./src/main/resources/xslts/vhim400/filter/*.xsl</value>
	</util:list>
	
	<util:list id="extensionFunctions" value-type="net.sf.saxon.lib.ExtensionFunctionDefinition">
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.Hl7SupportMessageDataExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.Hl7SupportCreateMessageDatetimeExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.Hl7SupportMessageControlIdExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.Hl7SupportRequestWhatCodeExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.Hl7UtilityGetSendingFacilityExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.AddCheckSumtoIcnExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.WorkStateExceptionCountExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.WorkStateFormattedExceptionDetailExtFunc"/>
		<bean class="gov.va.med.cds.mediator.xml.transform.saxonextensions.SurveyParseExtFunc"/>
	</util:list>
	
	<bean id="hdrDataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
		<property name="url" value="${cds.jdbc.url}"/>
		<property name="username" value="${cds.jdbc.username}"/>
		<property name="password" value="${cds.jdbc.password}"/>
		<property name="defaultAutoCommit" value="false"/>
	</bean>
	
	<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" lazy-init="false">
		<property name="locateExistingServerIfPossible" value="true"/>
	</bean>
	
</beans>