Bulk FHIR Export from EHRs

Bulk FHIR exports are a part of the Fast Healthcare Interoperability Resources (FHIR) specification, which is a standard for exchanging healthcare information electronically. The FHIR standard is developed by Health Level Seven International (HL7) and is designed to enable healthcare data interoperability.

Bulk FHIR exports refer to the capability within FHIR servers to export large datasets from a FHIR server for a given FHIR resource type or for all the data for a system. It's particularly useful for situations where an organization needs to export all patient records or a large subset of clinical data for analysis, backup, migration, or compliance reasons.

Here’s a simplified explanation of how Bulk FHIR exports typically work:

  1. Initiating the Export: A client or authorized user sends a request to the FHIR server to begin an export. This request specifies the types of resources to be exported, such as all resources or a specific set like all Patient or Observation resources.

  2. Authentication: The FHIR server authenticates the request, often using an OAuth2.0 token or similar authentication token, to ensure that the requestor has the necessary permissions to perform the export.

  3. Data Retrieval and Processing: The FHIR server processes the request, retrieves the requested data, and converts it into a suitable format for export. This process involves extracting the relevant data from the server's database and transforming it into FHIR-compliant resource instances.

  4. Data Storage: Once the data is prepared, it's typically written to files in a secure storage service. The files are usually in a format like NDJSON (Newline Delimited JSON), which is a standard file format that allows storing multiple JSON objects in a single file separated by newlines.

  5. Secure Access: The FHIR server provides the client with a secure method to access the exported files, usually by generating links to the stored data. This ensures that only authorized entities can download or interact with the exported data.

  6. Data Transfer: The client uses the provided links to download the exported data files. This data can then be used for various purposes such as analytics, data migration, or integration with other systems.

For data interoperability, Bulk FHIR exports are crucial because they provide a standardized method for moving large amounts of healthcare data between systems. This uniformity ensures that the data remains consistent, structured, and interpretable by different healthcare IT systems, which is essential for analyzing population health, conducting research, and creating backups. It also supports compliance with healthcare regulations that require data to be portable and accessible, such as the 21st Century Cures Act in the United States.

Unexpected error with integration github-files: Integration is not installed on this space

FHIR Bulk Data Export Service

This project is a Node.js application that provides a service for initiating and managing FHIR bulk data exports. It uses the FHIR Bulk Data Access (Flat FHIR) specification to export patient data from a FHIR server and stores the exported data in Azure Blob Storage.

Features

  • Initiates a bulk data export request to a FHIR server.

  • Checks the status of the export request.

  • Downloads the exported data once it's ready and stores it in Azure Blob Storage.

  • Handles token-based authentication with the FHIR server.

  • Provides a JSON Web Key Set (JWKS) endpoint.

Setup

  1. Clone the repository.

  2. Run npm install to install the required dependencies.

  3. Create a .env file in the root directory and set the following environment variables:

    • FHIR_BASE_URL: The base URL of your FHIR server.

    • CLIENT_ID: The client ID for your FHIR server.

    • KEY_VAULT_NAME: The name of your Azure Key Vault.

    • RSA_KEY_NAME: The name of your RSA key in Azure Key Vault.

    • EC_KEY_NAME: The name of your EC key in Azure Key Vault.

    • AZURE_STORAGE_ACCOUNT_NAME: The name of your Azure Storage account.

    • AZURE_STORAGE_ACCOUNT_ACCESS_KEY: The access key for your Azure Storage account.

    • PORT: The port number on which the server will run (default is 8000).

  4. Run node index.js to start the server.

Usage

  • To start a bulk data export, send a POST request to /start-bulk-export with a JSON body containing the groupId and resources parameters. The server will initiate the export and periodically check its status until it's complete, at which point it will download the exported data and store it in Azure Blob Storage.

  • To check the server status, send a GET request to /. The server will respond with a message indicating that it's online.

  • To get the JSON Web Key Set (JWKS), send a GET request to /.well-known/jwks.json. The server will respond with the JWKS.

Last updated