jembi / openmrs-module-shr-cdahandler

A CDA handler for the OpenMRS SHR implementation
1 stars 9 forks source link

Duplicate concept exception #31

Open hnnesv opened 9 years ago

hnnesv commented 9 years ago

When importing a CDA via the XDS interface - the following exception occurs (using the CIEL dictionary):

WARN - HibernateConceptDAO.getConceptByName(1741) |2015-06-01 22:58:25,796| Multiple concepts found for 'completed' ERROR - XdsDocumentRepositoryServiceImpl.provideAndRegisterDocumentSetB(167) |2015-06-01 22:58:25,866| org.openmrs.api.DuplicateConceptNameException: 'completed (completed)' is a duplicate name in locale 'en_GB' org.openmrs.api.DuplicateConceptNameException: 'completed (completed)' is a duplicate name in locale 'en_GB' at org.openmrs.validator.ConceptValidator.validate(ConceptValidator.java:166) at org.openmrs.api.db.hibernate.HibernateAdministrationDAO.validate(HibernateAdministrationDAO.java:369) at org.openmrs.api.impl.AdministrationServiceImpl.validate(AdministrationServiceImpl.java:1248) at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy136.validate(Unknown Source)

This is an issue triggered by the OMRS concept validator - so this might be an issue if we switch to a version of OMRS where we disabled these.

justin-fyfe commented 9 years ago

Hi Hannes,

The issue is triggered only when the cache concepts flag is enabled, after disabling it I found it works fine (albeit a lot slower). Not sure if that helps track it down.

Cheers

-Justin

From: Hannes Venter [mailto:notifications@github.com] Sent: Tuesday, June 02, 2015 5:53 AM To: jembi/openmrs-module-shr-cdahandler Subject: [openmrs-module-shr-cdahandler] Duplicate concept exception (#31)

When importing a CDA via the XDS interface - the following exception occurs (using the CIEL dictionary):

WARN - HibernateConceptDAO.getConceptByName(1741) |2015-06-01 22:58:25,796| Multiple concepts found for 'completed' ERROR - XdsDocumentRepositoryServiceImpl.provideAndRegisterDocumentSetB(167) |2015-06-01 22:58:25,866| org.openmrs.api.DuplicateConceptNameException: 'completed (completed)' is a duplicate name in locale 'en_GB' org.openmrs.api.DuplicateConceptNameException: 'completed (completed)' is a duplicate name in locale 'en_GB' at org.openmrs.validator.ConceptValidator.validate(ConceptValidator.java:166) at org.openmrs.api.db.hibernate.HibernateAdministrationDAO.validate(HibernateAdministrationDAO.java:369) at org.openmrs.api.impl.AdministrationServiceImpl.validate(AdministrationServiceImpl.java:1248) at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy136.validate(Unknown Source)

This is an issue triggered by the OMRS concept validator - so this might be an issue if we switch to a version of OMRS where we disabled these.

— Reply to this email directly or view it on GitHub https://github.com/jembi/openmrs-module-shr-cdahandler/issues/31.[image: Image removed by sender.]

hnnesv commented 9 years ago

Thanks Justin. Actually I thought I did have the caching off - but I couldn't reproduce it again now. Perhaps the server was missing a restart the last time or something like that. Thanks, this is good a clue as to where to debug.

rcrichton commented 9 years ago

I can confirm after turning caching off this problem went away on my new dev env.