I am unable to JSON parse the Appointment resource similar to the JSON parse Patient resource example in the Hapi FHIR docs. This works in plain old Java. This fails with Mirth 4.5.0, Java 17, Hapi FHIR 7.2.0, and Windows. 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. Mirth uses Rhino.js to translate JavaScript to Java.
ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[org.hl7.fhir.r4.model.Appointment] does not contain any valid HAPI-FHIR annotations
JavaScript destination connector:
// 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));