@medplum/fhirtypes
TypeScript icon, indicating that this package has built-in type declarations

3.2.30 • Public • Published

Medplum FHIR Type Definitions

This library contains TypeScript type definitions for all R4 types.

Installation

Add as a dependency:

npm install --save-dev @medplum/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 '@medplum/fhirtypes';

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

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:

Medplum fhirtypes screenshot

And now you will receive typeahead support:

Medplum fhirtypes typeahead

So we can build a well-formed example:

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

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

About Medplum

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

License

Apache 2.0. Copyright © Medplum 2024

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.2.300latest

Version History

VersionDownloads (Last 7 Days)Published
3.2.300
3.2.290
3.2.28600
3.2.272,510
3.2.26615
3.2.2562
3.2.2432
3.2.23237
3.2.2230
3.2.212
3.2.203
3.2.191,870
3.2.18470
3.2.17234
3.2.165
3.2.154
3.2.143
3.2.139
3.2.122
3.2.1111
3.2.102
3.2.94
3.2.8209
3.2.72,694
3.2.6533
3.2.53
3.2.4168
3.2.339
3.2.219
3.2.1232
3.2.02
3.1.1185
3.1.102
3.1.92
3.1.82
3.1.72
3.1.695
3.1.535
3.1.416
3.1.3112
3.1.22
3.1.12
3.1.03
3.0.132
3.0.122
3.0.112
3.0.102
3.0.92
3.0.82
3.0.73
3.0.62
3.0.52
3.0.42
3.0.32
3.0.22
3.0.12
3.0.02
2.2.101,016
2.2.74
2.2.635
2.2.5187
2.2.42
2.2.33
2.2.23
2.2.13
2.2.02
2.1.253
2.1.242
2.1.233
2.1.222
2.1.212
2.1.202
2.1.193
2.1.182
2.1.173
2.1.162
2.1.153
2.1.143
2.1.132
2.1.122
2.1.113
2.1.10112
2.1.92
2.1.818
2.1.72
2.1.62
2.1.52
2.1.425
2.1.32
2.1.22
2.1.12
2.1.02
2.0.322
2.0.312
2.0.3013
2.0.294
2.0.283
2.0.272
2.0.262
2.0.252
2.0.242
2.0.233
2.0.223
2.0.2110
2.0.2057
2.0.192
2.0.182
2.0.172
2.0.162
2.0.152
2.0.142
2.0.132
2.0.122
2.0.112
2.0.103
2.0.92
2.0.72
2.0.62
2.0.53
2.0.42
2.0.32
2.0.22
2.0.12
2.0.03
1.0.619
1.0.52
1.0.43
1.0.32
1.0.22
1.0.12
1.0.02
0.10.22
0.10.12
0.10.03
0.9.384
0.9.372
0.9.362
0.9.353
0.9.342
0.9.333
0.9.322
0.9.312
0.9.302
0.9.293
0.9.283
0.9.272
0.9.262
0.9.252
0.9.243
0.9.232
0.9.222
0.9.212
0.9.203
0.9.192
0.9.182
0.9.172
0.9.162
0.9.152
0.9.142
0.9.123
0.9.114
0.9.103
0.9.93
0.9.82
0.9.72
0.9.62
0.9.52
0.9.42
0.9.33
0.9.22
0.9.12
0.9.02
0.5.22
0.5.13
0.5.02
0.4.13
0.4.02
0.3.02

Package Sidebar

Install

npm i @medplum/fhirtypes

Weekly Downloads

3,166

Version

3.2.30

License

Apache-2.0

Unpacked Size

2.64 MB

Total Files

214

Last publish

Collaborators

  • codyebberson
  • reshmakh
  • rahul1