ezmedicationinput 0.1.43 → 0.1.44
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-rules.json +772 -0
- package/dist/advice-terminology.json +104 -0
- package/dist/advice.d.ts +16 -0
- package/dist/advice.js +1375 -0
- package/dist/event-trigger.d.ts +14 -0
- package/dist/event-trigger.js +501 -0
- package/dist/fhir-translations.d.ts +5 -0
- package/dist/fhir-translations.js +117 -0
- package/dist/fhir.d.ts +6 -4
- package/dist/fhir.js +566 -134
- package/dist/format.d.ts +4 -2
- package/dist/format.js +515 -218
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +641 -199
- package/dist/index.d.ts +0 -1
- package/dist/index.js +219 -168
- package/dist/internal-types.d.ts +5 -5
- package/dist/ir.d.ts +4 -0
- package/dist/ir.js +178 -0
- package/dist/lexer/lex.d.ts +2 -0
- package/dist/lexer/lex.js +401 -0
- package/dist/lexer/meaning.d.ts +71 -0
- package/dist/lexer/meaning.js +619 -0
- package/dist/lexer/surface.d.ts +2 -0
- package/dist/lexer/surface.js +62 -0
- package/dist/lexer/token-types.d.ts +36 -0
- package/dist/lexer/token-types.js +19 -0
- package/dist/maps.d.ts +6 -12
- package/dist/maps.js +793 -247
- package/dist/parser-state.d.ts +101 -0
- package/dist/parser-state.js +441 -0
- package/dist/parser.d.ts +7 -7
- package/dist/parser.js +3598 -1974
- package/dist/prn.d.ts +4 -0
- package/dist/prn.js +59 -0
- package/dist/schedule.js +230 -32
- package/dist/site-phrases.d.ts +35 -0
- package/dist/site-phrases.js +344 -0
- package/dist/timing-summary.d.ts +13 -3
- package/dist/timing-summary.js +7 -7
- package/dist/types.d.ts +237 -32
- package/dist/types.js +49 -1
- package/dist/utils/text.d.ts +3 -0
- package/dist/utils/text.js +48 -0
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lexemes": [
|
|
3
|
+
{ "surface": "with", "lemma": "with", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
4
|
+
{ "surface": "without", "lemma": "without", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
5
|
+
{ "surface": "before", "lemma": "before", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
6
|
+
{ "surface": "after", "lemma": "after", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
7
|
+
{ "surface": "during", "lemma": "during", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
8
|
+
{ "surface": "then", "lemma": "then", "partOfSpeech": "relation", "semanticClass": "sequence" },
|
|
9
|
+
{ "surface": "until", "lemma": "until", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
10
|
+
{ "surface": "for", "lemma": "for", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
11
|
+
{ "surface": "in", "lemma": "in", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
12
|
+
{ "surface": "on", "lemma": "on", "partOfSpeech": "relation", "semanticClass": "relation" },
|
|
13
|
+
{ "surface": "avoid", "lemma": "avoid", "partOfSpeech": "verb", "semanticClass": "avoidance" },
|
|
14
|
+
{ "surface": "drink", "lemma": "drink", "partOfSpeech": "verb", "semanticClass": "ingest" },
|
|
15
|
+
{ "surface": "swallow", "lemma": "swallow", "partOfSpeech": "verb", "semanticClass": "ingest" },
|
|
16
|
+
{ "surface": "crush", "lemma": "crush", "partOfSpeech": "verb", "semanticClass": "manipulate" },
|
|
17
|
+
{ "surface": "chew", "lemma": "chew", "partOfSpeech": "verb", "semanticClass": "manipulate" },
|
|
18
|
+
{ "surface": "mix", "lemma": "mix", "partOfSpeech": "verb", "semanticClass": "prepare" },
|
|
19
|
+
{ "surface": "dissolve", "lemma": "dissolve", "partOfSpeech": "verb", "semanticClass": "prepare" },
|
|
20
|
+
{ "surface": "wash", "lemma": "wash", "partOfSpeech": "verb", "semanticClass": "cleanse" },
|
|
21
|
+
{ "surface": "clean", "lemma": "clean", "partOfSpeech": "verb", "semanticClass": "cleanse" },
|
|
22
|
+
{ "surface": "dry", "lemma": "dry", "partOfSpeech": "verb", "semanticClass": "cleanse" },
|
|
23
|
+
{ "surface": "rinse", "lemma": "rinse", "partOfSpeech": "verb", "semanticClass": "cleanse" },
|
|
24
|
+
{ "surface": "cover", "lemma": "cover", "partOfSpeech": "verb", "semanticClass": "cover" },
|
|
25
|
+
{ "surface": "leave", "lemma": "leave", "partOfSpeech": "verb", "semanticClass": "retain" },
|
|
26
|
+
{ "surface": "drive", "lemma": "drive", "partOfSpeech": "verb", "semanticClass": "activity" },
|
|
27
|
+
{ "surface": "driving", "lemma": "drive", "partOfSpeech": "verb", "semanticClass": "activity" },
|
|
28
|
+
{ "surface": "eat", "lemma": "eat", "partOfSpeech": "verb", "semanticClass": "ingest" },
|
|
29
|
+
{ "surface": "cause", "lemma": "cause", "partOfSpeech": "verb", "semanticClass": "effect" },
|
|
30
|
+
{ "surface": "causes", "lemma": "cause", "partOfSpeech": "verb", "semanticClass": "effect" },
|
|
31
|
+
{ "surface": "use", "lemma": "use", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
32
|
+
{ "surface": "take", "lemma": "take", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
33
|
+
{ "surface": "apply", "lemma": "apply", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
34
|
+
{ "surface": "do", "lemma": "do", "partOfSpeech": "auxiliary", "semanticClass": "auxiliary" },
|
|
35
|
+
{ "surface": "not", "lemma": "not", "partOfSpeech": "negator", "semanticClass": "negation" },
|
|
36
|
+
{ "surface": "don't", "lemma": "not", "partOfSpeech": "negator", "semanticClass": "negation" },
|
|
37
|
+
{ "surface": "dont", "lemma": "not", "partOfSpeech": "negator", "semanticClass": "negation" },
|
|
38
|
+
{ "surface": "no", "lemma": "no", "partOfSpeech": "negator", "semanticClass": "negation" },
|
|
39
|
+
{ "surface": "may", "lemma": "may", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
40
|
+
{ "surface": "can", "lemma": "can", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
41
|
+
{ "surface": "might", "lemma": "might", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
42
|
+
{ "surface": "could", "lemma": "could", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
43
|
+
{ "surface": "should", "lemma": "should", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
44
|
+
{ "surface": "must", "lemma": "must", "partOfSpeech": "modifier", "semanticClass": "modal" },
|
|
45
|
+
{ "surface": "whole", "lemma": "whole", "partOfSpeech": "modifier", "semanticClass": "amount_style" },
|
|
46
|
+
{ "surface": "thin layer", "lemma": "thin layer", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
47
|
+
{ "surface": "thin film", "lemma": "thin film", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
48
|
+
{ "surface": "sparingly", "lemma": "sparingly", "partOfSpeech": "modifier", "semanticClass": "amount_style" },
|
|
49
|
+
{ "surface": "liberally", "lemma": "liberally", "partOfSpeech": "modifier", "semanticClass": "amount_style" },
|
|
50
|
+
{ "surface": "slowly", "lemma": "slowly", "partOfSpeech": "modifier", "semanticClass": "manner_style" },
|
|
51
|
+
{ "surface": "pea sized amount", "lemma": "pea sized amount", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
52
|
+
{ "surface": "pea-sized amount", "lemma": "pea sized amount", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
53
|
+
{ "surface": "fingertip unit", "lemma": "fingertip unit", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
54
|
+
{ "surface": "fingertip units", "lemma": "fingertip unit", "partOfSpeech": "noun", "semanticClass": "amount_style" },
|
|
55
|
+
{ "surface": "inject", "lemma": "inject", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
56
|
+
{ "surface": "infuse", "lemma": "infuse", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
57
|
+
{ "surface": "instill", "lemma": "instill", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
58
|
+
{ "surface": "insert", "lemma": "insert", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
59
|
+
{ "surface": "spray", "lemma": "spray", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
60
|
+
{ "surface": "administer", "lemma": "administer", "partOfSpeech": "verb", "semanticClass": "administration" },
|
|
61
|
+
{ "surface": "give", "lemma": "give", "partOfSpeech": "verb", "semanticClass": "administration" }
|
|
62
|
+
],
|
|
63
|
+
"concepts": [
|
|
64
|
+
{ "surface": "food", "lemma": "food", "semanticClass": "meal_state", "conceptId": "food" },
|
|
65
|
+
{ "surface": "meal", "lemma": "meal", "semanticClass": "meal_state", "conceptId": "meal" },
|
|
66
|
+
{ "surface": "meals", "lemma": "meal", "semanticClass": "meal_state", "conceptId": "meal" },
|
|
67
|
+
{
|
|
68
|
+
"surface": "empty stomach",
|
|
69
|
+
"lemma": "empty stomach",
|
|
70
|
+
"semanticClass": "meal_state",
|
|
71
|
+
"conceptId": "empty_stomach",
|
|
72
|
+
"implicitRelation": "on"
|
|
73
|
+
},
|
|
74
|
+
{ "surface": "water", "lemma": "water", "semanticClass": "substance", "conceptId": "water" },
|
|
75
|
+
{ "surface": "plenty of water", "lemma": "water", "semanticClass": "substance", "conceptId": "water" },
|
|
76
|
+
{ "surface": "lots of water", "lemma": "water", "semanticClass": "substance", "conceptId": "water" },
|
|
77
|
+
{ "surface": "alcohol", "lemma": "alcohol", "semanticClass": "substance", "conceptId": "alcohol" },
|
|
78
|
+
{ "surface": "alc", "lemma": "alcohol", "semanticClass": "substance", "conceptId": "alcohol" },
|
|
79
|
+
{ "surface": "alcoholic drink", "lemma": "alcohol", "semanticClass": "substance", "conceptId": "alcohol" },
|
|
80
|
+
{ "surface": "alcoholic drinks", "lemma": "alcohol", "semanticClass": "substance", "conceptId": "alcohol" },
|
|
81
|
+
{ "surface": "sun", "lemma": "sun", "semanticClass": "object", "conceptId": "sunlight" },
|
|
82
|
+
{ "surface": "sunlight", "lemma": "sunlight", "semanticClass": "object", "conceptId": "sunlight" },
|
|
83
|
+
{ "surface": "sun lamps", "lemma": "sun lamps", "semanticClass": "object", "conceptId": "sun_lamps" },
|
|
84
|
+
{ "surface": "drowsiness", "lemma": "drowsiness", "semanticClass": "effect", "conceptId": "drowsiness" },
|
|
85
|
+
{ "surface": "drowsy", "lemma": "drowsiness", "semanticClass": "effect", "conceptId": "drowsiness" },
|
|
86
|
+
{ "surface": "next day", "lemma": "next day", "semanticClass": "time", "conceptId": "next_day" },
|
|
87
|
+
{ "surface": "overnight", "lemma": "overnight", "semanticClass": "duration", "conceptId": "overnight" },
|
|
88
|
+
{ "surface": "morning", "lemma": "morning", "semanticClass": "time", "conceptId": "morning" },
|
|
89
|
+
{ "surface": "evening", "lemma": "evening", "semanticClass": "time", "conceptId": "evening" },
|
|
90
|
+
{ "surface": "night", "lemma": "night", "semanticClass": "time", "conceptId": "night" },
|
|
91
|
+
{ "surface": "bedtime", "lemma": "bedtime", "semanticClass": "time", "conceptId": "bedtime" },
|
|
92
|
+
{ "surface": "showering", "lemma": "showering", "semanticClass": "activity", "conceptId": "showering" },
|
|
93
|
+
{ "surface": "shower", "lemma": "showering", "semanticClass": "activity", "conceptId": "showering" },
|
|
94
|
+
{ "surface": "bathing", "lemma": "bathing", "semanticClass": "activity", "conceptId": "bathing" },
|
|
95
|
+
{ "surface": "bath", "lemma": "bathing", "semanticClass": "activity", "conceptId": "bathing" },
|
|
96
|
+
{ "surface": "washing", "lemma": "washing", "semanticClass": "activity", "conceptId": "washing" },
|
|
97
|
+
{ "surface": "washing hair", "lemma": "washing hair", "semanticClass": "activity", "conceptId": "washing_hair" },
|
|
98
|
+
{ "surface": "shampooing", "lemma": "shampooing", "semanticClass": "activity", "conceptId": "shampooing" },
|
|
99
|
+
{ "surface": "dressing", "lemma": "dressing", "semanticClass": "material", "conceptId": "dressing" },
|
|
100
|
+
{ "surface": "affected area", "lemma": "affected area", "semanticClass": "site", "conceptId": "affected_area" },
|
|
101
|
+
{ "surface": "affected areas", "lemma": "affected area", "semanticClass": "site", "conceptId": "affected_area" },
|
|
102
|
+
{ "surface": "slowly", "lemma": "slowly", "semanticClass": "manner_style", "conceptId": "slowly" }
|
|
103
|
+
]
|
|
104
|
+
}
|
package/dist/advice.d.ts
ADDED
|
@@ -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;
|