ezmedicationinput 0.1.63 → 0.1.64
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/date-interpretation.d.ts +20 -0
- package/dist/fhir.d.ts +1 -0
- package/dist/hpsg/rule-context.d.ts +3 -0
- package/dist/hpsg/rules/timing-rules.d.ts +1 -0
- package/dist/hpsg/signature.d.ts +4 -1
- package/dist/index.cjs +2293 -1360
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2288 -1360
- package/dist/types.d.ts +71 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -326,8 +326,10 @@ export interface FhirTimingRepeat extends FhirElement {
|
|
|
326
326
|
/** Exact event offset in minutes. */
|
|
327
327
|
offset?: number;
|
|
328
328
|
}
|
|
329
|
-
export interface FhirTiming {
|
|
329
|
+
export interface FhirTiming extends FhirElement {
|
|
330
330
|
event?: string[];
|
|
331
|
+
/** Primitive metadata corresponding positionally to event. */
|
|
332
|
+
_event?: FhirPrimitiveElement[];
|
|
331
333
|
repeat?: FhirTimingRepeat;
|
|
332
334
|
code?: FhirCodeableConcept;
|
|
333
335
|
}
|
|
@@ -847,12 +849,58 @@ export interface InstructionSemanticResolverRequest {
|
|
|
847
849
|
existingGraph: CanonicalInstructionGraph;
|
|
848
850
|
}
|
|
849
851
|
export type InstructionSemanticResolver = (request: InstructionSemanticResolverRequest) => InstructionSemanticResolution | null | undefined | Promise<InstructionSemanticResolution | null | undefined>;
|
|
852
|
+
export type MedicationDateOrder = "DMY" | "MDY";
|
|
853
|
+
export interface MedicationDatePlausibleWindow {
|
|
854
|
+
/** Maximum inferred-year distance into the past. Defaults to 5 years. */
|
|
855
|
+
pastYears?: number;
|
|
856
|
+
/** Maximum inferred-year distance into the future. Defaults to 10 years. */
|
|
857
|
+
futureYears?: number;
|
|
858
|
+
}
|
|
859
|
+
export interface MedicationDatePolicy {
|
|
860
|
+
/** Enabled calendar resolver ids, in preference order. Defaults by detected locale. */
|
|
861
|
+
calendars?: string[];
|
|
862
|
+
/** Numeric date field order. Defaults to DMY for Thai and MDY for en-US. */
|
|
863
|
+
dateOrder?: MedicationDateOrder;
|
|
864
|
+
/** ISO date used to resolve two-digit years. Defaults to the current date. */
|
|
865
|
+
referenceDate?: string;
|
|
866
|
+
/** Plausibility window applied only to inferred two-digit years. */
|
|
867
|
+
plausibleWindow?: MedicationDatePlausibleWindow;
|
|
868
|
+
/** How to handle multiple valid calendar interpretations. Defaults to prefer-first. */
|
|
869
|
+
ambiguity?: "prefer-first" | "reject";
|
|
870
|
+
}
|
|
871
|
+
export interface MedicationDateResolverContext {
|
|
872
|
+
locale: string;
|
|
873
|
+
referenceDate: string;
|
|
874
|
+
}
|
|
875
|
+
export interface MedicationDateResolverResult {
|
|
876
|
+
/** Gregorian year used in the normalized ISO date. */
|
|
877
|
+
isoYear: number;
|
|
878
|
+
/** Full year in the resolver's source calendar. */
|
|
879
|
+
calendarYear: number;
|
|
880
|
+
/** Whether a two-digit source year was expanded. */
|
|
881
|
+
inferredYear: boolean;
|
|
882
|
+
}
|
|
883
|
+
export interface MedicationDateResolver {
|
|
884
|
+
/** Stable resolver/calendar id, e.g. gregory or buddhist. */
|
|
885
|
+
id: string;
|
|
886
|
+
resolveYear(sourceYear: number, sourceYearDigits: number, context: MedicationDateResolverContext): MedicationDateResolverResult | undefined;
|
|
887
|
+
/**
|
|
888
|
+
* Optional reverse mapping used when the source omitted a year and the
|
|
889
|
+
* parser inferred an ISO year from the reference date.
|
|
890
|
+
*/
|
|
891
|
+
calendarYearFromIsoYear?(isoYear: number): number | undefined;
|
|
892
|
+
}
|
|
850
893
|
export interface ParseOptions extends FormatOptions {
|
|
851
894
|
/**
|
|
852
895
|
* Optional medication context that assists with default unit inference.
|
|
853
896
|
* May be omitted or explicitly set to null when no contextual clues exist.
|
|
854
897
|
*/
|
|
855
898
|
context?: MedicationContext | null;
|
|
899
|
+
/**
|
|
900
|
+
* Advanced date interpretation overrides. Ordinary callers can omit this:
|
|
901
|
+
* locale-relevant calendar resolvers are enabled automatically.
|
|
902
|
+
*/
|
|
903
|
+
datePolicy?: MedicationDatePolicy;
|
|
856
904
|
routeMap?: Record<string, RouteCode>;
|
|
857
905
|
unitMap?: Record<string, string>;
|
|
858
906
|
/**
|
|
@@ -1029,6 +1077,22 @@ export interface CanonicalActivityTimingExpr {
|
|
|
1029
1077
|
/** Maximum offset from the activity in minutes. */
|
|
1030
1078
|
offsetMax?: number;
|
|
1031
1079
|
}
|
|
1080
|
+
export interface CanonicalCalendarEventExpr {
|
|
1081
|
+
/** Gregorian ISO calendar date used for date-only FHIR Timing.event values and display. */
|
|
1082
|
+
isoDate: string;
|
|
1083
|
+
/** Original timestamp-valued FHIR Timing.event value, retained losslessly when present. */
|
|
1084
|
+
fhirDateTime?: string;
|
|
1085
|
+
/** Resolver/calendar that interpreted the source year. */
|
|
1086
|
+
calendar: string;
|
|
1087
|
+
/** Full source-calendar year after any two-digit expansion. */
|
|
1088
|
+
calendarYear: number;
|
|
1089
|
+
month: number;
|
|
1090
|
+
day: number;
|
|
1091
|
+
/** Exact source fragment representing this event or inherited day. */
|
|
1092
|
+
sourceText: string;
|
|
1093
|
+
/** True when a two-digit source year was expanded using the reference date. */
|
|
1094
|
+
inferredYear?: boolean;
|
|
1095
|
+
}
|
|
1032
1096
|
export interface CanonicalScheduleExpr {
|
|
1033
1097
|
timingCode?: string;
|
|
1034
1098
|
count?: number;
|
|
@@ -1036,6 +1100,10 @@ export interface CanonicalScheduleExpr {
|
|
|
1036
1100
|
duration?: number;
|
|
1037
1101
|
durationMax?: number;
|
|
1038
1102
|
durationUnit?: FhirPeriodUnit;
|
|
1103
|
+
/** Earliest calendar date/time on which this schedule becomes active. */
|
|
1104
|
+
boundsStart?: string;
|
|
1105
|
+
/** Latest inclusive calendar date/time on which this schedule remains active. */
|
|
1106
|
+
boundsEnd?: string;
|
|
1039
1107
|
/** Duration of each administration occurrence, distinct from regimen bounds duration. */
|
|
1040
1108
|
administrationDuration?: number;
|
|
1041
1109
|
administrationDurationMax?: number;
|
|
@@ -1054,6 +1122,8 @@ export interface CanonicalScheduleExpr {
|
|
|
1054
1122
|
dayOfWeek?: FhirDayOfWeek[];
|
|
1055
1123
|
when?: EventTiming[];
|
|
1056
1124
|
timeOfDay?: string[];
|
|
1125
|
+
/** Explicit calendar occurrences, projected to FHIR Timing.event. */
|
|
1126
|
+
calendarEvents?: CanonicalCalendarEventExpr[];
|
|
1057
1127
|
activityTiming?: CanonicalActivityTimingExpr[];
|
|
1058
1128
|
occurrenceCap?: CanonicalOccurrenceCapExpr;
|
|
1059
1129
|
evidence?: CanonicalEvidence[];
|