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 +4 -1
- package/dist/advice.d.ts +16 -0
- package/dist/fhir-translations.d.ts +5 -0
- package/dist/fhir.d.ts +6 -4
- package/dist/format.d.ts +4 -2
- package/dist/i18n.d.ts +2 -2
- package/dist/index.cjs +18842 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +18703 -638
- package/dist/ir.d.ts +4 -0
- package/dist/lexer/lex.d.ts +2 -0
- package/dist/lexer/meaning.d.ts +71 -0
- package/dist/lexer/surface.d.ts +2 -0
- package/dist/lexer/token-types.d.ts +36 -0
- package/dist/maps.d.ts +6 -12
- package/dist/parser-state.d.ts +101 -0
- package/dist/parser.d.ts +7 -7
- package/dist/prn.d.ts +4 -0
- package/dist/site-phrases.d.ts +35 -0
- package/dist/timing-summary.d.ts +13 -3
- package/dist/types.d.ts +237 -32
- package/dist/utils/text.d.ts +3 -0
- package/package.json +17 -6
- package/dist/context.js +0 -50
- package/dist/fhir.js +0 -261
- package/dist/format.js +0 -737
- package/dist/i18n.js +0 -899
- package/dist/internal-types.d.ts +0 -60
- package/dist/internal-types.js +0 -2
- package/dist/maps.js +0 -1680
- package/dist/package.json +0 -3
- package/dist/parser.js +0 -4007
- package/dist/safety.js +0 -15
- package/dist/schedule.js +0 -1438
- package/dist/segment.js +0 -203
- package/dist/suggest.js +0 -907
- package/dist/timing-summary.js +0 -138
- package/dist/types.js +0 -228
- package/dist/utils/array.js +0 -11
- package/dist/utils/enum.d.ts +0 -2
- package/dist/utils/enum.js +0 -7
- package/dist/utils/object.js +0 -34
- package/dist/utils/strength.js +0 -149
- package/dist/utils/units.js +0 -82
package/dist/ir.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParserState } from "./parser-state";
|
|
2
|
+
import { CanonicalSigClause } from "./types";
|
|
3
|
+
export declare function buildCanonicalSigClauses(internal: ParserState): CanonicalSigClause[];
|
|
4
|
+
export declare function shiftCanonicalSigClauses(clauses: CanonicalSigClause[], offset: number): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FrequencyDescriptor, RouteSynonym } from "../maps";
|
|
2
|
+
import { EventTiming, FhirDayOfWeek, RouteCode } from "../types";
|
|
3
|
+
import { LexToken } from "./token-types";
|
|
4
|
+
export declare enum ConnectorRole {
|
|
5
|
+
General = "GENERAL",
|
|
6
|
+
SiteAnchor = "SITE_ANCHOR",
|
|
7
|
+
SiteList = "SITE_LIST",
|
|
8
|
+
MealContext = "MEAL_CONTEXT",
|
|
9
|
+
DayRange = "DAY_RANGE"
|
|
10
|
+
}
|
|
11
|
+
export declare enum TokenWordClass {
|
|
12
|
+
AdministrationVerb = "ADMINISTRATION_VERB",
|
|
13
|
+
SiteSurfaceModifier = "SITE_SURFACE_MODIFIER",
|
|
14
|
+
WorkflowInstruction = "WORKFLOW_INSTRUCTION",
|
|
15
|
+
ApplicationVerb = "APPLICATION_VERB",
|
|
16
|
+
CountKeyword = "COUNT_KEYWORD"
|
|
17
|
+
}
|
|
18
|
+
export interface SiteMeaningCandidate {
|
|
19
|
+
text: string;
|
|
20
|
+
route?: RouteCode;
|
|
21
|
+
source: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RouteMeaningCandidate extends RouteSynonym {
|
|
24
|
+
source: string;
|
|
25
|
+
}
|
|
26
|
+
export interface TokenAnnotations {
|
|
27
|
+
eventTiming?: EventTiming;
|
|
28
|
+
timingAbbreviation?: FrequencyDescriptor;
|
|
29
|
+
dayOfWeek?: FhirDayOfWeek[];
|
|
30
|
+
routeCandidates?: RouteMeaningCandidate[];
|
|
31
|
+
siteCandidates?: SiteMeaningCandidate[];
|
|
32
|
+
prn?: true;
|
|
33
|
+
connectorRoles?: ConnectorRole[];
|
|
34
|
+
wordClasses?: TokenWordClass[];
|
|
35
|
+
}
|
|
36
|
+
export interface AnnotatedLexToken extends LexToken {
|
|
37
|
+
annotations?: TokenAnnotations;
|
|
38
|
+
}
|
|
39
|
+
interface Lowerable {
|
|
40
|
+
lower: string;
|
|
41
|
+
annotations?: TokenAnnotations;
|
|
42
|
+
}
|
|
43
|
+
export declare function expandDayMeaningRange(start: FhirDayOfWeek, end: FhirDayOfWeek): FhirDayOfWeek[];
|
|
44
|
+
export declare function resolveDayMeaning(tokenLower: string): FhirDayOfWeek[] | undefined;
|
|
45
|
+
export declare function annotateLexToken(token: LexToken): AnnotatedLexToken;
|
|
46
|
+
export declare function annotateLexTokens(tokens: LexToken[]): AnnotatedLexToken[];
|
|
47
|
+
export declare function hasConnectorRole(token: AnnotatedLexToken | undefined, role: ConnectorRole): boolean;
|
|
48
|
+
export declare function hasTokenWordClass(token: AnnotatedLexToken | undefined, wordClass: TokenWordClass): boolean;
|
|
49
|
+
export declare function hasDayOfWeekMeaning(token: Lowerable | undefined): boolean;
|
|
50
|
+
export declare function getDayOfWeekMeaning(token: Lowerable | undefined): FhirDayOfWeek[] | undefined;
|
|
51
|
+
export declare function hasEventTimingMeaning(token: Lowerable | undefined): boolean;
|
|
52
|
+
export declare function getEventTimingMeaning(token: Lowerable | undefined): EventTiming | undefined;
|
|
53
|
+
export declare function hasTimingAbbreviationMeaning(token: Lowerable | undefined): boolean;
|
|
54
|
+
export declare function getTimingAbbreviationMeaning(token: Lowerable | undefined): FrequencyDescriptor | undefined;
|
|
55
|
+
export declare function hasRouteMeaning(token: Lowerable | undefined): boolean;
|
|
56
|
+
export declare function getRouteMeaning(token: Lowerable | undefined): RouteMeaningCandidate | undefined;
|
|
57
|
+
export declare function hasSiteMeaningCandidate(token: Lowerable | undefined): boolean;
|
|
58
|
+
export declare function getSiteMeaningCandidates(token: Lowerable | undefined): SiteMeaningCandidate[] | undefined;
|
|
59
|
+
export declare function getPrimarySiteMeaningCandidate(token: Lowerable | undefined): SiteMeaningCandidate | undefined;
|
|
60
|
+
export declare function hasPrnMeaning(token: Lowerable | undefined): boolean;
|
|
61
|
+
export declare function hasConnectorMeaning(token: Lowerable | undefined): boolean;
|
|
62
|
+
export declare function isSiteAnchorWord(word: string): boolean;
|
|
63
|
+
export declare function isSiteListConnectorWord(word: string): boolean;
|
|
64
|
+
export declare function isSiteSurfaceModifierWord(word: string): boolean;
|
|
65
|
+
export declare function isWorkflowInstructionWord(word: string): boolean;
|
|
66
|
+
export declare function isApplicationVerbWord(word: string): boolean;
|
|
67
|
+
export declare function isAdministrationVerbWord(word: string): boolean;
|
|
68
|
+
export declare function isCountKeywordWord(word: string): boolean;
|
|
69
|
+
export declare function isMealContextConnectorWord(word: string): boolean;
|
|
70
|
+
export declare function isDayRangeConnectorWord(word: string): boolean;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum SurfaceTokenKind {
|
|
2
|
+
Text = "TEXT",
|
|
3
|
+
Separator = "SEPARATOR",
|
|
4
|
+
Punctuation = "PUNCTUATION"
|
|
5
|
+
}
|
|
6
|
+
export declare enum LexKind {
|
|
7
|
+
Word = "WORD",
|
|
8
|
+
Number = "NUMBER",
|
|
9
|
+
NumberRange = "NUMBER_RANGE",
|
|
10
|
+
Ordinal = "ORDINAL",
|
|
11
|
+
TimeLike = "TIME_LIKE",
|
|
12
|
+
Separator = "SEPARATOR",
|
|
13
|
+
Punctuation = "PUNCTUATION"
|
|
14
|
+
}
|
|
15
|
+
export interface SurfaceToken {
|
|
16
|
+
original: string;
|
|
17
|
+
lower: string;
|
|
18
|
+
index: number;
|
|
19
|
+
kind: SurfaceTokenKind;
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
}
|
|
23
|
+
export interface LexToken {
|
|
24
|
+
original: string;
|
|
25
|
+
lower: string;
|
|
26
|
+
index: number;
|
|
27
|
+
kind: LexKind;
|
|
28
|
+
value?: number;
|
|
29
|
+
low?: number;
|
|
30
|
+
high?: number;
|
|
31
|
+
sourceStart: number;
|
|
32
|
+
sourceEnd: number;
|
|
33
|
+
surfaceIndices: number[];
|
|
34
|
+
sourceText?: string;
|
|
35
|
+
derived?: true;
|
|
36
|
+
}
|
package/dist/maps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BodySiteDefinition, EventTiming, FhirDayOfWeek, FhirPeriodUnit, PrnReasonDefinition, RouteCode, SNOMEDCTRouteCodes } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* SNOMED CT codings aligned with every known RouteCode. Keeping the structure
|
|
4
4
|
* data-driven ensures any additions to the enumeration are surfaced
|
|
@@ -30,8 +30,13 @@ export declare const DEFAULT_BODY_SITE_SNOMED_SOURCE: Array<{
|
|
|
30
30
|
definition: BodySiteDefinition;
|
|
31
31
|
}>;
|
|
32
32
|
export declare const DEFAULT_BODY_SITE_SNOMED: Record<string, BodySiteDefinition>;
|
|
33
|
+
export declare const DEFAULT_BODY_SITE_HINTS: Set<string>;
|
|
33
34
|
export declare const HOUSEHOLD_VOLUME_UNITS: readonly ["tsp", "tbsp"];
|
|
34
35
|
export declare const DEFAULT_UNIT_SYNONYMS: Record<string, string>;
|
|
36
|
+
export interface ProductFormHint {
|
|
37
|
+
routeHint?: RouteCode;
|
|
38
|
+
}
|
|
39
|
+
export declare const PRODUCT_FORM_HINTS: Record<string, ProductFormHint>;
|
|
35
40
|
export interface FrequencyDescriptor {
|
|
36
41
|
code?: string;
|
|
37
42
|
frequency?: number;
|
|
@@ -71,18 +76,7 @@ export interface PrnReasonDictionaryEntry {
|
|
|
71
76
|
}
|
|
72
77
|
export declare const DEFAULT_PRN_REASON_ENTRIES: PrnReasonDictionaryEntry[];
|
|
73
78
|
export declare const DEFAULT_PRN_REASON_DEFINITIONS: Record<string, PrnReasonDefinition>;
|
|
74
|
-
export interface AdditionalInstructionDictionaryEntry {
|
|
75
|
-
canonical: string;
|
|
76
|
-
definition: AdditionalInstructionDefinition;
|
|
77
|
-
terms: string[];
|
|
78
|
-
}
|
|
79
|
-
export declare const DEFAULT_ADDITIONAL_INSTRUCTION_ENTRIES: AdditionalInstructionDictionaryEntry[];
|
|
80
|
-
export declare const DEFAULT_ADDITIONAL_INSTRUCTION_DEFINITIONS: Record<string, AdditionalInstructionDefinition>;
|
|
81
79
|
/**
|
|
82
80
|
* Finds a default PRN reason definition by its SNOMED coding.
|
|
83
81
|
*/
|
|
84
82
|
export declare function findPrnReasonDefinitionByCoding(system: string, code: string): PrnReasonDefinition | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* Finds a default additional instruction definition by its SNOMED coding.
|
|
87
|
-
*/
|
|
88
|
-
export declare function findAdditionalInstructionDefinitionByCoding(system: string, code: string): AdditionalInstructionDefinition | undefined;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AnnotatedLexToken } from "./lexer/meaning";
|
|
2
|
+
import { CanonicalAdditionalInstructionExpr, CanonicalDoseRange, CanonicalPrnReasonExpr, CanonicalSigClause, EventTiming, FhirCoding, FhirDayOfWeek, FhirPrimitiveElement, FhirPeriodUnit, PrnReasonLookupRequest, PrnReasonSuggestion, RouteCode, SiteCodeLookupRequest, SiteCodeSuggestion } from "./types";
|
|
3
|
+
export interface SiteLookupDetail {
|
|
4
|
+
request: SiteCodeLookupRequest;
|
|
5
|
+
suggestions: SiteCodeSuggestion[];
|
|
6
|
+
}
|
|
7
|
+
export interface PrnReasonLookupDetail {
|
|
8
|
+
request: PrnReasonLookupRequest;
|
|
9
|
+
suggestions: PrnReasonSuggestion[];
|
|
10
|
+
}
|
|
11
|
+
export interface Token extends AnnotatedLexToken {
|
|
12
|
+
}
|
|
13
|
+
type LocalizedCoding = FhirCoding & {
|
|
14
|
+
i18n?: Record<string, string>;
|
|
15
|
+
};
|
|
16
|
+
export declare class ParserState {
|
|
17
|
+
input: string;
|
|
18
|
+
tokens: Token[];
|
|
19
|
+
consumed: Set<number>;
|
|
20
|
+
warnings: string[];
|
|
21
|
+
siteTokenIndices: Set<number>;
|
|
22
|
+
siteLookupRequest?: SiteCodeLookupRequest;
|
|
23
|
+
siteLookups: SiteLookupDetail[];
|
|
24
|
+
customSiteHints?: Set<string>;
|
|
25
|
+
prnReasonLookupRequest?: PrnReasonLookupRequest;
|
|
26
|
+
prnReasonLookups: PrnReasonLookupDetail[];
|
|
27
|
+
methodVerb?: string;
|
|
28
|
+
productFormKey?: string;
|
|
29
|
+
clauses: CanonicalSigClause[];
|
|
30
|
+
private clause;
|
|
31
|
+
constructor(input: string, tokens: Token[], customSiteHints?: Set<string>);
|
|
32
|
+
get primaryClause(): CanonicalSigClause;
|
|
33
|
+
get dose(): number | undefined;
|
|
34
|
+
set dose(value: number | undefined);
|
|
35
|
+
get doseRange(): CanonicalDoseRange | undefined;
|
|
36
|
+
set doseRange(value: CanonicalDoseRange | undefined);
|
|
37
|
+
get unit(): string | undefined;
|
|
38
|
+
set unit(value: string | undefined);
|
|
39
|
+
get routeCode(): RouteCode | undefined;
|
|
40
|
+
set routeCode(value: RouteCode | undefined);
|
|
41
|
+
get routeText(): string | undefined;
|
|
42
|
+
set routeText(value: string | undefined);
|
|
43
|
+
get methodText(): string | undefined;
|
|
44
|
+
set methodText(value: string | undefined);
|
|
45
|
+
get methodTextElement(): FhirPrimitiveElement | undefined;
|
|
46
|
+
set methodTextElement(value: FhirPrimitiveElement | undefined);
|
|
47
|
+
get methodCoding(): LocalizedCoding | undefined;
|
|
48
|
+
set methodCoding(value: LocalizedCoding | undefined);
|
|
49
|
+
get count(): number | undefined;
|
|
50
|
+
set count(value: number | undefined);
|
|
51
|
+
get duration(): number | undefined;
|
|
52
|
+
set duration(value: number | undefined);
|
|
53
|
+
get durationMax(): number | undefined;
|
|
54
|
+
set durationMax(value: number | undefined);
|
|
55
|
+
get durationUnit(): FhirPeriodUnit | undefined;
|
|
56
|
+
set durationUnit(value: FhirPeriodUnit | undefined);
|
|
57
|
+
get frequency(): number | undefined;
|
|
58
|
+
set frequency(value: number | undefined);
|
|
59
|
+
get frequencyMax(): number | undefined;
|
|
60
|
+
set frequencyMax(value: number | undefined);
|
|
61
|
+
get period(): number | undefined;
|
|
62
|
+
set period(value: number | undefined);
|
|
63
|
+
get periodMax(): number | undefined;
|
|
64
|
+
set periodMax(value: number | undefined);
|
|
65
|
+
get periodUnit(): FhirPeriodUnit | undefined;
|
|
66
|
+
set periodUnit(value: FhirPeriodUnit | undefined);
|
|
67
|
+
get dayOfWeek(): FhirDayOfWeek[];
|
|
68
|
+
get when(): EventTiming[];
|
|
69
|
+
get timeOfDay(): string[] | undefined;
|
|
70
|
+
set timeOfDay(value: string[] | undefined);
|
|
71
|
+
get timingCode(): string | undefined;
|
|
72
|
+
set timingCode(value: string | undefined);
|
|
73
|
+
get asNeeded(): boolean | undefined;
|
|
74
|
+
set asNeeded(value: boolean | undefined);
|
|
75
|
+
get asNeededReason(): string | undefined;
|
|
76
|
+
set asNeededReason(value: string | undefined);
|
|
77
|
+
get asNeededReasons(): CanonicalPrnReasonExpr[] | undefined;
|
|
78
|
+
set asNeededReasons(value: CanonicalPrnReasonExpr[] | undefined);
|
|
79
|
+
get asNeededReasonCoding(): LocalizedCoding | undefined;
|
|
80
|
+
set asNeededReasonCoding(value: LocalizedCoding | undefined);
|
|
81
|
+
get siteText(): string | undefined;
|
|
82
|
+
set siteText(value: string | undefined);
|
|
83
|
+
get siteSource(): "abbreviation" | "text" | "selection" | "resolver" | undefined;
|
|
84
|
+
set siteSource(value: "abbreviation" | "text" | "selection" | "resolver" | undefined);
|
|
85
|
+
get siteCoding(): LocalizedCoding | undefined;
|
|
86
|
+
set siteCoding(value: LocalizedCoding | undefined);
|
|
87
|
+
get additionalInstructions(): CanonicalAdditionalInstructionExpr[];
|
|
88
|
+
set additionalInstructions(value: CanonicalAdditionalInstructionExpr[]);
|
|
89
|
+
get patientInstruction(): string | undefined;
|
|
90
|
+
set patientInstruction(value: string | undefined);
|
|
91
|
+
private ensureDose;
|
|
92
|
+
private ensureRoute;
|
|
93
|
+
private ensureSite;
|
|
94
|
+
private ensureMethod;
|
|
95
|
+
private ensureSchedule;
|
|
96
|
+
private ensurePrn;
|
|
97
|
+
private cleanupPrn;
|
|
98
|
+
private cleanupSite;
|
|
99
|
+
private cleanupMethod;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
package/dist/parser.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserState, Token } from "./parser-state";
|
|
2
2
|
import { ParseOptions, TextRange } from "./types";
|
|
3
3
|
export declare function tokenize(input: string): Token[];
|
|
4
|
-
export declare function findUnparsedTokenGroups(internal:
|
|
4
|
+
export declare function findUnparsedTokenGroups(internal: ParserState): Array<{
|
|
5
5
|
tokens: Token[];
|
|
6
6
|
range?: TextRange;
|
|
7
7
|
}>;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function parseClauseState(input: string, options?: ParseOptions): ParserState;
|
|
9
9
|
/**
|
|
10
10
|
* Resolves parsed site text against SNOMED dictionaries and synchronous
|
|
11
11
|
* callbacks, applying the best match to the in-progress parse result.
|
|
12
12
|
*/
|
|
13
|
-
export declare function applyPrnReasonCoding(internal:
|
|
14
|
-
export declare function applyPrnReasonCodingAsync(internal:
|
|
15
|
-
export declare function applySiteCoding(internal:
|
|
13
|
+
export declare function applyPrnReasonCoding(internal: ParserState, options?: ParseOptions): void;
|
|
14
|
+
export declare function applyPrnReasonCodingAsync(internal: ParserState, options?: ParseOptions): Promise<void>;
|
|
15
|
+
export declare function applySiteCoding(internal: ParserState, options?: ParseOptions): void;
|
|
16
16
|
/**
|
|
17
17
|
* Asynchronous counterpart to {@link applySiteCoding} that awaits resolver and
|
|
18
18
|
* suggestion callbacks so remote terminology services can be used.
|
|
19
19
|
*/
|
|
20
|
-
export declare function applySiteCodingAsync(internal:
|
|
20
|
+
export declare function applySiteCodingAsync(internal: ParserState, options?: ParseOptions): Promise<void>;
|
package/dist/prn.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CanonicalPrnReasonExpr } from "./types";
|
|
2
|
+
export declare function getCanonicalPrnReasonText(reason: CanonicalPrnReasonExpr | undefined): string | undefined;
|
|
3
|
+
export declare function joinCanonicalPrnReasonTexts(reasons: CanonicalPrnReasonExpr[] | undefined, conjunction?: string): string | undefined;
|
|
4
|
+
export declare function getPreferredCanonicalPrnReasonText(reason: CanonicalPrnReasonExpr | undefined, reasons: CanonicalPrnReasonExpr[] | undefined, conjunction?: string): string | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Token } from "./parser-state";
|
|
2
|
+
import { BodySiteDefinition, ParseOptions, RouteCode } from "./types";
|
|
3
|
+
export interface SitePhraseServices {
|
|
4
|
+
customSiteHints?: Set<string>;
|
|
5
|
+
siteConnectors: ReadonlySet<string>;
|
|
6
|
+
siteFillerWords: ReadonlySet<string>;
|
|
7
|
+
isInstructionLikeText?: (text: string) => boolean;
|
|
8
|
+
normalizeTokenLower: (token: Token) => string;
|
|
9
|
+
isBodySiteHint: (word: string, customSiteHints?: Set<string>) => boolean;
|
|
10
|
+
hasExplicitSiteIntroduction: (startIndex: number) => boolean;
|
|
11
|
+
isNumericToken: (value: string) => boolean;
|
|
12
|
+
isOrdinalToken: (value: string) => boolean;
|
|
13
|
+
mapFrequencyAdverb: (value: string) => string | undefined;
|
|
14
|
+
mapIntervalUnit: (value: string) => string | undefined;
|
|
15
|
+
normalizeUnit: (value: string, options?: ParseOptions) => string | undefined;
|
|
16
|
+
hasRouteLikeWord: (value: string, options?: ParseOptions) => boolean;
|
|
17
|
+
hasFrequencyLikeWord: (value: string) => boolean;
|
|
18
|
+
getNextActiveToken: (index: number) => Token | undefined;
|
|
19
|
+
getPreviousActiveToken: (index: number) => Token | undefined;
|
|
20
|
+
hasApplicationVerbBefore: (index: number) => boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SiteLookupServices {
|
|
23
|
+
lookupBodySiteDefinition: (map: Record<string, BodySiteDefinition> | undefined, canonical: string) => BodySiteDefinition | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface SitePhraseCandidate {
|
|
26
|
+
tokenIndices: number[];
|
|
27
|
+
source: "explicit" | "residual";
|
|
28
|
+
}
|
|
29
|
+
export declare function isTimingOnlySitePhrase(words: string[]): boolean;
|
|
30
|
+
export declare function hasExternalSurfaceModifier(siteText: string): boolean;
|
|
31
|
+
export declare function extractExplicitSiteCandidate(tokens: Token[], consumed: Set<number>, startIndex: number, options: ParseOptions | undefined, services: SitePhraseServices): SitePhraseCandidate | undefined;
|
|
32
|
+
export declare function selectBestResidualSiteCandidate(groups: Array<{
|
|
33
|
+
tokens: Token[];
|
|
34
|
+
}>, prnSiteSuffixIndices: Set<number>, services: SitePhraseServices): SitePhraseCandidate | undefined;
|
|
35
|
+
export declare function inferRouteHintFromSitePhrase(siteText: string, options: ParseOptions | undefined, services: SiteLookupServices): RouteCode | undefined;
|
package/dist/timing-summary.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EventTiming } from "./types";
|
|
1
|
+
import { EventTiming, FhirDayOfWeek, FhirPeriodUnit } from "./types";
|
|
3
2
|
export interface TimingSummaryOptions {
|
|
4
3
|
groupMealTimingsByRelation?: boolean;
|
|
5
4
|
includeTimesPerDaySummary?: boolean;
|
|
@@ -11,5 +10,16 @@ export interface MealTimingGroup {
|
|
|
11
10
|
meals: MealName[];
|
|
12
11
|
codes: EventTiming[];
|
|
13
12
|
}
|
|
13
|
+
export interface TimingSummaryInput {
|
|
14
|
+
frequency?: number;
|
|
15
|
+
frequencyMax?: number;
|
|
16
|
+
period?: number;
|
|
17
|
+
periodMax?: number;
|
|
18
|
+
periodUnit?: FhirPeriodUnit;
|
|
19
|
+
timingCode?: string;
|
|
20
|
+
dayOfWeek?: FhirDayOfWeek[];
|
|
21
|
+
when?: EventTiming[];
|
|
22
|
+
timeOfDay?: string[];
|
|
23
|
+
}
|
|
14
24
|
export declare function getMealTimingGroup(when: EventTiming[], options?: TimingSummaryOptions): MealTimingGroup | undefined;
|
|
15
|
-
export declare function inferDailyOccurrenceCount(
|
|
25
|
+
export declare function inferDailyOccurrenceCount(input: TimingSummaryInput, options?: TimingSummaryOptions): number | undefined;
|