You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hapi FHIR JSON parse fails on the Appointment resource with ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations . I can successfully JSON parse the Patient resource example in the Hapi FHIR docs. The JSON parse of resources works in plain old Java. I expect an Appointment object to be returned when the JSON Appointment resource is parsed. I can successfully JSON parse a Patient resource. This also fails for the Encounter resource.
To Reproduce
Setup steps
Run JDK 17
Run Mirth Connect 4.5.0
Download Hapi FHIR 7.2.0 to custom-libs from GitHub releases
Steps to reproduce the behavior:
Run code below in a JavaScript destination connector
See error
// Create a HAPI FHIR context for FHIR
var context = new Packages.ca.uhn.fhir.context.FhirContext.forR4();
// Instantiate a new parser
var parser = ctx.newJsonParser();
var input = {
{
"resourceType" : "Appointment",
"status" : "booked"
};
// Parse it
var appointment = parser.parseResource(Packages.org.hl7.fhir.r4.model.Appointment, JSON.stringify(input));
Expected behavior
I expect the JSON parser to successfully parse the Appointment resource JSON string returning an Appointment object.
Actual behavior
Appointment resource JSON parsing error DETAILS: Wrapped ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations at 580496cb-4e73-4584-b43b-2d157216edf7_JavaScript_Writer_9:494 (doScript) at 580496cb-4e73-4584-b43b-2d157216edf7_JavaScript_Writer_9:519 at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1899) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:121) ~[rhino-1.7.13.jar:1.7.13] at com.mirth.connect.server.util.javascript.JavaScriptTask.executeScript(JavaScriptTask.java:151) ~[mirth-server.jar:?] at com.mirth.connect.connectors.js.JavaScriptDispatcher$JavaScriptDispatcherTask.doCall(JavaScriptDispatcher.java:261) ~[js-server.jar:?] at com.mirth.connect.connectors.js.JavaScriptDispatcher$JavaScriptDispatcherTask.doCall(JavaScriptDispatcher.java:221) ~[js-server.jar:?] at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:114) ~[mirth-server.jar:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:842) ~[?:?] Caused by: ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations at ca.uhn.fhir.context.ModelScanner.scan(ModelScanner.java:232) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.ModelScanner.init(ModelScanner.java:141) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.ModelScanner.<init>(ModelScanner.java:98) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.scanResourceTypes(FhirContext.java:1064) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.scanResourceType(FhirContext.java:1041) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.getResourceDefinition(FhirContext.java:500) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:679) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:738) ~[hapi-fhir-base-7.2.0.jar:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) ~[rhino-1.7.13.jar:1.7.13] ... 15 more
Screenshots
None
Environment (please complete the following information):
OS: MacOS
Java Distribution/Version Java 17
Connect Version 4.5.0
Workaround(s)
I can use Hapi FHIR 6.8.7.
Additional context
None
The text was updated successfully, but these errors were encountered:
What did you put exactly in your custom-libs directory. The HAPI-FHIR distribution is pretty big! Maybe list the jars you put in there or a screenshot of your custom-libs directory. It will be easier then to help. I don't think this is a Mirth Connect bug, probably just a missing library
Describe the bug
Hapi FHIR JSON parse fails on the Appointment resource with
ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations
. I can successfully JSON parse the Patient resource example in the Hapi FHIR docs. The JSON parse of resources works in plain old Java. I expect an Appointment object to be returned when the JSON Appointment resource is parsed. I can successfully JSON parse a Patient resource. This also fails for the Encounter resource.To Reproduce
Setup steps
Steps to reproduce the behavior:
Expected behavior
I expect the JSON parser to successfully parse the Appointment resource JSON string returning an Appointment object.
Actual behavior
Appointment resource JSON parsing error
DETAILS: Wrapped ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations at 580496cb-4e73-4584-b43b-2d157216edf7_JavaScript_Writer_9:494 (doScript) at 580496cb-4e73-4584-b43b-2d157216edf7_JavaScript_Writer_9:519 at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1899) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) ~[rhino-1.7.13.jar:1.7.13] at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:121) ~[rhino-1.7.13.jar:1.7.13] at com.mirth.connect.server.util.javascript.JavaScriptTask.executeScript(JavaScriptTask.java:151) ~[mirth-server.jar:?] at com.mirth.connect.connectors.js.JavaScriptDispatcher$JavaScriptDispatcherTask.doCall(JavaScriptDispatcher.java:261) ~[js-server.jar:?] at com.mirth.connect.connectors.js.JavaScriptDispatcher$JavaScriptDispatcherTask.doCall(JavaScriptDispatcher.java:221) ~[js-server.jar:?] at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:114) ~[mirth-server.jar:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:842) ~[?:?] Caused by: ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations at ca.uhn.fhir.context.ModelScanner.scan(ModelScanner.java:232) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.ModelScanner.init(ModelScanner.java:141) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.ModelScanner.<init>(ModelScanner.java:98) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.scanResourceTypes(FhirContext.java:1064) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.scanResourceType(FhirContext.java:1041) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.context.FhirContext.getResourceDefinition(FhirContext.java:500) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:679) ~[hapi-fhir-base-7.2.0.jar:?] at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:738) ~[hapi-fhir-base-7.2.0.jar:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) ~[rhino-1.7.13.jar:1.7.13] ... 15 more
Screenshots
None
Environment (please complete the following information):
Workaround(s)
I can use Hapi FHIR 6.8.7.
Additional context
None
The text was updated successfully, but these errors were encountered: