@cosyte/astm 0.0.1 → 0.0.3
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 +59 -10
- package/README.md +36 -33
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -9,8 +9,63 @@ this file is maintained by hand (Changesets handles the version bump and publish
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **The published documentation sidebar now follows the shared section order.** The shipped
|
|
15
|
+
`docs-content/sidebars.json` carried a category named "About" holding the "what it does and does not
|
|
16
|
+
do" page. That label is not one of the sections the documentation site recognises (Overview,
|
|
17
|
+
Installation, Quickstart, Core Concepts, Guides, API Reference, Troubleshooting), so `docs.cosyte.com`
|
|
18
|
+
rendered this package with a section no other `@cosyte/*` package has. The page now sits under
|
|
19
|
+
**Troubleshooting**, beside the troubleshooting guide that already links to it, matching how
|
|
20
|
+
`@cosyte/mllp` files the same page. The page's own URL is unchanged, so existing links to it still
|
|
21
|
+
resolve. Both released documentation bundles (`v0.0.1` and `v0.0.2`) carry the old layout and cannot
|
|
22
|
+
be changed, because a release asset is immutable once published; this correction reaches readers with
|
|
23
|
+
the next release.
|
|
24
|
+
- **The status note no longer quotes a version number that a release makes wrong.** `README.md`,
|
|
25
|
+
`docs-content/intro.md` and `docs-content/installation.md` each opened with "published on npm at
|
|
26
|
+
`0.0.1`" while the package was at `0.0.2`. Nothing bound those sentences to the manifest, so every
|
|
27
|
+
publish falsified them, and the two documentation pages ship inside the release bundle the
|
|
28
|
+
documentation site re-fetches forever. They now say the package is published and name the `0.0.x`
|
|
29
|
+
pre-alpha ladder, and leave the exact version to the registry, where it cannot go stale. The
|
|
30
|
+
exported `VERSION` constant is unaffected: it is generated from `package.json` at release time and
|
|
31
|
+
asserted equal to it.
|
|
32
|
+
|
|
33
|
+
## [0.0.2] - 2026-07-27
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **Publish status corrected across the public surface.** `@cosyte/astm` has been published on npm at
|
|
38
|
+
`0.0.1` since 2026-07-22 and the repository is public, but `README.md`, `docs-content/intro.md`, and
|
|
39
|
+
`docs-content/installation.md` each still opened with "pre-alpha (`0.0.x`), not yet published to
|
|
40
|
+
npm" (and the installation page told readers to consume the package from source instead). Those
|
|
41
|
+
three status blocks, plus the project guide, now state the real published version. The install
|
|
42
|
+
instructions no longer describe a package that does not exist.
|
|
43
|
+
- **`VERSION` no longer lies about the release.** The published `0.0.1` exported `VERSION === "0.0.0"`
|
|
44
|
+
while `package.json` read `0.0.1`, which the documented install smoke test (print `VERSION`) surfaces
|
|
45
|
+
directly to an installer. The constant is corrected to `0.0.1`, `scripts/sync-version.mjs` now
|
|
46
|
+
rewrites it from `package.json` inside the release `version` script, and `test/sanity.test.ts`
|
|
47
|
+
asserts the two agree so a skipped sync fails the build instead of shipping. The declaration is now
|
|
48
|
+
annotated `: string` (matching `@cosyte/hl7`), so the emitted type is `string` rather than the
|
|
49
|
+
version literal.
|
|
50
|
+
- Removed `cosyte-astm-0.0.0.tgz`, a 307 KB `pnpm pack` artifact committed to the repository root that
|
|
51
|
+
carried a stale `0.0.0` `dist/`, and added `*.tgz` to `.gitignore` so pack output cannot be
|
|
52
|
+
committed again.
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- The `README.md` status block is replaced by a "What it covers" summary of the record, framing and
|
|
57
|
+
transport, emit, profile, and terminology layers. Per the public-surface rule, a README describes
|
|
58
|
+
what the software does, not our internal phase numbering; the ASTM designations `E1381` and `E1394`
|
|
59
|
+
are reference material and stay. Same removal of internal cross-references a reader cannot follow
|
|
60
|
+
from `docs-content/limitations.md` and `docs-content/quickstart.md`, leaving the surrounding
|
|
61
|
+
sentences intact.
|
|
62
|
+
- The released `0.0.1` entries now sit under a dated `## [0.0.1] - 2026-07-22` heading with a link to
|
|
63
|
+
its tag, instead of sitting under `[Unreleased]` behind a sentence saying `0.0.1` "will ship".
|
|
64
|
+
|
|
65
|
+
## [0.0.1] - 2026-07-22
|
|
66
|
+
|
|
67
|
+
The first pre-alpha release. The package begins its public history at `0.0.x`, per the cosyte version
|
|
68
|
+
ladder (`0.0.x` until first alpha).
|
|
14
69
|
|
|
15
70
|
### Added
|
|
16
71
|
|
|
@@ -347,12 +402,6 @@ EOT` session **reassembles exactly the source records**; a **raw-TCP stream equa
|
|
|
347
402
|
interactive contention/timeout/retransmit **timing**) is a thin consumer adapter, and the standard's
|
|
348
403
|
exact numeric timeouts / retry counts are deferred (we model transitions, not timers).
|
|
349
404
|
|
|
350
|
-
### Deprecated
|
|
351
|
-
|
|
352
|
-
### Removed
|
|
353
|
-
|
|
354
|
-
### Fixed
|
|
355
|
-
|
|
356
|
-
### Security
|
|
357
|
-
|
|
358
405
|
[Unreleased]: https://github.com/cosyte/astm/commits/main
|
|
406
|
+
[0.0.2]: https://github.com/cosyte/astm/releases/tag/v0.0.2
|
|
407
|
+
[0.0.1]: https://github.com/cosyte/astm/releases/tag/v0.0.1
|
package/README.md
CHANGED
|
@@ -8,39 +8,42 @@ parser that turns real-world, vendor-quirky input into **warnings** rather than
|
|
|
8
8
|
a serializer that always emits spec-clean output (Postel's Law). It mirrors the API shape of the
|
|
9
9
|
reference parser, [`@cosyte/hl7`](https://github.com/cosyte/hl7).
|
|
10
10
|
|
|
11
|
-
> **Status:** pre-alpha
|
|
12
|
-
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
11
|
+
> **Status:** published on npm, on the pre-alpha `0.0.x` ladder. Both layers are
|
|
12
|
+
> feature-complete, but the public surface can still change within `0.0.x`, before `0.1.0`.
|
|
13
|
+
|
|
14
|
+
## What it covers
|
|
15
|
+
|
|
16
|
+
- **Records (E1394 / LIS02-A2).** `H`/`P`/`O`/`R`/`C`/`Q`/`M`/`S`/`L` are read with per-header
|
|
17
|
+
delimiter self-declaration and escape decode, so an escaped delimiter inside a value reads as one
|
|
18
|
+
component. Result semantics are modeled and fail-safe: HL7 Table 0078 abnormal flags, result status
|
|
19
|
+
(a correction `C` or cancel `X` never reads as active-final), reference ranges kept verbatim, and a
|
|
20
|
+
missing unit flagged rather than defaulted. The practice-, laboratory-, and third patient IDs stay
|
|
21
|
+
distinct; a `C` comment attaches to its parent by position and an orphan is surfaced, never dropped;
|
|
22
|
+
a partial timestamp is preserved and flagged, never zero-filled. A `Q`-bearing message is classified
|
|
23
|
+
as a host query and is never read as a result set, and `M`/`S` vendor QC and calibration records are
|
|
24
|
+
surfaced verbatim rather than interpreted into clinical fields.
|
|
25
|
+
- **Framing and transport (E1381 / LIS01-A2).** `decodeAstmFrames` turns a framed byte stream into
|
|
26
|
+
frames plus reassembled record bytes: it verifies the modulo-256 checksum (a bad frame is surfaced
|
|
27
|
+
untrusted and never merged), tracks frame-number sequencing (a gap is never silently bridged), and
|
|
28
|
+
reassembles the 240-byte-limited multi-frame records. `detectFraming` routes framed streams (serial,
|
|
29
|
+
cobas 4800, Iguana) from raw ones (cobas b121, framing dropped), and `ltpReduce` is a pure,
|
|
30
|
+
socket-free `ENQ`/`ACK`/`NAK`/`EOT` receiver state machine that NAKs a frame the codec did not vouch
|
|
31
|
+
for rather than fabricating an ACK. `parseFramedAstm` composes both layers at the edge.
|
|
32
|
+
- **Emit.** `serializeAstmRecords` and `buildAstmMessage` emit canonical `H|\^&` records with embedded
|
|
33
|
+
delimiters re-escaped and nothing clinical fabricated; `composeAstmFrames` and `serializeFramedAstm`
|
|
34
|
+
frame them with computed checksums, frame numbers, and the 240-byte split. Both layers round-trip by
|
|
35
|
+
construction.
|
|
36
|
+
- **Vendor profiles.** `defineAstmProfile()` builds a provenance-backed profile whose tolerances
|
|
37
|
+
downgrade _expected_, non-safety-critical deviations to a `PROFILE_QUIRK_APPLIED` warning without
|
|
38
|
+
ever altering a value, behind a definition-time safety gate that refuses to tolerate any result
|
|
39
|
+
value, flag, status, range, or units warning, any patient or comment context, any message-kind
|
|
40
|
+
ambiguity, and any frame or transport integrity warning. A profile can never make a bad checksum
|
|
41
|
+
"ok" or a cancelled result read "final." Named per-vendor profiles await a public,
|
|
42
|
+
vendor-attributed quirk document.
|
|
43
|
+
- **Terminology, bring your own.** `applyLivd(msg, catalog)` maps an analyzer's local test code to a
|
|
44
|
+
LOINC from a consumer-supplied IICC LIVD catalog as an additive, advisory annotation that never
|
|
45
|
+
mutates the raw code or value and never guesses a LOINC. No LOINC, SNOMED, or LIVD dictionary is
|
|
46
|
+
bundled: the package stays a structural recognizer and you bring the catalog.
|
|
44
47
|
|
|
45
48
|
## Decode a framed byte stream
|
|
46
49
|
|
package/dist/index.cjs
CHANGED