Skip to main content

FHIR Resource Creator

The FHIR Resource Creator is a component that demonstrates how to create and map FHIR resources. It does so by demonstrating the following workflow:

  1. First parses a template FHIR resource JSON. In this example, a v4.0.1 Patient resource has been provided.

  2. Performs some sample mappings to the FHIR resource object

  3. Removes any null values remaining in the mapped FHIR resource object

  4. Serializes the FHIR resource object for further processing

How to use it:

STEP 1: Import the FHIR Resource Creator and open the Translator

Using +COMPONENT, import the FHIR Resource Creator, and click Edit to open the Translator

STEP 2: Optionally, replace the provided template Patient resource in FHIRresource.lua with one of your own

You can easily generate a new template resource using the FHIR Profiling Tool .

STEP 3: Use the annotations to understand how the template resource is transformed

Click on the output of the json.parse() on line 8 to see the parsed JSON template:

You'll see the JSON template contains the structure for a Patient resource, with each field populated with a json.NULL:

Now click on the result of the trace on line 18 after the FHIR object has been mapped and cleaned using the https://interfaceware.atlassian.net/wiki/x/AoDys:

You can see that the FHIR object now only contains the data that was mapped over. Notice that the other template fields that originally contained json.NULLs have also been removed: