bonFHIR icon

bonFHIR

Perform operations on FHIR resources

Overview

This node, named "bonFHIR," is designed to interact with FHIR (Fast Healthcare Interoperability Resources) servers by performing various operations on FHIR resources. The provided operation is Read for the Default resource type, which means it retrieves a specific FHIR resource instance by its ID from a FHIR server.

Common scenarios where this node is beneficial include:

  • Fetching patient records or clinical data from a FHIR server.
  • Retrieving specific healthcare resources such as Observations, Conditions, or MedicationRequests by their unique identifiers.
  • Integrating FHIR-based healthcare data into workflows for further processing or analysis.

Practical example:

  • A workflow that reads a Patient resource by ID to obtain demographic information before proceeding with other healthcare automation tasks.
  • Retrieving an Observation resource to analyze lab results in a clinical decision support system.

Properties

Name Meaning
Authentication Method of authentication to use when connecting to the FHIR server. 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 connect to (e.g., http://example.com/fhir).
Resource Type The type of FHIR resource to operate on (e.g., Patient, Observation, Condition).
Custom Resource Type If "Resource Type" is set to "- Custom -", specify the custom resource type string here.
ID The unique identifier of the FHIR resource instance to read. Required for Read operation.
Specify Query Parameters How to specify query parameters: either using key-value pairs or JSON.
Query Parameters Key-value pairs for query parameters if "Using Fields Below" is selected.
JSON JSON object for query parameters if "Using JSON" is selected.
FHIR Path A FHIRPath expression to extract specific data from the output.
Ignore SSL Issues Whether to allow connections even if SSL certificate validation fails (useful for self-signed certificates).

Additional properties exist for other operations (Create, Update, Patch, etc.) but are not relevant for the Read operation.

Output

The node outputs the JSON representation of the requested FHIR resource(s) under the json field of each item. If the response is a FHIR Bundle (common in search operations), it extracts and outputs individual resources from the bundle entries.

If a FHIRPath expression is specified, the node evaluates it against the response and outputs the resulting data instead of the full resource.

Binary data output is not indicated in the provided code; thus, the node primarily outputs JSON data representing FHIR resources.

Dependencies

  • Requires access to a FHIR server endpoint specified by the Base URL.
  • Supports multiple authentication methods; appropriate credentials or tokens must be configured in n8n.
  • Uses internal utilities for HTTP requests with authentication handling.
  • Utilizes a FHIRPath evaluation library to process FHIRPath expressions.
  • No external environment variables are explicitly required beyond standard n8n credential configurations.

Troubleshooting

Common Issues

  • Invalid or missing resource ID: The Read operation requires a valid resource ID; omitting or providing an incorrect ID will result in errors.
  • Authentication failures: Incorrect or missing authentication credentials can cause connection failures.
  • SSL certificate issues: If connecting to a server with a self-signed or invalid SSL certificate, enable "Ignore SSL Issues" to avoid connection errors.
  • FHIRPath syntax errors: Invalid FHIRPath expressions may cause evaluation errors or unexpected output.
  • Multiple results error: Although more common in Search operations, if the node is configured to error on multiple results and the response contains multiple entries, it will throw an error.

Error Messages

  • "The operation 'Read' is not supported": Indicates an unsupported operation was selected; verify the operation name.
  • "The search returned more than one result": Occurs if "Error if More than One Result" is enabled during a Search operation and multiple resources are returned.
  • HTTP request errors: Network issues, invalid URLs, or server errors will propagate as node errors.
  • JSON parsing errors: Malformed JSON input in parameters like body or query parameters will cause errors.

Resolution Tips

  • Ensure all required parameters (Base URL, Resource Type, ID) are correctly set.
  • Verify authentication credentials and method.
  • Use valid FHIRPath expressions; test them separately if needed.
  • Enable "Ignore SSL Issues" only if you trust the server.
  • Check network connectivity and server availability.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions without executing any code.

Discussion