@cosyte/terminology 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +3 -0
- package/dist/index.cjs +430 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -38
- package/dist/index.d.ts +56 -38
- package/dist/index.mjs +430 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -4
package/dist/index.d.cts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* A single coded value: a `code` drawn from a code `system`, optionally versioned and displayed.
|
|
14
14
|
*
|
|
15
15
|
* Models FHIR R4 `Coding`. `system` is the code system's **canonical URI** (e.g.
|
|
16
|
-
* `http://loinc.org`), not a mnemonic or OID: use {@link
|
|
16
|
+
* `http://loinc.org`), not a mnemonic or OID: use {@link resolveSystem} to
|
|
17
17
|
* canonicalize before constructing one. `system` is optional because a raw wire code sometimes
|
|
18
18
|
* arrives without one; the engine surfaces that rather than inventing a system.
|
|
19
19
|
*
|
|
@@ -38,7 +38,7 @@ interface Coding {
|
|
|
38
38
|
/**
|
|
39
39
|
* A concept described by one or more {@link Coding}s plus optional free text: FHIR R4
|
|
40
40
|
* `CodeableConcept`. Included so the value layer is complete for downstream consumers even though
|
|
41
|
-
* {@link
|
|
41
|
+
* {@link translate} operates on a single {@link Coding}.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -385,7 +385,7 @@ declare const FATAL_CODES: {
|
|
|
385
385
|
/**
|
|
386
386
|
* An **inversion** of a directional crosswalk was requested: a forbidden operation. The GEMs and
|
|
387
387
|
* the SNOMED→ICD-10-CM map are authoritative in **one direction only**; a forward map is not the
|
|
388
|
-
* inverse of the backward map. Thrown by {@link
|
|
388
|
+
* inverse of the backward map. Thrown by {@link invertGem} so the
|
|
389
389
|
* never-invert refusal is a first-class, discoverable contract rather than a silent absence.
|
|
390
390
|
*/
|
|
391
391
|
readonly TERM_MAP_NOT_INVERTIBLE: "TERM_MAP_NOT_INVERTIBLE";
|
|
@@ -558,8 +558,11 @@ interface SystemIdentity {
|
|
|
558
558
|
readonly mnemonics: readonly string[];
|
|
559
559
|
}
|
|
560
560
|
/**
|
|
561
|
-
* The seed identity table. Order is irrelevant;
|
|
562
|
-
*
|
|
561
|
+
* The seed identity table. Order is irrelevant; {@link resolveSystem} builds its lookup indexes from
|
|
562
|
+
* it. Each entry is one system whose URI and OID were grounded firsthand against the FHIR R4
|
|
563
|
+
* terminology-systems registry (and its ICD page). Its mnemonics are its HL7 Table 0396 mnemonic
|
|
564
|
+
* and, for some systems, other accepted short aliases (such as `LOINC` or `CPT`) that are not
|
|
565
|
+
* Table 0396 codes.
|
|
563
566
|
*/
|
|
564
567
|
declare const SYSTEM_IDENTITIES: readonly SystemIdentity[];
|
|
565
568
|
/**
|
|
@@ -602,10 +605,12 @@ type ResolveSystemResult = SystemIdentity | UnknownSystem;
|
|
|
602
605
|
/**
|
|
603
606
|
* Resolve a code-system identifier to its canonical {@link SystemIdentity}.
|
|
604
607
|
*
|
|
605
|
-
* Accepts, in order of attempt: a canonical URI (case-insensitive), a
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
608
|
+
* Accepts, in order of attempt: a canonical URI (case-insensitive), a mnemonic listed in
|
|
609
|
+
* {@link SYSTEM_IDENTITIES} (an HL7 v2 Table 0396 mnemonic or another accepted alias,
|
|
610
|
+
* case-insensitive), a bare or `urn:oid:`-prefixed OID, and an HL7 v2 table's OID or
|
|
611
|
+
* `terminology.hl7.org` URI (resolved structurally from the table number). The `v2-XXXX` mnemonic a
|
|
612
|
+
* v2 table identity carries is not accepted as input on its own. Whitespace is trimmed. An empty or
|
|
613
|
+
* unrecognized identifier yields a typed {@link UnknownSystem}: the resolver **never** invents a URI.
|
|
609
614
|
*
|
|
610
615
|
* @param id - The identifier (canonical URI, OID, `urn:oid:` OID, or mnemonic).
|
|
611
616
|
* @returns The resolved {@link SystemIdentity}, or `{ unknown: true, input }`.
|
|
@@ -1274,9 +1279,9 @@ type CodeSystemSource = RrfSource | CsvSource | FixedWidthSource | FhirCodeSyste
|
|
|
1274
1279
|
* - `"fhir"`: a native FHIR R4 `CodeSystem` JSON resource.
|
|
1275
1280
|
*
|
|
1276
1281
|
* **Liberal on load:** a malformed *row* is skipped and surfaced in `warnings` (never a crash, never a
|
|
1277
|
-
* partial concept). **Conservative on structure:** an unusable *source* (wrong FHIR `resourceType`,
|
|
1278
|
-
*
|
|
1279
|
-
* carrying `TERM_CODESYSTEM_MALFORMED`.
|
|
1282
|
+
* partial concept). **Conservative on structure:** an unusable *source* (wrong FHIR `resourceType`, a
|
|
1283
|
+
* CSV whose configured columns are absent from the header, or an RRF or fixed-width property entry
|
|
1284
|
+
* that is not an object) throws a typed `TerminologyError` carrying `TERM_CODESYSTEM_MALFORMED`.
|
|
1280
1285
|
*
|
|
1281
1286
|
* @param source - The release descriptor (a discriminated {@link CodeSystemSource}).
|
|
1282
1287
|
* @returns The immutable, deep-frozen {@link CodeSystem}.
|
|
@@ -1372,6 +1377,10 @@ declare function validateCode(cs: CodeSystem, code: string): ValidateCodeResult;
|
|
|
1372
1377
|
* concept, never a crash. RRF reserves `|` as the delimiter (fields never contain a literal pipe), so
|
|
1373
1378
|
* a plain split is exact.
|
|
1374
1379
|
*
|
|
1380
|
+
* **Conservative on structure:** a `columns.properties` entry that is not an object (a hole in a
|
|
1381
|
+
* sparse list, an explicit `undefined`, a `null`) names no column, so it is a typed
|
|
1382
|
+
* `TERM_CODESYSTEM_MALFORMED` fatal, raised before any row is read.
|
|
1383
|
+
*
|
|
1375
1384
|
* @packageDocumentation
|
|
1376
1385
|
*/
|
|
1377
1386
|
|
|
@@ -1397,6 +1406,8 @@ declare function parseRrfLine(line: string): readonly string[];
|
|
|
1397
1406
|
*
|
|
1398
1407
|
* @param source - The RRF source.
|
|
1399
1408
|
* @returns The parsed concepts (by code) and the load warnings.
|
|
1409
|
+
* @throws {TerminologyError} `TERM_CODESYSTEM_MALFORMED` when a `columns.properties` entry is not an
|
|
1410
|
+
* object (a hole, `undefined`, or `null`). The message is fixed and names no configured value.
|
|
1400
1411
|
* @example
|
|
1401
1412
|
* ```ts
|
|
1402
1413
|
* import { parseRrf } from "@cosyte/terminology";
|
|
@@ -1432,8 +1443,8 @@ declare function parseRrf(source: RrfSource): {
|
|
|
1432
1443
|
*/
|
|
1433
1444
|
|
|
1434
1445
|
/**
|
|
1435
|
-
* Parse RFC-4180 CSV content into rows of fields
|
|
1436
|
-
*
|
|
1446
|
+
* Parse RFC-4180 CSV content into rows of fields. Lenient: a stray mid-field quote is literal, so a
|
|
1447
|
+
* malformed quote never silently swallows subsequent rows.
|
|
1437
1448
|
*
|
|
1438
1449
|
* @param content - The raw CSV text.
|
|
1439
1450
|
* @returns The rows, each an array of field strings (untrimmed).
|
|
@@ -1483,6 +1494,10 @@ declare function parseCsvSource(source: CsvSource): {
|
|
|
1483
1494
|
* **Liberal on load:** a line too short to contain the code slice, or with an empty code, is skipped
|
|
1484
1495
|
* and surfaced as a `TERM_FIXED_WIDTH_MALFORMED` warning.
|
|
1485
1496
|
*
|
|
1497
|
+
* **Conservative on structure:** a `fields.properties` entry that is not an object (a hole in a
|
|
1498
|
+
* sparse list, an explicit `undefined`, a `null`) names no slice, so it is a typed
|
|
1499
|
+
* `TERM_CODESYSTEM_MALFORMED` fatal, raised before any line is read.
|
|
1500
|
+
*
|
|
1486
1501
|
* @packageDocumentation
|
|
1487
1502
|
*/
|
|
1488
1503
|
|
|
@@ -1519,6 +1534,8 @@ declare const ICD10CM_ORDER_FILE_FIELDS: FixedWidthFieldMap;
|
|
|
1519
1534
|
*
|
|
1520
1535
|
* @param source - The fixed-width source.
|
|
1521
1536
|
* @returns The parsed concepts (by code) and the load warnings.
|
|
1537
|
+
* @throws {TerminologyError} `TERM_CODESYSTEM_MALFORMED` when a `fields.properties` entry is not an
|
|
1538
|
+
* object (a hole, `undefined`, or `null`). The message is fixed and names no configured value.
|
|
1522
1539
|
* @example
|
|
1523
1540
|
* ```ts
|
|
1524
1541
|
* import { parseFixedWidth } from "@cosyte/terminology";
|
|
@@ -2506,7 +2523,7 @@ declare function loadUcumEssence(): UcumEssence;
|
|
|
2506
2523
|
* - a context-dependent rule with no runtime context is a typed {@link ComplexMapContextRequired}:
|
|
2507
2524
|
* the rule + advice ride through, the engine never picks a branch it wasn't given the data for;
|
|
2508
2525
|
* - all Map Advice / GEM flags ride through **verbatim** (advice flags must not be swallowed);
|
|
2509
|
-
* - a directional map is **never inverted** (see {@link
|
|
2526
|
+
* - a directional map is **never inverted** (see {@link invertGem}).
|
|
2510
2527
|
*
|
|
2511
2528
|
* @packageDocumentation
|
|
2512
2529
|
*/
|
|
@@ -2718,8 +2735,8 @@ interface PatientContext {
|
|
|
2718
2735
|
readonly gender?: "male" | "female";
|
|
2719
2736
|
}
|
|
2720
2737
|
/**
|
|
2721
|
-
* One map group's resolution: a discriminated outcome. A group resolves to a target, a No-Map,
|
|
2722
|
-
*
|
|
2738
|
+
* One map group's resolution: a discriminated outcome. A group resolves to a target, a No-Map, or a
|
|
2739
|
+
* context-required stall carrying the group's candidate rules; it is **never** a silently-picked
|
|
2723
2740
|
* single target when the steward flagged otherwise.
|
|
2724
2741
|
*/
|
|
2725
2742
|
type ComplexMapGroupResult = ComplexMapGroupResolved | ComplexMapGroupNoMap | ComplexMapContextRequired;
|
|
@@ -2755,8 +2772,9 @@ interface ComplexMapGroupNoMap {
|
|
|
2755
2772
|
readonly advice: string;
|
|
2756
2773
|
}
|
|
2757
2774
|
/**
|
|
2758
|
-
* A group whose winning path is a **context-dependent** `IFA` rule
|
|
2759
|
-
*
|
|
2775
|
+
* A group whose winning path is a **context-dependent** `IFA` rule for which the caller supplied
|
|
2776
|
+
* **no** matching context (or an `IFA` rule the resolver cannot interpret, or a group in which no rule
|
|
2777
|
+
* held). The engine surfaces the rules +
|
|
2760
2778
|
* advice and refuses to pick a branch: the never-fabricate rule for runtime context.
|
|
2761
2779
|
*/
|
|
2762
2780
|
interface ComplexMapContextRequired {
|
|
@@ -2809,10 +2827,10 @@ interface CrosswalkUnmapped {
|
|
|
2809
2827
|
/** The source code, echoed. */
|
|
2810
2828
|
readonly source: string;
|
|
2811
2829
|
}
|
|
2812
|
-
/** The result of {@link
|
|
2830
|
+
/** The result of {@link applyGem}: a match, an authored No-Map, or an absence. */
|
|
2813
2831
|
type GemApplyResult = GemMatched | CrosswalkNoMap | CrosswalkUnmapped;
|
|
2814
2832
|
/**
|
|
2815
|
-
* The result of {@link
|
|
2833
|
+
* The result of {@link applyComplexMap}: a per-group match, or a typed
|
|
2816
2834
|
* absence when the source concept is not in the map.
|
|
2817
2835
|
*/
|
|
2818
2836
|
type ComplexMapApplyResult = ComplexMapMatched | CrosswalkUnmapped;
|
|
@@ -3058,7 +3076,7 @@ declare const MAP_CATEGORIES: {
|
|
|
3058
3076
|
readonly NO_MAP: "447638001";
|
|
3059
3077
|
/** `447639009`: "Map of source concept is context dependent" (needs runtime patient context). */
|
|
3060
3078
|
readonly CONTEXT_DEPENDENT: "447639009";
|
|
3061
|
-
/** `447640006`: "Source concept is ambiguous" (
|
|
3079
|
+
/** `447640006`: "Source concept is ambiguous" (carried through on the result; the rule decides). */
|
|
3062
3080
|
readonly AMBIGUOUS: "447640006";
|
|
3063
3081
|
};
|
|
3064
3082
|
/** A value from {@link MAP_CATEGORIES}: the SNOMED map-category id carried on a resolution. */
|
|
@@ -3070,8 +3088,8 @@ type MapCategoryId = (typeof MAP_CATEGORIES)[keyof typeof MAP_CATEGORIES];
|
|
|
3070
3088
|
declare const NO_MAP_CATEGORIES: ReadonlySet<string>;
|
|
3071
3089
|
/**
|
|
3072
3090
|
* The canonical code-system URI for **ICD-10-CM**: the target system of both crosswalks. A published
|
|
3073
|
-
* identity fact (mirrors {@link
|
|
3074
|
-
* target {@link
|
|
3091
|
+
* identity fact (mirrors {@link SYSTEM_IDENTITIES}); attached to a resolved
|
|
3092
|
+
* target {@link Coding} so a translation is self-describing.
|
|
3075
3093
|
*/
|
|
3076
3094
|
declare const ICD10CM_SYSTEM = "http://hl7.org/fhir/sid/icd-10-cm";
|
|
3077
3095
|
/**
|
|
@@ -3096,7 +3114,7 @@ declare const SNOMEDCT_SYSTEM = "http://snomed.info/sct";
|
|
|
3096
3114
|
* `consists_of`, …). The graph these form is the whole point: resolve a drug to its
|
|
3097
3115
|
* components and through them to its ingredient, a branded drug to its generic, a drug to its dose
|
|
3098
3116
|
* form. Note that the ingredient edge is authored on the component rather than on the `SCD` itself
|
|
3099
|
-
* (see {@link
|
|
3117
|
+
* (see {@link ingredientsOf}).
|
|
3100
3118
|
*
|
|
3101
3119
|
* **The direction convention is a documented medication-safety trap**, and it
|
|
3102
3120
|
* is grounded here firsthand on the NLM RxNorm Technical Documentation (§12.7) and the UMLS Reference
|
|
@@ -3125,7 +3143,7 @@ declare const SNOMEDCT_SYSTEM = "http://snomed.info/sct";
|
|
|
3125
3143
|
* `PSN` / `SY` / `TMSY` are Appendix 5's **synonym** term types: each labels an alternate *name* on
|
|
3126
3144
|
* some other concept rather than a concept of its own, so they are part of this vocabulary but can
|
|
3127
3145
|
* never appear as a loaded {@link RxNormConcept.tty}. See
|
|
3128
|
-
* {@link
|
|
3146
|
+
* {@link isSynonymTermType}.
|
|
3129
3147
|
*/
|
|
3130
3148
|
type TermType = "IN" | "PIN" | "MIN" | "BN" | "SCDC" | "SBDC" | "SCDF" | "SBDF" | "SCDFP" | "SBDFP" | "SCD" | "SBD" | "SCDG" | "SBDG" | "SCDGP" | "GPCK" | "BPCK" | "DF" | "DFG" | "PSN" | "SY" | "TMSY" | "ET";
|
|
3131
3149
|
/**
|
|
@@ -3180,9 +3198,9 @@ interface NdcResolution {
|
|
|
3180
3198
|
/**
|
|
3181
3199
|
* The temporal status of an NDC↔RXCUI mapping (RxNav `getNDCStatus`: `ACTIVE` / `OBSOLETE` / `ALIEN`
|
|
3182
3200
|
* / `UNKNOWN`). An NDC found in the loaded release's `RXNSAT` attributes is `active` **as of that
|
|
3183
|
-
* release**; `obsolete` / `alien` come from the RxNav NDC-history data (a differential
|
|
3184
|
-
*
|
|
3185
|
-
* **never fabricates** a non-current status.
|
|
3201
|
+
* release**; `obsolete` / `alien` come from the RxNav NDC-history data (a differential source, not
|
|
3202
|
+
* the base RRF concept files), which {@link loadRxNormGraph} does not read, so every resolution it
|
|
3203
|
+
* returns today is `active`. The engine **never fabricates** a non-current status.
|
|
3186
3204
|
*/
|
|
3187
3205
|
type NdcStatus = "active" | "obsolete" | "alien" | "unknown";
|
|
3188
3206
|
/** An NDC that could not be resolved to any `RXCUI` in the loaded release: a typed absence. */
|
|
@@ -3194,7 +3212,7 @@ interface NdcUnmapped {
|
|
|
3194
3212
|
/** The NDC (as supplied), echoed. */
|
|
3195
3213
|
readonly ndc: string;
|
|
3196
3214
|
}
|
|
3197
|
-
/** The result of {@link
|
|
3215
|
+
/** The result of {@link resolveNdc}: a resolution or a typed absence. */
|
|
3198
3216
|
type NdcResult = NdcResolution | NdcUnmapped;
|
|
3199
3217
|
/**
|
|
3200
3218
|
* A successful graph-navigation result: the concept, the predicate followed, and the **full** set of
|
|
@@ -3250,7 +3268,7 @@ interface RxNormLoadWarning {
|
|
|
3250
3268
|
/**
|
|
3251
3269
|
* The stable diagnostic code for the skip. `TERM_RXNORM_MALFORMED_ROW` is a structurally unusable
|
|
3252
3270
|
* row; `TERM_RXNORM_UNTYPED_CONCEPT` is an `RXCUI` no defining atom could type. Both are in the
|
|
3253
|
-
* package-wide {@link
|
|
3271
|
+
* package-wide {@link DIAGNOSTIC_CODES} registry, which documents each.
|
|
3254
3272
|
*/
|
|
3255
3273
|
readonly code: "TERM_RXNORM_MALFORMED_ROW" | "TERM_RXNORM_UNTYPED_CONCEPT";
|
|
3256
3274
|
/** Which source file the fault was in. */
|
|
@@ -3276,7 +3294,7 @@ interface RxNormLoadWarning {
|
|
|
3276
3294
|
interface RxNormGraph {
|
|
3277
3295
|
/** The release version (e.g. `"RXNORM_2026AA"`), when supplied: mappings are release-scoped. */
|
|
3278
3296
|
readonly version?: string;
|
|
3279
|
-
/** Concepts keyed by `RXCUI
|
|
3297
|
+
/** Concepts keyed by `RXCUI`, each typed by its first **defining** `SAB=RXNORM` atom. Each frozen. */
|
|
3280
3298
|
readonly concepts: ReadonlyMap<string, RxNormConcept>;
|
|
3281
3299
|
/** Directed edges indexed by `subject` `RXCUI`, each list in file order. Each list frozen. */
|
|
3282
3300
|
readonly edges: ReadonlyMap<string, readonly RxNormEdge[]>;
|
|
@@ -3629,7 +3647,7 @@ declare function approximateMatch(graph: RxNormGraph, query: string, options?: A
|
|
|
3629
3647
|
* or atom (with … RXCUI1 …)."* The doc's worked example (a row with `RXCUI1=1155862`, `RELA=isa`,
|
|
3630
3648
|
* `RXCUI2=197589`) reads *"197589 **isa** 1155862"* (the second concept is-a the first).
|
|
3631
3649
|
*
|
|
3632
|
-
* So an `RXNREL.RRF` row is read **`RXCUI2 ⟶RELA⟶ RXCUI1`**, and {@link
|
|
3650
|
+
* So an `RXNREL.RRF` row is read **`RXCUI2 ⟶RELA⟶ RXCUI1`**, and {@link loadRxNormGraph}
|
|
3633
3651
|
* normalizes every row to `subject = RXCUI2`, `predicate = RELA`, `object = RXCUI1`. Concretely, a
|
|
3634
3652
|
* `has_ingredient` row places the **having** concept in `RXCUI2` and what it *has* in `RXCUI1`; a
|
|
3635
3653
|
* `tradename_of` row places the **branded** concept in `RXCUI2` and the **generic** in `RXCUI1` (the
|
|
@@ -3645,7 +3663,7 @@ declare function approximateMatch(graph: RxNormGraph, query: string, options?: A
|
|
|
3645
3663
|
* basis-of-strength substances by `has_boss` (one-to-many, and its targets can be a `PIN` or a plain
|
|
3646
3664
|
* `IN`), and the other two author no ingredient-bearing edge at all. Treat those pairings as the
|
|
3647
3665
|
* ones RxNorm authors, not as a closed set, and read the `TTY` of what a traversal returns. See
|
|
3648
|
-
* {@link
|
|
3666
|
+
* {@link ingredientsOf}.
|
|
3649
3667
|
*
|
|
3650
3668
|
* @packageDocumentation
|
|
3651
3669
|
*/
|
|
@@ -3714,7 +3732,7 @@ type RelaName = (typeof RELA)[keyof typeof RELA];
|
|
|
3714
3732
|
* The authored **inverse pairs** of the drug-graph `RELA`s: a published fact (RxNorm Appendix 1),
|
|
3715
3733
|
* used only to *document* and *validate* that a caller is traversing a real relationship. The graph
|
|
3716
3734
|
* **never** uses this to synthesize a missing edge: RxNorm ships both directions, so
|
|
3717
|
-
*
|
|
3735
|
+
* the navigation functions follow whichever authored predicate points the way they want to go.
|
|
3718
3736
|
*
|
|
3719
3737
|
* @example
|
|
3720
3738
|
* ```ts
|
|
@@ -3744,7 +3762,7 @@ declare const RXNORM_SYSTEM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
|
3744
3762
|
* type. `ET` is in neither table; the appendix describes it only in prose, as "a small number of
|
|
3745
3763
|
* concepts with TTY=ET, a term type reserved for entry terms for dose forms". Those are concepts in
|
|
3746
3764
|
* their own right rather than synonyms carried on another, so `ET` counts as defining here. See
|
|
3747
|
-
* {@link isSynonymTermType} and {@link
|
|
3765
|
+
* {@link isSynonymTermType} and {@link loadRxNormGraph}.
|
|
3748
3766
|
*
|
|
3749
3767
|
* @packageDocumentation
|
|
3750
3768
|
*/
|
|
@@ -3753,7 +3771,7 @@ declare const RXNORM_SYSTEM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
|
3753
3771
|
* The drug-graph term types (`RXNCONSO.TTY`), each mapped to its **verbatim Appendix 5 name** (`ET`
|
|
3754
3772
|
* excepted: the appendix publishes no Name for it, so the UMLS expansion "Entry Term" is used).
|
|
3755
3773
|
* Encoded as an identity fact; a concept's `TTY` is carried verbatim on its
|
|
3756
|
-
* {@link
|
|
3774
|
+
* {@link RxNormConcept}, never re-labeled.
|
|
3757
3775
|
*
|
|
3758
3776
|
* The keys are the full Appendix 5 vocabulary, defining and synonym alike. Only the **defining** ones
|
|
3759
3777
|
* can appear on a loaded concept (see {@link isSynonymTermType}).
|
|
@@ -3788,7 +3806,7 @@ declare function asTermType(tty: string): TermType | undefined;
|
|
|
3788
3806
|
*
|
|
3789
3807
|
* Appendix 5 defines each as a *"synonym of another TTY"*: it labels an alternate **name** for a
|
|
3790
3808
|
* concept, never the concept's own kind. So a synonym atom can never establish an `RXCUI`'s term
|
|
3791
|
-
* type, and {@link
|
|
3809
|
+
* type, and {@link loadRxNormGraph} will not let one: an `RXCUI` whose release
|
|
3792
3810
|
* supplies only synonym atoms is skipped and surfaced, never typed `"TMSY"`.
|
|
3793
3811
|
*
|
|
3794
3812
|
* @param tty - A {@link TermType}.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* A single coded value: a `code` drawn from a code `system`, optionally versioned and displayed.
|
|
14
14
|
*
|
|
15
15
|
* Models FHIR R4 `Coding`. `system` is the code system's **canonical URI** (e.g.
|
|
16
|
-
* `http://loinc.org`), not a mnemonic or OID: use {@link
|
|
16
|
+
* `http://loinc.org`), not a mnemonic or OID: use {@link resolveSystem} to
|
|
17
17
|
* canonicalize before constructing one. `system` is optional because a raw wire code sometimes
|
|
18
18
|
* arrives without one; the engine surfaces that rather than inventing a system.
|
|
19
19
|
*
|
|
@@ -38,7 +38,7 @@ interface Coding {
|
|
|
38
38
|
/**
|
|
39
39
|
* A concept described by one or more {@link Coding}s plus optional free text: FHIR R4
|
|
40
40
|
* `CodeableConcept`. Included so the value layer is complete for downstream consumers even though
|
|
41
|
-
* {@link
|
|
41
|
+
* {@link translate} operates on a single {@link Coding}.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -385,7 +385,7 @@ declare const FATAL_CODES: {
|
|
|
385
385
|
/**
|
|
386
386
|
* An **inversion** of a directional crosswalk was requested: a forbidden operation. The GEMs and
|
|
387
387
|
* the SNOMED→ICD-10-CM map are authoritative in **one direction only**; a forward map is not the
|
|
388
|
-
* inverse of the backward map. Thrown by {@link
|
|
388
|
+
* inverse of the backward map. Thrown by {@link invertGem} so the
|
|
389
389
|
* never-invert refusal is a first-class, discoverable contract rather than a silent absence.
|
|
390
390
|
*/
|
|
391
391
|
readonly TERM_MAP_NOT_INVERTIBLE: "TERM_MAP_NOT_INVERTIBLE";
|
|
@@ -558,8 +558,11 @@ interface SystemIdentity {
|
|
|
558
558
|
readonly mnemonics: readonly string[];
|
|
559
559
|
}
|
|
560
560
|
/**
|
|
561
|
-
* The seed identity table. Order is irrelevant;
|
|
562
|
-
*
|
|
561
|
+
* The seed identity table. Order is irrelevant; {@link resolveSystem} builds its lookup indexes from
|
|
562
|
+
* it. Each entry is one system whose URI and OID were grounded firsthand against the FHIR R4
|
|
563
|
+
* terminology-systems registry (and its ICD page). Its mnemonics are its HL7 Table 0396 mnemonic
|
|
564
|
+
* and, for some systems, other accepted short aliases (such as `LOINC` or `CPT`) that are not
|
|
565
|
+
* Table 0396 codes.
|
|
563
566
|
*/
|
|
564
567
|
declare const SYSTEM_IDENTITIES: readonly SystemIdentity[];
|
|
565
568
|
/**
|
|
@@ -602,10 +605,12 @@ type ResolveSystemResult = SystemIdentity | UnknownSystem;
|
|
|
602
605
|
/**
|
|
603
606
|
* Resolve a code-system identifier to its canonical {@link SystemIdentity}.
|
|
604
607
|
*
|
|
605
|
-
* Accepts, in order of attempt: a canonical URI (case-insensitive), a
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
608
|
+
* Accepts, in order of attempt: a canonical URI (case-insensitive), a mnemonic listed in
|
|
609
|
+
* {@link SYSTEM_IDENTITIES} (an HL7 v2 Table 0396 mnemonic or another accepted alias,
|
|
610
|
+
* case-insensitive), a bare or `urn:oid:`-prefixed OID, and an HL7 v2 table's OID or
|
|
611
|
+
* `terminology.hl7.org` URI (resolved structurally from the table number). The `v2-XXXX` mnemonic a
|
|
612
|
+
* v2 table identity carries is not accepted as input on its own. Whitespace is trimmed. An empty or
|
|
613
|
+
* unrecognized identifier yields a typed {@link UnknownSystem}: the resolver **never** invents a URI.
|
|
609
614
|
*
|
|
610
615
|
* @param id - The identifier (canonical URI, OID, `urn:oid:` OID, or mnemonic).
|
|
611
616
|
* @returns The resolved {@link SystemIdentity}, or `{ unknown: true, input }`.
|
|
@@ -1274,9 +1279,9 @@ type CodeSystemSource = RrfSource | CsvSource | FixedWidthSource | FhirCodeSyste
|
|
|
1274
1279
|
* - `"fhir"`: a native FHIR R4 `CodeSystem` JSON resource.
|
|
1275
1280
|
*
|
|
1276
1281
|
* **Liberal on load:** a malformed *row* is skipped and surfaced in `warnings` (never a crash, never a
|
|
1277
|
-
* partial concept). **Conservative on structure:** an unusable *source* (wrong FHIR `resourceType`,
|
|
1278
|
-
*
|
|
1279
|
-
* carrying `TERM_CODESYSTEM_MALFORMED`.
|
|
1282
|
+
* partial concept). **Conservative on structure:** an unusable *source* (wrong FHIR `resourceType`, a
|
|
1283
|
+
* CSV whose configured columns are absent from the header, or an RRF or fixed-width property entry
|
|
1284
|
+
* that is not an object) throws a typed `TerminologyError` carrying `TERM_CODESYSTEM_MALFORMED`.
|
|
1280
1285
|
*
|
|
1281
1286
|
* @param source - The release descriptor (a discriminated {@link CodeSystemSource}).
|
|
1282
1287
|
* @returns The immutable, deep-frozen {@link CodeSystem}.
|
|
@@ -1372,6 +1377,10 @@ declare function validateCode(cs: CodeSystem, code: string): ValidateCodeResult;
|
|
|
1372
1377
|
* concept, never a crash. RRF reserves `|` as the delimiter (fields never contain a literal pipe), so
|
|
1373
1378
|
* a plain split is exact.
|
|
1374
1379
|
*
|
|
1380
|
+
* **Conservative on structure:** a `columns.properties` entry that is not an object (a hole in a
|
|
1381
|
+
* sparse list, an explicit `undefined`, a `null`) names no column, so it is a typed
|
|
1382
|
+
* `TERM_CODESYSTEM_MALFORMED` fatal, raised before any row is read.
|
|
1383
|
+
*
|
|
1375
1384
|
* @packageDocumentation
|
|
1376
1385
|
*/
|
|
1377
1386
|
|
|
@@ -1397,6 +1406,8 @@ declare function parseRrfLine(line: string): readonly string[];
|
|
|
1397
1406
|
*
|
|
1398
1407
|
* @param source - The RRF source.
|
|
1399
1408
|
* @returns The parsed concepts (by code) and the load warnings.
|
|
1409
|
+
* @throws {TerminologyError} `TERM_CODESYSTEM_MALFORMED` when a `columns.properties` entry is not an
|
|
1410
|
+
* object (a hole, `undefined`, or `null`). The message is fixed and names no configured value.
|
|
1400
1411
|
* @example
|
|
1401
1412
|
* ```ts
|
|
1402
1413
|
* import { parseRrf } from "@cosyte/terminology";
|
|
@@ -1432,8 +1443,8 @@ declare function parseRrf(source: RrfSource): {
|
|
|
1432
1443
|
*/
|
|
1433
1444
|
|
|
1434
1445
|
/**
|
|
1435
|
-
* Parse RFC-4180 CSV content into rows of fields
|
|
1436
|
-
*
|
|
1446
|
+
* Parse RFC-4180 CSV content into rows of fields. Lenient: a stray mid-field quote is literal, so a
|
|
1447
|
+
* malformed quote never silently swallows subsequent rows.
|
|
1437
1448
|
*
|
|
1438
1449
|
* @param content - The raw CSV text.
|
|
1439
1450
|
* @returns The rows, each an array of field strings (untrimmed).
|
|
@@ -1483,6 +1494,10 @@ declare function parseCsvSource(source: CsvSource): {
|
|
|
1483
1494
|
* **Liberal on load:** a line too short to contain the code slice, or with an empty code, is skipped
|
|
1484
1495
|
* and surfaced as a `TERM_FIXED_WIDTH_MALFORMED` warning.
|
|
1485
1496
|
*
|
|
1497
|
+
* **Conservative on structure:** a `fields.properties` entry that is not an object (a hole in a
|
|
1498
|
+
* sparse list, an explicit `undefined`, a `null`) names no slice, so it is a typed
|
|
1499
|
+
* `TERM_CODESYSTEM_MALFORMED` fatal, raised before any line is read.
|
|
1500
|
+
*
|
|
1486
1501
|
* @packageDocumentation
|
|
1487
1502
|
*/
|
|
1488
1503
|
|
|
@@ -1519,6 +1534,8 @@ declare const ICD10CM_ORDER_FILE_FIELDS: FixedWidthFieldMap;
|
|
|
1519
1534
|
*
|
|
1520
1535
|
* @param source - The fixed-width source.
|
|
1521
1536
|
* @returns The parsed concepts (by code) and the load warnings.
|
|
1537
|
+
* @throws {TerminologyError} `TERM_CODESYSTEM_MALFORMED` when a `fields.properties` entry is not an
|
|
1538
|
+
* object (a hole, `undefined`, or `null`). The message is fixed and names no configured value.
|
|
1522
1539
|
* @example
|
|
1523
1540
|
* ```ts
|
|
1524
1541
|
* import { parseFixedWidth } from "@cosyte/terminology";
|
|
@@ -2506,7 +2523,7 @@ declare function loadUcumEssence(): UcumEssence;
|
|
|
2506
2523
|
* - a context-dependent rule with no runtime context is a typed {@link ComplexMapContextRequired}:
|
|
2507
2524
|
* the rule + advice ride through, the engine never picks a branch it wasn't given the data for;
|
|
2508
2525
|
* - all Map Advice / GEM flags ride through **verbatim** (advice flags must not be swallowed);
|
|
2509
|
-
* - a directional map is **never inverted** (see {@link
|
|
2526
|
+
* - a directional map is **never inverted** (see {@link invertGem}).
|
|
2510
2527
|
*
|
|
2511
2528
|
* @packageDocumentation
|
|
2512
2529
|
*/
|
|
@@ -2718,8 +2735,8 @@ interface PatientContext {
|
|
|
2718
2735
|
readonly gender?: "male" | "female";
|
|
2719
2736
|
}
|
|
2720
2737
|
/**
|
|
2721
|
-
* One map group's resolution: a discriminated outcome. A group resolves to a target, a No-Map,
|
|
2722
|
-
*
|
|
2738
|
+
* One map group's resolution: a discriminated outcome. A group resolves to a target, a No-Map, or a
|
|
2739
|
+
* context-required stall carrying the group's candidate rules; it is **never** a silently-picked
|
|
2723
2740
|
* single target when the steward flagged otherwise.
|
|
2724
2741
|
*/
|
|
2725
2742
|
type ComplexMapGroupResult = ComplexMapGroupResolved | ComplexMapGroupNoMap | ComplexMapContextRequired;
|
|
@@ -2755,8 +2772,9 @@ interface ComplexMapGroupNoMap {
|
|
|
2755
2772
|
readonly advice: string;
|
|
2756
2773
|
}
|
|
2757
2774
|
/**
|
|
2758
|
-
* A group whose winning path is a **context-dependent** `IFA` rule
|
|
2759
|
-
*
|
|
2775
|
+
* A group whose winning path is a **context-dependent** `IFA` rule for which the caller supplied
|
|
2776
|
+
* **no** matching context (or an `IFA` rule the resolver cannot interpret, or a group in which no rule
|
|
2777
|
+
* held). The engine surfaces the rules +
|
|
2760
2778
|
* advice and refuses to pick a branch: the never-fabricate rule for runtime context.
|
|
2761
2779
|
*/
|
|
2762
2780
|
interface ComplexMapContextRequired {
|
|
@@ -2809,10 +2827,10 @@ interface CrosswalkUnmapped {
|
|
|
2809
2827
|
/** The source code, echoed. */
|
|
2810
2828
|
readonly source: string;
|
|
2811
2829
|
}
|
|
2812
|
-
/** The result of {@link
|
|
2830
|
+
/** The result of {@link applyGem}: a match, an authored No-Map, or an absence. */
|
|
2813
2831
|
type GemApplyResult = GemMatched | CrosswalkNoMap | CrosswalkUnmapped;
|
|
2814
2832
|
/**
|
|
2815
|
-
* The result of {@link
|
|
2833
|
+
* The result of {@link applyComplexMap}: a per-group match, or a typed
|
|
2816
2834
|
* absence when the source concept is not in the map.
|
|
2817
2835
|
*/
|
|
2818
2836
|
type ComplexMapApplyResult = ComplexMapMatched | CrosswalkUnmapped;
|
|
@@ -3058,7 +3076,7 @@ declare const MAP_CATEGORIES: {
|
|
|
3058
3076
|
readonly NO_MAP: "447638001";
|
|
3059
3077
|
/** `447639009`: "Map of source concept is context dependent" (needs runtime patient context). */
|
|
3060
3078
|
readonly CONTEXT_DEPENDENT: "447639009";
|
|
3061
|
-
/** `447640006`: "Source concept is ambiguous" (
|
|
3079
|
+
/** `447640006`: "Source concept is ambiguous" (carried through on the result; the rule decides). */
|
|
3062
3080
|
readonly AMBIGUOUS: "447640006";
|
|
3063
3081
|
};
|
|
3064
3082
|
/** A value from {@link MAP_CATEGORIES}: the SNOMED map-category id carried on a resolution. */
|
|
@@ -3070,8 +3088,8 @@ type MapCategoryId = (typeof MAP_CATEGORIES)[keyof typeof MAP_CATEGORIES];
|
|
|
3070
3088
|
declare const NO_MAP_CATEGORIES: ReadonlySet<string>;
|
|
3071
3089
|
/**
|
|
3072
3090
|
* The canonical code-system URI for **ICD-10-CM**: the target system of both crosswalks. A published
|
|
3073
|
-
* identity fact (mirrors {@link
|
|
3074
|
-
* target {@link
|
|
3091
|
+
* identity fact (mirrors {@link SYSTEM_IDENTITIES}); attached to a resolved
|
|
3092
|
+
* target {@link Coding} so a translation is self-describing.
|
|
3075
3093
|
*/
|
|
3076
3094
|
declare const ICD10CM_SYSTEM = "http://hl7.org/fhir/sid/icd-10-cm";
|
|
3077
3095
|
/**
|
|
@@ -3096,7 +3114,7 @@ declare const SNOMEDCT_SYSTEM = "http://snomed.info/sct";
|
|
|
3096
3114
|
* `consists_of`, …). The graph these form is the whole point: resolve a drug to its
|
|
3097
3115
|
* components and through them to its ingredient, a branded drug to its generic, a drug to its dose
|
|
3098
3116
|
* form. Note that the ingredient edge is authored on the component rather than on the `SCD` itself
|
|
3099
|
-
* (see {@link
|
|
3117
|
+
* (see {@link ingredientsOf}).
|
|
3100
3118
|
*
|
|
3101
3119
|
* **The direction convention is a documented medication-safety trap**, and it
|
|
3102
3120
|
* is grounded here firsthand on the NLM RxNorm Technical Documentation (§12.7) and the UMLS Reference
|
|
@@ -3125,7 +3143,7 @@ declare const SNOMEDCT_SYSTEM = "http://snomed.info/sct";
|
|
|
3125
3143
|
* `PSN` / `SY` / `TMSY` are Appendix 5's **synonym** term types: each labels an alternate *name* on
|
|
3126
3144
|
* some other concept rather than a concept of its own, so they are part of this vocabulary but can
|
|
3127
3145
|
* never appear as a loaded {@link RxNormConcept.tty}. See
|
|
3128
|
-
* {@link
|
|
3146
|
+
* {@link isSynonymTermType}.
|
|
3129
3147
|
*/
|
|
3130
3148
|
type TermType = "IN" | "PIN" | "MIN" | "BN" | "SCDC" | "SBDC" | "SCDF" | "SBDF" | "SCDFP" | "SBDFP" | "SCD" | "SBD" | "SCDG" | "SBDG" | "SCDGP" | "GPCK" | "BPCK" | "DF" | "DFG" | "PSN" | "SY" | "TMSY" | "ET";
|
|
3131
3149
|
/**
|
|
@@ -3180,9 +3198,9 @@ interface NdcResolution {
|
|
|
3180
3198
|
/**
|
|
3181
3199
|
* The temporal status of an NDC↔RXCUI mapping (RxNav `getNDCStatus`: `ACTIVE` / `OBSOLETE` / `ALIEN`
|
|
3182
3200
|
* / `UNKNOWN`). An NDC found in the loaded release's `RXNSAT` attributes is `active` **as of that
|
|
3183
|
-
* release**; `obsolete` / `alien` come from the RxNav NDC-history data (a differential
|
|
3184
|
-
*
|
|
3185
|
-
* **never fabricates** a non-current status.
|
|
3201
|
+
* release**; `obsolete` / `alien` come from the RxNav NDC-history data (a differential source, not
|
|
3202
|
+
* the base RRF concept files), which {@link loadRxNormGraph} does not read, so every resolution it
|
|
3203
|
+
* returns today is `active`. The engine **never fabricates** a non-current status.
|
|
3186
3204
|
*/
|
|
3187
3205
|
type NdcStatus = "active" | "obsolete" | "alien" | "unknown";
|
|
3188
3206
|
/** An NDC that could not be resolved to any `RXCUI` in the loaded release: a typed absence. */
|
|
@@ -3194,7 +3212,7 @@ interface NdcUnmapped {
|
|
|
3194
3212
|
/** The NDC (as supplied), echoed. */
|
|
3195
3213
|
readonly ndc: string;
|
|
3196
3214
|
}
|
|
3197
|
-
/** The result of {@link
|
|
3215
|
+
/** The result of {@link resolveNdc}: a resolution or a typed absence. */
|
|
3198
3216
|
type NdcResult = NdcResolution | NdcUnmapped;
|
|
3199
3217
|
/**
|
|
3200
3218
|
* A successful graph-navigation result: the concept, the predicate followed, and the **full** set of
|
|
@@ -3250,7 +3268,7 @@ interface RxNormLoadWarning {
|
|
|
3250
3268
|
/**
|
|
3251
3269
|
* The stable diagnostic code for the skip. `TERM_RXNORM_MALFORMED_ROW` is a structurally unusable
|
|
3252
3270
|
* row; `TERM_RXNORM_UNTYPED_CONCEPT` is an `RXCUI` no defining atom could type. Both are in the
|
|
3253
|
-
* package-wide {@link
|
|
3271
|
+
* package-wide {@link DIAGNOSTIC_CODES} registry, which documents each.
|
|
3254
3272
|
*/
|
|
3255
3273
|
readonly code: "TERM_RXNORM_MALFORMED_ROW" | "TERM_RXNORM_UNTYPED_CONCEPT";
|
|
3256
3274
|
/** Which source file the fault was in. */
|
|
@@ -3276,7 +3294,7 @@ interface RxNormLoadWarning {
|
|
|
3276
3294
|
interface RxNormGraph {
|
|
3277
3295
|
/** The release version (e.g. `"RXNORM_2026AA"`), when supplied: mappings are release-scoped. */
|
|
3278
3296
|
readonly version?: string;
|
|
3279
|
-
/** Concepts keyed by `RXCUI
|
|
3297
|
+
/** Concepts keyed by `RXCUI`, each typed by its first **defining** `SAB=RXNORM` atom. Each frozen. */
|
|
3280
3298
|
readonly concepts: ReadonlyMap<string, RxNormConcept>;
|
|
3281
3299
|
/** Directed edges indexed by `subject` `RXCUI`, each list in file order. Each list frozen. */
|
|
3282
3300
|
readonly edges: ReadonlyMap<string, readonly RxNormEdge[]>;
|
|
@@ -3629,7 +3647,7 @@ declare function approximateMatch(graph: RxNormGraph, query: string, options?: A
|
|
|
3629
3647
|
* or atom (with … RXCUI1 …)."* The doc's worked example (a row with `RXCUI1=1155862`, `RELA=isa`,
|
|
3630
3648
|
* `RXCUI2=197589`) reads *"197589 **isa** 1155862"* (the second concept is-a the first).
|
|
3631
3649
|
*
|
|
3632
|
-
* So an `RXNREL.RRF` row is read **`RXCUI2 ⟶RELA⟶ RXCUI1`**, and {@link
|
|
3650
|
+
* So an `RXNREL.RRF` row is read **`RXCUI2 ⟶RELA⟶ RXCUI1`**, and {@link loadRxNormGraph}
|
|
3633
3651
|
* normalizes every row to `subject = RXCUI2`, `predicate = RELA`, `object = RXCUI1`. Concretely, a
|
|
3634
3652
|
* `has_ingredient` row places the **having** concept in `RXCUI2` and what it *has* in `RXCUI1`; a
|
|
3635
3653
|
* `tradename_of` row places the **branded** concept in `RXCUI2` and the **generic** in `RXCUI1` (the
|
|
@@ -3645,7 +3663,7 @@ declare function approximateMatch(graph: RxNormGraph, query: string, options?: A
|
|
|
3645
3663
|
* basis-of-strength substances by `has_boss` (one-to-many, and its targets can be a `PIN` or a plain
|
|
3646
3664
|
* `IN`), and the other two author no ingredient-bearing edge at all. Treat those pairings as the
|
|
3647
3665
|
* ones RxNorm authors, not as a closed set, and read the `TTY` of what a traversal returns. See
|
|
3648
|
-
* {@link
|
|
3666
|
+
* {@link ingredientsOf}.
|
|
3649
3667
|
*
|
|
3650
3668
|
* @packageDocumentation
|
|
3651
3669
|
*/
|
|
@@ -3714,7 +3732,7 @@ type RelaName = (typeof RELA)[keyof typeof RELA];
|
|
|
3714
3732
|
* The authored **inverse pairs** of the drug-graph `RELA`s: a published fact (RxNorm Appendix 1),
|
|
3715
3733
|
* used only to *document* and *validate* that a caller is traversing a real relationship. The graph
|
|
3716
3734
|
* **never** uses this to synthesize a missing edge: RxNorm ships both directions, so
|
|
3717
|
-
*
|
|
3735
|
+
* the navigation functions follow whichever authored predicate points the way they want to go.
|
|
3718
3736
|
*
|
|
3719
3737
|
* @example
|
|
3720
3738
|
* ```ts
|
|
@@ -3744,7 +3762,7 @@ declare const RXNORM_SYSTEM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
|
3744
3762
|
* type. `ET` is in neither table; the appendix describes it only in prose, as "a small number of
|
|
3745
3763
|
* concepts with TTY=ET, a term type reserved for entry terms for dose forms". Those are concepts in
|
|
3746
3764
|
* their own right rather than synonyms carried on another, so `ET` counts as defining here. See
|
|
3747
|
-
* {@link isSynonymTermType} and {@link
|
|
3765
|
+
* {@link isSynonymTermType} and {@link loadRxNormGraph}.
|
|
3748
3766
|
*
|
|
3749
3767
|
* @packageDocumentation
|
|
3750
3768
|
*/
|
|
@@ -3753,7 +3771,7 @@ declare const RXNORM_SYSTEM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
|
3753
3771
|
* The drug-graph term types (`RXNCONSO.TTY`), each mapped to its **verbatim Appendix 5 name** (`ET`
|
|
3754
3772
|
* excepted: the appendix publishes no Name for it, so the UMLS expansion "Entry Term" is used).
|
|
3755
3773
|
* Encoded as an identity fact; a concept's `TTY` is carried verbatim on its
|
|
3756
|
-
* {@link
|
|
3774
|
+
* {@link RxNormConcept}, never re-labeled.
|
|
3757
3775
|
*
|
|
3758
3776
|
* The keys are the full Appendix 5 vocabulary, defining and synonym alike. Only the **defining** ones
|
|
3759
3777
|
* can appear on a loaded concept (see {@link isSynonymTermType}).
|
|
@@ -3788,7 +3806,7 @@ declare function asTermType(tty: string): TermType | undefined;
|
|
|
3788
3806
|
*
|
|
3789
3807
|
* Appendix 5 defines each as a *"synonym of another TTY"*: it labels an alternate **name** for a
|
|
3790
3808
|
* concept, never the concept's own kind. So a synonym atom can never establish an `RXCUI`'s term
|
|
3791
|
-
* type, and {@link
|
|
3809
|
+
* type, and {@link loadRxNormGraph} will not let one: an `RXCUI` whose release
|
|
3792
3810
|
* supplies only synonym atoms is skipped and surfaced, never typed `"TMSY"`.
|
|
3793
3811
|
*
|
|
3794
3812
|
* @param tty - A {@link TermType}.
|