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.
- Comprehensive interfaces for R4, R4B, and R5 FHIR resources
- Flexible type generation for FHIR resources
- Version-specific Bundles (
BundleForVersion
) - Version-specific Resource Types (
ResourceForVersion
)
Install the package using NPM:
npm install @huseyininanc/fhir-models
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;
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'>;
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'>;
Developed and maintained by @huseyininnc