Skip to content

qie.convertFHIRJSONtoXML

Signature: qie.convertFHIRJSONtoXML(message, indent*, annotate*)

Returns: XML Message xmlMessage - the XML message object

Converts an HL7 FHIR JSON message object into an XML message object.

Note

Follows the conventions and rules outlined here.

Parameters

Type Name Description Default
JSON Message message the JSON message object to convert
Integer indent* (optional) the number of spaces to use for indentation 0
Boolean annotate* (optional) include annotations required to properly convert a FHIR resource from XML to JSON true

Example

var jsonMessageFHIR = qie.parseJSONString('' +
   '{\n' +
   '  "resourceType": "Patient",\n' +
   '  "id": "example-patient-id",\n' +
   '  "name": [\n' +
   '    {\n' +
   '      "family": "Doe",\n' +
   '      "given": ["John","Johnny"]\n' +
   '    }\n' +
   '  ],\n' +
   '  "gender": "male",\n' +
   '  "birthDate": "1990-05-15"\n' +
   '}');

var xmlMessage = qie.convertFHIRJSONtoXML(jsonMessageFHIR);