mdht / mdht-models

This branch supports Rational Software components
25 stars 18 forks source link

Spring Boot: EMF package registry is not getting loaded #111

Closed JiahaoLi closed 7 years ago

JiahaoLi commented 7 years ago

My project is using the run time library to implement CCDA R1 and R2 validation. It works when servers in Spring MVC project. But for some reason the EMF package registry is not getting loaded properly and therefore it cannot deserialize as a Consol CCD document when try to servers in Sprint Boot project.

Mu2consolPackage.eINSTANCE.unload(); ConsolPackage.eINSTANCE.eClass(); CDAUtil.load(in, result);

swmuir commented 7 years ago

try ConsolPackage.eInstance.getContinuityOfCareDocument() instead i am not sure getting the instance eClass triggers the load

htank

sean

On May 18, 2017, at 1:05 PM, JiahaoLi notifications@github.com wrote:

My project is using the run time library to implement CCDA R1 and R2 validation. It works when servers in Spring MVC project. But for some reason the EMF package registry is not getting loaded properly and therefore it cannot deserialize as a Consol CCD document when try to servers in Sprint Boot project.

Mu2consolPackage.eINSTANCE.unload(); ConsolPackage.eINSTANCE.eClass(); CDAUtil.load(in, result);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mdht/mdht-models/issues/111, or mute the thread https://github.com/notifications/unsubscribe-auth/AFGeFzJPTpgazogHWkotH4UWqU7SU60mks5r7HpjgaJpZM4NfiDj.

JiahaoLi commented 7 years ago

@swmuir Thank you for your quick response. I tried the solution you shared, however, i still get the same issue. Here is the code:

    XPathIndexer xpathIndexer = new XPathIndexer();

     ValidationResult result = new ValidationResult();`
    try {
        processParseXMLDocument(xpathIndexer, ccdaDocument);

        InputStream ccdaDocumentStream = new ByteArrayInputStream(ccdaDocument.getBytes());
        log.info("Using validation criteria: " + ValidationCriteria.C_CDA_IG_ONLY);
        Mu2consolPackage.eINSTANCE.unload();
        // ConsolPackage.eINSTANCE.eClass();
        ConsolPackage.eINSTANCE.getContinuityOfCareDocument();
        CDAUtil.load(ccdaDocumentStream, result);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
    return analysisValidationResults(xpathIndexer, result);
}

Here is the error message: java.lang.UnsupportedOperationException: Unknown type ([vocab, ActClinicalDocument, DOCCLIN]) at org.eclipse.mdht.uml.cda.operations.ClinicalDocumentOperations.validateClassCode(ClinicalDocumentOperations.java:133) ~[org.eclipse.mdht.uml.cda-3.0.0.201703230502.jar:na] at org.eclipse.mdht.uml.cda.impl.ClinicalDocumentImpl.validateClassCode(ClinicalDocumentImpl.java:1659) ~[org.eclipse.mdht.uml.cda-3.0.0.201703230502.jar:na]

Thanks.

swmuir commented 7 years ago

That is defined in org.eclipse.mdht.uml.hl7.vocab so make sure the that jar has been deployed

JiahaoLi commented 7 years ago

@swmuir Yes, i add all required latest libraries, here is dependencies list:

  1. lpg.runtime.java-2.0.17.v201004271640.jar
  2. org.eclipse.emf.common-2.11.1.v20160208-0816.jar
  3. org.eclipse.emf.ecore.xmi-2.11.1.v20160208-0816.jar
  4. org.eclipse.emf.ecore-2.11.2.v20160208-0816.jar
  5. org.eclipse.mdht.emf.runtime-3.0.0.201703230502.jar
  6. org.eclipse.mdht.uml.cda-3.0.0.201703230502.jar
  7. org.eclipse.mdht.uml.hl7.datatypes-3.0.0.201703230502.jar
  8. org.eclipse.mdht.uml.hl7.rim-3.0.0.201703230502.jar
  9. org.eclipse.mdht.uml.hl7.vocab-3.0.0.201703230502.jar
  10. org.eclipse.ocl.common-1.3.0.v20150519-0914.jar
  11. org.eclipse.ocl.ecore-3.5.0.v20150525-1635.jar
  12. org.eclipse.ocl-3.5.0.v20150521-1211.jar
  13. org.eclipse.uml2.common-2.1.0.v20160201-0816.jar
  14. org.eclipse.uml2.types-2.0.0.v20160201-0816.jar
  15. org.openhealthtools.mdht.uml.cda.consol2-2.6.3.20170323.jar
  16. org.openhealthtools.mdht.uml.cda.mu2consol-2.6.3.20170323.jar

Thanks.

JiahaoLi commented 7 years ago

@swmuir Hi swmuir, After i changed packaging from jar to war and use tomcat to deploy instead of spring boot embedded container. It works!

Thanks.