Skip to main content
Version: v0.0.4

Function: parseRrf()

parseRrf(source): object

Parse an RrfSource into concepts (first row per code wins) and skipped-row warnings.

A code that recurs across rows (RRF repeats a code once per atom/attribute) keeps its first occurrence - a documented v1 limitation: preferred-atom selection (TS/STT/ISPREF) and attribute merging are later work. The result is data only; loadCodeSystem freezes it.

Parameters

source

RrfSource

The RRF source.

Returns

object

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

concepts

concepts: Map<string, Concept>

warnings

warnings: LoadWarning[]

Example

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

const { concepts } = parseRrf({
format: "rrf",
content: "1|Aspirin|",
columns: { code: 0, display: 1 },
});
concepts.get("1")?.display; // => "Aspirin"