ezmedicationinput 0.1.43 → 0.1.45

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/README.md CHANGED
@@ -307,7 +307,7 @@ const result = await parseSigAsync("apply to {left temple} nightly", {
307
307
  text: "Scalp"
308
308
  },
309
309
  {
310
- coding: { system: "http://snomed.info/sct", code: "280447003", display: "Temple region of head" },
310
+ coding: { system: "http://snomed.info/sct", code: "450721000", display: "Temple region structure" },
311
311
  text: "Temple"
312
312
  }
313
313
  ];
@@ -375,6 +375,9 @@ You can specify the number of times (total count) the medication is supposed to
375
375
  combinations (e.g. `1x3` → breakfast/lunch/dinner). This also respects
376
376
  `context.mealRelation` when provided and only applies to schedules with four
377
377
  or fewer daily doses.
378
+ - `smartMealExpansionScope`: optional include/exclude overrides for route codes
379
+ and dosage forms. When omitted, smart meal expansion uses the built-in
380
+ default heuristic. Exclusions take precedence over includes.
378
381
  - `enableMealDashSyntax`: when `true`, enables shorthand meal-dose patterns
379
382
  such as `1-0-1`, `1-0-1 pc`, `10-12-0 ac`, and `1-0-0-1 ac`. The parser
380
383
  expands them into multiple dosage clauses aligned to breakfast/lunch/dinner
@@ -0,0 +1,16 @@
1
+ import { AdditionalInstructionDefinition, AdviceForce, AdviceFrame, FhirCoding, TextRange } from "./types";
2
+ export interface ParsedAdditionalInstruction {
3
+ text?: string;
4
+ coding?: FhirCoding & {
5
+ i18n?: Record<string, string>;
6
+ };
7
+ frames: AdviceFrame[];
8
+ }
9
+ export interface AdviceParseContext {
10
+ defaultPredicate: string;
11
+ defaultForce?: AdviceForce;
12
+ allowFreeTextFallback?: boolean;
13
+ }
14
+ export declare function parseAdditionalInstructions(sourceText: string, span: TextRange, context?: AdviceParseContext): ParsedAdditionalInstruction[];
15
+ export declare function findAdditionalInstructionDefinitionByCoding(system: string, code: string): AdditionalInstructionDefinition | undefined;
16
+ export declare function buildAdditionalInstructionFramesFromCoding(system: string, code: string, sourceText?: string, span?: TextRange): AdviceFrame[] | undefined;
@@ -0,0 +1,5 @@
1
+ import { FhirPrimitiveElement } from "./types";
2
+ export declare const FHIR_TRANSLATION_EXTENSION_URL = "http://hl7.org/fhir/StructureDefinition/translation";
3
+ export declare function clonePrimitiveElement(element: FhirPrimitiveElement | undefined): FhirPrimitiveElement | undefined;
4
+ export declare function buildTranslationPrimitiveElement(translations: Record<string, string> | undefined, base?: FhirPrimitiveElement): FhirPrimitiveElement | undefined;
5
+ export declare function getPrimitiveTranslation(element: FhirPrimitiveElement | undefined, locale: string | undefined): string | undefined;
package/dist/fhir.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { ParsedSigInternal } from "./internal-types";
2
- import { FhirDosage } from "./types";
3
- export declare function toFhir(internal: ParsedSigInternal): FhirDosage;
4
- export declare function internalFromFhir(dosage: FhirDosage): ParsedSigInternal;
1
+ import { ParserState } from "./parser-state";
2
+ import { CanonicalSigClause, FhirDosage } from "./types";
3
+ export declare function canonicalToFhir(clause: CanonicalSigClause, textOverride?: string): FhirDosage;
4
+ export declare function toFhir(state: ParserState): FhirDosage;
5
+ export declare function canonicalFromFhir(dosage: FhirDosage): CanonicalSigClause;
6
+ export declare function parserStateFromFhir(dosage: FhirDosage): ParserState;
package/dist/format.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { ParsedSigInternal } from "./internal-types";
1
+ import { ParserState } from "./parser-state";
2
2
  import type { SigLocalization } from "./i18n";
3
+ import { CanonicalSigClause } from "./types";
3
4
  import { type TimingSummaryOptions } from "./timing-summary";
4
- export declare function formatInternal(internal: ParsedSigInternal, style: "short" | "long", localization?: SigLocalization, options?: TimingSummaryOptions): string;
5
+ export declare function formatCanonicalClause(clause: CanonicalSigClause, style: "short" | "long", localization?: SigLocalization, options?: TimingSummaryOptions): string;
6
+ export declare function formatInternal(internal: ParserState, style: "short" | "long", localization?: SigLocalization, options?: TimingSummaryOptions): string;
package/dist/i18n.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ParsedSigInternal } from "./internal-types";
1
+ import { CanonicalSigClause } from "./types";
2
2
  export interface SigFormatContext {
3
3
  readonly style: "short" | "long";
4
- readonly internal: ParsedSigInternal;
4
+ readonly clause: CanonicalSigClause;
5
5
  readonly defaultText: string;
6
6
  readonly groupMealTimingsByRelation: boolean;
7
7
  readonly includeTimesPerDaySummary: boolean;