Socket
Socket
Sign inDemoInstall

@medplum/fhirtypes

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@medplum/fhirtypes

Medplum FHIR Type Definitions


Version published
Weekly downloads
7.8K
decreased by-27.07%
Maintainers
3
Weekly downloads
 
Created
Source

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

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 2023

Keywords

FAQs

Package last updated on 05 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc