3.1.3 • Published 7 days ago

@iehr/fhirtypes v3.1.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 days ago

iEHR FHIR Type Definitions

This library contains TypeScript type definitions for all R4 types.

Installation

Add as a dependency:

npm install --save-dev @iehr/fhirtypes

Basic Usage

Consider the following untyped code:

const myPatient = {
  resourceType: 'Patient',
  name: 'George Washington',
};

Keen observers will note that Patient.name should not be a string. Instead, it should be an array of HumanName objects.

Let's add the type definition and see what happens:

import { Patient } from '@iehr/fhirtypes';

const myPatient: Patient = {
  resourceType: 'Patient',
  name: 'George Wasington',
};

Now "name" is a compile error. Developer tools with TypeScript support should provide feedback. For example, VS Code adds red squigglies and a helpful error message:

iEHR fhirtypes screenshot

And now you will receive typeahead support:

iEHR fhirtypes typeahead

So we can build a well-formed example:

import { Patient } from '@iehr/fhirtypes';

const myPatient: Patient = {
  resourceType: 'Patient',
  name: [
    {
      given: ['George'],
      family: 'Washington',
    },
  ],
};

About iEHR

iEHR is a healthcare platform that helps you quickly develop high-quality compliant applications. iEHR includes a FHIR server, React component library, and developer app.

License

Apache 2.0. Copyright © iEHR 2023

3.1.3

7 days ago

3.1.1

25 days ago

3.0.8

2 months ago

3.0.7

2 months ago

3.0.4

2 months ago