# @medplum/fhirtypes

> Medplum FHIR Type Definitions

Latest version **5.2.17** (published 2026-11-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @medplum/fhirtypes
pnpm add @medplum/fhirtypes
yarn add @medplum/fhirtypes
bun add @medplum/fhirtypes
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.2.17 |
| Published | 2026-11-11 |
| First published | 2021-12-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^22.18.0 \|\| >=24.2.0 |
| Dependencies | 0 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2698 |
| Author | Medplum |
| Maintainers | codyebberson, reshmakh, mattlong |
| Keywords | medplum, fhir, healthcare, interoperability, json, serialization, hl7, standards, clinical, dstu2, stu3, r4, normative |

## Links

- npm: https://www.npmjs.com/package/@medplum/fhirtypes
- Repository: https://github.com/medplum/medplum
- Homepage: https://www.medplum.com/
- Issues: https://github.com/medplum/medplum/issues
- npm.io page: https://npm.io/package/@medplum/fhirtypes

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 5.2.17 (latest) — 2026-11-11
- 5.1.45 (backport) — 2026-10-31
- 5.2.16 — 2026-11-10
- 5.2.15 — 2026-11-06
- 5.2.14 — 2026-11-03
- 5.2.13 — 2026-10-30
- 5.2.12 — 2026-10-29
- 5.2.11 — 2026-10-29
- 5.2.10 — 2026-10-28
- 5.2.9 — 2026-10-26
- 5.2.8 — 2026-10-24
- 5.2.7 — 2026-10-20
- 5.2.6 — 2026-10-17
- 5.2.5 — 2026-10-15
- 5.2.4 — 2026-10-14
- … 295 more at https://npm.io/package/@medplum/fhirtypes/versions

## README

# Medplum FHIR Type Definitions

This library contains [TypeScript](https://www.typescriptlang.org/) type definitions for all [R4 types](https://hl7.org/fhir/R4/valueset-resource-types.html).

## Installation

Add as a dependency:

```bash
npm install --save-dev @medplum/fhirtypes
```

## Basic Usage

Consider the following untyped code:

```ts
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:

```ts
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](https://user-images.githubusercontent.com/749094/146444130-ac3a2c5d-3a9a-429d-8db3-5581986c05dc.png)

And now you will receive typeahead support:

![Medplum fhirtypes typeahead](https://user-images.githubusercontent.com/749094/146444465-974f6a3e-f655-4212-893b-fad14b1c4386.png)

So we can build a well-formed example:

```ts
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](../../LICENSE.txt)

---
_Source: https://npm.io/package/@medplum/fhirtypes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
