Function: parseFhirCodeSystem()
parseFhirCodeSystem(
source):object
Parse a FhirCodeSystemSource into concepts, a resolved url/version/name, and warnings.
Parameters
source
The FHIR CodeSystem source.
Returns
object
The parsed concepts (by code), the load warnings, and the resource metadata.
concepts
concepts:
Map<string,Concept>
name?
optionalname?:string
url?
optionalurl?:string
version?
optionalversion?: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"