Terminology

A terminology engine that never fabricates a code.

@cosyte/terminology mirrors FHIR's terminology operations ($lookup, $validate-code, $translate and $expand) over the code-system releases and FHIR resources you supply. An unmapped code comes back as unmapped, never as a guess.

@cosyte/terminology
npm install @cosyte/terminology

Need it integrated? Talk to us.

The standard

Clinical codes come from a few systems, each with its own steward.

@cosyte/terminology

The engine, with your releases.

It ships the engine and no code-system release: SNOMED CT, CPT, LOINC, RxNorm and VSAC value sets are licensed by their stewards, so you bring them. What it does bundle is listed, with its copyright, in the README.

  • resolveSystem turns an OID, a mnemonic or a URI into the canonical code-system URI, or a typed unknown.
  • ConceptMap $translate, read only in the map's authored direction, returning every candidate for a one-to-many map.
  • CodeSystem loading from RRF, CSV, fixed-width and FHIR JSON, with $lookup and $validate-code.
  • ValueSet $expand and $validate-code, measured against HL7's own terminology ecosystem test cases.
  • UCUM validation and canonicalization, checked against the official UCUM functional tests.
  • The CMS ICD-9 and ICD-10 GEMs, the NLM SNOMED CT to ICD-10-CM map, and an RxNorm drug graph, each over files you supply.
  • Zero runtime dependencies. A release you load is frozen.
resolve-a-system.tsts
import { resolveSystem, isUnknownSystem } from "@cosyte/terminology";

const r = resolveSystem("2.16.840.1.113883.6.1"); // OID, mnemonic, or URI
console.log(isUnknownSystem(r) ? "unknown" : r.url); // http://loinc.org

From the @cosyte/terminology README on GitHub, verbatim. Every value in it is synthetic.

Limits

What it does not do.

Its README is explicit about what it will not do:

  • No code-system release is bundled. SNOMED CT, CPT, LOINC, RxNorm and VSAC value sets are yours to supply, under their stewards' terms.
  • UCUM support is recognition and canonicalization only: no magnitude conversion.
  • A directional map is never inverted. Reverse translation needs a map of its own.
  • An unrecognized system resolves to a typed unknown, never a guessed URI.
  • It does bundle the UCUM unit table, reproduced verbatim under its license, and code-system identity facts. The README names both.

The full status and limits, in the README

Alternatives

What else you could use.

Each description comes from the project’s own documentation or listing, linked below.

JavaScript library

ucum-lhc

The National Library of Medicine's JavaScript library for validating and converting UCUM unit strings. It converts units, which @cosyte/terminology deliberately does not.

Source: npm, @lhncbc/ucum-lhc

Hosted API

RxNorm API

The National Library of Medicine's web service for the RxNorm data set. It is a network call; @cosyte/terminology runs in your process over an RxNorm release you supply.

Source: NLM, RxNorm API

FHIR terminology server

Ontoserver

A FHIR terminology server developed by the Australian e-Health Research Centre at CSIRO.

Source: CSIRO, Ontoserver

Java FHIR server

HAPI FHIR JPA server

Loads terminology through standard FHIR REST APIs or its command-line upload-terminology command, and serves it from a Java FHIR server.

Source: HAPI FHIR, terminology

Works with

  • FHIR@cosyte/fhir validates binding strength and takes a terminology service you supply.
  • C-CDA@cosyte/ccda consults a terminology adapter at its coded slots.
  • @cosyte/transformTranslates coded HL7 v2 fields through the ConceptMaps the v2-to-FHIR guide publishes.

Try @cosyte/terminology on your own messages.

It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.

Need it integrated? Talk to us, or see what our integration services cover.