Skip to content

Instantly share code, notes, and snippets.

@samuelmale
Created July 2, 2018 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelmale/e8591e28d1de0bafcbf34b3921763f02 to your computer and use it in GitHub Desktop.
Save samuelmale/e8591e28d1de0bafcbf34b3921763f02 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Beans to add to the current Application context definition -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
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/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-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/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<context:component-scan base-package="org.openmrs.module.mergepatientdata" />
<bean id="mergepatientdata.AuditDao" class="org.openmrs.module.mergepatientdata.api.dao.Impl.MergePatientDataAuditDaoImpl"/>
<!-- Wraps MergepatientdataService methods in DB transactions and OpenMRS interceptors,
which set audit info like dateCreated, changedBy, etc.-->
<bean id="mergepatientdata.MergepatientdataAuditService"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<bean class="org.openmrs.module.mergepatientdata.api.impl.MergePatientDataAuditServiceImpl">
<property name="dao" ref="mergepatientdata.AuditDao" />
</bean>
</property>
<property name="preInterceptors">
<ref bean="serviceInterceptors" />
</property>
<property name="transactionAttributeSource">
<ref bean="transactionAttributeSource" />
</property>
</bean>
<!-- Adds MergepatientdataServices to OpenMRS context so it can be accessed
calling Context.getService(MergepatientdataService.class) -->
<bean parent="serviceContext">
<property name="moduleService">
<list>
<value>org.openmrs.module.mergepatientdata.api.MergePatientDataAuditService</value>
<ref bean="mergepatientdata.MergepatientdataAuditService" />
</list>
</property>
</bean>
<bean id="patient" class="org.openmrs.module.mergepatientdata.resource.Patient"/>
<bean id="location" class="org.openmrs.module.mergepatientdata.resource.Location"/>
<bean id="mpdcient"
class="org.openmrs.module.mergepatientdata.sync.MPDClient">
<property name="supportedClasses">
<list value-type="org.openmrs.module.mergepatientdata.resource.MergeAbleResource">
<ref bean="patient" />
<ref bean="location" />
</list>
</property>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment