ezmedicationinput 0.2.0 → 0.3.0-beta.1
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 +201 -10
- package/dist/adapters/canonical-course.d.ts +128 -0
- package/dist/adapters/r5-course.d.ts +24 -0
- package/dist/advice.d.ts +36 -5
- package/dist/body-site-lookup.d.ts +3 -0
- package/dist/body-site-spatial.d.ts +6 -2
- package/dist/body-site-target.d.ts +9 -3
- package/dist/canonical/compile.d.ts +79 -0
- package/dist/canonical/course.d.ts +352 -0
- package/dist/canonical/format-course.d.ts +36 -0
- package/dist/dosage-course.d.ts +294 -29
- package/dist/execution/calendar.d.ts +107 -0
- package/dist/execution/engine.d.ts +11 -0
- package/dist/fhir-quantity-operator.d.ts +53 -0
- package/dist/fhir-translations.d.ts +5 -6
- package/dist/fhir.d.ts +99 -14
- package/dist/format.d.ts +105 -3
- package/dist/hpsg/constructions.d.ts +11 -3
- package/dist/hpsg/defaults.d.ts +2 -0
- package/dist/hpsg/lexical-classes.d.ts +115 -4
- package/dist/hpsg/procedural-context.d.ts +3 -3
- package/dist/hpsg/projection.d.ts +28 -1
- package/dist/hpsg/rule-context.d.ts +104 -7
- package/dist/hpsg/rules/clinical-quantity-rules.d.ts +16 -7
- package/dist/hpsg/rules/condition-rules.d.ts +0 -1
- package/dist/hpsg/rules/core-rules.d.ts +3 -0
- package/dist/hpsg/rules/instruction-rules.d.ts +2 -0
- package/dist/hpsg/rules/prn-rules.d.ts +3 -1
- package/dist/hpsg/rules/timing-rules.d.ts +17 -1
- package/dist/hpsg/signature.d.ts +13 -3
- package/dist/hpsg/unification.d.ts +3 -1
- package/dist/i18n.d.ts +37 -1
- package/dist/index.cjs +63500 -46393
- package/dist/index.d.ts +21 -9
- package/dist/index.js +63491 -46393
- package/dist/instruction-action-locale-adapter.d.ts +31 -3
- package/dist/instruction-action-terminology.d.ts +23 -3
- package/dist/instruction-concept-terminology.d.ts +7 -0
- package/dist/instruction-graph-fhir.d.ts +8 -2
- package/dist/instruction-graph.d.ts +80 -38
- package/dist/ir.d.ts +1 -1
- package/dist/lexer/surface-segmenter.d.ts +1 -1
- package/dist/lexer/surface.d.ts +1 -0
- package/dist/locale-detection.d.ts +3 -0
- package/dist/locales/course/en.d.ts +15 -0
- package/dist/locales/course/th.d.ts +12 -0
- package/dist/localization.d.ts +73 -0
- package/dist/maps.d.ts +10 -2
- package/dist/medication-condition.d.ts +1 -1
- package/dist/parser-state.d.ts +2 -2
- package/dist/regimen/grammar.d.ts +11 -0
- package/dist/regimen/parallel-course.d.ts +8 -41
- package/dist/regimen/regimen.d.ts +6 -2
- package/dist/relation-terminology.d.ts +1 -0
- package/dist/schedule.d.ts +14 -10
- package/dist/timing-summary.d.ts +82 -1
- package/dist/types.d.ts +510 -56
- package/dist/unit-lexicon.d.ts +7 -0
- package/dist/utils/text.d.ts +3 -0
- package/dist/utils/units.d.ts +19 -0
- package/package.json +1 -1
|
@@ -74,6 +74,7 @@ export declare function resolveActionRelationSurfaceCandidates(surface: string):
|
|
|
74
74
|
export declare function resolveActionRelationSurface(surface: string, preferredSemanticClasses?: readonly string[]): AdviceRelation | undefined;
|
|
75
75
|
export declare function resolveActionRelationSurfaceByGrammarFeature(surface: string, feature: keyof AdviceRelationGrammarFeatures): AdviceRelation | undefined;
|
|
76
76
|
export declare function resolveAdviceRelationSurface(surface: string): AdviceRelation | undefined;
|
|
77
|
+
/** Vocabulary definitions are borrowed under the immutable-output contract. */
|
|
77
78
|
export declare function getAdviceRelationDefinition(relation: AdviceRelation): AdviceRelationDefinition | undefined;
|
|
78
79
|
export declare function relationHasGrammarFeature(relation: AdviceRelation | undefined, feature: keyof AdviceRelationGrammarFeatures): boolean;
|
|
79
80
|
export declare function getUniqueAdviceRelationByGrammarFeature(feature: keyof AdviceRelationGrammarFeatures): AdviceRelation | undefined;
|
package/dist/schedule.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Public medication execution boundary.
|
|
3
|
+
*
|
|
4
|
+
* Accept the established R5/R6/batch inputs and normalize them ONCE to the
|
|
5
|
+
* canonical course. All calendar, phase, occurrence and supply semantics are
|
|
6
|
+
* implemented in execution/engine, which has no import/export dependency.
|
|
7
|
+
* Canonical callers bypass interchange completely.
|
|
8
|
+
*/
|
|
9
|
+
import type { FhirDosage, FhirR6DosageInstructionInput, ParseBatchResult, NextDueDoseOptions, TotalUnitsOptions, TotalUnitsResult } from "./types";
|
|
10
|
+
import type { CanonicalScheduleInput, CanonicalSupplyOptions } from "./canonical/course";
|
|
11
|
+
import { MedicationQuantityCalculationError } from "./execution/engine";
|
|
12
|
+
export { MedicationQuantityCalculationError };
|
|
13
|
+
export declare function nextDueDoses(input: FhirDosage | readonly FhirDosage[] | FhirR6DosageInstructionInput | ParseBatchResult | CanonicalScheduleInput, options: NextDueDoseOptions): string[];
|
|
14
|
+
export declare function calculateTotalUnits(options: TotalUnitsOptions | CanonicalSupplyOptions): TotalUnitsResult;
|
package/dist/timing-summary.d.ts
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
|
-
import { EventTiming, FhirDayOfWeek, FhirPeriodUnit } from "./types";
|
|
1
|
+
import { EventTiming, FhirDayOfWeek, FhirPeriodUnit, type ParseOptions } from "./types";
|
|
2
|
+
/** Exact standard timing identities shared by native compilation and wire
|
|
3
|
+
* projection. Local codes remain text unless this vocabulary recognizes them. */
|
|
4
|
+
export declare const FHIR_GTS_TIMING_SYSTEM = "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation";
|
|
5
|
+
export declare const FHIR_GTS_TIMING_CODES: Set<string>;
|
|
6
|
+
/** Supported standard identity for coding selection and wire projection. */
|
|
7
|
+
export declare function isStandardTimingCoding(coding: {
|
|
8
|
+
system?: string;
|
|
9
|
+
code?: string;
|
|
10
|
+
} | undefined): boolean;
|
|
11
|
+
/** Existing compact interval vocabulary applies to text and systemless codes. */
|
|
12
|
+
export declare function isCompactIntervalTimingCode(code: string): boolean;
|
|
13
|
+
/** Existing clinical preview abbreviations include shorthand such as QHS
|
|
14
|
+
* that is not emitted as a standard FHIR code. Foreign systems stay opaque. */
|
|
15
|
+
export declare function isPreviewTimingCoding(coding: {
|
|
16
|
+
system?: string;
|
|
17
|
+
code?: string;
|
|
18
|
+
} | undefined): boolean;
|
|
19
|
+
/** Prefer an understood cadence over a local translation without changing
|
|
20
|
+
* either coding or its authored order. Local-only concepts keep their first code. */
|
|
21
|
+
export declare function preferredTimingCoding<T extends {
|
|
22
|
+
system?: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
}>(timing: {
|
|
25
|
+
code?: {
|
|
26
|
+
coding?: readonly T[];
|
|
27
|
+
};
|
|
28
|
+
}, includePreview?: boolean): T | undefined;
|
|
29
|
+
/** Display-only coding is authored text, never an executable cadence. */
|
|
30
|
+
export declare function codeLessTimingDisplay(timing: {
|
|
31
|
+
code?: {
|
|
32
|
+
coding?: readonly {
|
|
33
|
+
code?: string;
|
|
34
|
+
display?: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
} | undefined): string | undefined;
|
|
38
|
+
/** Preview shorthand does not change execution's standard-code preference. */
|
|
39
|
+
export declare function preferredPreviewTimingCoding<T extends {
|
|
40
|
+
system?: string;
|
|
41
|
+
code?: string;
|
|
42
|
+
}>(timing: {
|
|
43
|
+
code?: {
|
|
44
|
+
coding?: readonly T[];
|
|
45
|
+
};
|
|
46
|
+
}): T | undefined;
|
|
47
|
+
/** Recognized daily cadence, independent of configured clock realization. */
|
|
48
|
+
export declare const TIMING_CODE_DAILY_FREQUENCIES: Readonly<Record<string, number>>;
|
|
49
|
+
/** Exact standard elapsed intervals, separate from daily clock codes and
|
|
50
|
+
* language-specific SIG abbreviation recognition. */
|
|
51
|
+
export declare const TIMING_CODE_HOURLY_PERIODS: Readonly<Record<string, number>>;
|
|
52
|
+
/** Exact elapsed scales used to compare a numeric cadence, without assigning
|
|
53
|
+
* calendar-month lengths or choosing clinic clocks. */
|
|
54
|
+
export declare const FIXED_TIMING_PERIOD_SECONDS: Readonly<Record<string, number>>;
|
|
55
|
+
/** One exact cadence comparison for execution and clinical preview. */
|
|
56
|
+
export declare function matchesDailyCodeCadence(daily: number, repeat: {
|
|
57
|
+
frequency?: number;
|
|
58
|
+
period?: number;
|
|
59
|
+
periodUnit?: string;
|
|
60
|
+
}): boolean;
|
|
61
|
+
/** Standard coding has its own clinical meaning; free SIG shorthand stays lexical. */
|
|
62
|
+
export declare function timingCodeMeaning(coding: {
|
|
63
|
+
system?: string;
|
|
64
|
+
code?: string;
|
|
65
|
+
} | undefined): string | undefined;
|
|
66
|
+
/** Emit a standard identity only when its meaning matches the parsed shorthand. */
|
|
67
|
+
export declare function standardTimingCodingFromSig(code: string | undefined): {
|
|
68
|
+
system: string;
|
|
69
|
+
code: string;
|
|
70
|
+
} | undefined;
|
|
71
|
+
/** Standard BED supplies an event anchor independently of the repeat cadence. */
|
|
72
|
+
export declare function timingPreviewDescriptor(code: string): import("./maps").FrequencyDescriptor;
|
|
73
|
+
/** Human previews also recognize existing SIG shorthand without treating it
|
|
74
|
+
* as a standard FHIR timing identity or changing its structured projection. */
|
|
75
|
+
export declare function intervalTimingPreviewDescriptor(code: string): {
|
|
76
|
+
period: number;
|
|
77
|
+
periodMax?: number;
|
|
78
|
+
periodUnit: FhirPeriodUnit;
|
|
79
|
+
} | undefined;
|
|
2
80
|
export interface TimingSummaryOptions {
|
|
81
|
+
/** Scoped vocabulary in the original parse/format request. Do not build
|
|
82
|
+
* any second registry or retain it on the canonical clinical course. */
|
|
83
|
+
instructionActionMap?: ParseOptions["instructionActionMap"];
|
|
3
84
|
realizationMode?: "normalized" | "roundtrip";
|
|
4
85
|
groupMealTimingsByRelation?: boolean;
|
|
5
86
|
includeTimesPerDaySummary?: boolean;
|