@cosyte/transform 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/dist/index.mjs CHANGED
@@ -5,16 +5,16 @@ import { randomUUID } from 'crypto';
5
5
  // src/diagnostics/codes.ts
6
6
  var ISSUE_CODES = {
7
7
  /** A v2 DTM/TS carried a time-of-day but no timezone offset. FHIR forbids time-without-zone, so
8
- * the value was reduced to date precision (or an explicit sender offset applied via options) —
8
+ * the value was reduced to date precision (or an explicit sender offset applied via options),
9
9
  * **never** a guessed UTC. */
10
10
  TRANSFORM_TIMESTAMP_NO_TIMEZONE: "TRANSFORM_TIMESTAMP_NO_TIMEZONE",
11
11
  /** A v2 DTM/TS could not be parsed into a valid FHIR date/time; no value was emitted. */
12
12
  TRANSFORM_TIMESTAMP_INVALID: "TRANSFORM_TIMESTAMP_INVALID",
13
13
  /** The assigning authority (HD) could not be resolved to a FHIR `Identifier.system` URI via the
14
- * NamingSystem registry. The identifier is emitted with its value and **no** system — a system URI
14
+ * NamingSystem registry. The identifier is emitted with its value and **no** system: a system URI
15
15
  * is **never** synthesized from HD.1 alone. */
16
16
  TRANSFORM_IDENTIFIER_SYSTEM_UNRESOLVED: "TRANSFORM_IDENTIFIER_SYSTEM_UNRESOLVED",
17
- /** A coded value could not be mapped to a FHIR concept — either it carried no coding-system context
17
+ /** A coded value could not be mapped to a FHIR concept: either it carried no coding-system context
18
18
  * (CWE.3 absent), or it is a table code the IG ConceptMap has **no target** for (e.g. an OBX-11/
19
19
  * OBR-25 result status the HL70085/HL70123 map does not carry, or an OBX-8 abnormal flag absent from
20
20
  * HL70078). The original code is preserved / the FHIR value left absent; **never** coerced to a
@@ -24,14 +24,14 @@ var ISSUE_CODES = {
24
24
  * be emitted. The code is preserved; a URI is **never** invented. */
25
25
  TRANSFORM_CODE_SYSTEM_UNRESOLVED: "TRANSFORM_CODE_SYSTEM_UNRESOLVED",
26
26
  /** A unit was not a valid UCUM code (or was not declared UCUM). It is preserved verbatim in
27
- * `Quantity.unit`; `Quantity.code`/`.system` are left absent — a UCUM code is **never** fabricated
27
+ * `Quantity.unit`; `Quantity.code`/`.system` are left absent: a UCUM code is **never** fabricated
28
28
  * and a magnitude is **never** converted. */
29
29
  TRANSFORM_UNIT_NOT_UCUM: "TRANSFORM_UNIT_NOT_UCUM",
30
- /** A v2 numeric value (NM) could not be represented as a FHIR `decimal` without altering it — e.g.
30
+ /** A v2 numeric value (NM) could not be represented as a FHIR `decimal` without altering it, e.g.
31
31
  * a leading `+`, a leading zero, or a trailing dot, which FHIR's `decimal` lexical form forbids. No
32
32
  * `Quantity` value is emitted rather than a canonicalized (and therefore altered) magnitude. */
33
33
  TRANSFORM_QUANTITY_VALUE_INVALID: "TRANSFORM_QUANTITY_VALUE_INVALID",
34
- /** A populated source element was not carried to its FHIR target and was dropped — either because
34
+ /** A populated source element was not carried to its FHIR target and was dropped, either because
35
35
  * the IG map defines no target, or because that target's conversion is **not implemented**
36
36
  * (e.g. XTN→ContactPoint telecom, PV1 participants). Surfaced here rather than silently discarded,
37
37
  * never a fabricated value. */
@@ -44,13 +44,13 @@ var ISSUE_CODES = {
44
44
  TRANSFORM_ADDRESS_USE_UNMAPPED: "TRANSFORM_ADDRESS_USE_UNMAPPED",
45
45
  /** The message's trigger event has no IG *message* map, so its resource graph was assembled from
46
46
  * the reusable IG *segment* maps rather than a message map. The graph is best-effort and flagged
47
- * as such — never a fabricated message map. */
47
+ * as such, never a fabricated message map. */
48
48
  TRANSFORM_SEGMENT_ASSEMBLED: "TRANSFORM_SEGMENT_ASSEMBLED",
49
49
  /** A produced FHIR resource failed `@cosyte/fhir` R4 structural validation and was **withheld**
50
- * from the bundle rather than emitted as a silently-invalid resource — the conservative-emit gate. */
50
+ * from the bundle rather than emitted as a silently-invalid resource: the conservative-emit gate. */
51
51
  TRANSFORM_RESOURCE_INVALID: "TRANSFORM_RESOURCE_INVALID",
52
52
  /** A FHIR-required element's value could not be faithfully derived from the source, so it was
53
- * emitted with a `data-absent-reason` extension (value `unknown`) rather than fabricated — e.g.
53
+ * emitted with a `data-absent-reason` extension (value `unknown`) rather than fabricated, e.g.
54
54
  * `MessageHeader.source.endpoint` from an MSH-3 application namespace that is not a URL. */
55
55
  TRANSFORM_REQUIRED_ELEMENT_UNKNOWN: "TRANSFORM_REQUIRED_ELEMENT_UNKNOWN"
56
56
  };
@@ -163,7 +163,7 @@ function renderIssue(i) {
163
163
  prop("severity", primitive(i.severity)),
164
164
  prop("code", primitive(fhirIssueTypeFor(i.code))),
165
165
  prop("details", details),
166
- // `diagnostics` carries the v2 source location — positional metadata, never a value.
166
+ // `diagnostics` carries the v2 source location: positional metadata, never a value.
167
167
  prop("diagnostics", primitive(i.v2Location))
168
168
  ];
169
169
  if (i.fhirPath !== void 0) {
@@ -1607,7 +1607,7 @@ var EMIT_SCHEMAS = Object.freeze([
1607
1607
  },
1608
1608
  {
1609
1609
  // Immunization: status (1..1 code), vaccineCode (1..1 CodeableConcept), patient (1..1 Reference), and
1610
- // occurrence[x] (1..1) are all required — the assembler only ever emits the occurrenceDateTime form, so
1610
+ // occurrence[x] (1..1) are all required, and the assembler only ever emits the occurrenceDateTime form, so
1611
1611
  // it is required here. An RXA with no groundable status/vaccine/occurrence, or no bundle Patient, is
1612
1612
  // withheld rather than emitted incomplete.
1613
1613
  type: "Immunization",
@@ -1619,7 +1619,7 @@ var EMIT_SCHEMAS = Object.freeze([
1619
1619
  }
1620
1620
  },
1621
1621
  {
1622
- // Appointment: status (1..1 code) and participant (1..* BackboneElement) are both required — an
1622
+ // Appointment: status (1..1 code) and participant (1..* BackboneElement) are both required, so an
1623
1623
  // Appointment whose SCH-25 status could not be grounded via HL70278, or that has no resolvable Patient
1624
1624
  // participant, is withheld rather than emitted with a guessed status or no participant.
1625
1625
  type: "Appointment",
@@ -1629,7 +1629,7 @@ var EMIT_SCHEMAS = Object.freeze([
1629
1629
  }
1630
1630
  },
1631
1631
  {
1632
- // DocumentReference: status (1..1 code) and content (1..* BackboneElement) are both required — a
1632
+ // DocumentReference: status (1..1 code) and content (1..* BackboneElement) are both required, so a
1633
1633
  // reference whose TXA-19 is not "AV" (no groundable status), or that carries no document body from its
1634
1634
  // OBX segments, is withheld rather than emitted with a guessed status or referencing nothing.
1635
1635
  type: "DocumentReference",
@@ -2645,7 +2645,7 @@ function toFhir(msg, opts = {}) {
2645
2645
  }
2646
2646
 
2647
2647
  // src/index.ts
2648
- var VERSION = "0.0.7";
2648
+ var VERSION = "0.0.8";
2649
2649
 
2650
2650
  export { ADDRESS_TYPE_MAP, ADDRESS_USE_MAP, ADMINISTRATIVE_GENDER_MAP, APPOINTMENT_STATUS_MAP, APPOINTMENT_TYPE_VALUE_MAP, DEFAULT_V2_CODE_SYSTEMS, DIAGNOSTIC_REPORT_STATUS_MAP, ENCOUNTER_CLASS_V3_MAP, ENCOUNTER_STATUS_MAP, FATAL_CODES, HL70078_INTERPRETATION_CODES, IG_MAPPED_ADT_TRIGGERS, IG_MAPPED_APPOINTMENT_TRIGGERS, IG_MAPPED_DOCUMENT_TRIGGERS, IG_MAPPED_IMMUNIZATION_TRIGGERS, IG_MAPPED_ORDER_TRIGGERS, IG_MAPPED_ORU_TRIGGERS, IMMUNIZATION_STATUS_MAP, ISSUE_CODES, ISSUE_REGISTRY, NAME_USE_MAP, OBSERVATION_STATUS_MAP, REQUEST_STATUS_MAP, ROUTE_VALUE_MAP, SERVICE_REQUEST_PRIORITY_MAP, SITE_VALUE_MAP, SUBSTITUTION_VALUE_MAP, TRANSFORM_ISSUE_SYSTEM, V2_0161_SYSTEM, V2_0162_SYSTEM, V2_0203_SYSTEM, V2_0277_SYSTEM, V2_0550_SYSTEM, V3_ROUTE_OF_ADMINISTRATION_SYSTEM, VERSION, codeableConceptFromTarget, createNamingSystem, fhirIssueTypeFor, issue, toFhir, toFhirAddress, toFhirCodeableConcept, toFhirCodeableConceptVia, toFhirDateTime, toFhirHumanName, toFhirIdentifier, toFhirQuantity, toOperationOutcome, translateBound };
2651
2651
  //# sourceMappingURL=index.mjs.map