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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fhirtypescript

v1.0.2

Published

Implementation of FHIR JSON protocol using TypeScript. Includes valid values and multi-language oriented display labels.

Downloads

8

Readme

Gallaware's FHIR TypeScript library

Overview

The HL7 FHIR data structures are created to move Healthcare around the internet by providing a common data structure as well as a common transport mechanism. This library is a FHIR v4.0 TypeScript class library implementing the JSON schema that is built for those who want to source the data, like from a UI, and send that data to a data store, and, of course, query that data back and present it again in the UI.

Unlike interface based versions found elsewhere, this provides functions for data setting that validates, either by value or by pattern, the data and throws an Error when the data is not correct. When the data requires validation, the class field is protected, otherwise the class fields are public and can be set to any valid value for the type.

The valid values and patterns are stored in separate files and referenced by the classes. You'll find them in the FhirTsLibValidation folder. Care was taken to not repeat the data in order to save memory, but instead reference a variable at the top of the file when values were duplicated. So, the order of the file is important.

This library also includes labels for the valid values which are found under the FhirTsResources folder, and organized by 2 letter language abbreviations, and then named with the class name and the field they reference.

To provide in/out JSON conversion, this library uses "class-transformer" library and its @Type annotations/decorators. Although, class-tranformer provides the actually conversion to/from JSON for a class, additional utilities are provided in order to associated the correct class with the FHIR JSON data recieved. The FHIR JSON data structure are usually marked with the "resourceType", but there are a few that are not, like Coding or AccountGuarantor. With these JSON data, the utility does its best guess to get it right. However, normally, these classes without "resourceType" don't usually get transmitted alone, but are part of a larger object. You'll find the JSON related utilities for conversion in the FhirTsLibJson folder.

Example Code

You can look at the test cases for example, or take a look at How to create a Patient, in the ExampleCreatePatient.md. This shows not only how to create a FHIR patient with data, but also how to send it across the wire or get it back from a server and how that conversion from a real object to/from JSON works.

How it was created

It was built using 2 Java apps: one with a JSON schema parser and one with an XML parser. The FHIR JSON schema provided the bulk of the informtion and the FHIR XML provided the labels per language. Where data annomolies were found extra files were added to help out.

The generated classes include all the class use documentation of the original JSON schema.