Package Exports
- @healthcare-interoperability/fhir-query-mongo-store
- @healthcare-interoperability/fhir-query-mongo-store/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@healthcare-interoperability/fhir-query-mongo-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@healthcare-interoperability/fhir-query-mongo-store
MongoDB-specific query builder for FHIR resources, built on top of fhir-query-store.
@healthcare-interoperability/fhir-query-mongo-store
provides MongoDB-compatible query generation utilities for storing and updating FHIR resources using bulk operations. It extends the generic FHIR query framework provided by @healthcare-interoperability/fhir-query-store
, enabling support for real-world healthcare integration workflows and storage patterns.
Features
- 🔁 Supports FHIR Bundles (type
collection
,transaction
, etc.) - ⚙️ Converts FHIR resources into
bulkWrite
-ready MongoDB update queries - 🧠 Optimized for idempotent operations using
updateOne
withupsert
- 📦 Handles integration IDs and task-based processing
- 🧩 Built for composability and subclassing
Installation
npm install @healthcare-interoperability/fhir-query-mongo-store
Usage
import { FHIRMongoBundleProcessor } from '@healthcare-interoperability/fhir-query-mongo-store';
const bundle = {
resourceType: 'Bundle',
type: 'collection',
entry: [/* array of FHIR resources */]
};
const processor = new FHIRMongoBundleProcessor(bundle)
.setIntegrationId('your-integration-id');
const queries = processor.query();
// `queries` is an object keyed by resource type, each with an array of MongoDB operations
// e.g. { Patient: [ { updateOne: { filter, update, upsert: true } } ] }
API
FHIRMongoBundleProcessor
Processes a FHIR bundle and generates MongoDB-compatible update queries.
Constructor
new FHIRMongoBundleProcessor(bundle)
bundle
: A valid FHIR Bundle or single resource.
.setIntegrationId(integrationId)
Sets an integration ID to associate with all processed queries.
.query()
Returns an object where each key is a FHIR resource type (e.g., "Patient"
) and the value is an array of MongoDB update queries ready for bulkWrite
.
Related Packages
@healthcare-interoperability/fhir-query-store
: Generic FHIR query generation framework used as the base for MongoDB and other data stores.
License
MIT