Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@healthcare-interoperability/fhir-query-store

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@healthcare-interoperability/fhir-query-store

Abstract base for generating queries from FHIR resources that can be used with any data store.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
3
Created
Source

@healthcare-interoperability/fhir-query-store

Lightweight, extensible framework for generating data store–agnostic queries from FHIR resources.

✨ Features

  • 🏥 Supports core FHIR resource types (e.g., Patient, Appointment, Encounter)
  • 🔌 Backend-agnostic: works with any storage engine (MongoDB, SQL, memory, etc.)
  • ⚙️ Query generation logic encapsulated in a pluggable FHIRQuery class
  • 🔍 Built-in validation, normalization, and integration ID support
  • 🔄 Easily extendable for custom business logic or resource types

📦 Installation

npm install @healthcare-interoperability/fhir-query-store

🚀 Usage

import { FHIRQuery } from '@healthcare-interoperability/fhir-query-store';

// Sample FHIR resource
const resource = {
  resourceType: 'Patient',
  id: '123',
  name: [{ family: 'Doe', given: ['John'] }],
};

// Create a FHIRQuery instance
const query = new FHIRQuery(resource);

// Optionally set integration ID
query.setIntegrationId('your-integration-id');

// Generate database-ready query structure
const updates = query.query();

console.log(updates);
/*
[
  {
    resourceType: 'Patient',
    query: {
      updateOne: {
        filter: { id: '123' },
        update: { $set: { ... } },
        upsert: true
      }
    }
  }
]
*/

🧱 Class Overview

FHIRQuery

  • constructor(resource: object)
  • .setIntegrationId(id: string)
  • .query() → Array<{ resourceType, query }>

🧩 Extending

To add custom logic or support new backends, extend the base class:

class CustomQuery extends FHIRQuery {
  query() {
    const base = super.query();
    // Add custom logic here
    return base;
  }
}
  • @healthcare-interoperability/fhir-query-store-mongo: MongoDB-specific implementation of FHIRQuery

📄 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