Function: lookupLivdForRecord()
lookupLivdForRecord(
record,catalog):LivdAnnotation
Annotate one R or O record against a LIVD catalog. The building block of
applyLivd; useful when a consumer holds a single record. Never mutates
the record and never fabricates a LOINC.
Parameters
record
The result/order record to annotate.
catalog
The consumer-supplied LIVD catalog.
Returns
The record's annotation.
Example
import { parseAstmRecords, results, defineLivdCatalog, lookupLivdForRecord } from "@cosyte/astm";
const msg = parseAstmRecords("H|\\^&\rR|1|^^^687|28.6|U/L||N||F\rL|1\r");
const catalog = defineLivdCatalog([{ vendorCode: "687", loinc: "1920-8" }]);
lookupLivdForRecord(results(msg)[0]!, catalog).mapping.status; // "mapped"