Clinivault icon

Clinivault

Perform operations on FHIR resources

Overview

This node enables interaction with FHIR (Fast Healthcare Interoperability Resources) servers, specifically performing a Search operation on FHIR resources. It allows users to query a FHIR server for resources of a specified type using various query parameters and retrieve matching results.

Common scenarios where this node is beneficial include:

  • Retrieving patient records or clinical observations from a FHIR server.
  • Searching for healthcare-related data such as appointments, medications, or diagnostic reports.
  • Integrating healthcare applications by querying standardized FHIR resources.
  • Extracting specific subsets of data using FHIR Path expressions for further processing.

For example, a user might search for all "Patient" resources with a certain attribute or retrieve all "Observation" resources related to a particular patient.

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 to which requests are sent. Required when using a specific authentication method.
Retrieve All Pages? Whether to automatically retrieve all pages of search results. Useful for getting complete result sets but may lead to large data volumes.
Normalize Next URL to Base URL When retrieving all pages, whether to normalize the "next" page URL to use the configured base URL. Helps if the next URL points to a different base URL.
Error if More than One Result If enabled, the node will throw an error if the search returns more than one resource in the Bundle. Only applicable when not retrieving all pages.
Resource Type The type of FHIR resource to search for (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.
Specify Query Parameters Choose how to specify search query parameters: either as key-value pairs or as a raw JSON string.
Query Parameters When specifying query parameters as key-value pairs, add multiple name-value pairs representing search criteria.
JSON When specifying query parameters as JSON, provide the entire query object as a JSON string.
FHIR Path An optional FHIR Path expression to extract specific data from the search results.
Ignore SSL Issues Whether to allow connections even if SSL certificate validation fails (useful for self-signed certificates or development environments).

Output

The node outputs an array of JSON objects representing the FHIR resources returned by the search operation. The output structure depends on the search results:

  • If the response is a FHIR Bundle, each entry's resource is extracted and output individually.
  • If a FHIR Path expression is provided, it is applied to the response to extract specific data.
  • Each output item includes the JSON representation of a FHIR resource or extracted data, paired with the input item index for traceability.

If the search retrieves multiple pages (when "Retrieve All Pages?" is enabled), the node fetches subsequent pages and appends their results to the output.

The node does not output binary data.

Dependencies

  • Requires access to a FHIR server endpoint supporting the FHIR REST API.
  • Supports various authentication methods; appropriate credentials or tokens must be configured in n8n.
  • Uses the fhirpath library internally to evaluate FHIR Path expressions.
  • Network connectivity and proper SSL configuration are necessary unless "Ignore SSL Issues" is enabled.

Troubleshooting

  • Error: "The search returned more than one result"
    Occurs if "Error if More than One Result" is enabled and the search Bundle contains multiple matching resources. To resolve, disable this option or refine the search query to return a single result.

  • Invalid JSON in Query Parameters
    When specifying query parameters as JSON, invalid JSON syntax will cause an error. Ensure the JSON string is well-formed.

  • Authentication Failures
    Incorrect or missing authentication credentials will cause request failures. Verify that the correct authentication method and credentials are configured.

  • SSL Certificate Errors
    If connecting to a server with an invalid or self-signed certificate, enable "Ignore SSL Issues" to bypass SSL validation during development or testing.

  • Large Result Sets
    Enabling "Retrieve All Pages?" can result in very large data sets and longer execution times. Use with caution and consider filtering queries to limit results.

Links and References

Discussion