You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@healthcare-interoperability/fhir-query-mongo-store

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@healthcare-interoperability/fhir-query-mongo-store

MongoDB-specific query builder for FHIR resources, built on top of fhir-query-store.

0.2.0
latest
npmnpm
Version published
Maintainers
3
Created
Source

@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 with upsert
  • 📦 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.

License

MIT

Keywords

fhir

FAQs

Package last updated on 16 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts