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
falserather than dropping it. - Name, telecom, address — added through helpers that omit anything absent.
- Gender — normalized (for example
Fbecomesfemale). - 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.jsonis 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.jsonis 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.
| Upstream | Downstream |
|---|---|
| An HL7 v2 feed already mapped to fields | The FHIR Validator, then a FHIR server |
| A database query | A file written for a downstream system |
| A CRM adapter | Another transform that adds more resources |
Set it up
- Add the FHIR Resource Creator node to a workflow from the palette, or open the supplied one.
- Connect the node producing your patient data to its input.
- Connect the FHIR Validator, or whatever should receive the resource, to its output.
- 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
resourceTypeset toPatient. - Fields your message did not supply are absent from the output, not present and null.
active: falsein the input is preserved in the output.- A gender code like
Fcomes out normalized asfemale. - Sending the same message twice produces identical output.
If it didn't work
| Symptom | Cause | Fix |
|---|---|---|
| The node logs a mapping error and forwards nothing | The inbound message is not valid JSON, or a value is the wrong type | Check what the upstream node emits; add a transform ahead of it if the shape differs |
| The node errors on gender | The input carries a gender code the mapping does not recognize | Send a supported value, or extend the normalization in the script |
| Expected fields are missing from the resource | The message did not carry them, so they were left out | Confirm the upstream node populates them |
| Output still contains empty values | Those fields were populated with empty strings rather than left unset | Leave them unset upstream |
Next
- FHIR Profiling Tools — get a JSON template for any FHIR resource
- FHIR Validator — check the resource against a FHIR server before you send it
- How Adapters Work
- Custom Scripting Nodes