Clinivault icon

Clinivault

Perform operations on FHIR resources

Overview

This node enables interaction with FHIR (Fast Healthcare Interoperability Resources) servers, specifically supporting the "Patch" operation on FHIR resources. The Patch operation allows users to apply partial updates to existing FHIR resources using JSON Patch as defined by RFC 6902. This is useful when you want to modify only certain fields of a resource without sending the entire resource representation.

Common scenarios include updating patient records, modifying clinical observations, or adjusting appointment details in a healthcare system that supports FHIR APIs. For example, if a patient's contact information changes, instead of replacing the whole patient resource, you can patch just the relevant fields.

Properties

Name Meaning
Authentication The method used to authenticate requests. Options: Basic Auth, Custom Auth, Digest Auth, Header Auth, None, OAuth1, OAuth2, Query Auth.
Base URL The base URL of the FHIR server API where requests are sent.
Resource Type The type of FHIR resource to operate on (e.g., Patient, Observation, Appointment). A comprehensive list of standard FHIR resource types is provided, plus an option for custom resource types.
Custom Resource Type If "Resource Type" is set to custom, specify the custom resource type string here.
Tenant ID Optional tenant identifier to include in request headers for multi-tenant FHIR servers.
ID The unique identifier of the specific FHIR resource instance to patch.
Specify Patch Body Choose how to specify the patch body: either "Using Fields Below" (key-value pairs) or "Using JSON" (raw JSON array of patch operations).
JSON Patch Body When specifying patch body as JSON, provide a JSON array of patch operations conforming to RFC 6902.
Patch Parameters When specifying patch body using fields, define one or more patch operations with these parameters: Op (operation type: add, copy, move, remove, replace, test), From (source path for copy/move/test), Path (target path), Value (value to apply).
Specify Query Parameters Choose how to specify query parameters for the request: "Using Fields Below" or "Using JSON".
Query Parameters When specifying query parameters using fields, define name-value pairs for query parameters.
JSON When specifying query parameters as JSON, provide a JSON object representing the query parameters.
FHIR Path An optional FHIRPath expression to extract specific data from the response output.
Ignore SSL Issues Whether to ignore SSL certificate validation errors (useful for self-signed certificates).

Output

The node outputs JSON data representing the patched FHIR resource(s) returned by the server after applying the patch operation. The output structure typically includes:

  • json: The updated FHIR resource object reflecting the changes made by the patch.
  • pairedItem: Metadata linking the output item to the input item index.

If the response is a FHIR Bundle (a collection of resources), the node extracts and outputs each resource individually.

No binary data output is produced by this node.

Dependencies

  • Requires access to a FHIR server API endpoint that supports PATCH operations with JSON Patch (RFC 6902).
  • Requires appropriate authentication credentials configured in n8n according to the selected authentication method.
  • Optionally requires tenant ID header configuration if the FHIR server uses multi-tenancy.
  • Uses the fhirpath library internally to evaluate FHIRPath expressions if specified.

Troubleshooting

  • Invalid JSON Patch Body: If the JSON Patch body is malformed or does not conform to RFC 6902, the server may reject the request. Ensure the JSON array of patch operations is valid.
  • Missing or Incorrect Resource ID: The patch operation requires a valid resource ID. Omitting or providing an incorrect ID will cause errors.
  • Authentication Errors: Incorrect or missing authentication credentials will result in authorization failures.
  • SSL Certificate Issues: If connecting to a server with a self-signed or invalid SSL certificate, enable "Ignore SSL Issues" to bypass validation.
  • More Than One Result Error: Although not typical for Patch, if combined with search operations, setting "Error if More than One Result" to true will throw an error if multiple resources match.
  • Unsupported Operation: Attempting to use an unsupported operation value will throw an error indicating the operation is not supported.

Links and References

Discussion