Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@huseyininanc/fhir-models

huseyininnc9MIT1.0.3TypeScript support: included

FHIR models library with R4, R4B, and R5 Resource models

fhir-json, fhir-client, fhir-interfaces, fhir-resources, fhir-types, fhir-models, angular-fhir, angular, FHIR, healthcare, models, R4, R4B, R5, health-data, patient-resources, TypeScript, type-safe, javascript, open-source-library, data-modeling, frontend, web-components, api-client, typescript-models

readme

Fhir Models

A powerful library providing R4, R4B, and R5 resource models for FHIR. This package simplifies handling FHIR resources with flexible interfaces and type-safe utilities tailored to various FHIR versions.

Features

  • Comprehensive interfaces for R4, R4B, and R5 FHIR resources
  • Flexible type generation for FHIR resources
  • Version-specific Bundles (BundleForVersion)
  • Version-specific Resource Types (ResourceForVersion)

Installation

Install the package using NPM:

  npm install @huseyininanc/fhir-models

Usage/Examples

Resource Types for R4, R4B, and R5

Effortlessly import resource types from different FHIR versions:

import { R4, R4B, R5 } from "@huseyininanc/fhir-models";

var patientR4: R4.Patient;
var patientR4B: R4B.Patient;
var patientR5: R5.Patient;

BundleForVersion

Use BundleForVersion to work with Bundles customized for specific FHIR versions and resource types:


import { BundleForVersion } from "@huseyininanc/fhir-models";

// Define an R4 Bundle for the Patient resource
type R4BundlePatientType = BundleForVersion<'R4', 'Patient'>;

// Define an R5 Bundle for the Observation resource
type R5BundleObservationType = BundleForVersion<'R5', 'Observation'>;

ResourceForVersion

With ResourceForVersion, you can access the correct resource type for a given FHIR version:

import { ResourceForVersion } from "@huseyininanc/fhir-models";

// Define R4 Patient type
type R4PatientType = ResourceForVersion<'R4', 'Patient'>;

// Define R5 Observation type
type R5ObservationType = ResourceForVersion<'R5', 'Observation'>;

Authors

Developed and maintained by @huseyininnc