@cosyte/synth 0.1.6 → 0.1.8
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 +34 -0
- package/README.md +8 -2
- package/dist/astm/index.cjs +4 -1
- package/dist/astm/index.cjs.map +1 -1
- package/dist/astm/index.mjs +4 -1
- package/dist/astm/index.mjs.map +1 -1
- package/dist/ccda/index.cjs.map +1 -1
- package/dist/ccda/index.mjs.map +1 -1
- package/dist/deid/index.cjs +36 -19
- package/dist/deid/index.cjs.map +1 -1
- package/dist/deid/index.mjs +36 -19
- package/dist/deid/index.mjs.map +1 -1
- package/dist/fhir/index.cjs +25 -12
- package/dist/fhir/index.cjs.map +1 -1
- package/dist/fhir/index.d.cts +8 -5
- package/dist/fhir/index.d.ts +8 -5
- package/dist/fhir/index.mjs +25 -12
- package/dist/fhir/index.mjs.map +1 -1
- package/dist/hl7/index.cjs +3 -1
- package/dist/hl7/index.cjs.map +1 -1
- package/dist/hl7/index.mjs +3 -1
- package/dist/hl7/index.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/ncpdp/index.cjs +2 -1
- package/dist/ncpdp/index.cjs.map +1 -1
- package/dist/ncpdp/index.mjs +2 -1
- package/dist/ncpdp/index.mjs.map +1 -1
- package/dist/x12/index.cjs +7 -6
- package/dist/x12/index.cjs.map +1 -1
- package/dist/x12/index.d.cts +2 -1
- package/dist/x12/index.d.ts +2 -1
- package/dist/x12/index.mjs +7 -6
- package/dist/x12/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2f6dff4: `engines.node` is now `>=22.12.0`, where it was `>=22.0.0`. Since 0.1.6 a generator loads its parser on first use through `require`, and Node.js loads an ES module that way by default only from 22.12. On 22.0 to 22.11 the ES module build fell back to the parser's CommonJS entry, so a value it returned was an instance of a second copy of the parser's classes and `instanceof` against a class imported with `import` was false. The 0.1.6 entry said a returned value was an instance of the classes your code imports; that holds on 22.12 and later, and CI now runs the built package's smoke, which checks `instanceof` under `import` and `require`, on Node.js 22.12.0 itself. If you run Node.js 22.0 to 22.11, upgrade to 22.12 or later. npm warns about the engines range by default and refuses the install only with `engine-strict`.
|
|
8
|
+
|
|
9
|
+
If you bundle code that uses `@cosyte/synth`, mark `@cosyte/synth` and each `@cosyte/*` parser you use as external (esbuild `--external:@cosyte/*`, Rollup `external`, webpack `externals`) and install them beside the bundle. A bundler cannot follow the first-use load, so a bundle that inlines a parser holds a second copy of it, and one that omits a parser fails with "Cannot find module" on the first call that needs it.
|
|
10
|
+
|
|
11
|
+
No generated value, export, warning code or seed mapping changes.
|
|
12
|
+
|
|
13
|
+
- dd2b762: Every artifact now says it is test data, in the field its standard gives for that, so a generated fixture that ends up somewhere real can be told apart from production data. HL7 v2 messages declared processing ID `P` (production) in MSH-11; X12 already set ISA-15 to `T`.
|
|
14
|
+
|
|
15
|
+
Output change: HL7 v2 messages set MSH-11 to `T` where it was `P`. Every FHIR resource, every resource inside a Bundle and the Bundle itself carry `meta.security` with the `HTEST` ("test health data") code from `http://terminology.hl7.org/CodeSystem/v3-ActReason`, so a resource built with `usCore: false` and a base Patient now carry a `meta` too, and the document Bundle's Organization and Composition carry one. ASTM messages set the header's processing ID (H.12) to `T`, so the `H` record gains the empty fields H.6 to H.11 before it. C-CDA, X12 and NCPDP output is unchanged. A golden file committed from an earlier release for HL7 v2, FHIR or ASTM has to be regenerated.
|
|
16
|
+
|
|
17
|
+
The marker is always on: there is no option to turn it off. The exported `meta(profiles)` helper in `@cosyte/synth/fhir` now adds the `HTEST` label as well, and accepts an empty list, which leaves `meta.profile` out. If your code reads `meta` from a generated resource and expected only `profile`, read `meta.profile` by name.
|
|
18
|
+
|
|
19
|
+
## 0.1.7
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 65399f9: `@cosyte/synth` now installs beside `@cosyte/deid` 0.2. The `@cosyte/deid` peer range is `^0.1.5 || ^0.2.0`, where it was `^0.1.5`, so npm no longer refuses the install with ERESOLVE when a project already has deid 0.2.3. The tests now run against `@cosyte/deid` 0.2.3, and a new workflow installs the lowest and the highest version the range admits and runs the de-identification loop against each.
|
|
24
|
+
|
|
25
|
+
Generated 837P, 837I and 837D claims now write each ICD-10-CM diagnosis code in `HI` without its decimal point (`HI*ABK:J209`, not `HI*ABK:J20.9`), as the 005010 claim guides transmit it. `@cosyte/deid` 0.2 removes a diagnosis code that has a decimal point, which made the X12 pairing loop report clinical codes as scrubbed. The exported `DIAGNOSES` pool (`@cosyte/synth/x12`) holds the same codes in that form: a caller that compared a generated code with `J20.9` must compare with `J209`, or remove the point first.
|
|
26
|
+
|
|
27
|
+
Output change: X12. Every generated 837P, 837I and 837D whose diagnosis code has a decimal point, and every X12 corpus that holds one, carries its diagnosis codes without the decimal point; nothing else in them moves. The X12 de-identification loop results move with it and with deid 0.2's X12 pass. An 837 golden file committed from an earlier release has to be regenerated. HL7 v2, FHIR R4 and US Core, C-CDA, NCPDP and ASTM output is byte for byte what it was for the same seed.
|
|
28
|
+
|
|
29
|
+
- 7bb58a6: Three generated values now follow their standards: the X12 271 benefit percent, the NCPDP Telecom Quantity Dispensed and the ASTM header sender.
|
|
30
|
+
|
|
31
|
+
- X12 271: EB-08 (benefit percent) is a decimal fraction, so it is now written as `.8`, `.9` or `1` instead of `80`, `90` or `100`.
|
|
32
|
+
- NCPDP Telecom: 442-E7 (Quantity Dispensed) carries three implied decimals, so a quantity of 37 is now written as `37000` instead of `37`. It reads back through `@cosyte/ncpdp` as `37.000`.
|
|
33
|
+
- ASTM: the sender name now sits in H.5 (Sender Name or ID). Before, the sender went to H.3 (Message Control ID) and the analyzer string to H.4 (Access Password). H.3 and H.4 are now empty, and the analyzer string is no longer written to the header. `astmHeaderIdentity` still returns both strings.
|
|
34
|
+
|
|
35
|
+
Output change: X12, NCPDP and ASTM. For the same seed, every generated 271, every B1 and B3 Telecom claim, and every ASTM result, order, framed and quirk message changes in the values above, and so do the corpora and de-identification loop results built from them. Every other generated artifact is byte for byte what it was for the same seed. If you commit golden files from an earlier release, regenerate each 271, B1, B3 and ASTM golden file from its seed with this release and commit the new bytes.
|
|
36
|
+
|
|
3
37
|
## 0.1.6
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://www.npmjs.com/package/@cosyte/synth)
|
|
13
13
|
[](https://github.com/cosyte/synth/actions/workflows/ci.yml)
|
|
14
14
|
[](https://github.com/cosyte/synth/blob/main/LICENSE)
|
|
15
|
-
[](https://nodejs.org)
|
|
16
16
|
|
|
17
17
|
Deterministic, seedable synthetic healthcare test fixtures for Node.js and TypeScript: HL7 v2, FHIR R4 and US Core, C-CDA, X12, NCPDP, and ASTM, spec-clean by construction and never real PHI.
|
|
18
18
|
|
|
@@ -57,7 +57,13 @@ pairing (no `@cosyte/deid` adapter, or not generated); and optional **Synthea**
|
|
|
57
57
|
npm install @cosyte/synth @cosyte/hl7 @cosyte/fhir @cosyte/ccda @cosyte/x12 @cosyte/ncpdp @cosyte/astm
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Node.js 22 or later, tested on 22, 24, and 26.
|
|
60
|
+
Node.js 22.12 or later, tested on 22.12, 22, 24, and 26. A generator loads its parser on first use
|
|
61
|
+
through `require`, and Node.js loads an ES module that way only from 22.12, so a value you get back
|
|
62
|
+
is an instance of the parser classes you import.
|
|
63
|
+
|
|
64
|
+
**Bundling.** A bundler cannot see that load. If you bundle code that uses `@cosyte/synth`, mark
|
|
65
|
+
`@cosyte/synth` and every `@cosyte/*` parser you use as external (esbuild `--external:@cosyte/*`,
|
|
66
|
+
Rollup and Vite `external`, webpack `externals`) and install them beside the bundle.
|
|
61
67
|
|
|
62
68
|
`@cosyte/hl7`, `@cosyte/fhir`, `@cosyte/ccda`, `@cosyte/x12`, `@cosyte/ncpdp`, `@cosyte/astm`, and
|
|
63
69
|
`@cosyte/deid` are **optional peer dependencies**, each needed only for its subpath (`@cosyte/synth/hl7`,
|
package/dist/astm/index.cjs
CHANGED
|
@@ -666,7 +666,10 @@ function buildResultInput(options) {
|
|
|
666
666
|
records.push({ type: "C", source: "L", text: rng.pick(ASTM_COMMENT_TEXT), commentType: "G" });
|
|
667
667
|
}
|
|
668
668
|
return {
|
|
669
|
-
|
|
669
|
+
// H.3 (message control id) and H.4 (access password) stay empty; H.5 is the sender name. H.6 to
|
|
670
|
+
// H.11 stay empty, and H.12, the processing ID, is `T` (training), never `P` (production): every
|
|
671
|
+
// message says it is test data in the field the standard gives for it.
|
|
672
|
+
header: { fields: ["", "", head.sender, "", "", "", "", "", "", "T"] },
|
|
670
673
|
records,
|
|
671
674
|
terminationCode: "N"
|
|
672
675
|
};
|