ehrbase / fhir-bridge

FHIR Bridge acts as a broker between an HL7 FHIR client and an openEHR server.
32 stars 20 forks source link

Unexpected 500 Error in happy path tests of ObservationLab #153

Closed af-pwo closed 3 years ago

af-pwo commented 3 years ago

Test Case/s To Reproduce Issue

tests/robot/OBSERVATION/01_create.robot/.. 42 Create Observation Lab - D-Dimer 47 Create Observation Lab - Neutrophils 50 Create Observation Lab - Cardiac Troponin 52 Create Observation Lab - Lactate Dehydrogenase 56 Create Observation Lab - Partial thrombolastin time 57 Create Observation Lab - Albumin in Serum 60 Create Observation Lab - Fibrinogen 61 Create Observation Lab - INR 62 Create Observation Lab - Aspartate aminotransferase

These test cases are using the associated example.json from src/test/resources/Observation.

robot command to execute related test case(s) in your terminal/console

You HAVE to be in the folder tests/

execute:

robot -i observation-lab -d results -L TRACE robot

NOTE: This will execute all observation-lab tagged test cases. Some of the executed test cases will result in a 422 error. The test cases that result in a 422 http error are part of another issue https://github.com/ehrbase/fhir-bridge/issues/152

Expected Result

http 200

Actual Result

http 500 none diagnostics': 'Unexpected server error', severity': 'error'

Stacktrace

STACKTRACE IS THE SAME FOR ALL RESOURCES

2021-01-22 14:44:48.082 INFO 34714 --- [nio-8888-exec-9] o.e.f.c.p.ResourceProfileValidator : Observation resource validated 2021-01-22 14:44:48.431 ERROR 34714 --- [nio-8888-exec-9] o.a.c.p.e.DefaultErrorHandler : Failed delivery for (MessageId: FABE5E743B2D30C-000000000000001E on ExchangeId: FABE5E743B2D30C-000000000000001E). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: Cannot invoke "java.util.GregorianCalendar.toZonedDateTime()" because the return value of "org.hl7.fhir.r4.model.DateTimeType.getValueAsCalendar()" is null. Processed by failure processor: FatalFallbackErrorHandler[Channel[DelegateSync[org.ehrbase.fhirbridge.camel.processor.DefaultExceptionHandler@29ceefb3]]]

Message History (complete message history is disabled)

RouteId ProcessorId Processor Elapsed (ms) [route5 ] [route5 ] [from[fhir-create-observation://fhirConsumer?fhirContext=%23fhirContext] ] [ 349]

Stacktrace

java.lang.NullPointerException: Cannot invoke "java.util.GregorianCalendar.toZonedDateTime()" because the return value of "org.hl7.fhir.r4.model.DateTimeType.getValueAsCalendar()" is null at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.mapToLaboranalyt(ObservationLabCompositionConverter.java:494) ~[classes!/:na] at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.toComposition(ObservationLabCompositionConverter.java:181) ~[classes!/:na] at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.toComposition(ObservationLabCompositionConverter.java:57) ~[classes!/:na] at org.ehrbase.fhirbridge.camel.component.ehr.composition.CompositionProducer.mergeCompositionEntity(CompositionProducer.java:43) ~[classes!/:na] at org.ehrbase.fhirbridge.camel.component.ehr.composition.CompositionProducer.process(CompositionProducer.java:27) ~[classes!/:na] at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) ~[camel-support-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:169) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:714) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.Pipeline.process(Pipeline.java:147) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41) ~[camel-support-3.7.0.jar!/:3.7.0] at org.openehealth.ipf.platform.camel.ihe.fhir.core.intercept.consumer.ConsumerAuditInterceptor.process(ConsumerAuditInterceptor.java:60) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.runRoute(FhirConsumer.java:192) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.handleInRoute(FhirConsumer.java:165) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.handleAction(FhirConsumer.java:137) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider.requestAction(AbstractPlainProvider.java:170) ~[ipf-commons-ihe-fhir-core-4.0.0.jar!/:na] at org.ehrbase.fhirbridge.fhir.observation.CreateObservationProvider.create(CreateObservationProvider.java:20) ~[classes!/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na] at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:245) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.method.BaseOutcomeReturningMethodBinding.invokeServer(BaseOutcomeReturningMethodBinding.java:154) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.method.CreateMethodBinding.invokeServer(CreateMethodBinding.java:41) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:1052) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:377) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1749) ~[hapi-fhir-server-5.2.0.jar!/:na] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.41.jar!/:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.4.1.jar!/:2.4.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]

