@cosyte/astm 0.0.1 → 0.0.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 +35 -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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,8 +9,40 @@ 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
|
+
- **Publish status corrected across the public surface.** `@cosyte/astm` has been published on npm at
|
|
15
|
+
`0.0.1` since 2026-07-22 and the repository is public, but `README.md`, `docs-content/intro.md`, and
|
|
16
|
+
`docs-content/installation.md` each still opened with "pre-alpha (`0.0.x`), not yet published to
|
|
17
|
+
npm" (and the installation page told readers to consume the package from source instead). Those
|
|
18
|
+
three status blocks, plus the project guide, now state the real published version. The install
|
|
19
|
+
instructions no longer describe a package that does not exist.
|
|
20
|
+
- **`VERSION` no longer lies about the release.** The published `0.0.1` exported `VERSION === "0.0.0"`
|
|
21
|
+
while `package.json` read `0.0.1`, which the documented install smoke test (print `VERSION`) surfaces
|
|
22
|
+
directly to an installer. The constant is corrected to `0.0.1`, `scripts/sync-version.mjs` now
|
|
23
|
+
rewrites it from `package.json` inside the release `version` script, and `test/sanity.test.ts`
|
|
24
|
+
asserts the two agree so a skipped sync fails the build instead of shipping. The declaration is now
|
|
25
|
+
annotated `: string` (matching `@cosyte/hl7`), so the emitted type is `string` rather than the
|
|
26
|
+
version literal.
|
|
27
|
+
- Removed `cosyte-astm-0.0.0.tgz`, a 307 KB `pnpm pack` artifact committed to the repository root that
|
|
28
|
+
carried a stale `0.0.0` `dist/`, and added `*.tgz` to `.gitignore` so pack output cannot be
|
|
29
|
+
committed again.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- The `README.md` status block is replaced by a "What it covers" summary of the record, framing and
|
|
34
|
+
transport, emit, profile, and terminology layers. Per the public-surface rule, a README describes
|
|
35
|
+
what the software does, not our internal phase numbering; the ASTM designations `E1381` and `E1394`
|
|
36
|
+
are reference material and stay. Same removal of internal cross-references a reader cannot follow
|
|
37
|
+
from `docs-content/limitations.md` and `docs-content/quickstart.md`, leaving the surrounding
|
|
38
|
+
sentences intact.
|
|
39
|
+
- The released `0.0.1` entries now sit under a dated `## [0.0.1] - 2026-07-22` heading with a link to
|
|
40
|
+
its tag, instead of sitting under `[Unreleased]` behind a sentence saying `0.0.1` "will ship".
|
|
41
|
+
|
|
42
|
+
## [0.0.1] - 2026-07-22
|
|
43
|
+
|
|
44
|
+
The first pre-alpha release. The package begins its public history at `0.0.x`, per the cosyte version
|
|
45
|
+
ladder (`0.0.x` until first alpha).
|
|
14
46
|
|
|
15
47
|
### Added
|
|
16
48
|
|
|
@@ -347,12 +379,5 @@ EOT` session **reassembles exactly the source records**; a **raw-TCP stream equa
|
|
|
347
379
|
interactive contention/timeout/retransmit **timing**) is a thin consumer adapter, and the standard's
|
|
348
380
|
exact numeric timeouts / retry counts are deferred (we model transitions, not timers).
|
|
349
381
|
|
|
350
|
-
### Deprecated
|
|
351
|
-
|
|
352
|
-
### Removed
|
|
353
|
-
|
|
354
|
-
### Fixed
|
|
355
|
-
|
|
356
|
-
### Security
|
|
357
|
-
|
|
358
382
|
[Unreleased]: https://github.com/cosyte/astm/commits/main
|
|
383
|
+
[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 at `0.0.1`, 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