@cosyte/synth 0.0.7 → 0.0.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 +135 -17
- package/README.md +47 -45
- package/dist/astm/index.cjs +7 -7
- package/dist/astm/index.cjs.map +1 -1
- package/dist/astm/index.d.cts +47 -47
- package/dist/astm/index.d.ts +47 -47
- package/dist/astm/index.mjs +7 -7
- package/dist/astm/index.mjs.map +1 -1
- package/dist/ccda/index.cjs +15 -15
- package/dist/ccda/index.cjs.map +1 -1
- package/dist/ccda/index.d.cts +31 -31
- package/dist/ccda/index.d.ts +31 -31
- package/dist/ccda/index.mjs +15 -15
- package/dist/ccda/index.mjs.map +1 -1
- package/dist/deid/index.cjs +15 -15
- package/dist/deid/index.cjs.map +1 -1
- package/dist/deid/index.d.cts +37 -37
- package/dist/deid/index.d.ts +37 -37
- package/dist/deid/index.mjs +15 -15
- package/dist/deid/index.mjs.map +1 -1
- package/dist/{example-codes-DeXcnCSK.d.cts → example-codes-88f3_bQZ.d.cts} +8 -8
- package/dist/{example-codes-DeXcnCSK.d.ts → example-codes-88f3_bQZ.d.ts} +8 -8
- package/dist/fhir/index.cjs +12 -12
- package/dist/fhir/index.cjs.map +1 -1
- package/dist/fhir/index.d.cts +46 -46
- package/dist/fhir/index.d.ts +46 -46
- package/dist/fhir/index.mjs +12 -12
- package/dist/fhir/index.mjs.map +1 -1
- package/dist/hl7/index.cjs +6 -6
- package/dist/hl7/index.cjs.map +1 -1
- package/dist/hl7/index.d.cts +45 -45
- package/dist/hl7/index.d.ts +45 -45
- package/dist/hl7/index.mjs +6 -6
- package/dist/hl7/index.mjs.map +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -49
- package/dist/index.d.ts +49 -49
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/dist/ncpdp/index.cjs +3 -3
- package/dist/ncpdp/index.cjs.map +1 -1
- package/dist/ncpdp/index.d.cts +42 -42
- package/dist/ncpdp/index.d.ts +42 -42
- package/dist/ncpdp/index.mjs +3 -3
- package/dist/ncpdp/index.mjs.map +1 -1
- package/dist/{providers-OLz3zAc-.d.cts → providers-B9uVinAe.d.cts} +24 -24
- package/dist/{providers-OLz3zAc-.d.ts → providers-B9uVinAe.d.ts} +24 -24
- package/dist/{quirk-C9t9CkPS.d.ts → quirk-HZdznAkM.d.ts} +23 -23
- package/dist/{quirk-DYMDojVw.d.cts → quirk-IaHp4z7N.d.cts} +23 -23
- package/dist/x12/index.cjs +6 -6
- package/dist/x12/index.cjs.map +1 -1
- package/dist/x12/index.d.cts +44 -44
- package/dist/x12/index.d.ts +44 -44
- package/dist/x12/index.mjs +6 -6
- package/dist/x12/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/fhir/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FhirComplex, StructureDefinition, FhirNode } from '@cosyte/fhir';
|
|
2
|
-
import { C as Corpus, R as Rng, S as SyntheticName, a as SyntheticIdentifier, b as SyntheticAddress } from '../providers-
|
|
3
|
-
export { C as CodeConcept, E as EXAMPLE_ALLERGENS, a as EXAMPLE_ALLERGY_MANIFESTATIONS, b as EXAMPLE_CONDITIONS, c as EXAMPLE_DIAGNOSTIC_REPORTS, d as EXAMPLE_ENCOUNTER_CLASSES, e as EXAMPLE_ENCOUNTER_TYPES, f as EXAMPLE_ETHNICITY_CATEGORIES, g as EXAMPLE_LAB_OBSERVATIONS, h as EXAMPLE_MEDICATIONS, i as EXAMPLE_PROCEDURES, j as EXAMPLE_RACE_CATEGORIES, k as EXAMPLE_VACCINES, l as EXAMPLE_VITAL_SIGNS, Q as QuantConcept } from '../example-codes-
|
|
2
|
+
import { C as Corpus, R as Rng, S as SyntheticName, a as SyntheticIdentifier, b as SyntheticAddress } from '../providers-B9uVinAe.cjs';
|
|
3
|
+
export { C as CodeConcept, E as EXAMPLE_ALLERGENS, a as EXAMPLE_ALLERGY_MANIFESTATIONS, b as EXAMPLE_CONDITIONS, c as EXAMPLE_DIAGNOSTIC_REPORTS, d as EXAMPLE_ENCOUNTER_CLASSES, e as EXAMPLE_ENCOUNTER_TYPES, f as EXAMPLE_ETHNICITY_CATEGORIES, g as EXAMPLE_LAB_OBSERVATIONS, h as EXAMPLE_MEDICATIONS, i as EXAMPLE_PROCEDURES, j as EXAMPLE_RACE_CATEGORIES, k as EXAMPLE_VACCINES, l as EXAMPLE_VITAL_SIGNS, Q as QuantConcept } from '../example-codes-88f3_bQZ.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Synthetic FHIR R4 **`Patient`** generation
|
|
6
|
+
* Synthetic FHIR R4 **`Patient`** generation: the anchor of the US Core clinical spine. Built through
|
|
7
7
|
* `@cosyte/fhir`'s model constructors, every identity field drawn from the
|
|
8
8
|
* synthetic-safety providers. In `us-core` mode the resource claims US Core Patient via
|
|
9
9
|
* `meta.profile`, satisfies its required elements (`identifier` + `system` + `value`, `name`, `gender`),
|
|
@@ -19,7 +19,7 @@ interface GeneratePatientOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* The profile posture. `"base"` (default) emits a spec-clean base-R4 `Patient`; `"us-core"` adds the
|
|
21
21
|
* US Core `meta.profile` and the race/ethnicity/birthsex must-support extensions (the required
|
|
22
|
-
* elements
|
|
22
|
+
* elements, identifier/name/gender, are always present).
|
|
23
23
|
*/
|
|
24
24
|
readonly profile?: "base" | "us-core";
|
|
25
25
|
}
|
|
@@ -39,7 +39,7 @@ interface GeneratePatientOptions {
|
|
|
39
39
|
declare function generatePatient(options?: GeneratePatientOptions): FhirComplex;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Synthetic FHIR R4 **`Condition`** generation
|
|
42
|
+
* Synthetic FHIR R4 **`Condition`** generation: a US Core "Problems and Health Concerns" problem-list
|
|
43
43
|
* item. Built through `@cosyte/fhir`; the `code` comes from the license-clean SNOMED
|
|
44
44
|
* example pool, the `subject` from a supplied or derived synthetic Patient reference.
|
|
45
45
|
*
|
|
@@ -69,10 +69,10 @@ interface GenerateConditionOptions {
|
|
|
69
69
|
declare function generateCondition(options?: GenerateConditionOptions): FhirComplex;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* Synthetic FHIR R4 **`Observation`** generation
|
|
72
|
+
* Synthetic FHIR R4 **`Observation`** generation: US Core Laboratory Result and US Core Vital Signs. Built
|
|
73
73
|
* through `@cosyte/fhir`; `code` and the measured `valueQuantity` come from
|
|
74
74
|
* the license-clean LOINC/UCUM example pool, `subject` from a supplied or derived Patient reference.
|
|
75
|
-
* The measured value is drawn from the seeded generator within a structurally-sane band
|
|
75
|
+
* The measured value is drawn from the seeded generator within a structurally-sane band: it implies no
|
|
76
76
|
* real measurement.
|
|
77
77
|
*
|
|
78
78
|
* @module
|
|
@@ -114,7 +114,7 @@ declare function generateObservationLab(options?: GenerateObservationOptions): F
|
|
|
114
114
|
declare function generateVitalSign(options?: GenerateObservationOptions): FhirComplex;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Synthetic FHIR R4 **`MedicationRequest`** generation
|
|
117
|
+
* Synthetic FHIR R4 **`MedicationRequest`** generation: a US Core MedicationRequest with an inline
|
|
118
118
|
* `medicationCodeableConcept`. Built through `@cosyte/fhir`; the medication comes
|
|
119
119
|
* from the license-clean RxNorm example pool. US Core invariant `us-core-21` requires a `requester`
|
|
120
120
|
* whenever `intent = order`, so a synthetic requester reference is always emitted.
|
|
@@ -147,7 +147,7 @@ interface GenerateMedicationRequestOptions {
|
|
|
147
147
|
declare function generateMedicationRequest(options?: GenerateMedicationRequestOptions): FhirComplex;
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* Synthetic FHIR R4 **`Encounter`** generation
|
|
150
|
+
* Synthetic FHIR R4 **`Encounter`** generation: a US Core Encounter. Built through `@cosyte/fhir`'s model
|
|
151
151
|
* constructors; `class` and `type` come from the
|
|
152
152
|
* license-clean v3-ActCode / SNOMED example pools, `subject` from a supplied or derived synthetic
|
|
153
153
|
* Patient reference. The required elements (`status`, `class`, `type`, `subject`) are always present.
|
|
@@ -178,7 +178,7 @@ interface GenerateEncounterOptions {
|
|
|
178
178
|
declare function generateEncounter(options?: GenerateEncounterOptions): FhirComplex;
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* Synthetic FHIR R4 **`Immunization`** generation
|
|
181
|
+
* Synthetic FHIR R4 **`Immunization`** generation: a US Core Immunization. Built through `@cosyte/fhir`;
|
|
182
182
|
* `vaccineCode` comes from the license-clean CVX example
|
|
183
183
|
* pool, `patient` from a supplied or derived synthetic Patient reference. The required elements
|
|
184
184
|
* (`status`, `vaccineCode`, `patient`, `occurrenceDateTime`) are always present.
|
|
@@ -209,7 +209,7 @@ interface GenerateImmunizationOptions {
|
|
|
209
209
|
declare function generateImmunization(options?: GenerateImmunizationOptions): FhirComplex;
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* Synthetic FHIR R4 **`AllergyIntolerance`** generation
|
|
212
|
+
* Synthetic FHIR R4 **`AllergyIntolerance`** generation: a US Core AllergyIntolerance. Built through
|
|
213
213
|
* `@cosyte/fhir`; the allergen `code` and reaction
|
|
214
214
|
* `manifestation` come from the license-clean RxNorm/SNOMED example pools, `patient` from a supplied or
|
|
215
215
|
* derived synthetic Patient reference. `clinicalStatus` + `verificationStatus` are emitted together so
|
|
@@ -242,7 +242,7 @@ interface GenerateAllergyIntoleranceOptions {
|
|
|
242
242
|
declare function generateAllergyIntolerance(options?: GenerateAllergyIntoleranceOptions): FhirComplex;
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
|
-
* Synthetic FHIR R4 **`Procedure`** generation
|
|
245
|
+
* Synthetic FHIR R4 **`Procedure`** generation: a US Core Procedure. Built through `@cosyte/fhir`; the
|
|
246
246
|
* `code` comes from the license-clean SNOMED procedure
|
|
247
247
|
* example pool (never CPT), `subject` from a supplied or derived synthetic Patient
|
|
248
248
|
* reference. The required elements (`status`, `code`, `subject`) plus the must-support
|
|
@@ -274,7 +274,7 @@ interface GenerateProcedureOptions {
|
|
|
274
274
|
declare function generateProcedure(options?: GenerateProcedureOptions): FhirComplex;
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
|
-
* Synthetic FHIR R4 **`DiagnosticReport`** generation
|
|
277
|
+
* Synthetic FHIR R4 **`DiagnosticReport`** generation: the US Core DiagnosticReport Profile for
|
|
278
278
|
* Laboratory Results Reporting. Built through `@cosyte/fhir`;
|
|
279
279
|
* the report `code` comes from the license-clean LOINC example pool, `subject` from a supplied or
|
|
280
280
|
* derived synthetic Patient reference. The required `category` carries the profile's mandated `LAB`
|
|
@@ -311,7 +311,7 @@ interface GenerateDiagnosticReportOptions {
|
|
|
311
311
|
declare function generateDiagnosticReport(options?: GenerateDiagnosticReportOptions): FhirComplex;
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
* Synthetic FHIR R4 **`Bundle`** generation
|
|
314
|
+
* Synthetic FHIR R4 **`Bundle`** generation: a self-contained `collection`,
|
|
315
315
|
* `transaction`, or `document` Bundle assembling a synthetic US Core `Patient` and its full clinical
|
|
316
316
|
* spine (`Condition`, lab + vital-sign `Observation`s, `MedicationRequest`, `Encounter`,
|
|
317
317
|
* `Immunization`, `AllergyIntolerance`, `Procedure`, `DiagnosticReport`), wired by `urn:uuid:`
|
|
@@ -361,7 +361,7 @@ interface FhirCorpusOptions {
|
|
|
361
361
|
* resource is generated from a distinct sub-seed derived from the corpus seed and round-tripped through
|
|
362
362
|
* `@cosyte/fhir`; the per-artifact `warnings` record the validator's non-informational findings (empty
|
|
363
363
|
* ⇒ spec-clean, no US Core profiles supplied). Pass US Core `StructureDefinition`s to a per-resource
|
|
364
|
-
* {@link roundTrip} call to additionally assert profile conformance (BYO
|
|
364
|
+
* {@link roundTrip} call to additionally assert profile conformance (BYO, none is bundled).
|
|
365
365
|
*
|
|
366
366
|
* @param options - Seed, count, and the resource mix. See {@link FhirCorpusOptions}.
|
|
367
367
|
* @returns A deep-frozen {@link Corpus}.
|
|
@@ -375,7 +375,7 @@ interface FhirCorpusOptions {
|
|
|
375
375
|
declare function fhirCorpus(options: FhirCorpusOptions): Corpus;
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
* Synthetic FHIR R4 **`Composition`** generation
|
|
378
|
+
* Synthetic FHIR R4 **`Composition`** generation: the mandatory first resource of a `document` Bundle
|
|
379
379
|
* (FHIR invariant `bdl-11`), built through `@cosyte/fhir`.
|
|
380
380
|
* A Composition is a base-R4 resource (US Core 6.1.0 defines no Composition profile), so it is grounded
|
|
381
381
|
* against base FHIR R4; every reference it carries (`subject`, `author`, `custodian`, section `entry`s)
|
|
@@ -420,15 +420,15 @@ interface BuildCompositionInput {
|
|
|
420
420
|
declare function buildComposition(rng: Rng, input: BuildCompositionInput): FhirComplex;
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
|
-
* The **round-trip-through-the-parser harness** for FHIR
|
|
424
|
-
* generator. A generated resource is "spec-clean" only if `@cosyte/fhir
|
|
425
|
-
* `@cosyte/synth`'s own opinion
|
|
423
|
+
* The **round-trip-through-the-parser harness** for FHIR: the headline gate for the synthetic-fixture
|
|
424
|
+
* generator. A generated resource is "spec-clean" only if `@cosyte/fhir`, not
|
|
425
|
+
* `@cosyte/synth`'s own opinion, reads it back, validates it, and re-serializes it byte-identically.
|
|
426
426
|
* This harness serializes a generated resource, parses it back, validates it (optionally against
|
|
427
427
|
* supplied US Core / vendor `StructureDefinition`s), and re-serializes, reporting what the parser found
|
|
428
428
|
* so a false "spec-clean" claim cannot hide.
|
|
429
429
|
*
|
|
430
430
|
* `@cosyte/synth` bundles **no** profile content: to validate US Core conformance, a caller supplies
|
|
431
|
-
* the `StructureDefinition`s via {@link RoundTripOptions.profiles}
|
|
431
|
+
* the `StructureDefinition`s via {@link RoundTripOptions.profiles}, exactly the content-free posture of
|
|
432
432
|
* `@cosyte/fhir.validateResource({ profiles })`.
|
|
433
433
|
*
|
|
434
434
|
* @module
|
|
@@ -437,7 +437,7 @@ declare function buildComposition(rng: Rng, input: BuildCompositionInput): FhirC
|
|
|
437
437
|
/** Options for {@link roundTrip}. */
|
|
438
438
|
interface RoundTripOptions {
|
|
439
439
|
/**
|
|
440
|
-
* US Core / vendor profiles (`StructureDefinition`s) to validate against. **None is bundled
|
|
440
|
+
* US Core / vendor profiles (`StructureDefinition`s) to validate against. **None is bundled**: a
|
|
441
441
|
* caller supplies them (BYO), matching `@cosyte/fhir`'s content-free posture.
|
|
442
442
|
*/
|
|
443
443
|
readonly profiles?: readonly StructureDefinition[];
|
|
@@ -449,7 +449,7 @@ interface RoundTripResult {
|
|
|
449
449
|
/**
|
|
450
450
|
* The validation issue codes at `error`/`fatal` severity (empty ⇒ valid). `information`/`warning`
|
|
451
451
|
* findings (e.g. `MUST_SUPPORT_ABSENT`, `INVARIANT_UNCHECKED`, base `dom-6`) are advisory and are
|
|
452
|
-
* excluded here
|
|
452
|
+
* excluded here: they never make a resource invalid.
|
|
453
453
|
*/
|
|
454
454
|
readonly errors: readonly string[];
|
|
455
455
|
/** All non-informational issue codes (errors **and** warnings), for the `Corpus` artifact record. */
|
|
@@ -478,10 +478,10 @@ interface RoundTripResult {
|
|
|
478
478
|
declare function roundTrip(resource: FhirComplex, options?: RoundTripOptions): RoundTripResult;
|
|
479
479
|
|
|
480
480
|
/**
|
|
481
|
-
* Shared FHIR model-construction helpers
|
|
481
|
+
* Shared FHIR model-construction helpers: the small vocabulary every resource generator uses
|
|
482
482
|
* to build **through `@cosyte/fhir`'s own model constructors** (`complex` / `list` / `primitive` /
|
|
483
483
|
* `decimal`). A generated resource is a `FhirComplex` tree assembled here and serialized by
|
|
484
|
-
* `@cosyte/fhir`'s conservative writer, so it is **spec-clean by construction
|
|
484
|
+
* `@cosyte/fhir`'s conservative writer, so it is **spec-clean by construction**: the same mechanism
|
|
485
485
|
* that makes the parser's emit side spec-clean. Nothing here hand-writes JSON
|
|
486
486
|
* bytes.
|
|
487
487
|
*
|
|
@@ -493,7 +493,7 @@ declare function roundTrip(resource: FhirComplex, options?: RoundTripOptions): R
|
|
|
493
493
|
* @module
|
|
494
494
|
*/
|
|
495
495
|
|
|
496
|
-
/** A named FHIR property (`{ name, value }`)
|
|
496
|
+
/** A named FHIR property (`{ name, value }`): the shape `complex` consumes. */
|
|
497
497
|
type Prop = {
|
|
498
498
|
readonly name: string;
|
|
499
499
|
readonly value: FhirNode;
|
|
@@ -593,11 +593,11 @@ declare function codeableConcept(concept: {
|
|
|
593
593
|
declare function reference(ref: string): FhirComplex;
|
|
594
594
|
/**
|
|
595
595
|
* A generated `Narrative` (`text`) with `status: "generated"` and an XHTML `div` carrying only
|
|
596
|
-
* synthetic text
|
|
596
|
+
* synthetic text, satisfies the base `dom-6` best-practice constraint so a generated resource is
|
|
597
597
|
* robust as well as valid. The `div` is XHTML-namespaced and carries no markup beyond a paragraph, so
|
|
598
598
|
* it round-trips byte-for-byte through `@cosyte/fhir`'s codec.
|
|
599
599
|
*
|
|
600
|
-
* @param text - The plain synthetic summary text (no PHI
|
|
600
|
+
* @param text - The plain synthetic summary text (no PHI: it is composed from synthetic values).
|
|
601
601
|
* @returns A `Narrative` `FhirComplex`.
|
|
602
602
|
* @example
|
|
603
603
|
* ```ts
|
|
@@ -620,9 +620,9 @@ declare function narrative(text: string): FhirComplex;
|
|
|
620
620
|
* ```
|
|
621
621
|
*/
|
|
622
622
|
declare function meta(profiles: readonly string[]): FhirComplex;
|
|
623
|
-
/** A synthetic FHIR patient identity
|
|
623
|
+
/** A synthetic FHIR patient identity: every field drawn from `../safe`. */
|
|
624
624
|
interface FhirPatientIdentity {
|
|
625
|
-
/** A synthetic resource `id` (a seeded UUID)
|
|
625
|
+
/** A synthetic resource `id` (a seeded UUID), never a real record key. */
|
|
626
626
|
readonly id: string;
|
|
627
627
|
/** Name from the shipped fake-name pool. */
|
|
628
628
|
readonly person: SyntheticName;
|
|
@@ -653,7 +653,7 @@ interface FhirPatientIdentity {
|
|
|
653
653
|
declare function toFhirDate(ymd: string): string;
|
|
654
654
|
/**
|
|
655
655
|
* Mint a complete synthetic {@link FhirPatientIdentity}. Every value comes from a synthetic-safety
|
|
656
|
-
* provider
|
|
656
|
+
* provider, no code path here can return a real or plausibly-real identifier. The draw
|
|
657
657
|
* order is fixed (id → name → MRN → DOB → gender → address → phone → email) so the same seed yields the
|
|
658
658
|
* same identity.
|
|
659
659
|
*
|
|
@@ -667,7 +667,7 @@ declare function toFhirDate(ymd: string): string;
|
|
|
667
667
|
*/
|
|
668
668
|
declare function fhirPatientIdentity(rng: Rng): FhirPatientIdentity;
|
|
669
669
|
/**
|
|
670
|
-
* The US Core Patient `identifier` element for a synthetic MRN
|
|
670
|
+
* The US Core Patient `identifier` element for a synthetic MRN: `type` (`MR`), the synthetic
|
|
671
671
|
* assigning-authority OID as `system`, and the synthetic value. Satisfies US Core Patient's required
|
|
672
672
|
* `identifier.system` + `identifier.value`.
|
|
673
673
|
*
|
|
@@ -683,18 +683,18 @@ declare function fhirPatientIdentity(rng: Rng): FhirPatientIdentity;
|
|
|
683
683
|
declare function mrnIdentifier(mrn: SyntheticIdentifier): FhirComplex;
|
|
684
684
|
|
|
685
685
|
/**
|
|
686
|
-
* US Core + base-FHIR **canonical URLs and code-system identifiers
|
|
686
|
+
* US Core + base-FHIR **canonical URLs and code-system identifiers**: the facts `@cosyte/synth` needs
|
|
687
687
|
* to emit US-Core-conformant resources, and nothing more.
|
|
688
688
|
*
|
|
689
|
-
* **Content-free, exactly like `@cosyte/fhir`.** These are *identifiers
|
|
690
|
-
* `system` URIs
|
|
689
|
+
* **Content-free, exactly like `@cosyte/fhir`.** These are *identifiers*: canonical URLs and code
|
|
690
|
+
* `system` URIs, not the copyrighted terminology tables or the profile `StructureDefinition` content
|
|
691
691
|
* they name. `@cosyte/synth` bundles **no** US Core IG: a consumer who wants to *validate* generated
|
|
692
692
|
* output against US Core supplies the `StructureDefinition`s themselves (BYO), exactly as
|
|
693
693
|
* `@cosyte/fhir.validateResource({ profiles })` requires. What is encoded here is only which canonical
|
|
694
|
-
* URL a resource's `meta.profile` claims and which `system` a coding carries
|
|
694
|
+
* URL a resource's `meta.profile` claims and which `system` a coding carries: public facts.
|
|
695
695
|
*
|
|
696
696
|
* The URLs target **US Core 6.1.0** (the USCDI v3 / ONC HTI-1 §170.315(g)(10) anchor, FHIR R4 4.0.1),
|
|
697
|
-
* grounded firsthand against the published IG (`hl7.org/fhir/us/core/STU6.1`)
|
|
697
|
+
* grounded firsthand against the published IG (`hl7.org/fhir/us/core/STU6.1`): the same version the
|
|
698
698
|
* test corpus validates against.
|
|
699
699
|
*
|
|
700
700
|
* @module
|
|
@@ -730,7 +730,7 @@ declare const US_CORE_ETHNICITY_EXTENSION = "http://hl7.org/fhir/us/core/Structu
|
|
|
730
730
|
declare const US_CORE_BIRTHSEX_EXTENSION = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex";
|
|
731
731
|
/**
|
|
732
732
|
* The code-system `system` URIs the generators reference. Public identity URIs (HL7-published),
|
|
733
|
-
* never the code-system *content
|
|
733
|
+
* never the code-system *content*, no SNOMED/LOINC/RxNorm table is bundled.
|
|
734
734
|
*/
|
|
735
735
|
declare const SYSTEM: Readonly<{
|
|
736
736
|
/** FHIR `administrative-gender` (`Patient.gender`). */
|
|
@@ -747,23 +747,23 @@ declare const SYSTEM: Readonly<{
|
|
|
747
747
|
readonly IDENTIFIER_TYPE: "http://terminology.hl7.org/CodeSystem/v2-0203";
|
|
748
748
|
/** OMB race & ethnicity category system (US Core race/ethnicity `ombCategory`). */
|
|
749
749
|
readonly OMB_RACE_ETHNICITY: "urn:oid:2.16.840.1.113883.6.238";
|
|
750
|
-
/** LOINC
|
|
750
|
+
/** LOINC, `Observation.code` (lab + vital-signs). */
|
|
751
751
|
readonly LOINC: "http://loinc.org";
|
|
752
|
-
/** SNOMED CT
|
|
752
|
+
/** SNOMED CT, `Condition.code`. */
|
|
753
753
|
readonly SNOMED: "http://snomed.info/sct";
|
|
754
|
-
/** RxNorm
|
|
754
|
+
/** RxNorm, `MedicationRequest.medicationCodeableConcept` + an allergen substance. */
|
|
755
755
|
readonly RXNORM: "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
756
|
-
/** UCUM
|
|
756
|
+
/** UCUM, `Quantity.system` for units of measure. */
|
|
757
757
|
readonly UCUM: "http://unitsofmeasure.org";
|
|
758
|
-
/** CVX (CDC vaccine administered)
|
|
758
|
+
/** CVX (CDC vaccine administered), `Immunization.vaccineCode`. */
|
|
759
759
|
readonly CVX: "http://hl7.org/fhir/sid/cvx";
|
|
760
|
-
/** HL7 v3 `ActCode
|
|
760
|
+
/** HL7 v3 `ActCode`, `Encounter.class`. */
|
|
761
761
|
readonly V3_ACT_CODE: "http://terminology.hl7.org/CodeSystem/v3-ActCode";
|
|
762
|
-
/** HL7 v2 `0074` diagnostic-service-section
|
|
762
|
+
/** HL7 v2 `0074` diagnostic-service-section, `DiagnosticReport.category` (`LAB`). */
|
|
763
763
|
readonly DIAGNOSTIC_SERVICE_SECTION: "http://terminology.hl7.org/CodeSystem/v2-0074";
|
|
764
|
-
/** HL7 Terminology `allergyintolerance-clinical
|
|
764
|
+
/** HL7 Terminology `allergyintolerance-clinical`, `AllergyIntolerance.clinicalStatus`. */
|
|
765
765
|
readonly ALLERGY_CLINICAL: "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical";
|
|
766
|
-
/** HL7 Terminology `allergyintolerance-verification
|
|
766
|
+
/** HL7 Terminology `allergyintolerance-verification`, `AllergyIntolerance.verificationStatus`. */
|
|
767
767
|
readonly ALLERGY_VERIFICATION: "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification";
|
|
768
768
|
}>;
|
|
769
769
|
/** A US Core profile canonical URL. */
|
package/dist/fhir/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FhirComplex, StructureDefinition, FhirNode } from '@cosyte/fhir';
|
|
2
|
-
import { C as Corpus, R as Rng, S as SyntheticName, a as SyntheticIdentifier, b as SyntheticAddress } from '../providers-
|
|
3
|
-
export { C as CodeConcept, E as EXAMPLE_ALLERGENS, a as EXAMPLE_ALLERGY_MANIFESTATIONS, b as EXAMPLE_CONDITIONS, c as EXAMPLE_DIAGNOSTIC_REPORTS, d as EXAMPLE_ENCOUNTER_CLASSES, e as EXAMPLE_ENCOUNTER_TYPES, f as EXAMPLE_ETHNICITY_CATEGORIES, g as EXAMPLE_LAB_OBSERVATIONS, h as EXAMPLE_MEDICATIONS, i as EXAMPLE_PROCEDURES, j as EXAMPLE_RACE_CATEGORIES, k as EXAMPLE_VACCINES, l as EXAMPLE_VITAL_SIGNS, Q as QuantConcept } from '../example-codes-
|
|
2
|
+
import { C as Corpus, R as Rng, S as SyntheticName, a as SyntheticIdentifier, b as SyntheticAddress } from '../providers-B9uVinAe.js';
|
|
3
|
+
export { C as CodeConcept, E as EXAMPLE_ALLERGENS, a as EXAMPLE_ALLERGY_MANIFESTATIONS, b as EXAMPLE_CONDITIONS, c as EXAMPLE_DIAGNOSTIC_REPORTS, d as EXAMPLE_ENCOUNTER_CLASSES, e as EXAMPLE_ENCOUNTER_TYPES, f as EXAMPLE_ETHNICITY_CATEGORIES, g as EXAMPLE_LAB_OBSERVATIONS, h as EXAMPLE_MEDICATIONS, i as EXAMPLE_PROCEDURES, j as EXAMPLE_RACE_CATEGORIES, k as EXAMPLE_VACCINES, l as EXAMPLE_VITAL_SIGNS, Q as QuantConcept } from '../example-codes-88f3_bQZ.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Synthetic FHIR R4 **`Patient`** generation
|
|
6
|
+
* Synthetic FHIR R4 **`Patient`** generation: the anchor of the US Core clinical spine. Built through
|
|
7
7
|
* `@cosyte/fhir`'s model constructors, every identity field drawn from the
|
|
8
8
|
* synthetic-safety providers. In `us-core` mode the resource claims US Core Patient via
|
|
9
9
|
* `meta.profile`, satisfies its required elements (`identifier` + `system` + `value`, `name`, `gender`),
|
|
@@ -19,7 +19,7 @@ interface GeneratePatientOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* The profile posture. `"base"` (default) emits a spec-clean base-R4 `Patient`; `"us-core"` adds the
|
|
21
21
|
* US Core `meta.profile` and the race/ethnicity/birthsex must-support extensions (the required
|
|
22
|
-
* elements
|
|
22
|
+
* elements, identifier/name/gender, are always present).
|
|
23
23
|
*/
|
|
24
24
|
readonly profile?: "base" | "us-core";
|
|
25
25
|
}
|
|
@@ -39,7 +39,7 @@ interface GeneratePatientOptions {
|
|
|
39
39
|
declare function generatePatient(options?: GeneratePatientOptions): FhirComplex;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Synthetic FHIR R4 **`Condition`** generation
|
|
42
|
+
* Synthetic FHIR R4 **`Condition`** generation: a US Core "Problems and Health Concerns" problem-list
|
|
43
43
|
* item. Built through `@cosyte/fhir`; the `code` comes from the license-clean SNOMED
|
|
44
44
|
* example pool, the `subject` from a supplied or derived synthetic Patient reference.
|
|
45
45
|
*
|
|
@@ -69,10 +69,10 @@ interface GenerateConditionOptions {
|
|
|
69
69
|
declare function generateCondition(options?: GenerateConditionOptions): FhirComplex;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* Synthetic FHIR R4 **`Observation`** generation
|
|
72
|
+
* Synthetic FHIR R4 **`Observation`** generation: US Core Laboratory Result and US Core Vital Signs. Built
|
|
73
73
|
* through `@cosyte/fhir`; `code` and the measured `valueQuantity` come from
|
|
74
74
|
* the license-clean LOINC/UCUM example pool, `subject` from a supplied or derived Patient reference.
|
|
75
|
-
* The measured value is drawn from the seeded generator within a structurally-sane band
|
|
75
|
+
* The measured value is drawn from the seeded generator within a structurally-sane band: it implies no
|
|
76
76
|
* real measurement.
|
|
77
77
|
*
|
|
78
78
|
* @module
|
|
@@ -114,7 +114,7 @@ declare function generateObservationLab(options?: GenerateObservationOptions): F
|
|
|
114
114
|
declare function generateVitalSign(options?: GenerateObservationOptions): FhirComplex;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Synthetic FHIR R4 **`MedicationRequest`** generation
|
|
117
|
+
* Synthetic FHIR R4 **`MedicationRequest`** generation: a US Core MedicationRequest with an inline
|
|
118
118
|
* `medicationCodeableConcept`. Built through `@cosyte/fhir`; the medication comes
|
|
119
119
|
* from the license-clean RxNorm example pool. US Core invariant `us-core-21` requires a `requester`
|
|
120
120
|
* whenever `intent = order`, so a synthetic requester reference is always emitted.
|
|
@@ -147,7 +147,7 @@ interface GenerateMedicationRequestOptions {
|
|
|
147
147
|
declare function generateMedicationRequest(options?: GenerateMedicationRequestOptions): FhirComplex;
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* Synthetic FHIR R4 **`Encounter`** generation
|
|
150
|
+
* Synthetic FHIR R4 **`Encounter`** generation: a US Core Encounter. Built through `@cosyte/fhir`'s model
|
|
151
151
|
* constructors; `class` and `type` come from the
|
|
152
152
|
* license-clean v3-ActCode / SNOMED example pools, `subject` from a supplied or derived synthetic
|
|
153
153
|
* Patient reference. The required elements (`status`, `class`, `type`, `subject`) are always present.
|
|
@@ -178,7 +178,7 @@ interface GenerateEncounterOptions {
|
|
|
178
178
|
declare function generateEncounter(options?: GenerateEncounterOptions): FhirComplex;
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* Synthetic FHIR R4 **`Immunization`** generation
|
|
181
|
+
* Synthetic FHIR R4 **`Immunization`** generation: a US Core Immunization. Built through `@cosyte/fhir`;
|
|
182
182
|
* `vaccineCode` comes from the license-clean CVX example
|
|
183
183
|
* pool, `patient` from a supplied or derived synthetic Patient reference. The required elements
|
|
184
184
|
* (`status`, `vaccineCode`, `patient`, `occurrenceDateTime`) are always present.
|
|
@@ -209,7 +209,7 @@ interface GenerateImmunizationOptions {
|
|
|
209
209
|
declare function generateImmunization(options?: GenerateImmunizationOptions): FhirComplex;
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* Synthetic FHIR R4 **`AllergyIntolerance`** generation
|
|
212
|
+
* Synthetic FHIR R4 **`AllergyIntolerance`** generation: a US Core AllergyIntolerance. Built through
|
|
213
213
|
* `@cosyte/fhir`; the allergen `code` and reaction
|
|
214
214
|
* `manifestation` come from the license-clean RxNorm/SNOMED example pools, `patient` from a supplied or
|
|
215
215
|
* derived synthetic Patient reference. `clinicalStatus` + `verificationStatus` are emitted together so
|
|
@@ -242,7 +242,7 @@ interface GenerateAllergyIntoleranceOptions {
|
|
|
242
242
|
declare function generateAllergyIntolerance(options?: GenerateAllergyIntoleranceOptions): FhirComplex;
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
|
-
* Synthetic FHIR R4 **`Procedure`** generation
|
|
245
|
+
* Synthetic FHIR R4 **`Procedure`** generation: a US Core Procedure. Built through `@cosyte/fhir`; the
|
|
246
246
|
* `code` comes from the license-clean SNOMED procedure
|
|
247
247
|
* example pool (never CPT), `subject` from a supplied or derived synthetic Patient
|
|
248
248
|
* reference. The required elements (`status`, `code`, `subject`) plus the must-support
|
|
@@ -274,7 +274,7 @@ interface GenerateProcedureOptions {
|
|
|
274
274
|
declare function generateProcedure(options?: GenerateProcedureOptions): FhirComplex;
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
|
-
* Synthetic FHIR R4 **`DiagnosticReport`** generation
|
|
277
|
+
* Synthetic FHIR R4 **`DiagnosticReport`** generation: the US Core DiagnosticReport Profile for
|
|
278
278
|
* Laboratory Results Reporting. Built through `@cosyte/fhir`;
|
|
279
279
|
* the report `code` comes from the license-clean LOINC example pool, `subject` from a supplied or
|
|
280
280
|
* derived synthetic Patient reference. The required `category` carries the profile's mandated `LAB`
|
|
@@ -311,7 +311,7 @@ interface GenerateDiagnosticReportOptions {
|
|
|
311
311
|
declare function generateDiagnosticReport(options?: GenerateDiagnosticReportOptions): FhirComplex;
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
* Synthetic FHIR R4 **`Bundle`** generation
|
|
314
|
+
* Synthetic FHIR R4 **`Bundle`** generation: a self-contained `collection`,
|
|
315
315
|
* `transaction`, or `document` Bundle assembling a synthetic US Core `Patient` and its full clinical
|
|
316
316
|
* spine (`Condition`, lab + vital-sign `Observation`s, `MedicationRequest`, `Encounter`,
|
|
317
317
|
* `Immunization`, `AllergyIntolerance`, `Procedure`, `DiagnosticReport`), wired by `urn:uuid:`
|
|
@@ -361,7 +361,7 @@ interface FhirCorpusOptions {
|
|
|
361
361
|
* resource is generated from a distinct sub-seed derived from the corpus seed and round-tripped through
|
|
362
362
|
* `@cosyte/fhir`; the per-artifact `warnings` record the validator's non-informational findings (empty
|
|
363
363
|
* ⇒ spec-clean, no US Core profiles supplied). Pass US Core `StructureDefinition`s to a per-resource
|
|
364
|
-
* {@link roundTrip} call to additionally assert profile conformance (BYO
|
|
364
|
+
* {@link roundTrip} call to additionally assert profile conformance (BYO, none is bundled).
|
|
365
365
|
*
|
|
366
366
|
* @param options - Seed, count, and the resource mix. See {@link FhirCorpusOptions}.
|
|
367
367
|
* @returns A deep-frozen {@link Corpus}.
|
|
@@ -375,7 +375,7 @@ interface FhirCorpusOptions {
|
|
|
375
375
|
declare function fhirCorpus(options: FhirCorpusOptions): Corpus;
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
* Synthetic FHIR R4 **`Composition`** generation
|
|
378
|
+
* Synthetic FHIR R4 **`Composition`** generation: the mandatory first resource of a `document` Bundle
|
|
379
379
|
* (FHIR invariant `bdl-11`), built through `@cosyte/fhir`.
|
|
380
380
|
* A Composition is a base-R4 resource (US Core 6.1.0 defines no Composition profile), so it is grounded
|
|
381
381
|
* against base FHIR R4; every reference it carries (`subject`, `author`, `custodian`, section `entry`s)
|
|
@@ -420,15 +420,15 @@ interface BuildCompositionInput {
|
|
|
420
420
|
declare function buildComposition(rng: Rng, input: BuildCompositionInput): FhirComplex;
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
|
-
* The **round-trip-through-the-parser harness** for FHIR
|
|
424
|
-
* generator. A generated resource is "spec-clean" only if `@cosyte/fhir
|
|
425
|
-
* `@cosyte/synth`'s own opinion
|
|
423
|
+
* The **round-trip-through-the-parser harness** for FHIR: the headline gate for the synthetic-fixture
|
|
424
|
+
* generator. A generated resource is "spec-clean" only if `@cosyte/fhir`, not
|
|
425
|
+
* `@cosyte/synth`'s own opinion, reads it back, validates it, and re-serializes it byte-identically.
|
|
426
426
|
* This harness serializes a generated resource, parses it back, validates it (optionally against
|
|
427
427
|
* supplied US Core / vendor `StructureDefinition`s), and re-serializes, reporting what the parser found
|
|
428
428
|
* so a false "spec-clean" claim cannot hide.
|
|
429
429
|
*
|
|
430
430
|
* `@cosyte/synth` bundles **no** profile content: to validate US Core conformance, a caller supplies
|
|
431
|
-
* the `StructureDefinition`s via {@link RoundTripOptions.profiles}
|
|
431
|
+
* the `StructureDefinition`s via {@link RoundTripOptions.profiles}, exactly the content-free posture of
|
|
432
432
|
* `@cosyte/fhir.validateResource({ profiles })`.
|
|
433
433
|
*
|
|
434
434
|
* @module
|
|
@@ -437,7 +437,7 @@ declare function buildComposition(rng: Rng, input: BuildCompositionInput): FhirC
|
|
|
437
437
|
/** Options for {@link roundTrip}. */
|
|
438
438
|
interface RoundTripOptions {
|
|
439
439
|
/**
|
|
440
|
-
* US Core / vendor profiles (`StructureDefinition`s) to validate against. **None is bundled
|
|
440
|
+
* US Core / vendor profiles (`StructureDefinition`s) to validate against. **None is bundled**: a
|
|
441
441
|
* caller supplies them (BYO), matching `@cosyte/fhir`'s content-free posture.
|
|
442
442
|
*/
|
|
443
443
|
readonly profiles?: readonly StructureDefinition[];
|
|
@@ -449,7 +449,7 @@ interface RoundTripResult {
|
|
|
449
449
|
/**
|
|
450
450
|
* The validation issue codes at `error`/`fatal` severity (empty ⇒ valid). `information`/`warning`
|
|
451
451
|
* findings (e.g. `MUST_SUPPORT_ABSENT`, `INVARIANT_UNCHECKED`, base `dom-6`) are advisory and are
|
|
452
|
-
* excluded here
|
|
452
|
+
* excluded here: they never make a resource invalid.
|
|
453
453
|
*/
|
|
454
454
|
readonly errors: readonly string[];
|
|
455
455
|
/** All non-informational issue codes (errors **and** warnings), for the `Corpus` artifact record. */
|
|
@@ -478,10 +478,10 @@ interface RoundTripResult {
|
|
|
478
478
|
declare function roundTrip(resource: FhirComplex, options?: RoundTripOptions): RoundTripResult;
|
|
479
479
|
|
|
480
480
|
/**
|
|
481
|
-
* Shared FHIR model-construction helpers
|
|
481
|
+
* Shared FHIR model-construction helpers: the small vocabulary every resource generator uses
|
|
482
482
|
* to build **through `@cosyte/fhir`'s own model constructors** (`complex` / `list` / `primitive` /
|
|
483
483
|
* `decimal`). A generated resource is a `FhirComplex` tree assembled here and serialized by
|
|
484
|
-
* `@cosyte/fhir`'s conservative writer, so it is **spec-clean by construction
|
|
484
|
+
* `@cosyte/fhir`'s conservative writer, so it is **spec-clean by construction**: the same mechanism
|
|
485
485
|
* that makes the parser's emit side spec-clean. Nothing here hand-writes JSON
|
|
486
486
|
* bytes.
|
|
487
487
|
*
|
|
@@ -493,7 +493,7 @@ declare function roundTrip(resource: FhirComplex, options?: RoundTripOptions): R
|
|
|
493
493
|
* @module
|
|
494
494
|
*/
|
|
495
495
|
|
|
496
|
-
/** A named FHIR property (`{ name, value }`)
|
|
496
|
+
/** A named FHIR property (`{ name, value }`): the shape `complex` consumes. */
|
|
497
497
|
type Prop = {
|
|
498
498
|
readonly name: string;
|
|
499
499
|
readonly value: FhirNode;
|
|
@@ -593,11 +593,11 @@ declare function codeableConcept(concept: {
|
|
|
593
593
|
declare function reference(ref: string): FhirComplex;
|
|
594
594
|
/**
|
|
595
595
|
* A generated `Narrative` (`text`) with `status: "generated"` and an XHTML `div` carrying only
|
|
596
|
-
* synthetic text
|
|
596
|
+
* synthetic text, satisfies the base `dom-6` best-practice constraint so a generated resource is
|
|
597
597
|
* robust as well as valid. The `div` is XHTML-namespaced and carries no markup beyond a paragraph, so
|
|
598
598
|
* it round-trips byte-for-byte through `@cosyte/fhir`'s codec.
|
|
599
599
|
*
|
|
600
|
-
* @param text - The plain synthetic summary text (no PHI
|
|
600
|
+
* @param text - The plain synthetic summary text (no PHI: it is composed from synthetic values).
|
|
601
601
|
* @returns A `Narrative` `FhirComplex`.
|
|
602
602
|
* @example
|
|
603
603
|
* ```ts
|
|
@@ -620,9 +620,9 @@ declare function narrative(text: string): FhirComplex;
|
|
|
620
620
|
* ```
|
|
621
621
|
*/
|
|
622
622
|
declare function meta(profiles: readonly string[]): FhirComplex;
|
|
623
|
-
/** A synthetic FHIR patient identity
|
|
623
|
+
/** A synthetic FHIR patient identity: every field drawn from `../safe`. */
|
|
624
624
|
interface FhirPatientIdentity {
|
|
625
|
-
/** A synthetic resource `id` (a seeded UUID)
|
|
625
|
+
/** A synthetic resource `id` (a seeded UUID), never a real record key. */
|
|
626
626
|
readonly id: string;
|
|
627
627
|
/** Name from the shipped fake-name pool. */
|
|
628
628
|
readonly person: SyntheticName;
|
|
@@ -653,7 +653,7 @@ interface FhirPatientIdentity {
|
|
|
653
653
|
declare function toFhirDate(ymd: string): string;
|
|
654
654
|
/**
|
|
655
655
|
* Mint a complete synthetic {@link FhirPatientIdentity}. Every value comes from a synthetic-safety
|
|
656
|
-
* provider
|
|
656
|
+
* provider, no code path here can return a real or plausibly-real identifier. The draw
|
|
657
657
|
* order is fixed (id → name → MRN → DOB → gender → address → phone → email) so the same seed yields the
|
|
658
658
|
* same identity.
|
|
659
659
|
*
|
|
@@ -667,7 +667,7 @@ declare function toFhirDate(ymd: string): string;
|
|
|
667
667
|
*/
|
|
668
668
|
declare function fhirPatientIdentity(rng: Rng): FhirPatientIdentity;
|
|
669
669
|
/**
|
|
670
|
-
* The US Core Patient `identifier` element for a synthetic MRN
|
|
670
|
+
* The US Core Patient `identifier` element for a synthetic MRN: `type` (`MR`), the synthetic
|
|
671
671
|
* assigning-authority OID as `system`, and the synthetic value. Satisfies US Core Patient's required
|
|
672
672
|
* `identifier.system` + `identifier.value`.
|
|
673
673
|
*
|
|
@@ -683,18 +683,18 @@ declare function fhirPatientIdentity(rng: Rng): FhirPatientIdentity;
|
|
|
683
683
|
declare function mrnIdentifier(mrn: SyntheticIdentifier): FhirComplex;
|
|
684
684
|
|
|
685
685
|
/**
|
|
686
|
-
* US Core + base-FHIR **canonical URLs and code-system identifiers
|
|
686
|
+
* US Core + base-FHIR **canonical URLs and code-system identifiers**: the facts `@cosyte/synth` needs
|
|
687
687
|
* to emit US-Core-conformant resources, and nothing more.
|
|
688
688
|
*
|
|
689
|
-
* **Content-free, exactly like `@cosyte/fhir`.** These are *identifiers
|
|
690
|
-
* `system` URIs
|
|
689
|
+
* **Content-free, exactly like `@cosyte/fhir`.** These are *identifiers*: canonical URLs and code
|
|
690
|
+
* `system` URIs, not the copyrighted terminology tables or the profile `StructureDefinition` content
|
|
691
691
|
* they name. `@cosyte/synth` bundles **no** US Core IG: a consumer who wants to *validate* generated
|
|
692
692
|
* output against US Core supplies the `StructureDefinition`s themselves (BYO), exactly as
|
|
693
693
|
* `@cosyte/fhir.validateResource({ profiles })` requires. What is encoded here is only which canonical
|
|
694
|
-
* URL a resource's `meta.profile` claims and which `system` a coding carries
|
|
694
|
+
* URL a resource's `meta.profile` claims and which `system` a coding carries: public facts.
|
|
695
695
|
*
|
|
696
696
|
* The URLs target **US Core 6.1.0** (the USCDI v3 / ONC HTI-1 §170.315(g)(10) anchor, FHIR R4 4.0.1),
|
|
697
|
-
* grounded firsthand against the published IG (`hl7.org/fhir/us/core/STU6.1`)
|
|
697
|
+
* grounded firsthand against the published IG (`hl7.org/fhir/us/core/STU6.1`): the same version the
|
|
698
698
|
* test corpus validates against.
|
|
699
699
|
*
|
|
700
700
|
* @module
|
|
@@ -730,7 +730,7 @@ declare const US_CORE_ETHNICITY_EXTENSION = "http://hl7.org/fhir/us/core/Structu
|
|
|
730
730
|
declare const US_CORE_BIRTHSEX_EXTENSION = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex";
|
|
731
731
|
/**
|
|
732
732
|
* The code-system `system` URIs the generators reference. Public identity URIs (HL7-published),
|
|
733
|
-
* never the code-system *content
|
|
733
|
+
* never the code-system *content*, no SNOMED/LOINC/RxNorm table is bundled.
|
|
734
734
|
*/
|
|
735
735
|
declare const SYSTEM: Readonly<{
|
|
736
736
|
/** FHIR `administrative-gender` (`Patient.gender`). */
|
|
@@ -747,23 +747,23 @@ declare const SYSTEM: Readonly<{
|
|
|
747
747
|
readonly IDENTIFIER_TYPE: "http://terminology.hl7.org/CodeSystem/v2-0203";
|
|
748
748
|
/** OMB race & ethnicity category system (US Core race/ethnicity `ombCategory`). */
|
|
749
749
|
readonly OMB_RACE_ETHNICITY: "urn:oid:2.16.840.1.113883.6.238";
|
|
750
|
-
/** LOINC
|
|
750
|
+
/** LOINC, `Observation.code` (lab + vital-signs). */
|
|
751
751
|
readonly LOINC: "http://loinc.org";
|
|
752
|
-
/** SNOMED CT
|
|
752
|
+
/** SNOMED CT, `Condition.code`. */
|
|
753
753
|
readonly SNOMED: "http://snomed.info/sct";
|
|
754
|
-
/** RxNorm
|
|
754
|
+
/** RxNorm, `MedicationRequest.medicationCodeableConcept` + an allergen substance. */
|
|
755
755
|
readonly RXNORM: "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
756
|
-
/** UCUM
|
|
756
|
+
/** UCUM, `Quantity.system` for units of measure. */
|
|
757
757
|
readonly UCUM: "http://unitsofmeasure.org";
|
|
758
|
-
/** CVX (CDC vaccine administered)
|
|
758
|
+
/** CVX (CDC vaccine administered), `Immunization.vaccineCode`. */
|
|
759
759
|
readonly CVX: "http://hl7.org/fhir/sid/cvx";
|
|
760
|
-
/** HL7 v3 `ActCode
|
|
760
|
+
/** HL7 v3 `ActCode`, `Encounter.class`. */
|
|
761
761
|
readonly V3_ACT_CODE: "http://terminology.hl7.org/CodeSystem/v3-ActCode";
|
|
762
|
-
/** HL7 v2 `0074` diagnostic-service-section
|
|
762
|
+
/** HL7 v2 `0074` diagnostic-service-section, `DiagnosticReport.category` (`LAB`). */
|
|
763
763
|
readonly DIAGNOSTIC_SERVICE_SECTION: "http://terminology.hl7.org/CodeSystem/v2-0074";
|
|
764
|
-
/** HL7 Terminology `allergyintolerance-clinical
|
|
764
|
+
/** HL7 Terminology `allergyintolerance-clinical`, `AllergyIntolerance.clinicalStatus`. */
|
|
765
765
|
readonly ALLERGY_CLINICAL: "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical";
|
|
766
|
-
/** HL7 Terminology `allergyintolerance-verification
|
|
766
|
+
/** HL7 Terminology `allergyintolerance-verification`, `AllergyIntolerance.verificationStatus`. */
|
|
767
767
|
readonly ALLERGY_VERIFICATION: "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification";
|
|
768
768
|
}>;
|
|
769
769
|
/** A US Core profile canonical URL. */
|
package/dist/fhir/index.mjs
CHANGED
|
@@ -35,11 +35,11 @@ function sfc32Next(s) {
|
|
|
35
35
|
var SYNTH_FATAL_CODES = {
|
|
36
36
|
/** An integer range was requested with its maximum below its minimum. Fatal. */
|
|
37
37
|
SYNTH_INVALID_RANGE: "SYNTH_INVALID_RANGE",
|
|
38
|
-
/** A value was drawn from an empty pool. Fatal
|
|
38
|
+
/** A value was drawn from an empty pool. Fatal, never a fabricated substitute. */
|
|
39
39
|
SYNTH_EMPTY_POOL: "SYNTH_EMPTY_POOL",
|
|
40
40
|
/**
|
|
41
41
|
* A caller-supplied selector (a message kind, a document type, a corpus mix entry, a claim
|
|
42
|
-
* variant, a Bundle type, a resource profile) is not in the closed set that governs it. Fatal
|
|
42
|
+
* variant, a Bundle type, a resource profile) is not in the closed set that governs it. Fatal:
|
|
43
43
|
* see `resolveKind`: a selector union is erased at run time, and a selector that falls through
|
|
44
44
|
* either mislabels the fixture or hands the value to a peer builder that quotes it back.
|
|
45
45
|
*/
|
|
@@ -112,7 +112,7 @@ function createRng(seed) {
|
|
|
112
112
|
var SYNTHETIC_ASSIGNING_AUTHORITY = Object.freeze({
|
|
113
113
|
/** The human-readable assigning-authority namespace id (HL7 HD.1). */
|
|
114
114
|
namespaceId: "COSYTE-SYNTH",
|
|
115
|
-
/** The universal id
|
|
115
|
+
/** The universal id, an OID under HL7's example arc `2.16.840.1.113883.19` (HD.2). */
|
|
116
116
|
universalId: "2.16.840.1.113883.19.999",
|
|
117
117
|
/** The universal id type (HD.3). */
|
|
118
118
|
universalIdType: "ISO"
|
|
@@ -421,23 +421,23 @@ var SYSTEM = Object.freeze({
|
|
|
421
421
|
IDENTIFIER_TYPE: "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
422
422
|
/** OMB race & ethnicity category system (US Core race/ethnicity `ombCategory`). */
|
|
423
423
|
OMB_RACE_ETHNICITY: "urn:oid:2.16.840.1.113883.6.238",
|
|
424
|
-
/** LOINC
|
|
424
|
+
/** LOINC, `Observation.code` (lab + vital-signs). */
|
|
425
425
|
LOINC: "http://loinc.org",
|
|
426
|
-
/** SNOMED CT
|
|
426
|
+
/** SNOMED CT, `Condition.code`. */
|
|
427
427
|
SNOMED: "http://snomed.info/sct",
|
|
428
|
-
/** RxNorm
|
|
428
|
+
/** RxNorm, `MedicationRequest.medicationCodeableConcept` + an allergen substance. */
|
|
429
429
|
RXNORM: "http://www.nlm.nih.gov/research/umls/rxnorm",
|
|
430
|
-
/** UCUM
|
|
430
|
+
/** UCUM, `Quantity.system` for units of measure. */
|
|
431
431
|
UCUM: "http://unitsofmeasure.org",
|
|
432
|
-
/** CVX (CDC vaccine administered)
|
|
432
|
+
/** CVX (CDC vaccine administered), `Immunization.vaccineCode`. */
|
|
433
433
|
CVX: "http://hl7.org/fhir/sid/cvx",
|
|
434
|
-
/** HL7 v3 `ActCode
|
|
434
|
+
/** HL7 v3 `ActCode`, `Encounter.class`. */
|
|
435
435
|
V3_ACT_CODE: "http://terminology.hl7.org/CodeSystem/v3-ActCode",
|
|
436
|
-
/** HL7 v2 `0074` diagnostic-service-section
|
|
436
|
+
/** HL7 v2 `0074` diagnostic-service-section, `DiagnosticReport.category` (`LAB`). */
|
|
437
437
|
DIAGNOSTIC_SERVICE_SECTION: "http://terminology.hl7.org/CodeSystem/v2-0074",
|
|
438
|
-
/** HL7 Terminology `allergyintolerance-clinical
|
|
438
|
+
/** HL7 Terminology `allergyintolerance-clinical`, `AllergyIntolerance.clinicalStatus`. */
|
|
439
439
|
ALLERGY_CLINICAL: "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
|
|
440
|
-
/** HL7 Terminology `allergyintolerance-verification
|
|
440
|
+
/** HL7 Terminology `allergyintolerance-verification`, `AllergyIntolerance.verificationStatus`. */
|
|
441
441
|
ALLERGY_VERIFICATION: "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification"
|
|
442
442
|
});
|
|
443
443
|
|