@cosyte/terminology 0.1.0 → 0.1.2
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 +19 -3
- package/LICENSE +1 -1
- package/README.md +34 -30
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -40
- package/vendor/ucum/NOTICE.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b9772b6: The `resolveSystem` documentation in the type declarations no longer says `@cosyte/transform` uses it, which was never true.
|
|
8
|
+
|
|
9
|
+
No code system, map, value set, result, or diagnostic changes. The README now names the package that does use this engine, `@cosyte/cli`, for its `map-codes` command, and the `LICENSE` names the copyright holder by its legal name, Cosyte LLC.
|
|
10
|
+
|
|
11
|
+
## 0.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 6ac6a32: Doc comments in the type declarations no longer use the en dash: the UCUM copyright line reads "©1999-2024", as the published notice does, and a similarity bound reads "`0` to `1`".
|
|
16
|
+
|
|
17
|
+
No code system, map, value set, result or diagnostic changes. The README, the documentation and `vendor/ucum/NOTICE.md` get the same edit, matching this package's LICENSE, and the repository's dash check now refuses the en dash in every spelling it already refused the em dash in.
|
|
18
|
+
|
|
3
19
|
## 0.1.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -352,7 +368,7 @@
|
|
|
352
368
|
|
|
353
369
|
- 9b5b390: The npm `description` no longer carries an em dash (`EMDASH-CONFORMANCE`).
|
|
354
370
|
|
|
355
|
-
The brand rule bans U+2014 on every
|
|
371
|
+
The brand rule bans U+2014 on every Cosyte surface, and this string is the most visible one the
|
|
356
372
|
package has: it is the subtitle on the npm package page and the one line shown in every npm search
|
|
357
373
|
result. It now reads with a colon, which is what the rule's own remedy list names first.
|
|
358
374
|
|
|
@@ -428,7 +444,7 @@ in `0.0.4`. It is not a hole to be filled, because publishing a `0.0.3` now woul
|
|
|
428
444
|
|
|
429
445
|
The entries below follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); the generated
|
|
430
446
|
sections above use the format Changesets writes, which is a version heading and a list of the
|
|
431
|
-
changes that release consumed. Versions follow the
|
|
447
|
+
changes that release consumed. Versions follow the Cosyte pre-alpha ladder, `0.0.x` until first
|
|
432
448
|
alpha, rather than [Semantic Versioning](https://semver.org/spec/v2.0.0.html) alone.
|
|
433
449
|
|
|
434
450
|
### Fixed
|
|
@@ -1497,7 +1513,7 @@ has_ingredient IN`). RxNorm authors no such relationship in any release: the ing
|
|
|
1497
1513
|
|
|
1498
1514
|
## [0.0.1] - 2026-07-21
|
|
1499
1515
|
|
|
1500
|
-
The first pre-alpha release. The package begins its public history at `0.0.x`, per the
|
|
1516
|
+
The first pre-alpha release. The package begins its public history at `0.0.x`, per the Cosyte version
|
|
1501
1517
|
ladder (`0.0.x` until first alpha).
|
|
1502
1518
|
|
|
1503
1519
|
### Security
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<a href="https://cosyte.com">
|
|
2
2
|
<picture>
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://cosyte.com/tile/cosyte-lockup-tile-on-dark-1200x300.png">
|
|
4
|
-
<img alt="Cosyte
|
|
4
|
+
<img alt="The Cosyte logo on its own white ground: the icon beside the word Cosyte." src="https://cosyte.com/tile/cosyte-lockup-tile-on-light-1200x300.png">
|
|
5
5
|
</picture>
|
|
6
6
|
</a>
|
|
7
7
|
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
`@cosyte/terminology` is **not a wire parser**. It mirrors the FHIR **Terminology Module**
|
|
14
14
|
(`$translate`, `$lookup`, `$validate-code`, `$expand`, …), operating over **consumer-supplied** FHIR
|
|
15
|
-
resources
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
> **Status:**
|
|
15
|
+
resources, and `@cosyte/cli` uses it to translate codes in its `map-codes` command. It ships the
|
|
16
|
+
**engine, and no code-system release**: SNOMED CT, CPT, LOINC, UMLS/RxNorm, and VSAC value sets are
|
|
17
|
+
strictly bring-your-own. It is not content-free, though: what it _does_ bundle, including the UCUM
|
|
18
|
+
unit table, the code-system _identities_ (OID ↔ canonical URI), the SNOMED CT concepts the crosswalk
|
|
19
|
+
resolver names, and RxNorm's relationship and term-type names, is listed with its copyright under
|
|
20
|
+
[What is bundled](#what-is-bundled).
|
|
21
|
+
|
|
22
|
+
> **Status:** the 0.1 line, **published on npm.** The public API is settled: below `1.0.0` a breaking
|
|
23
23
|
> change ships in a new minor version, never a patch, and the changelog says what broke. The
|
|
24
24
|
> **engine is complete**, every operation below ships today. The surface:
|
|
25
25
|
>
|
|
@@ -44,20 +44,22 @@ listed with its copyright under [What is bundled](#what-is-bundled).
|
|
|
44
44
|
>
|
|
45
45
|
> **Bring your own data.** The engine is whole; **no code-system release is bundled.** It runs over
|
|
46
46
|
> the FHIR resources and standard releases _you_ supply: SNOMED CT, CPT, LOINC, UMLS/RxNorm, the CMS
|
|
47
|
-
> GEM files, the NLM complex-map refset and VSAC value sets are all bring-your-own, under whatever
|
|
47
|
+
> GEM files, the NLM complex-map refset, and VSAC value sets are all bring-your-own, under whatever
|
|
48
48
|
> terms their steward sets. The content packs that would change that (RxNorm Prescribable, ICD-10-CM)
|
|
49
49
|
> are not bundled either. For the things that **are** bundled, and under whose copyright, see
|
|
50
50
|
> [What is bundled](#what-is-bundled).
|
|
51
51
|
|
|
52
52
|
## Install
|
|
53
53
|
|
|
54
|
-
> **On npm.** `@cosyte/terminology` is **published**, on the
|
|
54
|
+
> **On npm.** `@cosyte/terminology` is **published**, on the 0.1 line. The command below
|
|
55
55
|
> installs the real package; the registry, not this page, is the authority on the exact version.
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
npm install @cosyte/terminology
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
Node.js 22 or later, tested on 22 and 24.
|
|
62
|
+
|
|
61
63
|
Runnable programs for the main jobs are in
|
|
62
64
|
[`examples/`](https://github.com/cosyte/terminology/tree/main/examples).
|
|
63
65
|
|
|
@@ -152,14 +154,14 @@ ucumEqual("Cel", "K"); // false: a special (non-linear) unit is never equated wi
|
|
|
152
154
|
|
|
153
155
|
The UCUM table is the official `ucum-essence.xml` (version 2.2), and it **is bundled with this
|
|
154
156
|
package**: embedded verbatim in the published build and parsed at runtime. It is copyright
|
|
155
|
-
©1999
|
|
157
|
+
©1999-2024 Regenstrief Institute, Inc., reproduced under the UCUM Copyright Notice and License
|
|
156
158
|
(<https://ucum.org/license>); the engine ships no derivative of it. It passes the official UCUM
|
|
157
159
|
functional-test cases it claims, and claims no more than it runs: see
|
|
158
160
|
[UCUM conformance](#ucum-conformance). The full notice ships in the package at
|
|
159
161
|
`vendor/ucum/NOTICE.md`: see [What is bundled](#what-is-bundled).
|
|
160
162
|
|
|
161
163
|
> **Case-sensitive (c/s) mode only.** UCUM's normative interchange mode (the one FHIR/HL7 bind to)
|
|
162
|
-
> is case-sensitive (`m` =
|
|
164
|
+
> is case-sensitive (`m` = meter, `M` = mega, `Pa` = pascal, `pA` = picoampere). The
|
|
163
165
|
> case-**insensitive** (c/i) spelling variant is **not** supported; a c/i-only string returns a typed
|
|
164
166
|
> `TERM_UCUM_INVALID` (fail-safe, never silently reinterpreted). Magnitude conversion is likewise a
|
|
165
167
|
> deliberate non-goal (recognition and canonicalization only).
|
|
@@ -195,18 +197,18 @@ can tell what was run from what was not:
|
|
|
195
197
|
|
|
196
198
|
- **Snapshot: upstream commit `33d37fc0f8efaed5832032f3a73956f66d4d4f23`.** The suite publishes no
|
|
197
199
|
version field, so the commit is the version, and it is the version these counts were produced
|
|
198
|
-
against. A pinned copy of the cases sits in the repository with their origin and
|
|
200
|
+
against. A pinned copy of the cases sits in the repository with their origin and license recorded
|
|
199
201
|
beside them; they are third-party material and are not part of the published package.
|
|
200
202
|
- **Suites in scope: `simple-cases`, `parameters`, `validation`. Operations in scope: `$expand` and
|
|
201
203
|
ValueSet `$validate-code`.** The suite's other suites and its other operations are not run, and no
|
|
202
204
|
conformance to them is claimed.
|
|
203
205
|
- **Cases ran: 101. Passed: 20. Declined: 81.** The three add up: every case that ran is exactly one
|
|
204
206
|
of them. Those three suites declare 112 cases in total; the rest declare a different operation,
|
|
205
|
-
are marked in the suite for one server's own
|
|
207
|
+
are marked in the suite for one server's own behavior, or are held out of the measurement, and
|
|
206
208
|
none of those is run or counted anywhere above.
|
|
207
209
|
- **A declined case is one this library has no answer for, named rather than counted as a pass.** It
|
|
208
210
|
asks for a request parameter the public API takes no argument for (`activeOnly`,
|
|
209
|
-
`displayLanguage`, `includeDesignations
|
|
211
|
+
`displayLanguage`, `includeDesignations`, and others), for HTTP or language negotiation that a
|
|
210
212
|
library call cannot perform, or it is met by this engine's own typed refusal. Every decline is
|
|
211
213
|
recorded with its case and its reason.
|
|
212
214
|
- **A case that answers differently fails the run, and is never recorded as a decline.** The counts
|
|
@@ -214,16 +216,16 @@ can tell what was run from what was not:
|
|
|
214
216
|
|
|
215
217
|
The cases are written for a **server** answering over HTTP, and this package is a library, so they
|
|
216
218
|
are driven in process through the public API and the comparison is narrower than a server's would
|
|
217
|
-
be: an expansion is compared on its membership (system, code and display), a `$validate-code` case
|
|
219
|
+
be: an expansion is compared on its membership (system, code, and display), a `$validate-code` case
|
|
218
220
|
on its recorded `result`. The recorded responses declare their own tolerances and those are
|
|
219
|
-
|
|
221
|
+
honored as declared; every tolerance applied beyond them is written down beside the counts, on the
|
|
220
222
|
ground that a tolerance nobody can see is indistinguishable from a pass that was not earned.
|
|
221
223
|
|
|
222
224
|
The package's own test suite reproduces the run and holds these figures to it, so they cannot go
|
|
223
225
|
stale in silence.
|
|
224
226
|
|
|
225
227
|
**This is a measurement, not an endorsement.** HL7 publishes these cases and reviews outcomes under
|
|
226
|
-
its own process. Nothing here is an approval, a certification or an endorsement of this package by
|
|
228
|
+
its own process. Nothing here is an approval, a certification, or an endorsement of this package by
|
|
227
229
|
HL7 or by anyone else.
|
|
228
230
|
|
|
229
231
|
## Navigate the RxNorm drug graph
|
|
@@ -246,7 +248,7 @@ basis-of-strength substances by `has_boss`, a one-to-many relation with a differ
|
|
|
246
248
|
targets can be a `PIN` or a plain `IN`, and which `ingredientsOf` does not follow. Read the `tty` of
|
|
247
249
|
what comes back rather than assuming it.
|
|
248
250
|
|
|
249
|
-
A concept is typed by its **defining** atom, whichever line of `RXNCONSO` that sits on. `PSN`, `SY
|
|
251
|
+
A concept is typed by its **defining** atom, whichever line of `RXNCONSO` that sits on. `PSN`, `SY`,
|
|
250
252
|
and `TMSY` type a _name_ rather than a concept, so they never establish an `RXCUI`'s term type. An
|
|
251
253
|
`RXCUI` no defining atom could type is left out of the graph and reported as
|
|
252
254
|
`TERM_RXNORM_UNTYPED_CONCEPT` on `graph.warnings`, rather than loaded under a synonym's term type:
|
|
@@ -294,21 +296,21 @@ _names_, listed under [What is bundled](#what-is-bundled).
|
|
|
294
296
|
- **Liberal load, conservative assertion.** Malformed input degrades to a typed diagnostic; a 1:many
|
|
295
297
|
mapping returns the full candidate set, never collapsed to one.
|
|
296
298
|
- **Value-free diagnostic messages.** Nothing you configured and nothing your release or resource
|
|
297
|
-
contained reaches a `message`, `detail`, `reason
|
|
299
|
+
contained reaches a `message`, `detail`, `reason`, or `err.stack` (not a column name, not a
|
|
298
300
|
canonical URI, not a unit atom) at any length. What sits beside a message is a locus: a line
|
|
299
301
|
number, a column count, an index path into your own resource (`compose.include[2]`), or a fixed
|
|
300
302
|
token naming which file of a release it came from. The
|
|
301
|
-
**objects** are a different matter: a typed `unknown`/`unmapped` outcome names the code, unit or
|
|
303
|
+
**objects** are a different matter: a typed `unknown`/`unmapped` outcome names the code, unit, or
|
|
302
304
|
NDC you asked about, so log the `code` and the locus rather than the whole result: a code _in
|
|
303
305
|
patient context_ can be PHI.
|
|
304
306
|
- **Zero runtime dependencies. Dual ESM + CJS.** Node stdlib only; built with `tsup`, validated with
|
|
305
307
|
`attw`. A release you load is frozen, its indexes included: a code system's concepts, a GEM's or a
|
|
306
|
-
complex map's entries and a drug graph's concepts, edges and NDCs are each a read-only **view** of a
|
|
307
|
-
map rather than the map itself, so nothing holding one can add, delete or clear an entry, whichever
|
|
308
|
+
complex map's entries, and a drug graph's concepts, edges, and NDCs are each a read-only **view** of a
|
|
309
|
+
map rather than the map itself, so nothing holding one can add, delete, or clear an entry, whichever
|
|
308
310
|
way it tries. A view is not a `Map` instance, so a model carrying one cannot be `structuredClone`d
|
|
309
311
|
or posted to a worker: copy out what you need (`new Map(cs.concepts)`). The bundled unit table is frozen deeply, atom by atom and definition by
|
|
310
312
|
definition, because it is shared with the engine's own reducer; its two lookup maps refuse `set`,
|
|
311
|
-
`delete
|
|
313
|
+
`delete`, and `clear` by name, and an entry forced past that through `Map.prototype` changes nothing
|
|
312
314
|
the engine reads, because `parseUcum` resolves an atom by scanning the frozen atom array rather than
|
|
313
315
|
through a lookup map. The AST and
|
|
314
316
|
the reduction that `parseUcum` and `reduce` hand back are per-call values you own, and mutating one
|
|
@@ -320,7 +322,7 @@ The engine bundles **no code-system release**. What it _does_ bundle includes th
|
|
|
320
322
|
with its copyright:
|
|
321
323
|
|
|
322
324
|
- **The UCUM unit table**: `ucum-essence.xml`, version 2.2, revision-date 2024-06-17. The Unified
|
|
323
|
-
Code for Units of Measure (UCUM) is copyright ©1999
|
|
325
|
+
Code for Units of Measure (UCUM) is copyright ©1999-2024 Regenstrief Institute, Inc., all rights
|
|
324
326
|
reserved, and is reproduced **verbatim** under the UCUM Copyright Notice and License
|
|
325
327
|
(<https://ucum.org/license>). It is embedded byte-for-byte in the published build and parsed at
|
|
326
328
|
runtime; no modified or derivative copy is distributed. The UCUM Specification is provided "as is"
|
|
@@ -335,7 +337,7 @@ with its copyright:
|
|
|
335
337
|
ICD-10-CM codes, appear in the API documentation examples, which are distributed in the compiled
|
|
336
338
|
declaration files and in the build's sourcemaps. SNOMED CT is copyright
|
|
337
339
|
© International Health Terminology Standards Development Organisation. **No SNOMED CT release or
|
|
338
|
-
refset is bundled**: you supply the map rows under your own SNOMED CT
|
|
340
|
+
refset is bundled**: you supply the map rows under your own SNOMED CT license.
|
|
339
341
|
- **The RxNorm relationship and term-type names** the drug-graph API is written against: the
|
|
340
342
|
relationship names in `RELA` / `RELA_INVERSE` (`has_ingredient`, `tradename_of`, …), and the
|
|
341
343
|
term-type codes in `TERM_TYPES`, each with its name as published by the U.S. National Library of
|
|
@@ -349,6 +351,8 @@ no claim about whether any particular use of these materials is permitted to you
|
|
|
349
351
|
|
|
350
352
|
## License
|
|
351
353
|
|
|
352
|
-
MIT © Cosyte: this package's own code.
|
|
353
|
-
|
|
354
|
-
third-party notices section naming each of
|
|
354
|
+
[MIT](https://github.com/cosyte/terminology/blob/main/LICENSE) © Cosyte LLC: this package's own code.
|
|
355
|
+
The bundled third-party materials above stay under their own copyright and licenses; the `LICENSE` file
|
|
356
|
+
that ships with this package carries the MIT text and a third-party notices section naming each of
|
|
357
|
+
them. The code-system and standards names this package uses belong to their owners: see
|
|
358
|
+
[TRADEMARKS.md](https://github.com/cosyte/terminology/blob/main/TRADEMARKS.md).
|
package/dist/index.cjs
CHANGED
|
@@ -4979,7 +4979,7 @@ function approximateMatch(graph, query, options = {}) {
|
|
|
4979
4979
|
}
|
|
4980
4980
|
|
|
4981
4981
|
// src/index.ts
|
|
4982
|
-
var VERSION = "0.1.
|
|
4982
|
+
var VERSION = "0.1.2";
|
|
4983
4983
|
|
|
4984
4984
|
exports.COMPLEX_MAP_SOURCE_SYSTEM = COMPLEX_MAP_SOURCE_SYSTEM;
|
|
4985
4985
|
exports.DIAGNOSTIC_CODES = DIAGNOSTIC_CODES;
|