0.4.0 • Published 5 years ago

@tangdrew/fhir-types v0.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

fhir-types

Runtime Types for FHIR built on top of io-ts. io-ts introduces the concept of a runtime type which represents a runtime validator for a static TypeScript type. These types were generated using fhir-ts-codegen from the canonical FHIR StructureDefinitions.

Disclaimer

This project is still in early stages of development and should not be considered "production-ready".

Motivation

FHIR promises a future of interoperability and much easier exchange of healthcare data. There are a lot of great ideas in FHIR, but it doesn't matter if developers don't implement it. The specification is so large and verbose that it's nearly impossible to be confident that your data is even valid. The goal of this project is to leverage the conformance resources exposed by FHIR, code generation, static types, and runtime validation to build a library improves confidence when playing with FHIR.

Installation

npm install @tangdrew/fhir-types

Usage

import { R4 } from "@tangdrew/fhir-types";

// validation succeeded
R4.Coding.decode(
  JSON.parse(
    '{"system":"http://loinc.org","version":"2.62","code":"55423-8","display":"Number of steps in unspecified time Pedometer"}'
  )
); // => Right({{system:"http://loinc.org",version:"2.62",code:"55423-8",display:"Number of steps in unspecified time Pedometer"})

// validation failed
R4.Coding.decode(JSON.parse('{"system":false}')); // => Left([...])

License

MIT licensed.

0.4.0

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago