Welcome to the MongoDB Healthcare API! This API provides functionality for FHIR and OpenEHR operations, offering robust healthcare data management within applications.
Configure your application by setting the following environment variables:
MONGO_ATLAS_URI=""
DATABASE_NAME=""
To begin working with the API, you need to load test data into MongoDB. Follow these steps:
- Download the latest FHIR dataset from Synthea.
- Extract the downloaded file.
- Place the extracted dataset inside the
modules/fhir/load-data
directory of your project. - Run
fhir-load-data-multiple
orfhir-load-data-single
To run the API locally, execute the following commands in your terminal:
-
Install the required npm packages:
npm install
-
Start the API:
npm run api
-
Open your browser and navigate to http://localhost:3456/api/docs to view the OpenAPI documentation.
For containerized environments, you can create and run a Docker container using the steps below:
-
Build the Docker image:
docker build -t hc-framework .
-
Run the Docker container:
docker run -d --name hc-framework -p 3456:3456 hc-framework
The system supports various FHIR operations for interacting with healthcare resources. The supported operations are outlined below:
Feature | Supported |
---|---|
Create | ✅ |
Read | ✅ |
Update | ✅ |
Delete | ✅ |
VRead | ❌ |
History (Instance) | ❌ |
History (Type) | ❌ |
Search (Type) | ❌ |
Patch | ❌ |
Validate | ❌ |
Everything | ❌ |
The API provides several routes for OpenEHR operations:
-
Store Template: Stores a template in ADL format.
POST /api/openehr/v1/ehr/definition/template/adl1.4
-
Store Composition: Stores a composition for a specific EHR.
POST /api/openehr/v1/ehr/:ehrId/composition
-
Get Composition: Retrieves a specific composition using EHR and composition IDs.
GET /api/openehr/v1/ehr/:ehrId/composition/:compositionId
-
Create EHR: Creates an Electronic Health Record (EHR).
PUT /api/openehr/v1/ehr/:ehrId
Inside the src
folder and the api
folder, you will find a routes
directory. This folder contains all route definitions for FHIR and OpenEHR operations, helping you navigate through different functionalities provided by the API.
Feel free to explore the codebase, and make use of the routes and APIs to integrate healthcare data management into your applications effectively!