Export Format Documentation

For ONC Certification – §170.315(b)(10): Electronic Health Information export

Step-by-Step Instructions to export Single Patient EHI data [without developer assistance]

 

Step 1: Navigate to the EHI Export Page

  1. Log in to the EMR system with an authorized user account. You must be a “Systems Administrator” to download EHI reports.
  2. On the left navigation panel, click on the “Reports” section.
  3. Under “Reports”, click the “EHI Export” submenu item.
  4. The EHI Export interface will open on the right side of the screen.

 

Step 2: Enter Patient Reference Number

  1. You will see a text input labeled “Patient Reference Number.”
  2. Initially, the “Search” button will be disabled.
  3. Start typing a valid patient reference number.
  4. Once a non-empty value is entered, the “Search” button becomes enabled.

 

Step 3: Search for the Patient Record

  1. Click the “Search” button.
  2. The system will perform a lookup for the patient reference number you entered.
  3. Two possible outcomes:
    • No Match Found: An alert is shown with the message.
    • Match Found: The system displays some basic details.

 

Step 4: Generate the EHI Report

  1. Click the “Generate Report” button.
  2. The system will begin generating the report in the background.

 

Step 5: Retrieve the Downloadable File

  1. Once the report is ready, a new entry is added to the “Notifications” panel.
  2. Navigate to the Notifications section (accessible from the top navigation bar or user dashboard).
  3. Locate the notification using the Search bar using the Patient Reference Number.
  4. The notification includes:
    • Patient Reference Number
    • A Download link (hyperlinked filename or button)
  5. Click the Download link to get the file in the stated format: FHIR NDJSON (ZIP compressed) format.

Data Dictionary:

Find a sample exported ZIP file here

 

 

Instructions to export Patient Population EHI data [with developer assistance]

 

Overview

This script exports all patients and their associated resources from a FHIR server using the Patient/$everything operation. It uses axios for direct HTTP communication with the FHIR server, providing better control and flexibility.

 

Features

  • Direct HTTP Communication: Uses axios for direct communication with the FHIR server.
  • Flexible Patient Selection: You can export all patients or filter by specific IDs or creation dates.
  • Batch Processing: Processes patients in configurable batches to avoid overwhelming the FHIR server.
  • Complete Resource Export: Uses Patient/$everything to get all resources associated with each patient.
  • Organized Output: Creates a separate JSON file for each resource type per patient.
  • Compressed Archive: Creates a zip file containing all exported data.
  • Comprehensive Logging: Provides detailed logging throughout the export process.
  • Error Handling: Gracefully handles failures with detailed error reporting.
  • Authentication Support: Supports Bearer token authentication.
  • Configurable FHIR Server: Allows for easy configuration of the FHIR server URL.

 

Prerequisites

  • Node.js installed on your system.
  • Access to a FHIR server.
  • FHIR server base URL.
  • Authentication token (if your FHIR server requires it).

 

Installation Steps

  1. Navigate to Project Directory: cd /path/to/your/patient-service.
  2. Install Dependencies: Run npm install or yarn install.
  3. Verify ts-node Availability: Check if ts-node is available by running npx ts-node --version. If it is not available, install it by running npm install -g ts-node typescript.

 

Usage Instructions

  • Method 1: Using npx (Recommended): npx ts-node src/scripts/run-patient-export.ts --fhirUrl=YOUR_FHIR_SERVER_URL.
  • Method 2: Using npm script: npm run export-patients -- --fhirUrl=YOUR_FHIR_SERVER_URL.
  • Method 3: Using Yarn: yarn ts-node src/scripts/run-patient-export.ts --fhirUrl=YOUR_FHIR_SERVER_URL.

 

Command Line Parameters

  • --fhirUrl=URL: Specifies the FHIR server base URL.
  • Optional Parameters:
    • --authToken=TOKEN: The authentication Bearer token.
    • --patientIds=id1,id2: Specific patient IDs to export.
    • --createdAfter=YYYY-MM-DD: Exports patients created after this date.
    • --createdBefore=YYYY-MM-DD: Exports patients created before this date.
    • --batchSize=N: The number of patients to process in each batch (default is 50).
    • --outputDir=path: The output directory for exported files (default is ./patient-exports).
    • --zipFileName=name: The base name for the zip file (default is patient-export).