How to create FHIR npm package
In this tutorial, you will learn how to create a FHIR NPM package and import it into Aidbox.
A FHIR package groups a coherent collection of conformance resources, like StructureDefinitions, SearchParameters, etc., into an easily distributed NPM package.
1. Prepare the package manifest file
To start, we need to describe the package manifest file for our NPM package. A package manifest is a JSON file called package.json
.
The list of packages that can be specified in dependencies can be found in the Aidbox FHIR IGs Registry.
2. Write Package Content
A package contains a set of FHIR resources in the JSON format. Let's describe a few resources for the package.
2.1 StructureDefinition resource
Let's describe a profile of the US Core Patient in the file my-patient-profile.json
.
We have described a profile that inherits from the US Core Patient and adds a required field for address.
2.2 SearchParameter resource
Let's describe a custom search parameter on the Patient resource in the file my-patient-search.json
.
3. Build NPM package
The resulting npm package has the following structure:
package
├── my-patient-profile.json
├── my-patient-search.json
└── package.json
We need to build the artifacts of the npm package into an archive in the TAR (.tar.gz) format.
tar -czvf package.tar.gz package
Following the guide below, upload the archive to Aidbox.
Last updated 2025-08-08T12:04:21Z