Newer Version Available

This content describes an older version of this product. View Latest

Custom HL7 JSON Object Parsing

The default parser supplied with Health Cloud works for most purposes. If this parser doesn't meet your needs, you can create your own parser class using the sample code provided.
You may wish to swap in an alternative parser if any of these is true:
  • You can't get JSON objects in the required format for Health Cloud.
  • Your incoming message has extra elements that aren't supported in Health Cloud.
  • You need to map an HL7 element to a non-default field in the corresponding Health Cloud object.
In any of these cases, you can replace the parser with another parser with the mapping you need.
  1. Create the new Apex class.
    See the code samples for guidance.
  2. In Settings, under HL7 Parser Mapping, deactivate the existing parser mapping record.
  3. Clone the existing parser mapping record and add the new value.
    If more than one is active, Salesforce uses the first listed, which is usually the one that was most recently used.
  4. Define which nodes are parsed. If you want to parse all nodes in the JSON object, not just the elements that are supported in Health Cloud by default, set Parse Strategy to 2.
    If you are using a custom parser to handle custom fields in your HL7 message that aren't represented in the supplied Health Cloud objects, you'll want to make sure all nodes are parsed. By default, the value is set to 1, which parses only those nodes that correspond to fields in the Health Cloud data objects. Any elements that aren't supported in Health Cloud are ignored.

If you are doing your parsing with a third-party service, you can send just the parsed message. Use this end point:/services/apexrest/HealthCloudGA/HL7Businessobject

Tip