Skip to main content
Version: v0.0.4

Function: parseFhirCodeSystem()

parseFhirCodeSystem(source): object

Parse a FhirCodeSystemSource into concepts, a resolved url/version/name, and warnings.

Parameters

source

FhirCodeSystemSource

The FHIR CodeSystem source.

Returns

object

The parsed concepts (by code), the load warnings, and the resource metadata.

concepts

concepts: Map<string, Concept>

name?

optional name?: string

url?

optional url?: string

version?

optional version?: string

warnings

warnings: LoadWarning[]

Throws

TERM_CODESYSTEM_MALFORMED when the resource is not a FHIR CodeSystem.

Example

import { parseFhirCodeSystem } from "@cosyte/terminology";

const { concepts } = parseFhirCodeSystem({
resource: { resourceType: "CodeSystem", concept: [{ code: "A", display: "Alpha" }] },
format: "fhir",
});
concepts.get("A")?.display; // => "Alpha"