Skip to main content

FHIR Resource Creator

A Transform Custom node that maps an inbound JSON message onto a FHIR R4 Patient resource and pushes it downstream — typically to the FHIR Validator.

Published in the Linkiir FHIR Adapters catalog. Install that catalog from Settings → Catalogs → Install Linkiir catalogs to add this adapter to your grid — see Adapter Catalogs.

What it does​

When a message arrives, the node reads its fields and builds a FHIR Patient by hand using the fhir_creator helpers. It adds only the fields the message actually carries, so the output is a valid Patient with no empty scaffolding and no null placeholders left in it.

upstream node → FHIR Resource Creator → FHIR Validator (or your next node)

The mapping is deliberately direct and readable: the node's script says exactly which source field goes where. There is no mapping engine and no null-cleanup step — the resource is assembled from populated fields only.

No network calls and no credentials: this is a local transformation, so it runs the same in DEV as in PROD and has nothing to authenticate.

How the mapping works​

The node ships a worked Patient mapping. It parses the inbound JSON, then:

  • Identifier — stamps a configured system onto the MRN, and only when the input carries a value.
  • Active — copies the boolean through, preserving false rather than dropping it.
  • Name, telecom, address — added through helpers that omit anything absent.
  • Gender — normalized (for example F becomes female).
  • Birth date — copied when present.

Fields the message does not populate never appear in the output. A mapping error — malformed JSON, an unsupported gender code — is logged as an error and nothing is forwarded, so a bad input is visible rather than silently passed on.

Reference template and sample input​

  • templates/patient.json is a reference of the resource shape being built. It is generated by the FHIR Profile Designer and is not parsed at runtime — it is there to show you the field names when you edit the mapping.
  • samples/patient-input.json is an example inbound message. Its fields are flat, for example:
{
"identifier_value": "DEMO-123",
"given": "Jane",
"family": "Smith",
"active": false,
"gender": "F",
"birthDate": "1980-05-15",
"phone": "555-0123",
"email": "jane.smith@example.com",
"addressLine": "123 Main Street",
"city": "Springfield",
"state": "IL",
"postalCode": "62704",
"country": "US"
}

Where it fits​

Pair it with an adapter or transport node that produces structured patient data, then send the resource on to the FHIR Validator or straight to whatever consumes FHIR.

UpstreamDownstream
An HL7 v2 feed already mapped to fieldsThe FHIR Validator, then a FHIR server
A database queryA file written for a downstream system
A CRM adapterAnother transform that adds more resources

Set it up​

  1. Add the FHIR Resource Creator node to a workflow from the palette, or open the supplied one.
  2. Connect the node producing your patient data to its input.
  3. Connect the FHIR Validator, or whatever should receive the resource, to its output.
  4. Send one message through with Run Test on the upstream node, then start the nodes.

Configuration reference​

This node has no configuration fields. Everything it needs comes from the inbound message, and the mapping itself lives in the node's script.

To map a different resource, or to change which fields land where, edit the script. Use a template from the FHIR Profile Designer as your field reference. See Custom Scripting Nodes.

Verify it worked​

  • The downstream node receives JSON with resourceType set to Patient.
  • Fields your message did not supply are absent from the output, not present and null.
  • active: false in the input is preserved in the output.
  • A gender code like F comes out normalized as female.
  • Sending the same message twice produces identical output.

If it didn't work​

SymptomCauseFix
The node logs a mapping error and forwards nothingThe inbound message is not valid JSON, or a value is the wrong typeCheck what the upstream node emits; add a transform ahead of it if the shape differs
The node errors on genderThe input carries a gender code the mapping does not recognizeSend a supported value, or extend the normalization in the script
Expected fields are missing from the resourceThe message did not carry them, so they were left outConfirm the upstream node populates them
Output still contains empty valuesThose fields were populated with empty strings rather than left unsetLeave them unset upstream

Next​