ezmedicationinput 0.1.67 → 0.2.0

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.
Files changed (44) hide show
  1. package/README.md +25 -22
  2. package/dist/advice.d.ts +20 -0
  3. package/dist/body-site-grammar.d.ts +34 -1
  4. package/dist/date-interpretation.d.ts +2 -0
  5. package/dist/dosage-course.d.ts +188 -0
  6. package/dist/fhir.d.ts +144 -9
  7. package/dist/format.d.ts +9 -1
  8. package/dist/hpsg/constructions.d.ts +105 -0
  9. package/dist/hpsg/lexical-classes.d.ts +170 -1
  10. package/dist/hpsg/procedural-context.d.ts +15 -1
  11. package/dist/hpsg/projection.d.ts +10 -2
  12. package/dist/hpsg/rule-context.d.ts +13 -0
  13. package/dist/hpsg/rules/clinical-quantity-rules.d.ts +9 -0
  14. package/dist/hpsg/rules/condition-rules.d.ts +15 -0
  15. package/dist/hpsg/rules/core-rules.d.ts +29 -0
  16. package/dist/hpsg/rules/instruction-rules.d.ts +9 -1
  17. package/dist/hpsg/rules/timing-rules.d.ts +121 -7
  18. package/dist/hpsg/signature.d.ts +342 -4
  19. package/dist/hpsg/type-system.d.ts +16 -1
  20. package/dist/hpsg/unification.d.ts +1 -0
  21. package/dist/i18n.d.ts +2 -0
  22. package/dist/index.cjs +48961 -31422
  23. package/dist/index.d.ts +21 -5
  24. package/dist/index.js +48936 -31421
  25. package/dist/instruction-action-locale-adapter.d.ts +1 -0
  26. package/dist/instruction-action-terminology.d.ts +16 -1
  27. package/dist/instruction-concept-terminology.d.ts +1 -1
  28. package/dist/instruction-graph-fhir.d.ts +1 -1
  29. package/dist/instruction-graph.d.ts +38 -2
  30. package/dist/ir.d.ts +12 -1
  31. package/dist/maps.d.ts +15 -0
  32. package/dist/medication-condition.d.ts +42 -0
  33. package/dist/parser-state.d.ts +5 -1
  34. package/dist/parser.d.ts +5 -2
  35. package/dist/regimen/coordination-scope.d.ts +53 -0
  36. package/dist/regimen/grammar.d.ts +68 -0
  37. package/dist/regimen/parallel-course.d.ts +85 -0
  38. package/dist/regimen/planner.d.ts +19 -0
  39. package/dist/regimen/regimen.d.ts +66 -0
  40. package/dist/schedule.d.ts +9 -6
  41. package/dist/stable-structure.d.ts +23 -1
  42. package/dist/types.d.ts +433 -28
  43. package/dist/utils/strength.d.ts +16 -0
  44. package/package.json +3 -2
@@ -5,7 +5,23 @@ import { FhirRatio, FhirQuantity, MedicationContext } from "../types";
5
5
  export declare function parseStrength(strength: string, context?: MedicationContext): {
6
6
  strengthQuantity?: FhirQuantity;
7
7
  strengthRatio?: FhirRatio;
8
+ strengthComponents?: Array<{
9
+ strengthQuantity?: FhirQuantity;
10
+ strengthRatio?: FhirRatio;
11
+ }>;
8
12
  };
13
+ /**
14
+ * Retain each ingredient's strength separately. The names of the ingredients
15
+ * must come from the medication/product record, not from unnamed SIG numbers.
16
+ *
17
+ * Use this when parsing combination products: summing 875 mg + 125 mg as one
18
+ * active-ingredient strength would be clinically misleading.
19
+ * Returns null if any component cannot be parsed, not a partial ingredient set.
20
+ */
21
+ export declare function parseStrengthComponents(strength: string, context?: MedicationContext): Array<{
22
+ strengthQuantity?: FhirQuantity;
23
+ strengthRatio?: FhirRatio;
24
+ }> | null;
9
25
  /**
10
26
  * Internal helper to parse a strength string into a FHIR Ratio.
11
27
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ezmedicationinput",
3
- "version": "0.1.67",
4
- "description": "Parse concise medication sigs into FHIR R5 Dosage JSON",
3
+ "version": "0.2.0",
4
+ "description": "Parse clinician SIGs into extended R5-style dosages with strict R5 and R6 projections",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -19,6 +19,7 @@
19
19
  "build": "tsup && tsc -p tsconfig.types.json",
20
20
  "test": "vitest run --dir test",
21
21
  "bench:torture": "npm run build && node bench/real-world-torture.mjs",
22
+ "bench:r6-regression": "npm run build && node bench/compare-r6.mjs",
22
23
  "bench:adversarial": "npm run build && node bench/adversarial.mjs",
23
24
  "bench:roundtrip": "npm run build && node bench/roundtrip.mjs",
24
25
  "bench:suggest": "npm run build && node --expose-gc bench/suggest.mjs",