@cosyte/synth 0.1.4 → 0.1.5

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.
@@ -34,18 +34,59 @@ function sfc32Next(s) {
34
34
  }
35
35
 
36
36
  // src/codes.ts
37
- var SYNTH_FATAL_CODES = {
37
+ var SYNTH_FATAL_CODES = Object.freeze({
38
+ /**
39
+ * A format was requested that this build cannot generate through a real parser builder/serializer.
40
+ * Fatal, never a hand-written byte fallback.
41
+ *
42
+ * **No code path in this build raises it.** All six formats generate, so it is reserved for a
43
+ * future format that does not, and is kept because removing a published code is a breaking change.
44
+ * An unsupported *kind* within a format that does generate is `SYNTH_UNSUPPORTED_KIND`.
45
+ */
46
+ SYNTH_UNSUPPORTED_FORMAT: "SYNTH_UNSUPPORTED_FORMAT",
47
+ /**
48
+ * A vendor quirk was requested that the target format's profile system does not support. Fatal,
49
+ * never a silent no-op and never a fabricated quirk.
50
+ */
51
+ SYNTH_UNSUPPORTED_QUIRK: "SYNTH_UNSUPPORTED_QUIRK",
52
+ /**
53
+ * A quirk transform found no structural anchor to mutate, so the fixture would not carry the
54
+ * deviation it is labelled with. Fatal: a golden file that lies about its parser verdict is worse
55
+ * than no golden file.
56
+ */
57
+ SYNTH_QUIRK_ANCHOR_ABSENT: "SYNTH_QUIRK_ANCHOR_ABSENT",
58
+ /**
59
+ * A bare parse of a freshly-generated quirk artifact did not produce exactly the declared intended
60
+ * warning code(s). Fatal, never emit a mislabeled fixture.
61
+ */
62
+ SYNTH_INTENDED_WARNING_MISMATCH: "SYNTH_INTENDED_WARNING_MISMATCH",
63
+ /** A concept's code-system URI has no OID mapping in the C-CDA example-code table. Fatal. */
64
+ SYNTH_UNMAPPED_CODE_SYSTEM: "SYNTH_UNMAPPED_CODE_SYSTEM",
65
+ /** A money value could not be read as an X12 decimal. Fatal: a generator never rounds to a float. */
66
+ SYNTH_INVALID_DECIMAL: "SYNTH_INVALID_DECIMAL",
38
67
  /** An integer range was requested with its maximum below its minimum. Fatal. */
39
68
  SYNTH_INVALID_RANGE: "SYNTH_INVALID_RANGE",
40
69
  /** A value was drawn from an empty pool. Fatal, never a fabricated substitute. */
41
70
  SYNTH_EMPTY_POOL: "SYNTH_EMPTY_POOL",
71
+ /** A `defineSynthProfile` spec was not usable (a missing or blank `name`). Fatal. */
72
+ SYNTH_INVALID_PROFILE: "SYNTH_INVALID_PROFILE",
42
73
  /**
43
74
  * A caller-supplied selector (a message kind, a document type, a corpus mix entry, a claim
44
75
  * variant, a Bundle type, a resource profile) is not in the closed set that governs it. Fatal:
45
76
  * see `resolveKind`: a selector union is erased at run time, and a selector that falls through
46
77
  * either mislabels the fixture or hands the value to a peer builder that quotes it back.
47
78
  */
48
- SYNTH_UNSUPPORTED_KIND: "SYNTH_UNSUPPORTED_KIND"};
79
+ SYNTH_UNSUPPORTED_KIND: "SYNTH_UNSUPPORTED_KIND",
80
+ /**
81
+ * A requested profile IS published by the adopted implementation guide, and this build does not
82
+ * generate it. Deliberately distinct from `SYNTH_UNSUPPORTED_KIND`, which says the name is not in
83
+ * the adopted set at all: "the guide does not publish this" and "we do not generate this yet" are
84
+ * different answers, and a caller building to a regulatory profile set has to be able to tell them
85
+ * apart without matching message text. Fatal, and raised **before** anything is generated: a
86
+ * mislabelled artifact is worse than no artifact.
87
+ */
88
+ SYNTH_PROFILE_NOT_GENERATED: "SYNTH_PROFILE_NOT_GENERATED"
89
+ });
49
90
  var SYNTH_FATAL_MESSAGES = Object.freeze({
50
91
  SYNTH_UNSUPPORTED_FORMAT: "The requested format is not generable by this build. A generator has no byte fallback: it builds through a parser's own serializer or it refuses.",
51
92
  SYNTH_UNSUPPORTED_QUIRK: "The requested vendor quirk is not in the target format's quirk registry. Compare the request against that format's exported registry (HL7_QUIRKS, CCDA_QUIRKS, ASTM_QUIRKS).",
@@ -467,18 +508,20 @@ function ncpdpScriptRouting(rng) {
467
508
  }
468
509
 
469
510
  // src/ncpdp/example-codes.ts
470
- var EXAMPLE_DRUGS = Object.freeze([
471
- { description: "Amoxicillin 500 MG Oral Capsule", ndc: "00000010101", form: "EA" },
472
- { description: "Lisinopril 10 MG Oral Tablet", ndc: "00000020202", form: "EA" },
473
- { description: "Atorvastatin 20 MG Oral Tablet", ndc: "00000030303", form: "EA" },
474
- { description: "Metformin 500 MG Oral Tablet", ndc: "00000040404", form: "EA" },
475
- { description: "Amlodipine 5 MG Oral Tablet", ndc: "00000050505", form: "EA" },
476
- { description: "Omeprazole 20 MG Delayed Release Capsule", ndc: "00000060606", form: "EA" },
477
- { description: "Levothyroxine 50 MCG Oral Tablet", ndc: "00000070707", form: "EA" },
478
- { description: "Azithromycin 250 MG Oral Tablet", ndc: "00000080808", form: "EA" },
479
- { description: "Sertraline 50 MG Oral Tablet", ndc: "00000090909", form: "EA" },
480
- { description: "Albuterol 90 MCG Metered Dose Inhaler", ndc: "00000101010", form: "EA" }
481
- ]);
511
+ var EXAMPLE_DRUGS = Object.freeze(
512
+ [
513
+ { description: "Amoxicillin 500 MG Oral Capsule", ndc: "00000010101", form: "EA" },
514
+ { description: "Lisinopril 10 MG Oral Tablet", ndc: "00000020202", form: "EA" },
515
+ { description: "Atorvastatin 20 MG Oral Tablet", ndc: "00000030303", form: "EA" },
516
+ { description: "Metformin 500 MG Oral Tablet", ndc: "00000040404", form: "EA" },
517
+ { description: "Amlodipine 5 MG Oral Tablet", ndc: "00000050505", form: "EA" },
518
+ { description: "Omeprazole 20 MG Delayed Release Capsule", ndc: "00000060606", form: "EA" },
519
+ { description: "Levothyroxine 50 MCG Oral Tablet", ndc: "00000070707", form: "EA" },
520
+ { description: "Azithromycin 250 MG Oral Tablet", ndc: "00000080808", form: "EA" },
521
+ { description: "Sertraline 50 MG Oral Tablet", ndc: "00000090909", form: "EA" },
522
+ { description: "Albuterol 90 MCG Metered Dose Inhaler", ndc: "00000101010", form: "EA" }
523
+ ].map((entry) => Object.freeze(entry))
524
+ );
482
525
  var EXAMPLE_SIG_TEXT = Object.freeze([
483
526
  "Take 1 tablet by mouth once daily",
484
527
  "Take 1 capsule by mouth twice daily with food",