ezmedicationinput 0.3.0-beta.1 → 0.3.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 +155 -10
- package/dist/adapters/canonical-course.d.ts +7 -4
- package/dist/adapters/r5-course.d.ts +11 -2
- package/dist/advice-locale-adapter.d.ts +24 -0
- package/dist/advice.d.ts +39 -3
- package/dist/body-site-grammar.d.ts +21 -2
- package/dist/body-site-lookup.d.ts +6 -1
- package/dist/body-site-spatial.d.ts +7 -1
- package/dist/body-site-target.d.ts +35 -3
- package/dist/canonical/compile.d.ts +22 -3
- package/dist/canonical/course.d.ts +43 -7
- package/dist/canonical/dosage-agreement.d.ts +84 -0
- package/dist/canonical/format-course.d.ts +4 -2
- package/dist/clause-tail-grammar.d.ts +2 -0
- package/dist/combine-multilingual-dosages.d.ts +32 -0
- package/dist/date-interpretation.d.ts +36 -2
- package/dist/dosage-course.d.ts +26 -17
- package/dist/event-timing-expression.d.ts +26 -1
- package/dist/execution/engine.d.ts +2 -1
- package/dist/fhir-quantity-operator.d.ts +37 -1
- package/dist/fhir-translations.d.ts +14 -1
- package/dist/fhir.d.ts +25 -5
- package/dist/format.d.ts +23 -24
- package/dist/hpsg/constructions.d.ts +27 -5
- package/dist/hpsg/lexical-classes.d.ts +94 -33
- package/dist/hpsg/method-lexicon.d.ts +3 -0
- package/dist/hpsg/procedural-context.d.ts +51 -3
- package/dist/hpsg/projection.d.ts +7 -3
- package/dist/hpsg/quantity-lexicon.d.ts +51 -0
- package/dist/hpsg/rule-context.d.ts +101 -33
- package/dist/hpsg/rules/clinical-quantity-rules.d.ts +1 -1
- package/dist/hpsg/rules/condition-rules.d.ts +13 -2
- package/dist/hpsg/rules/core-rules.d.ts +5 -2
- package/dist/hpsg/rules/prn-rules.d.ts +10 -1
- package/dist/hpsg/rules/site-rules.d.ts +10 -1
- package/dist/hpsg/rules/timing-rules.d.ts +108 -24
- package/dist/hpsg/segmenter.d.ts +2 -2
- package/dist/hpsg/signature.d.ts +50 -5
- package/dist/hpsg/timing-lexicon.d.ts +18 -2
- package/dist/i18n.d.ts +8 -7
- package/dist/index.cjs +84275 -66589
- package/dist/index.d.ts +13 -3
- package/dist/index.js +84263 -66588
- package/dist/instruction-action-locale-adapter.d.ts +69 -5
- package/dist/instruction-action-parser.d.ts +48 -0
- package/dist/instruction-action-terminology.d.ts +22 -1
- package/dist/instruction-concept-terminology.d.ts +14 -1
- package/dist/instruction-graph-fhir.d.ts +4 -2
- package/dist/instruction-graph-ownership.d.ts +96 -0
- package/dist/instruction-graph.d.ts +19 -42
- package/dist/lexer/lex.d.ts +5 -1
- package/dist/lexer/locale.d.ts +14 -0
- package/dist/lexer/locales/en.d.ts +11 -0
- package/dist/lexer/surface.d.ts +3 -1
- package/dist/lexer/token-types.d.ts +6 -0
- package/dist/locale-detection.d.ts +4 -2
- package/dist/locales/clause/en.d.ts +14 -0
- package/dist/locales/course/en.d.ts +5 -0
- package/dist/localization.d.ts +6 -0
- package/dist/localized-timing.d.ts +1 -1
- package/dist/maps.d.ts +38 -12
- package/dist/medication-condition.d.ts +105 -11
- package/dist/parser-state.d.ts +10 -0
- package/dist/parser.d.ts +5 -3
- package/dist/prn.d.ts +15 -2
- package/dist/regimen/coordination-scope.d.ts +13 -1
- package/dist/regimen/grammar.d.ts +7 -1
- package/dist/regimen/parallel-course.d.ts +6 -2
- package/dist/regimen/planner.d.ts +2 -3
- package/dist/regimen/regimen.d.ts +2 -0
- package/dist/schedule.d.ts +5 -2
- package/dist/snomed.d.ts +3 -0
- package/dist/suggest-locale-adapter.d.ts +15 -0
- package/dist/symptom-terminology.d.ts +5 -1
- package/dist/timing-summary.d.ts +43 -10
- package/dist/types.d.ts +213 -16
- package/dist/unit-lexicon.d.ts +2 -6
- package/dist/utils/units.d.ts +3 -0
- package/package.json +1 -1
|
@@ -32,16 +32,20 @@ export declare function cloneSiteRestrictions(restrictions: NonNullable<HpsgSign
|
|
|
32
32
|
sourceText: string;
|
|
33
33
|
}[] | undefined;
|
|
34
34
|
export declare function hasRecurringSchedule(schedule: HpsgScheduleFeature | undefined, positionsRepeat?: boolean): boolean;
|
|
35
|
-
/** A single dated clock locates an elapsed administration
|
|
36
|
-
* supply a repeat cadence.
|
|
37
|
-
*
|
|
35
|
+
/** A single dated clock locates an elapsed administration, including its
|
|
36
|
+
* authored start date; it does not supply a repeat cadence. Independent
|
|
37
|
+
* cadence, course bounds and additional slots retain recurring ownership. */
|
|
38
38
|
export declare function hasRecurringAdministrationSchedule(schedule: HpsgScheduleFeature | undefined, positionsRepeat?: boolean): boolean;
|
|
39
39
|
export declare function projectHpsgSignToState(sign: HpsgSign, state: ParserState, tokens: Token[], deps: HpsgProjectionDeps): void;
|
|
40
|
+
/** The selected member of a retained source conjunction, without inferring a
|
|
41
|
+
* new target from coding, text, or a later rendering. */
|
|
42
|
+
export declare function selectedAdministrationTargetIndex(clause: CanonicalSigClause): number | undefined;
|
|
40
43
|
/**
|
|
41
44
|
* Return the FHIR projection alternatives licensed by the typed HPSG site
|
|
42
45
|
* coordination. A disjunction is deliberately one retained canonical clause;
|
|
43
46
|
* it is never converted into simultaneous administrations.
|
|
44
47
|
*/
|
|
48
|
+
export declare function unexpandedAdministrationTargets(clauses: readonly CanonicalSigClause[]): readonly CanonicalSiteExpr[] | undefined;
|
|
45
49
|
export declare function administrationTargetProjections(clauses: readonly CanonicalSigClause[]): Array<CanonicalSiteExpr | undefined>;
|
|
46
50
|
/** Pure pre-FHIR projection from one typed conjunction to one singular site. */
|
|
47
51
|
export declare function projectAdministrationTargetClauses(clauses: readonly CanonicalSigClause[], target: CanonicalSiteExpr | undefined): CanonicalSigClause[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Token } from "../parser-state";
|
|
2
|
+
import type { CanonicalDoseRange, ParseOptions } from "../types";
|
|
3
|
+
import type { HpsgSign, HpsgDimensionalQuantityTerm } from "./signature";
|
|
4
|
+
/** Complete amount morphology is available before grammar construction. The
|
|
5
|
+
* optional admitted signs preserve the richer HPSG lookahead's ownership. */
|
|
6
|
+
export interface QuantityLexicalContext {
|
|
7
|
+
tokens: readonly Token[];
|
|
8
|
+
options?: ParseOptions;
|
|
9
|
+
limit?: number;
|
|
10
|
+
state?: {
|
|
11
|
+
consumed: ReadonlySet<number>;
|
|
12
|
+
};
|
|
13
|
+
clinicalCache?: {
|
|
14
|
+
quantityLookahead?: ReadonlyMap<number, readonly HpsgSign[]>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function quantityTokenAvailable(context: QuantityLexicalContext, index: number): boolean;
|
|
18
|
+
export declare function doseNumberValue(token: Token | undefined): number | undefined;
|
|
19
|
+
/** One plain numeric daughter shared by active amounts, carrier volumes and limits. */
|
|
20
|
+
export declare function plainClinicalNumberAt(context: QuantityLexicalContext, start: number, initial?: number): {
|
|
21
|
+
value: number;
|
|
22
|
+
numericIndex: number;
|
|
23
|
+
mixed: boolean;
|
|
24
|
+
fractional: boolean;
|
|
25
|
+
} | undefined;
|
|
26
|
+
/** The optional article or partitive belongs to the following medication unit. */
|
|
27
|
+
export declare function doseUnitIndexAfter(context: QuantityLexicalContext, start: number): number | undefined;
|
|
28
|
+
/** Explicit compound medication units share one declared lexical span. Context-
|
|
29
|
+
* licensed bare units remain the responsibility of their admitting construction.
|
|
30
|
+
* A selecting construction may expose the final word before its attached complement. */
|
|
31
|
+
export declare function compoundDoseUnitAt(context: QuantityLexicalContext, start: number, terminalUnit?: (index: number, surface: string) => string | undefined): {
|
|
32
|
+
unit: string;
|
|
33
|
+
end: number;
|
|
34
|
+
} | undefined;
|
|
35
|
+
export declare function clinicalMassTerm(value: number, raw: string): HpsgDimensionalQuantityTerm | undefined;
|
|
36
|
+
/** The same patient-mass denominator qualifies administered amounts and
|
|
37
|
+
* quantity ceilings. Cadence remains owned by the selecting construction. */
|
|
38
|
+
export declare function normalizeClinicalDoseUnit(raw: string, options?: ParseOptions): string | undefined;
|
|
39
|
+
export declare function directDoseUnitAfter(context: QuantityLexicalContext, start: number, terminalUnit?: (index: number, surface: string) => string | undefined): {
|
|
40
|
+
unit: string;
|
|
41
|
+
end: number;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** A complete medication amount owns its numeric daughters, connectors and unit.
|
|
44
|
+
* Consumers use the same bounded end before considering another constituent. */
|
|
45
|
+
export declare function medicationAmountAt(context: QuantityLexicalContext, index: number): {
|
|
46
|
+
end: number;
|
|
47
|
+
unit?: string;
|
|
48
|
+
range?: CanonicalDoseRange;
|
|
49
|
+
rangeConnectorIndex?: number;
|
|
50
|
+
} | undefined;
|
|
51
|
+
export declare function hasPrecedingMedicationAmount(context: QuantityLexicalContext, before: number): boolean;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { type QuantityLexicalContext } from "./quantity-lexicon";
|
|
2
|
+
export { quantityTokenAvailable, doseNumberValue, plainClinicalNumberAt, doseUnitIndexAfter, compoundDoseUnitAt, directDoseUnitAfter, medicationAmountAt, hasPrecedingMedicationAmount } from "./quantity-lexicon";
|
|
1
3
|
import { Token, ParserState } from "../parser-state";
|
|
2
|
-
import { EventTiming, FhirPeriodUnit, ParseOptions } from "../types";
|
|
4
|
+
import { type FhirCoding, EventTiming, FhirPeriodUnit, ParseOptions, type CanonicalScheduleExpr, type MedicationInstructionActionDefinition } from "../types";
|
|
5
|
+
import { type LexToken } from "../lexer/token-types";
|
|
3
6
|
import type { MedicationDateListMatch } from "../date-interpretation";
|
|
4
7
|
import { type ParsedMedicationGuard } from "./constructions";
|
|
8
|
+
import { MEAL_RELATION_BY_TOKEN } from "./lexical-classes";
|
|
5
9
|
export { normalizeTokenLower, parseClockToken } from "./lexical-classes";
|
|
6
10
|
import { HpsgLexicalRule, HpsgSign } from "./signature";
|
|
7
11
|
import { HpsgProjectionDeps } from "./projection";
|
|
@@ -9,6 +13,8 @@ import { HpsgUnificationContext } from "./unification";
|
|
|
9
13
|
export interface HpsgClauseContext {
|
|
10
14
|
state: ParserState;
|
|
11
15
|
tokens: Token[];
|
|
16
|
+
/** Completed lexical tokens for the same clause, before semantic annotation. */
|
|
17
|
+
rawTokens?: LexToken[];
|
|
12
18
|
options?: ParseOptions;
|
|
13
19
|
dateSpans: MedicationDateListMatch[];
|
|
14
20
|
limit: number;
|
|
@@ -16,11 +22,22 @@ export interface HpsgClauseContext {
|
|
|
16
22
|
clinicalCache: {
|
|
17
23
|
/** Existing lexical matches requested early by instruction body lookahead. */
|
|
18
24
|
quantityLookahead?: Map<number, HpsgSign[]>;
|
|
19
|
-
/** PRN daughters
|
|
25
|
+
/** PRN daughters after final conditional-owner admission. */
|
|
20
26
|
prnLookahead?: Map<number, HpsgSign[]>;
|
|
27
|
+
/** Nominal PRN daughters retained independently of final admission. */
|
|
28
|
+
prnNominalLookahead?: Map<number, HpsgSign[]>;
|
|
29
|
+
/** Route ownership is shared by chart admission and adjacent lexical consumers. */
|
|
30
|
+
routeLookahead?: Map<number, HpsgSign[]>;
|
|
31
|
+
/** Product signs requested early by a competing instruction head. */
|
|
32
|
+
productLookahead?: Map<number, HpsgSign[]>;
|
|
33
|
+
/** Complete administration schedules already admitted by the lexical chart.
|
|
34
|
+
* Generic source-tail fallback cannot detach their internal words. */
|
|
35
|
+
scheduleTokenIndices?: Set<number>;
|
|
36
|
+
/** Typed nominal signs requested before generic instruction fallback. */
|
|
37
|
+
siteLookahead?: Map<number, HpsgSign[]>;
|
|
21
38
|
medicationGuardScanned?: true;
|
|
22
39
|
medicationGuard?: ParsedMedicationGuard;
|
|
23
|
-
/** Tokens owned by a complete dimensional quantity or cumulative limit.
|
|
40
|
+
/** Tokens owned by a complete medication range, dimensional quantity or cumulative limit.
|
|
24
41
|
* Numeric, site and advice fallbacks must not detach its daughters. */
|
|
25
42
|
quantityTokenIndices?: Set<number>;
|
|
26
43
|
/** A recognized per-time expression still owns its numeral when no rate
|
|
@@ -39,13 +56,54 @@ export declare function isMedicationGuardMarker(context: HpsgClauseContext, star
|
|
|
39
56
|
export declare function startsMedicationGuard(context: HpsgClauseContext, start: number): boolean;
|
|
40
57
|
export declare function sourceRangeOverlapsContextDate(context: HpsgClauseContext, start: number, end: number): boolean;
|
|
41
58
|
export declare function isPunctuation(lower: string): boolean;
|
|
42
|
-
/**
|
|
59
|
+
/** Registered, immediate treatment origin following a temporal quantity. */
|
|
60
|
+
export declare function immediateTreatmentOriginAt(context: QuantityLexicalContext, start: number): boolean;
|
|
61
|
+
/** An interval origin cannot displace an explicitly introduced runtime. */
|
|
62
|
+
export declare function treatmentStartOriginAt(context: HpsgClauseContext, start: number, durationStart: number): boolean;
|
|
63
|
+
/** Infusion quantities and runtime lookahead share the same elapsed nominal. */
|
|
64
|
+
export declare function infusionDurationAt(context: HpsgClauseContext, start: number, allowRange?: boolean): {
|
|
65
|
+
unit: FhirPeriodUnit.Second | FhirPeriodUnit.Minute | FhirPeriodUnit.Hour;
|
|
66
|
+
value: number;
|
|
67
|
+
maximum?: number;
|
|
68
|
+
unitSurface: string;
|
|
69
|
+
comparator?: CanonicalScheduleExpr["administrationDurationComparator"];
|
|
70
|
+
range?: CanonicalScheduleExpr["administrationDurationRange"];
|
|
71
|
+
end: number;
|
|
72
|
+
} | undefined;
|
|
73
|
+
/** The nearest selected action or clause boundary owns a following complement. */
|
|
74
|
+
export declare function precedingMedicationInstructionAction(context: HpsgClauseContext, start: number): MedicationInstructionActionDefinition | undefined;
|
|
75
|
+
/** The selected action licenses both the current duration and any disambiguating runtime. */
|
|
76
|
+
export declare function selectedMethodOwnsAdministrationDuration(context: HpsgClauseContext, start: number, relation: string, definition: MedicationInstructionActionDefinition | undefined): boolean;
|
|
43
77
|
export declare function precedingMethodOwnsAdministrationDuration(context: HpsgClauseContext, start: number, relation: string): boolean;
|
|
44
78
|
export declare function isClockLikeLower(lower: string): boolean;
|
|
45
79
|
export declare function isAmPmLower(lower: string): boolean;
|
|
46
80
|
export declare function isAnteMeridiemLower(lower: string): boolean;
|
|
47
81
|
export declare function isPostMeridiemLower(lower: string): boolean;
|
|
48
|
-
export declare function tokensAvailable(context:
|
|
82
|
+
export declare function tokensAvailable(context: QuantityLexicalContext, start: number, span: number): Token[] | undefined;
|
|
83
|
+
/** Read the longest registered activity noun while retaining original tokens.
|
|
84
|
+
* @param context Shared clause and caller vocabulary.
|
|
85
|
+
* @param start First noun token, after any separate nominal modifier.
|
|
86
|
+
* @param prefixLength Length of a source-attached lexical modifier already interpreted by its construction.
|
|
87
|
+
*/
|
|
88
|
+
export declare function activityConceptAt(context: QuantityLexicalContext, start: number, prefixLength?: number): {
|
|
89
|
+
length: number;
|
|
90
|
+
display: string;
|
|
91
|
+
i18n?: Record<string, string>;
|
|
92
|
+
coding?: FhirCoding;
|
|
93
|
+
} | undefined;
|
|
94
|
+
/** The existing activity noun plus optional event phase is one temporal nominal.
|
|
95
|
+
* Shared with opaque-source admission so a declared event does not lose its owner. */
|
|
96
|
+
export declare function activityEventNominalAt(context: QuantityLexicalContext, start: number): {
|
|
97
|
+
start: number;
|
|
98
|
+
activity: {
|
|
99
|
+
length: number;
|
|
100
|
+
display: string;
|
|
101
|
+
i18n?: Record<string, string>;
|
|
102
|
+
coding?: FhirCoding;
|
|
103
|
+
} | undefined;
|
|
104
|
+
hasEventPhase: boolean;
|
|
105
|
+
end: number;
|
|
106
|
+
} | undefined;
|
|
49
107
|
export declare function rangeFromTokens(tokens: Token[]): {
|
|
50
108
|
start: number;
|
|
51
109
|
end: number;
|
|
@@ -54,47 +112,50 @@ export declare function splitByLexicalSeparators(text: string, separators: Reado
|
|
|
54
112
|
export declare function hasLexicalSeparator(text: string, separators: ReadonlySet<string>): boolean;
|
|
55
113
|
export declare function joinTokenText(tokens: Token[]): string;
|
|
56
114
|
export declare function lexicalRule(id: string, match: HpsgLexicalRule<HpsgClauseContext>["match"]): HpsgLexicalRule<HpsgClauseContext>;
|
|
57
|
-
interface QuantityLexicalContext {
|
|
58
|
-
tokens: Token[];
|
|
59
|
-
options?: ParseOptions;
|
|
60
|
-
limit?: number;
|
|
61
|
-
state?: Pick<ParserState, "consumed">;
|
|
62
|
-
clinicalCache?: HpsgClauseContext["clinicalCache"];
|
|
63
|
-
}
|
|
64
|
-
export declare function quantityTokenAvailable(context: QuantityLexicalContext, index: number): boolean;
|
|
65
|
-
export declare function doseNumberValue(token: Token | undefined): number | undefined;
|
|
66
115
|
/** Shared numeric-word inventory: clinical quantities and ordinary timing
|
|
67
116
|
* interpret the same lexical number daughters, without string special cases. */
|
|
68
117
|
export declare function clinicalDurationNumber(token: Token | undefined): number | undefined;
|
|
69
|
-
/**
|
|
70
|
-
|
|
118
|
+
/** Seconds are an existing action duration, without broadening cadence units. */
|
|
119
|
+
declare function clinicalDurationUnit(surface: string): FhirPeriodUnit | undefined;
|
|
120
|
+
export interface ClinicalDurationMatch {
|
|
71
121
|
value: number;
|
|
72
|
-
|
|
122
|
+
maximum?: number;
|
|
123
|
+
unit: FhirPeriodUnit;
|
|
73
124
|
unitSurface: string;
|
|
74
|
-
comparator
|
|
125
|
+
comparator?: CanonicalScheduleExpr["administrationDurationComparator"];
|
|
126
|
+
range?: CanonicalScheduleExpr["administrationDurationRange"];
|
|
75
127
|
end: number;
|
|
76
|
-
}
|
|
77
|
-
/** One
|
|
78
|
-
export declare function
|
|
128
|
+
}
|
|
129
|
+
/** One elapsed-duration daughter shared by infusion amounts and dose-limit periods. */
|
|
130
|
+
export declare function clinicalDurationAt(context: QuantityLexicalContext, start: number, allowRange?: boolean, unitForSurface?: typeof clinicalDurationUnit): ClinicalDurationMatch | undefined;
|
|
131
|
+
/** Compare fixed elapsed measures without replacing the authored unit. */
|
|
132
|
+
export declare function elapsedDurationInUnit(value: number, from: FhirPeriodUnit, to: FhirPeriodUnit): number | undefined;
|
|
133
|
+
/** Read the upper duration only. Compare compatible units and keep both authored endpoints. */
|
|
134
|
+
export declare function clinicalDurationRangeAfter(context: QuantityLexicalContext, lower: ClinicalDurationMatch, unitForSurface?: typeof clinicalDurationUnit, pairedConnector?: string): {
|
|
79
135
|
value: number;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
136
|
+
maximum: number;
|
|
137
|
+
unit: FhirPeriodUnit;
|
|
138
|
+
unitSurface: string;
|
|
139
|
+
range: {
|
|
140
|
+
low: {
|
|
141
|
+
value: number;
|
|
142
|
+
unit: FhirPeriodUnit;
|
|
143
|
+
};
|
|
144
|
+
high: {
|
|
145
|
+
value: number;
|
|
146
|
+
unit: FhirPeriodUnit;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
88
149
|
end: number;
|
|
89
150
|
} | undefined;
|
|
90
|
-
/** The same lexical medication amount owns administration heads and dose caps. */
|
|
91
|
-
export declare function medicationAmountAt(context: QuantityLexicalContext, index: number): boolean;
|
|
92
|
-
export declare function hasPrecedingMedicationAmount(context: QuantityLexicalContext, before: number): boolean;
|
|
93
151
|
/** A maximum head owns its leading separators and coordinated attachment. */
|
|
94
152
|
export declare function maximumCountLeadAt(context: QuantityLexicalContext, start: number, firstLower?: string): {
|
|
95
153
|
tokens: Token[];
|
|
96
154
|
headStart: number;
|
|
155
|
+
comparative: boolean;
|
|
97
156
|
} | undefined;
|
|
157
|
+
/** Maximum abbreviations share one optional trailing punctuation token. */
|
|
158
|
+
export declare function maximumCountValueIndex(context: QuantityLexicalContext, lead: NonNullable<ReturnType<typeof maximumCountLeadAt>>): number;
|
|
98
159
|
export declare function occurrenceCapPeriodAt(context: QuantityLexicalContext, start: number): {
|
|
99
160
|
tokens: Token[];
|
|
100
161
|
period: number;
|
|
@@ -107,8 +168,12 @@ type MaximumDosePeriod = ({
|
|
|
107
168
|
} | {
|
|
108
169
|
tokens: Token[];
|
|
109
170
|
daypart: true;
|
|
171
|
+
} | {
|
|
172
|
+
tokens: Token[];
|
|
173
|
+
administration: true;
|
|
110
174
|
}) & {
|
|
111
175
|
unitDenominator?: boolean;
|
|
176
|
+
numericWindow?: true;
|
|
112
177
|
rolling?: true;
|
|
113
178
|
};
|
|
114
179
|
/** The existing compact maximum denominator is shared by quantity and count nouns. */
|
|
@@ -121,6 +186,7 @@ export declare function maximumDosePeriodAt(context: QuantityLexicalContext, sta
|
|
|
121
186
|
export declare function maximumDosePerPeriodAt(context: QuantityLexicalContext, start: number, maximumHead?: {
|
|
122
187
|
tokens: Token[];
|
|
123
188
|
headStart: number;
|
|
189
|
+
comparative: boolean;
|
|
124
190
|
} | undefined): {
|
|
125
191
|
tokens: Token[];
|
|
126
192
|
amount: number;
|
|
@@ -128,12 +194,14 @@ export declare function maximumDosePerPeriodAt(context: QuantityLexicalContext,
|
|
|
128
194
|
period: MaximumDosePeriod;
|
|
129
195
|
headStart: number;
|
|
130
196
|
comparative: boolean;
|
|
197
|
+
rateDenominator: boolean;
|
|
131
198
|
} | undefined;
|
|
132
199
|
/** Numeric and locale-licensed named clocks share one end complement owner. */
|
|
133
|
-
export declare function courseEndClockAt(tokens: readonly Token[], start: number, limit?: number): {
|
|
200
|
+
export declare function courseEndClockAt(tokens: readonly Token[], start: number, limit?: number, endLead?: Token): {
|
|
134
201
|
tokens: Token[];
|
|
135
202
|
value?: string;
|
|
136
203
|
event?: EventTiming;
|
|
204
|
+
relation?: ReturnType<typeof MEAL_RELATION_BY_TOKEN.get>;
|
|
137
205
|
} | undefined;
|
|
138
206
|
/** A daypart inside UNTIL + NEXT is an end complement, not a recurring event. */
|
|
139
207
|
export declare function isEndBoundDaypartAt(tokens: readonly Token[], head: number): boolean;
|
|
@@ -4,7 +4,7 @@ import { HpsgDimensionalQuantityTerm, HpsgLexicalRule, HpsgSign } from "../signa
|
|
|
4
4
|
export declare function volumeOrMassTerm(value: number, raw: string): HpsgDimensionalQuantityTerm | undefined;
|
|
5
5
|
export declare function clinicalRatePeriodUnit(raw: string): FhirPeriodUnit.Hour | FhirPeriodUnit.Minute | undefined;
|
|
6
6
|
/** Shared lexical rate-head ownership, including a local route or AT marker. */
|
|
7
|
-
export declare function clinicalRateHeadAt(context: HpsgClauseContext, phraseStart: number, end: number, allowPrecedingDose?: boolean, period?: number): {
|
|
7
|
+
export declare function clinicalRateHeadAt(context: HpsgClauseContext, phraseStart: number, end: number, allowPrecedingDose?: boolean, period?: number, routeIsRateHead?: boolean): {
|
|
8
8
|
licensed: boolean;
|
|
9
9
|
rateSpecific: boolean;
|
|
10
10
|
marker: number | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { actionArgumentSpan } from "../procedural-context";
|
|
1
2
|
import { FhirDayOfWeek, ParseOptions } from "../../types";
|
|
2
3
|
import { MedicationDateListMatch } from "../../date-interpretation";
|
|
3
4
|
import { HpsgClauseContext } from "../rule-context";
|
|
@@ -8,9 +9,19 @@ export interface CalendarExclusion {
|
|
|
8
9
|
excluded: FhirDayOfWeek[];
|
|
9
10
|
dates: string[];
|
|
10
11
|
}
|
|
11
|
-
export declare function containsCalendarExclusionCue(source: string): boolean;
|
|
12
|
+
export declare function containsCalendarExclusionCue(source: string, locale?: string): boolean;
|
|
13
|
+
/** Whole-source admission searches the provider cue independently of local
|
|
14
|
+
* sticky anchoring. Registration derives this stateless search expression. */
|
|
15
|
+
export declare function calendarExclusionSourceCue(source: string, locale?: string): {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
export declare function containsCalendarExclusionSourceCue(source: string, locale?: string): boolean;
|
|
12
20
|
/** Resolve the lexical payload for a typed calendar-exclusion sign. */
|
|
13
|
-
export declare function matchCalendarExclusion(source: string, options?: ParseOptions, knownDateSpans?: MedicationDateListMatch[], scopeEnd?: number, from?: number
|
|
21
|
+
export declare function matchCalendarExclusion(source: string, options?: ParseOptions, knownDateSpans?: MedicationDateListMatch[], scopeEnd?: number, from?: number, selectedCue?: {
|
|
22
|
+
start: number;
|
|
23
|
+
end: number;
|
|
24
|
+
}): CalendarExclusion | undefined;
|
|
14
25
|
export declare function medicationGuardLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
15
26
|
export declare function weekdayComplementReferenceLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
16
27
|
export declare function calendarExclusionLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
@@ -20,9 +20,12 @@ export declare function phaseAdjustmentAt(tokens: readonly Token[], start: numbe
|
|
|
20
20
|
export declare function phaseAdjustmentLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
21
21
|
export declare function directiveMarkerLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
22
22
|
export declare function methodLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
23
|
-
|
|
23
|
+
/** An exact end lets an adjacent constituent request this same route owner. */
|
|
24
|
+
export declare function routeLexicalRule(exactEnd?: number): HpsgLexicalRule<HpsgClauseContext>;
|
|
25
|
+
/** Complete governed route boundary; the route lexical rule still owns its value. */
|
|
26
|
+
export declare function governedRouteLexicalEnd(tokens: readonly Token[], start: number, options?: ParseOptions, limit?: number): number | undefined;
|
|
24
27
|
export declare function fillerLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
25
|
-
export declare function productLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
28
|
+
export declare function productLexicalRule(cacheLookahead?: boolean): HpsgLexicalRule<HpsgClauseContext>;
|
|
26
29
|
/**
|
|
27
30
|
* Return the end of a bounded, explicit scalar-dose head for regimen boundary
|
|
28
31
|
* candidacy. This uses the same HPSG quantity lexemes as `doseLexicalRule`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Token } from "../../parser-state";
|
|
2
|
+
import { type TextRange } from "../../types";
|
|
2
3
|
import { HpsgClauseContext } from "../rule-context";
|
|
3
4
|
import { HpsgLexicalRule, HpsgSign } from "../signature";
|
|
4
5
|
export declare function startsMaximumCountLead(context: HpsgClauseContext, start: number): boolean;
|
|
@@ -11,6 +12,14 @@ export declare function matchContextualPrnReasonLead(context: HpsgClauseContext,
|
|
|
11
12
|
export declare function tokenBelongsToContextualPrnReasonLead(context: HpsgClauseContext, tokenIndex: number): boolean;
|
|
12
13
|
export declare function hasSymptomOnsetPrnAt(context: HpsgClauseContext, start: number): boolean;
|
|
13
14
|
export declare function symptomOnsetPrnRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
14
|
-
/**
|
|
15
|
+
/** Offer an established indication before the conditional target is selected. */
|
|
16
|
+
export declare function hasKnownPrnNominalBefore(context: HpsgClauseContext, start: number, boundary: number): boolean;
|
|
17
|
+
/** Existing maximum-boundary callers use the same complete nominal proof. */
|
|
18
|
+
export declare const prnEndsBeforeMaximum: typeof hasKnownPrnNominalBefore;
|
|
19
|
+
/** A complete indication owns an internal unresolved nominal before generic
|
|
20
|
+
* action fallback. Conditional leads additionally need an established symptom
|
|
21
|
+
* focus; an explicit PRN lead may retain authored unknown indications. */
|
|
22
|
+
export declare function prnNominalOwnsOpaqueRange(context: HpsgClauseContext, start: number, range: TextRange): number | undefined;
|
|
23
|
+
/** Share final PRN admission without promoting nominal boundary evidence. */
|
|
15
24
|
export declare function prnAt(context: HpsgClauseContext, start: number): HpsgSign[];
|
|
16
25
|
export declare function prnLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { HpsgClauseContext } from "../rule-context";
|
|
2
2
|
import { HpsgLexicalRule } from "../signature";
|
|
3
|
-
|
|
3
|
+
/** Opaque-source admission defers to the same relative-site daughters as the chart. */
|
|
4
|
+
export declare function siteRelativeHasSign(context: HpsgClauseContext, start: number): boolean;
|
|
5
|
+
/** An explicit selected argument governor owns its site constituent. Without
|
|
6
|
+
* one, procedure-owned anatomy cannot become the medication site. */
|
|
7
|
+
export declare function siteLexicalRule(governorStart?: number): HpsgLexicalRule<HpsgClauseContext>;
|
|
8
|
+
/** Instruction fallback defers to the same typed site sign used by the chart.
|
|
9
|
+
* This bounded lexical lookahead does not enter chart selection or reparse actions. */
|
|
10
|
+
export declare function siteModifierHasSign(context: HpsgClauseContext, start: number): boolean;
|
|
11
|
+
/** Share the actual selected nominal owner with adjacent opaque-source admission. */
|
|
12
|
+
export declare function bareSiteHasSign(context: HpsgClauseContext, start: number): boolean;
|
|
4
13
|
export declare function bareSiteLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
+
import { type QuantityLexicalContext } from "../quantity-lexicon";
|
|
1
2
|
import { Token } from "../../parser-state";
|
|
2
|
-
import { type AdviceFrame, type CanonicalCalendarEventExpr, type FhirQuantity, type ParseOptions } from "../../types";
|
|
3
|
-
import { HpsgClauseContext, maximumCountLeadAt, maximumDosePerPeriodAt, maximumDosePeriodAt } from "../rule-context";
|
|
3
|
+
import { type AdviceFrame, AdviceRelation, EventTiming, FhirDayOfWeek, FhirPeriodUnit, type CanonicalCalendarEventExpr, type CanonicalAdditionalInstructionExpr, type FhirCoding, type FhirQuantity, type ParseOptions } from "../../types";
|
|
4
|
+
import { HpsgClauseContext, maximumCountLeadAt, maximumDosePerPeriodAt, maximumDosePeriodAt, clinicalDurationAt } from "../rule-context";
|
|
4
5
|
import { HpsgLexicalRule, HpsgSign } from "../signature";
|
|
5
|
-
|
|
6
|
-
* The planner reuses its source extent; duration semantics remain owned by
|
|
7
|
-
* the ordinary duration lexical rule.
|
|
8
|
-
* @param tokens Source lexical tokens.
|
|
9
|
-
* @param start Candidate duration-lead index.
|
|
10
|
-
*/
|
|
11
|
-
export declare function followingCourseDurationHeaderAt(tokens: readonly Token[], start: number): {
|
|
12
|
-
valueIndex: number;
|
|
13
|
-
tokenEnd: number;
|
|
14
|
-
implicitSingle?: boolean;
|
|
15
|
-
} | undefined;
|
|
6
|
+
export { followingCourseDurationHeaderAt } from "../timing-lexicon";
|
|
16
7
|
export interface OrdinalWeekStageHeader {
|
|
17
8
|
tokenStart: number;
|
|
18
9
|
tokenEnd: number;
|
|
@@ -30,6 +21,11 @@ export declare function ordinalWeekStageHeaderAt(tokens: readonly Token[], start
|
|
|
30
21
|
export declare function ordinalWeekStageHeaders(tokens: readonly Token[]): OrdinalWeekStageHeader[];
|
|
31
22
|
/** A regimen-stage construction requires at least Week 1 + Week 2. */
|
|
32
23
|
export declare function ordinalWeekStageSequence(tokens: readonly Token[]): OrdinalWeekStageHeader[];
|
|
24
|
+
export declare function monthlyOrdinalWeekdayParts(context: HpsgClauseContext, start: number): {
|
|
25
|
+
members: Token[];
|
|
26
|
+
weekday: FhirDayOfWeek;
|
|
27
|
+
ordinal: 1 | 2 | 3 | 4 | -1;
|
|
28
|
+
} | undefined;
|
|
33
29
|
export declare function multiplicativeDoseFrequencyRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
34
30
|
export declare function compactIntervalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
35
31
|
export declare function separatedIntervalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
@@ -37,18 +33,24 @@ export declare function separatedIntervalRule(): HpsgLexicalRule<HpsgClauseConte
|
|
|
37
33
|
export declare function maximumOccurrenceAt(context: Parameters<typeof maximumCountLeadAt>[0], start: number, lead?: {
|
|
38
34
|
tokens: Token[];
|
|
39
35
|
headStart: number;
|
|
36
|
+
comparative: boolean;
|
|
40
37
|
} | undefined): {
|
|
41
38
|
tokens: Token[];
|
|
42
39
|
headStart: number;
|
|
43
40
|
count: number;
|
|
44
|
-
|
|
41
|
+
occurrenceScope: "generic" | "medication";
|
|
42
|
+
comparative: boolean;
|
|
45
43
|
period?: NonNullable<ReturnType<typeof maximumDosePeriodAt>>;
|
|
46
44
|
} | undefined;
|
|
45
|
+
/** Evidence from the selected final predicate, without reparsing its text.
|
|
46
|
+
* An ordinary condition can still take an episode count; a measurement or
|
|
47
|
+
* lexical PRN condition has already supplied its complete complement. */
|
|
48
|
+
export type MaximumPredicateScope = "unresolved" | "condition" | "measurement" | "prn";
|
|
47
49
|
/** A comparative maximum needs a complete preceding predicate and its own
|
|
48
50
|
* complete daughter. A conjunction alone cannot detach a count prefix from
|
|
49
51
|
* an opaque Boolean predicate. Explicit separators/maximum heads retain their
|
|
50
52
|
* independent instruction license. */
|
|
51
|
-
export declare function isIndependentMaximum(context: Parameters<typeof maximumCountLeadAt>[0], start: number, maximum: NonNullable<ReturnType<typeof maximumOccurrenceAt> | ReturnType<typeof maximumDosePerPeriodAt>>,
|
|
53
|
+
export declare function isIndependentMaximum(context: Parameters<typeof maximumCountLeadAt>[0], start: number, maximum: NonNullable<ReturnType<typeof maximumOccurrenceAt> | ReturnType<typeof maximumDosePerPeriodAt>>, predicateScope?: MaximumPredicateScope, endSource?: number): boolean;
|
|
52
54
|
export declare function separatedFrequencyRangeRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
53
55
|
/**
|
|
54
56
|
* A distributive cadence followed directly by a discrete unit licenses an
|
|
@@ -56,18 +58,86 @@ export declare function separatedFrequencyRangeRule(): HpsgLexicalRule<HpsgClaus
|
|
|
56
58
|
* than globally treating every bare unit as one dose.
|
|
57
59
|
*/
|
|
58
60
|
export declare function cadenceFirstImplicitSingleDoseRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
59
|
-
/**
|
|
60
|
-
* Parses languages and clinical shorthand that place the cadence adverb before
|
|
61
|
-
* the count, e.g. `daily 2 times`. Thai `วันละ 2 ครั้ง` is normalized by the
|
|
62
|
-
* locale lexer to exactly this feature sequence, without pretending Thai has
|
|
63
|
-
* English word order.
|
|
64
|
-
*/
|
|
65
61
|
export declare function cadenceFirstFrequencyRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
66
62
|
export declare function singleOccurrencePhraseRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
63
|
+
/** Complete declared cardinal/cadence nominal, shared with local action
|
|
64
|
+
* boundaries. HPSG's contextual ownership guards remain at its lexical rule. */
|
|
65
|
+
export declare function countFrequencyNominalAt(context: QuantityLexicalContext, start: number): HpsgSign | undefined;
|
|
66
|
+
/** Complete recurrence morphology shared with action-valence boundaries.
|
|
67
|
+
* The lexical productions below still own the schedule meaning and evidence. */
|
|
68
|
+
export declare function cadenceNominalEnd(context: QuantityLexicalContext, start: number): number | undefined;
|
|
67
69
|
export declare function countFrequencyRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
68
70
|
export declare function alternateEventCadenceRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
69
71
|
export declare function calendarDateListRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
70
72
|
export declare function timingLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
73
|
+
/** The same relation-selected event owns bare, immediate, and quantified
|
|
74
|
+
* timing constituents. Sleep and wake keep their established lexical aliases. */
|
|
75
|
+
export declare function relatedEventTimingExpression(parts: readonly string[], relation: "before" | "after" | "with"): {
|
|
76
|
+
timing: EventTiming;
|
|
77
|
+
length: number;
|
|
78
|
+
} | undefined;
|
|
79
|
+
interface QualifiedEventAdvice {
|
|
80
|
+
start: number;
|
|
81
|
+
end: number;
|
|
82
|
+
frame?: AdviceFrame;
|
|
83
|
+
alternative?: true;
|
|
84
|
+
registeredInstruction?: CanonicalAdditionalInstructionExpr;
|
|
85
|
+
}
|
|
86
|
+
/** A selected MealState owns its complete nominal before a contained generic
|
|
87
|
+
* event. Reuse the selected argument's provider and occurrence proof; unheaded
|
|
88
|
+
* stock compounds keep their existing lexical fallback. */
|
|
89
|
+
export declare function qualifiedEventAdviceAt(context: HpsgClauseContext, index: number): QualifiedEventAdvice | undefined;
|
|
90
|
+
interface CoordinatedRelatedEvents {
|
|
91
|
+
timings: EventTiming[];
|
|
92
|
+
members: Token[];
|
|
93
|
+
next: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Compose a relation-scoped list of event daughters. English commonly names
|
|
97
|
+
* every meal (`breakfast, lunch and dinner`), while Thai commonly shares the
|
|
98
|
+
* nominal head (`อาหารเช้า กลางวัน และเย็น`). Both are the same typed list;
|
|
99
|
+
* disjunction remains outside this conjunctive construction.
|
|
100
|
+
*/
|
|
101
|
+
export declare function coordinatedRelatedEventsAt(context: QuantityLexicalContext, start: number, relation: "before" | "after" | "with", measuredOffset?: boolean): CoordinatedRelatedEvents | undefined;
|
|
102
|
+
type EventOffsetQuantity = {
|
|
103
|
+
value: number;
|
|
104
|
+
unit: FhirPeriodUnit;
|
|
105
|
+
bound: "minimum" | "maximum" | undefined;
|
|
106
|
+
next: number;
|
|
107
|
+
comparator?: NonNullable<ReturnType<typeof clinicalDurationAt>>["comparator"];
|
|
108
|
+
ranged?: boolean;
|
|
109
|
+
minutes?: number;
|
|
110
|
+
};
|
|
111
|
+
export declare function eventOffsetQuantityAt(context: QuantityLexicalContext, start: number): EventOffsetQuantity | undefined;
|
|
112
|
+
export declare function semanticActivityWindowAt(context: QuantityLexicalContext, start: number, includeRegisteredActivity?: boolean): {
|
|
113
|
+
definition: {
|
|
114
|
+
parts: string[];
|
|
115
|
+
text: string;
|
|
116
|
+
offsetOnly: boolean;
|
|
117
|
+
i18n: {
|
|
118
|
+
th: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
relation: "before" | "after" | undefined;
|
|
121
|
+
activity: string | undefined;
|
|
122
|
+
eventWindow: {
|
|
123
|
+
start: EventTiming;
|
|
124
|
+
end: EventTiming;
|
|
125
|
+
} | undefined;
|
|
126
|
+
};
|
|
127
|
+
tokens: Token[];
|
|
128
|
+
relation: "before" | "after";
|
|
129
|
+
activity: undefined;
|
|
130
|
+
} | {
|
|
131
|
+
definition: undefined;
|
|
132
|
+
tokens: Token[];
|
|
133
|
+
relation: AdviceRelation.Before | AdviceRelation.After;
|
|
134
|
+
activity: {
|
|
135
|
+
length: number;
|
|
136
|
+
display: string;
|
|
137
|
+
i18n?: Record<string, string>;
|
|
138
|
+
coding?: FhirCoding;
|
|
139
|
+
} | undefined;
|
|
140
|
+
} | undefined;
|
|
71
141
|
export declare function quantityFirstActivityTimingRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
72
142
|
export declare function quantityFirstEventOffsetRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
73
143
|
/**
|
|
@@ -83,6 +153,13 @@ export declare function eventTimingPhraseRule(): HpsgLexicalRule<HpsgClauseConte
|
|
|
83
153
|
* @returns A lexical rule yielding typed calendar-day membership.
|
|
84
154
|
*/
|
|
85
155
|
export declare function monthlyDayOfMonthLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
156
|
+
/** Conjunction and juxtaposition compose already registered weekday atoms.
|
|
157
|
+
* An authored disjunction remains a choice, not a set of excluded days. */
|
|
158
|
+
export declare function weekdayNominalAt(context: QuantityLexicalContext, start: number): {
|
|
159
|
+
end: number;
|
|
160
|
+
dayOfWeek: FhirDayOfWeek[];
|
|
161
|
+
alternative: boolean;
|
|
162
|
+
} | undefined;
|
|
86
163
|
export declare function dayRangeLexicalRule(): HpsgLexicalRule<HpsgClauseContext>;
|
|
87
164
|
/**
|
|
88
165
|
* A maximum medication quantity is a typed schedule adjunct, not another
|
|
@@ -121,10 +198,11 @@ export interface HpsgRecurringCourseConstituent {
|
|
|
121
198
|
/** Cheap lexical activation only; the course construction must still compose. */
|
|
122
199
|
export declare function hasRecurringCourseCue(tokens: readonly Token[], options?: ParseOptions): boolean;
|
|
123
200
|
/** A registered withholding head selects one complete finite duration NP.
|
|
124
|
-
*
|
|
125
|
-
*
|
|
201
|
+
* Selected Duration arguments retain their registered head/complement order;
|
|
202
|
+
* objects, conditional tails, and negative directives are not medication pauses. */
|
|
126
203
|
export declare function finiteTreatmentPauseAt(context: HpsgClauseContext, frame: AdviceFrame, start: number): {
|
|
127
|
-
|
|
204
|
+
headTokens: Token[];
|
|
205
|
+
headSide: "left" | "right";
|
|
128
206
|
duration: HpsgSign;
|
|
129
207
|
pause: {
|
|
130
208
|
durationDays: number;
|
|
@@ -156,6 +234,10 @@ export interface CycleSchedule {
|
|
|
156
234
|
anchor?: string;
|
|
157
235
|
events: CanonicalCalendarEventExpr[];
|
|
158
236
|
error?: string;
|
|
237
|
+
cycleConcept?: FhirCoding;
|
|
238
|
+
startDay?: number;
|
|
239
|
+
maxTreatmentDays?: number;
|
|
240
|
+
dayOneEvent?: FhirCoding;
|
|
159
241
|
kind?: 'calendar-days' | 'recurring-on-off';
|
|
160
242
|
onDuration?: FhirQuantity;
|
|
161
243
|
offDuration?: FhirQuantity;
|
|
@@ -167,6 +249,8 @@ export interface CycleSchedule {
|
|
|
167
249
|
}
|
|
168
250
|
/** Recognize finite anchored cycle/day-offset expressions; never guess an absent anchor or cycle length. */
|
|
169
251
|
export declare function recognizeCycles(input: string, options?: ParseOptions, sourceTokens?: readonly Token[]): CycleSchedule[];
|
|
252
|
+
type CycleClauseContext = Pick<HpsgClauseContext, "state" | "options">;
|
|
253
|
+
export declare function cycleSchedulesForContext(context: CycleClauseContext): readonly CycleSchedule[];
|
|
170
254
|
/** Finite cycles emit exact events; recurring active/rest cycles emit their
|
|
171
255
|
* typed active duration and whole-course repeat interval on the same sign. */
|
|
172
256
|
export declare function cycleScheduleRule(): HpsgLexicalRule<HpsgClauseContext>;
|
package/dist/hpsg/segmenter.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ParseOptions } from "../types";
|
|
2
1
|
export interface HpsgSigSegment {
|
|
3
2
|
text: string;
|
|
4
3
|
start: number;
|
|
@@ -6,4 +5,5 @@ export interface HpsgSigSegment {
|
|
|
6
5
|
/** A trailing duration on the next heterogeneous dose applies to this sibling too. */
|
|
7
6
|
inheritTrailingDurationFromNext?: boolean;
|
|
8
7
|
}
|
|
9
|
-
|
|
8
|
+
/** Compatibility segment view; the production boundary planner owns segmentation. */
|
|
9
|
+
export { parseSigSegments } from "../regimen/planner";
|