Skip to main content
Version: v0.0.3

Function: extractMedications()

extractMedications(sectionEl, narrativeById, ctx): readonly Medication[]

Extract every Medication Activity from a Medications <section> element. Each <entry> whose substanceAdministration carries the Medication Activity template becomes a Medication. Flags a missing doseQuantity / routeCode and an unclassifiable effectiveTime. Never throws.

Parameters

sectionEl

Element

narrativeById

ReadonlyMap<string, string>

ctx

ParseCtx

Returns

readonly Medication[]

Example

import { extractMedications } from "@cosyte/ccda";
const meds = extractMedications(sectionEl, section.narrativeById, ctx);