Socket
Book a DemoInstallSign in
Socket

@atomic-ehr/fhirschema

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atomic-ehr/fhirschema

TypeScript implementation of FHIRSchema converter and validator

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
362
182.81%
Maintainers
1
Weekly downloads
 
Created
Source

FHIRSchema

CI Type Check

TypeScript implementation of FHIRSchema converter and validator.

Overview

This project provides:

  • Converter: Transforms FHIR StructureDefinitions into FHIRSchema format
  • Validator: Validates FHIR resources against FHIRSchema definitions

Installation

npm install @atomic-ehr/fhirschema

Or install the latest canary version:

npm install @atomic-ehr/fhirschema@canary

Usage

Converting StructureDefinition to FHIRSchema

import { translate } from '@atomic-ehr/fhirschema';

const structureDefinition = {
  resourceType: 'StructureDefinition',
  name: 'Patient',
  // ... rest of the StructureDefinition
};

const fhirSchema = translate(structureDefinition);

Validating FHIR Resources

import { validate } from '@atomic-ehr/fhirschema';

const resource = {
  resourceType: 'Patient',
  // ... patient data
};

const schema = { /* FHIRSchema */ };
const context = { schemas: { Patient: schema } };

const result = validate(context, [], resource);
if (result.valid) {
  console.log('Resource is valid');
} else {
  console.log('Validation errors:', result.errors);
}

Development

Running Tests

bun test

Type Checking

bun run typecheck

Building

bun run build

Project Structure

├── src/
│   ├── converter/     # StructureDefinition to FHIRSchema converter
│   ├── validator/     # FHIRSchema validator
│   └── types.ts       # Shared TypeScript types
├── test/
│   ├── unit/          # Unit tests
│   └── golden/        # Golden tests with expected outputs
├── spec/              # Specifications and documentation
├── adr/               # Architecture Decision Records
└── tasks/             # Task management

Development

This project uses:

  • Bun as the runtime and test runner
  • TypeScript for type safety
  • GitHub Actions for CI/CD

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

[License information to be added]

Keywords

fhir

FAQs

Package last updated on 02 Aug 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.