npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@paq-ts-fhir/r5-datamodels

v1.2.0

Published

Generated FHIR R5 data model package

Downloads

201

Readme

FHIR R5 Data Model Library

The TypeScript data models in this package were generated for all FHIR R5 resources and complex types. TypeScript classes were generated for each FHIR R5 resource and FHIR R5 complex type as defined by their corresponding FHIR StructureDefinition.

Background

The HAPI FHIR ecosystem (implemented in Java) includes data model classes representing FHIR resources and data types. These data model classes include a number of getters and setters for the basic properties of that data model along with many convenience methods. These HAPI FHIR data models provided the inspiration for the design of the TypeScript data models generated for this project.

A proof-of-concept (POC) project was undertaken to arrive at a design for TypeScript that could easily be applied to generated data models. This POC project resulted in contents for a core library that contains the base data models, implementations of the FHIR primitive data types, and various utilities required by the data models. These are implemented in the @paq-ts-fhir/fhir-core library. This generated data model project takes this library as its sole dependency. Additionally, a set of implementation patterns were identified to facilitate code generation of data models for resources and complex data types.

Getting Started

This @paq-ts-fhir/r5-datamodels package is intended to be installed as a dependency in your TypeScript/JavaScript project for use within a Node.js environment. The minimum supported version of Node.js is v22.11.0 (LTS). To install this package, run the following command in your project directory:

> npm install @paq-ts-fhir/r5-datamodels -P

This package's only dependency is the @paq-ts-fhir/fhir-core library whose only dependencies are the Luxon and Zod libraries.

Data Model Classes

The FHIR data model class hierarchy is based on the FHIR Type Framework. All FHIR resource data models extend either Resource or DomainResource. According to the FHIR specification, only DomainResource, Bundle, Parameters, and Binary extend Resource. All other FHIR resources extend DomainResource. All FHIR complex data types extend either DataType or BackboneType. All FHIR primitive data types extend PrimitiveType<T> where T represents the FHIR primitive as defined in the FHIR Specification and implemented in the @paq-ts-fhir/fhir-core library.

Additional "component" classes are also generated for each BackboneElement defined in a resource. While generated as separate classes, these "component" classes have no meaning on their own and should only be used as a special data type defined within a resource.

Finally, "pseudo-enumeration" classes based on a FHIR CodeSystem were generated for each primitive code element defined in a resource or complex type. These are generated when the code element has a binding.strength of required with a binding.valueSet URL. These classes are used to represent the values of code elements that are defined in the FHIR specification.

Additional Information

Release Notes are available for all published FHIR data model libraries.

For more information on the data models generated by this package, refer to the API Documentation and the User Guide.

For background information on the generation of these data models, refer to content in dev-docs.