2021-01-22 14:44:48.546 ERROR 34714 --- [nio-8888-exec-9] c.u.f.r.s.i.ExceptionHandlingInterceptor : Failure during REST processing

ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Unexpected server error at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.runRoute(FhirConsumer.java:203) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.handleInRoute(FhirConsumer.java:165) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.handleAction(FhirConsumer.java:137) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider.requestAction(AbstractPlainProvider.java:170) ~[ipf-commons-ihe-fhir-core-4.0.0.jar!/:na] at org.ehrbase.fhirbridge.fhir.observation.CreateObservationProvider.create(CreateObservationProvider.java:20) ~[classes!/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na] at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:245) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.method.BaseOutcomeReturningMethodBinding.invokeServer(BaseOutcomeReturningMethodBinding.java:154) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.method.CreateMethodBinding.invokeServer(CreateMethodBinding.java:41) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:1052) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:377) ~[hapi-fhir-server-5.2.0.jar!/:na] at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1749) ~[hapi-fhir-server-5.2.0.jar!/:na] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.41.jar!/:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.4.1.jar!/:2.4.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.2.jar!/:5.3.2] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar!/:5.3.2] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41] at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na] Caused by: java.lang.NullPointerException: Cannot invoke "java.util.GregorianCalendar.toZonedDateTime()" because the return value of "org.hl7.fhir.r4.model.DateTimeType.getValueAsCalendar()" is null at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.mapToLaboranalyt(ObservationLabCompositionConverter.java:494) ~[classes!/:na] at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.toComposition(ObservationLabCompositionConverter.java:181) ~[classes!/:na] at org.ehrbase.fhirbridge.ehr.converter.ObservationLabCompositionConverter.toComposition(ObservationLabCompositionConverter.java:57) ~[classes!/:na] at org.ehrbase.fhirbridge.camel.component.ehr.composition.CompositionProducer.mergeCompositionEntity(CompositionProducer.java:43) ~[classes!/:na] at org.ehrbase.fhirbridge.camel.component.ehr.composition.CompositionProducer.process(CompositionProducer.java:27) ~[classes!/:na] at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) ~[camel-support-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:169) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:714) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.processor.Pipeline.process(Pipeline.java:147) ~[camel-core-processor-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) ~[camel-base-engine-3.7.0.jar!/:3.7.0] at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41) ~[camel-support-3.7.0.jar!/:3.7.0] at org.openehealth.ipf.platform.camel.ihe.fhir.core.intercept.consumer.ConsumerAuditInterceptor.process(ConsumerAuditInterceptor.java:60) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] at org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer.runRoute(FhirConsumer.java:192) ~[ipf-platform-camel-ihe-fhir-core-4.0.0.jar!/:na] ... 56 common frames omitted

ppazos commented 3 years ago

@af-pwo the error from the log happens because the issuedDateTime is not in the JSON.

https://github.com/ehrbase/fhir-bridge/blob/develop/src/main/java/org/ehrbase/fhirbridge/ehr/converter/ObservationLabCompositionConverter.java#L456-L494

Can you attach the JSON used? Thanks

af-pwo commented 3 years ago

@ppazos

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-aspartate-aminotransferase.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-fibrinogen.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-inr.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-albumin-in.serum.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-partial-thromboplastin-time.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-cardiac-troponin.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-lactate-dehydrogenase.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-d-dimer.json

https://github.com/ehrbase/fhir-bridge/blob/develop/src/test/resources/Observation/create-observation-lab-neutrophils.json

birgerhaarbrandt commented 3 years ago

@ppazos @af-pwo what's the status on this? Does the mapping team need to do something?

ppazos commented 3 years ago

@birgerhaarbrandt I did a change in the code but wasn't able to execute the robot tests. Asked @af-pwo to fix the robot command so I can execute them before and after my change to verify the fix.

ppazos commented 3 years ago

@birgerhaarbrandt I think the fix to this is what I mentioned about removing codes that are hardcoded in templates so the SDK generator doesn't create a enum and the person doing the mapping can assign the codes freely. IF the code is not in the enum, the mapping can't be done. Another strategy would be to use the codes that come in the FHIR resource without any mappings.