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/maps.js
DELETED
|
@@ -1,1680 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_ADDITIONAL_INSTRUCTION_DEFINITIONS = exports.DEFAULT_ADDITIONAL_INSTRUCTION_ENTRIES = exports.DEFAULT_PRN_REASON_DEFINITIONS = exports.DEFAULT_PRN_REASON_ENTRIES = exports.DEFAULT_UNIT_BY_ROUTE = exports.DEFAULT_UNIT_BY_NORMALIZED_FORM = exports.KNOWN_TMT_DOSAGE_FORM_TO_SNOMED_ROUTE = exports.KNOWN_DOSAGE_FORMS_TO_DOSE = exports.WORD_FREQUENCIES = exports.DAY_OF_WEEK_TOKENS = exports.DISCOURAGED_TOKENS = exports.MEAL_KEYWORDS = exports.EVENT_TIMING_TOKENS = exports.TIMING_ABBREVIATIONS = exports.DEFAULT_UNIT_SYNONYMS = exports.HOUSEHOLD_VOLUME_UNITS = exports.DEFAULT_BODY_SITE_SNOMED = exports.DEFAULT_BODY_SITE_SNOMED_SOURCE = exports.DEFAULT_ROUTE_SYNONYMS = exports.ROUTE_BY_SNOMED = exports.ROUTE_TEXT = exports.ROUTE_SNOMED = void 0;
|
|
4
|
-
exports.normalizeBodySiteKey = normalizeBodySiteKey;
|
|
5
|
-
exports.normalizePrnReasonKey = normalizePrnReasonKey;
|
|
6
|
-
exports.normalizeAdditionalInstructionKey = normalizeAdditionalInstructionKey;
|
|
7
|
-
exports.findPrnReasonDefinitionByCoding = findPrnReasonDefinitionByCoding;
|
|
8
|
-
exports.findAdditionalInstructionDefinitionByCoding = findAdditionalInstructionDefinitionByCoding;
|
|
9
|
-
const types_1 = require("./types");
|
|
10
|
-
const object_1 = require("./utils/object");
|
|
11
|
-
const SNOMED_SYSTEM = "http://snomed.info/sct";
|
|
12
|
-
const ROUTE_TEXT_OVERRIDES = {
|
|
13
|
-
[types_1.RouteCode["Oral route"]]: "by mouth",
|
|
14
|
-
[types_1.RouteCode["Sublingual route"]]: "sublingual",
|
|
15
|
-
[types_1.RouteCode["Buccal route"]]: "buccal",
|
|
16
|
-
[types_1.RouteCode["Respiratory tract route (qualifier value)"]]: "inhalation",
|
|
17
|
-
[types_1.RouteCode["Nasal route"]]: "intranasal",
|
|
18
|
-
[types_1.RouteCode["Topical route"]]: "topical",
|
|
19
|
-
[types_1.RouteCode["Transdermal route"]]: "transdermal",
|
|
20
|
-
[types_1.RouteCode["Subcutaneous route"]]: "subcutaneous",
|
|
21
|
-
[types_1.RouteCode["Intramuscular route"]]: "intramuscular",
|
|
22
|
-
[types_1.RouteCode["Intravenous route"]]: "intravenous",
|
|
23
|
-
[types_1.RouteCode["Per rectum"]]: "rectal",
|
|
24
|
-
[types_1.RouteCode["Per vagina"]]: "vaginal",
|
|
25
|
-
[types_1.RouteCode["Ophthalmic route"]]: "ophthalmic",
|
|
26
|
-
[types_1.RouteCode["Intravitreal route (qualifier value)"]]: "intravitreal"
|
|
27
|
-
};
|
|
28
|
-
function defaultRouteText(display) {
|
|
29
|
-
const cleaned = display.replace(/\s*\(qualifier value\)/gi, "");
|
|
30
|
-
const withoutSuffix = cleaned.replace(/\b(route|use)\b/gi, "");
|
|
31
|
-
return withoutSuffix.replace(/\s+/g, " ").trim().toLowerCase();
|
|
32
|
-
}
|
|
33
|
-
const ROUTE_SNOMED_ENTRIES = (0, object_1.objectEntries)(types_1.SNOMEDCTRouteCodes).map(([display, code]) => {
|
|
34
|
-
const routeCode = code;
|
|
35
|
-
return [
|
|
36
|
-
routeCode,
|
|
37
|
-
{ code: code, display }
|
|
38
|
-
];
|
|
39
|
-
});
|
|
40
|
-
/**
|
|
41
|
-
* SNOMED CT codings aligned with every known RouteCode. Keeping the structure
|
|
42
|
-
* data-driven ensures any additions to the enumeration are surfaced
|
|
43
|
-
* automatically throughout the library.
|
|
44
|
-
*/
|
|
45
|
-
exports.ROUTE_SNOMED = (0, object_1.objectFromEntries)(ROUTE_SNOMED_ENTRIES);
|
|
46
|
-
exports.ROUTE_TEXT = (0, object_1.objectFromEntries)(ROUTE_SNOMED_ENTRIES.map(([routeCode, meta]) => {
|
|
47
|
-
var _a;
|
|
48
|
-
return [
|
|
49
|
-
routeCode,
|
|
50
|
-
(_a = ROUTE_TEXT_OVERRIDES[routeCode]) !== null && _a !== void 0 ? _a : defaultRouteText(meta.display)
|
|
51
|
-
];
|
|
52
|
-
}));
|
|
53
|
-
/**
|
|
54
|
-
* Inverse lookup so that SNOMED codes flowing in from FHIR can be mapped back
|
|
55
|
-
* into our internal RouteCode abstraction during round-tripping.
|
|
56
|
-
*/
|
|
57
|
-
exports.ROUTE_BY_SNOMED = (0, object_1.objectFromEntries)(ROUTE_SNOMED_ENTRIES.map(([routeCode, meta]) => [meta.code, routeCode]));
|
|
58
|
-
exports.DEFAULT_ROUTE_SYNONYMS = (() => {
|
|
59
|
-
const map = {};
|
|
60
|
-
const assign = (key, code) => {
|
|
61
|
-
if (!key)
|
|
62
|
-
return;
|
|
63
|
-
const normalized = key.trim().toLowerCase();
|
|
64
|
-
if (!normalized || map[normalized]) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
map[normalized] = { code, text: exports.ROUTE_TEXT[code] };
|
|
68
|
-
};
|
|
69
|
-
const assignWithAdverb = (key, code) => {
|
|
70
|
-
assign(key, code);
|
|
71
|
-
if (!key)
|
|
72
|
-
return;
|
|
73
|
-
const normalized = key.trim().toLowerCase();
|
|
74
|
-
if (!normalized) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (!/^[a-z]+$/.test(normalized)) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (normalized.length < 4 || normalized.endsWith("ly") || normalized.endsWith("eal")) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
let adverb;
|
|
84
|
-
if (normalized.endsWith("ic")) {
|
|
85
|
-
adverb = normalized.replace(/ic$/, "ically");
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
adverb = `${normalized}ly`;
|
|
89
|
-
}
|
|
90
|
-
assign(adverb, code);
|
|
91
|
-
};
|
|
92
|
-
const registerVariants = (value, code) => {
|
|
93
|
-
if (!value)
|
|
94
|
-
return;
|
|
95
|
-
assignWithAdverb(value, code);
|
|
96
|
-
const withoutParens = value
|
|
97
|
-
.replace(/[()]/g, " ")
|
|
98
|
-
.replace(/\s+/g, " ")
|
|
99
|
-
.trim();
|
|
100
|
-
assignWithAdverb(withoutParens, code);
|
|
101
|
-
const withoutCommas = value
|
|
102
|
-
.replace(/,/g, " ")
|
|
103
|
-
.replace(/\s+/g, " ")
|
|
104
|
-
.trim();
|
|
105
|
-
assignWithAdverb(withoutCommas, code);
|
|
106
|
-
const withoutPunctuation = value
|
|
107
|
-
.replace(/[().,-]/g, " ")
|
|
108
|
-
.replace(/\s+/g, " ")
|
|
109
|
-
.trim();
|
|
110
|
-
assignWithAdverb(withoutPunctuation, code);
|
|
111
|
-
};
|
|
112
|
-
registerVariants("po", types_1.RouteCode["Oral route"]);
|
|
113
|
-
registerVariants("oral", types_1.RouteCode["Oral route"]);
|
|
114
|
-
registerVariants("by mouth", types_1.RouteCode["Oral route"]);
|
|
115
|
-
registerVariants("per os", types_1.RouteCode["Oral route"]);
|
|
116
|
-
registerVariants("sl", types_1.RouteCode["Sublingual route"]);
|
|
117
|
-
registerVariants("s.l.", types_1.RouteCode["Sublingual route"]);
|
|
118
|
-
registerVariants("sublingual", types_1.RouteCode["Sublingual route"]);
|
|
119
|
-
registerVariants("buccal", types_1.RouteCode["Buccal route"]);
|
|
120
|
-
registerVariants("inh", types_1.RouteCode["Respiratory tract route (qualifier value)"]);
|
|
121
|
-
registerVariants("inhalation", types_1.RouteCode["Respiratory tract route (qualifier value)"]);
|
|
122
|
-
registerVariants("inhaled", types_1.RouteCode["Respiratory tract route (qualifier value)"]);
|
|
123
|
-
registerVariants("iv", types_1.RouteCode["Intravenous route"]);
|
|
124
|
-
registerVariants("ivp", types_1.RouteCode["Intravenous route"]);
|
|
125
|
-
registerVariants("ivpb", types_1.RouteCode["Intravenous route"]);
|
|
126
|
-
registerVariants("iv push", types_1.RouteCode["Intravenous route"]);
|
|
127
|
-
registerVariants("iv bolus", types_1.RouteCode["Intravenous route"]);
|
|
128
|
-
registerVariants("iv drip", types_1.RouteCode["Intravenous route"]);
|
|
129
|
-
registerVariants("intravenous", types_1.RouteCode["Intravenous route"]);
|
|
130
|
-
registerVariants("im", types_1.RouteCode["Intramuscular route"]);
|
|
131
|
-
registerVariants("im injection", types_1.RouteCode["Intramuscular route"]);
|
|
132
|
-
registerVariants("intramuscular", types_1.RouteCode["Intramuscular route"]);
|
|
133
|
-
registerVariants("sc", types_1.RouteCode["Subcutaneous route"]);
|
|
134
|
-
registerVariants("sq", types_1.RouteCode["Subcutaneous route"]);
|
|
135
|
-
registerVariants("subq", types_1.RouteCode["Subcutaneous route"]);
|
|
136
|
-
registerVariants("subcut", types_1.RouteCode["Subcutaneous route"]);
|
|
137
|
-
registerVariants("subcutaneous", types_1.RouteCode["Subcutaneous route"]);
|
|
138
|
-
registerVariants("in", types_1.RouteCode["Nasal route"]);
|
|
139
|
-
registerVariants("intranasal", types_1.RouteCode["Nasal route"]);
|
|
140
|
-
registerVariants("nasal", types_1.RouteCode["Nasal route"]);
|
|
141
|
-
registerVariants("top", types_1.RouteCode["Topical route"]);
|
|
142
|
-
registerVariants("topical", types_1.RouteCode["Topical route"]);
|
|
143
|
-
registerVariants("td", types_1.RouteCode["Transdermal route"]);
|
|
144
|
-
registerVariants("patch", types_1.RouteCode["Transdermal route"]);
|
|
145
|
-
registerVariants("transdermal", types_1.RouteCode["Transdermal route"]);
|
|
146
|
-
registerVariants("pr", types_1.RouteCode["Per rectum"]);
|
|
147
|
-
registerVariants("rectal", types_1.RouteCode["Per rectum"]);
|
|
148
|
-
registerVariants("supp", types_1.RouteCode["Per rectum"]);
|
|
149
|
-
registerVariants("suppo", types_1.RouteCode["Per rectum"]);
|
|
150
|
-
registerVariants("suppository", types_1.RouteCode["Per rectum"]);
|
|
151
|
-
registerVariants("suppositories", types_1.RouteCode["Per rectum"]);
|
|
152
|
-
registerVariants("pv", types_1.RouteCode["Per vagina"]);
|
|
153
|
-
registerVariants("vaginal", types_1.RouteCode["Per vagina"]);
|
|
154
|
-
registerVariants("oph", types_1.RouteCode["Ophthalmic route"]);
|
|
155
|
-
registerVariants("ophth", types_1.RouteCode["Ophthalmic route"]);
|
|
156
|
-
registerVariants("ophthalmic", types_1.RouteCode["Ophthalmic route"]);
|
|
157
|
-
registerVariants("ocular", types_1.RouteCode["Ophthalmic route"]);
|
|
158
|
-
registerVariants("intravitreal", types_1.RouteCode["Intravitreal route (qualifier value)"]);
|
|
159
|
-
registerVariants("intravitreal injection", types_1.RouteCode["Intravitreal route (qualifier value)"]);
|
|
160
|
-
registerVariants("ivt", types_1.RouteCode["Intravitreal route (qualifier value)"]);
|
|
161
|
-
for (const [routeCode, meta] of ROUTE_SNOMED_ENTRIES) {
|
|
162
|
-
const display = meta.display.toLowerCase();
|
|
163
|
-
registerVariants(display, routeCode);
|
|
164
|
-
const withoutQualifier = display.replace(/\s*\(qualifier value\)/g, "").trim();
|
|
165
|
-
registerVariants(withoutQualifier, routeCode);
|
|
166
|
-
const withoutSuffix = withoutQualifier
|
|
167
|
-
.replace(/\b(route|use)\b/g, "")
|
|
168
|
-
.replace(/\s+/g, " ")
|
|
169
|
-
.trim();
|
|
170
|
-
registerVariants(withoutSuffix, routeCode);
|
|
171
|
-
const withoutPer = withoutSuffix.replace(/^per\s+/, "").trim();
|
|
172
|
-
registerVariants(withoutPer, routeCode);
|
|
173
|
-
}
|
|
174
|
-
return map;
|
|
175
|
-
})();
|
|
176
|
-
/**
|
|
177
|
-
* Normalizes body-site phrases into lookup keys by trimming, lower-casing, and
|
|
178
|
-
* collapsing whitespace. Custom site maps should normalize their keys with the
|
|
179
|
-
* same logic to ensure consistent lookups.
|
|
180
|
-
*/
|
|
181
|
-
function normalizeBodySiteKey(value) {
|
|
182
|
-
return value
|
|
183
|
-
.trim()
|
|
184
|
-
.toLowerCase()
|
|
185
|
-
.replace(/[^\p{L}\p{N}]+/gu, " ")
|
|
186
|
-
.replace(/\s+/g, " ")
|
|
187
|
-
.trim();
|
|
188
|
-
}
|
|
189
|
-
exports.DEFAULT_BODY_SITE_SNOMED_SOURCE = [
|
|
190
|
-
{
|
|
191
|
-
names: ["eye", "eyes"],
|
|
192
|
-
definition: { coding: { code: "81745001", display: "Eye" } }
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
names: ["left eye"],
|
|
196
|
-
definition: {
|
|
197
|
-
coding: { code: "1290031003", display: "Structure of left eye proper" }
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
names: ["right eye"],
|
|
202
|
-
definition: {
|
|
203
|
-
coding: { code: "1290032005", display: "Structure of right eye proper" }
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
names: ["both eyes", "bilateral eyes"],
|
|
208
|
-
definition: { coding: { code: "40638003", display: "Structure of both eyes" } }
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
names: ["ear", "ears"],
|
|
212
|
-
definition: { coding: { code: "117590005", display: "Ear-related structure" } }
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
names: ["left ear"],
|
|
216
|
-
definition: { coding: { code: "89644007", display: "Left ear" } }
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
names: ["right ear"],
|
|
220
|
-
definition: { coding: { code: "25577004", display: "Right ear" } }
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
names: ["both ears", "bilateral ears"],
|
|
224
|
-
definition: { coding: { code: "34338003", display: "Both ears" } }
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
names: ["nostril", "nostrils"],
|
|
228
|
-
definition: { coding: { code: "1797002", display: "Naris" } }
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
names: ["left nostril", "left naris"],
|
|
232
|
-
definition: {
|
|
233
|
-
coding: { code: "723608007", display: "Structure of left anterior naris" }
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
names: ["right nostril", "right naris"],
|
|
238
|
-
definition: {
|
|
239
|
-
coding: { code: "723609004", display: "Structure of right anterior naris" }
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
names: ["nares", "anterior nares"],
|
|
244
|
-
definition: { coding: { code: "244506005", display: "Anterior nares" } }
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
names: ["nose"],
|
|
248
|
-
definition: { coding: { code: "181195007", display: "Entire nose" } }
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
names: ["mouth"],
|
|
252
|
-
definition: { coding: { code: "123851003", display: "Mouth region" } }
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
names: ["tongue", "tongues"],
|
|
256
|
-
definition: { coding: { code: "21974007", display: "Tongue" } }
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
names: ["cheek", "cheeks"],
|
|
260
|
-
definition: {
|
|
261
|
-
coding: { code: "60819002", display: "Buccal region of face" }
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
names: ["gum", "gums"],
|
|
266
|
-
definition: {
|
|
267
|
-
coding: {
|
|
268
|
-
code: "362116001",
|
|
269
|
-
display: "Entire gum and supporting structure of tooth"
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
names: ["tooth"],
|
|
275
|
-
definition: { coding: { code: "38199008", display: "Tooth" } }
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
names: ["teeth"],
|
|
279
|
-
definition: { coding: { code: "1162715001", display: "All teeth" } }
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
names: ["arm", "upper arm"],
|
|
283
|
-
definition: { coding: { code: "302538001", display: "Entire upper arm" } }
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
names: ["left arm", "left upper arm"],
|
|
287
|
-
definition: {
|
|
288
|
-
coding: { code: "368208006", display: "Left upper arm structure" }
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
names: ["right arm", "right upper arm"],
|
|
293
|
-
definition: { coding: { code: "368209003", display: "Right upper arm" } }
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
names: ["both arms", "bilateral arms"],
|
|
297
|
-
definition: { coding: { code: "69273007", display: "Both arms" } }
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
names: ["forearm"],
|
|
301
|
-
definition: { coding: { code: "14975008", display: "Forearm" } }
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
names: ["left forearm"],
|
|
305
|
-
definition: { coding: { code: "66480008", display: "Left forearm" } }
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
names: ["right forearm"],
|
|
309
|
-
definition: { coding: { code: "64262003", display: "Right forearm" } }
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
names: ["leg", "lower leg"],
|
|
313
|
-
definition: {
|
|
314
|
-
coding: { code: "362793004", display: "Entire lower leg, from knee to ankle" }
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
names: ["left leg", "left lower leg"],
|
|
319
|
-
definition: { coding: { code: "213384005", display: "Entire left lower leg" } }
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
names: ["right leg", "right lower leg"],
|
|
323
|
-
definition: { coding: { code: "213289002", display: "Entire right lower leg" } }
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
names: ["both legs", "bilateral legs"],
|
|
327
|
-
definition: { coding: { code: "40927001", display: "Both legs" } }
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
names: ["thigh"],
|
|
331
|
-
definition: { coding: { code: "68367000", display: "Thigh" } }
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
names: ["left thigh"],
|
|
335
|
-
definition: { coding: { code: "61396006", display: "Left thigh" } }
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
names: ["right thigh"],
|
|
339
|
-
definition: { coding: { code: "11207009", display: "Right thigh" } }
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
names: ["hand", "hands"],
|
|
343
|
-
definition: { coding: { code: "85562004", display: "Hand" } }
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
names: ["left hand"],
|
|
347
|
-
definition: { coding: { code: "85151006", display: "Left hand" } }
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
names: ["right hand"],
|
|
351
|
-
definition: { coding: { code: "78791008", display: "Right hand" } }
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
names: ["foot", "feet"],
|
|
355
|
-
definition: { coding: { code: "56459004", display: "Foot" } }
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
names: ["left foot"],
|
|
359
|
-
definition: { coding: { code: "22335008", display: "Left foot" } }
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
names: ["right foot"],
|
|
363
|
-
definition: { coding: { code: "7769000", display: "Right foot" } }
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
names: ["abdomen", "abdominal", "belly"],
|
|
367
|
-
definition: { coding: { code: "302553009", display: "Entire abdomen" } }
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
names: ["back"],
|
|
371
|
-
definition: { coding: { code: "77568009", display: "Back" } }
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
names: ["scalp"],
|
|
375
|
-
definition: { coding: { code: "41695006", display: "Scalp" } }
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
names: ["face"],
|
|
379
|
-
definition: { coding: { code: "89545001", display: "Face" } }
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
names: ["forehead"],
|
|
383
|
-
definition: { coding: { code: "52795006", display: "Forehead" } }
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
names: ["chin"],
|
|
387
|
-
definition: {
|
|
388
|
-
coding: {
|
|
389
|
-
code: "897081006",
|
|
390
|
-
display: "Skin and/or subcutaneous tissue of chin"
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
names: ["neck"],
|
|
396
|
-
definition: { coding: { code: "45048000", display: "Neck" } }
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
names: ["buttock", "buttocks", "gluteal", "glute"],
|
|
400
|
-
definition: { coding: { code: "46862004", display: "Buttock" } }
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
names: ["left buttock", "left gluteal"],
|
|
404
|
-
definition: { coding: { code: "723979003", display: "Structure of left buttock" } }
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
names: ["right buttock", "right gluteal"],
|
|
408
|
-
definition: { coding: { code: "723980000", display: "Structure of right buttock" } }
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
names: ["muscle", "muscles"],
|
|
412
|
-
definition: {
|
|
413
|
-
coding: {
|
|
414
|
-
code: "362876008",
|
|
415
|
-
display: "All skeletal and smooth muscles of the body"
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
names: ["vein", "veins"],
|
|
421
|
-
definition: { coding: { code: "181367001", display: "Entire vein" } }
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
names: ["vagina", "vaginal"],
|
|
425
|
-
definition: { coding: { code: "76784001", display: "Vagina" } }
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
names: ["penis", "penile"],
|
|
429
|
-
definition: { coding: { code: "18911002", display: "Penis structure" } }
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
names: ["rectum", "rectal"],
|
|
433
|
-
definition: { coding: { code: "34402009", display: "Rectum" } }
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
names: ["anus"],
|
|
437
|
-
definition: { coding: { code: "181262009", display: "Entire anus" } }
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
names: ["perineum"],
|
|
441
|
-
definition: { coding: { code: "243990009", display: "Entire perineum" } }
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
names: ["skin"],
|
|
445
|
-
definition: { coding: { code: "181469002", display: "Entire skin" } }
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
names: ["hair"],
|
|
449
|
-
definition: {
|
|
450
|
-
coding: { code: "386045008", display: "Hair structure (body structure)" }
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
];
|
|
454
|
-
exports.DEFAULT_BODY_SITE_SNOMED = (0, object_1.objectFromEntries)(exports.DEFAULT_BODY_SITE_SNOMED_SOURCE.reduce((entries, source) => {
|
|
455
|
-
const { names, definition } = source;
|
|
456
|
-
for (const name of names) {
|
|
457
|
-
const key = normalizeBodySiteKey(name);
|
|
458
|
-
if (!key) {
|
|
459
|
-
continue;
|
|
460
|
-
}
|
|
461
|
-
entries.push([key, definition]);
|
|
462
|
-
}
|
|
463
|
-
return entries;
|
|
464
|
-
}, []));
|
|
465
|
-
const UNIT_PREFIXES = [
|
|
466
|
-
{ canonical: "", abbreviations: [""], names: [{ singular: "", plural: "" }] },
|
|
467
|
-
{
|
|
468
|
-
canonical: "m",
|
|
469
|
-
abbreviations: ["m"],
|
|
470
|
-
names: [{ singular: "milli", plural: "milli" }],
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
canonical: "mc",
|
|
474
|
-
abbreviations: ["mc", "µ", "μ", "u"],
|
|
475
|
-
names: [{ singular: "micro", plural: "micro" }],
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
canonical: "n",
|
|
479
|
-
abbreviations: ["n"],
|
|
480
|
-
names: [{ singular: "nano", plural: "nano" }],
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
canonical: "k",
|
|
484
|
-
abbreviations: ["k"],
|
|
485
|
-
names: [{ singular: "kilo", plural: "kilo" }],
|
|
486
|
-
},
|
|
487
|
-
];
|
|
488
|
-
const METRIC_UNIT_BASES = [
|
|
489
|
-
{
|
|
490
|
-
canonical: "g",
|
|
491
|
-
abbreviations: ["g"],
|
|
492
|
-
names: [
|
|
493
|
-
{ singular: "gram", plural: "grams" },
|
|
494
|
-
{ singular: "gramme", plural: "grammes" },
|
|
495
|
-
],
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
canonical: "L",
|
|
499
|
-
abbreviations: ["l"],
|
|
500
|
-
names: [
|
|
501
|
-
{ singular: "liter", plural: "liters" },
|
|
502
|
-
{ singular: "litre", plural: "litres" },
|
|
503
|
-
],
|
|
504
|
-
},
|
|
505
|
-
];
|
|
506
|
-
function assignUnitSynonym(map, key, canonical) {
|
|
507
|
-
const normalized = key.trim().toLowerCase();
|
|
508
|
-
if (!normalized || map[normalized]) {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
map[normalized] = canonical;
|
|
512
|
-
}
|
|
513
|
-
function addMetricUnitSynonyms(map) {
|
|
514
|
-
for (const prefix of UNIT_PREFIXES) {
|
|
515
|
-
for (const base of METRIC_UNIT_BASES) {
|
|
516
|
-
const canonical = `${prefix.canonical}${base.canonical}`;
|
|
517
|
-
for (const prefixAbbrev of prefix.abbreviations) {
|
|
518
|
-
for (const baseAbbrev of base.abbreviations) {
|
|
519
|
-
if (!baseAbbrev) {
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
const token = `${prefixAbbrev}${baseAbbrev}`;
|
|
523
|
-
assignUnitSynonym(map, token, canonical);
|
|
524
|
-
assignUnitSynonym(map, `${token}s`, canonical);
|
|
525
|
-
if (token.endsWith(".")) {
|
|
526
|
-
assignUnitSynonym(map, token.replace(/\.+$/, ""), canonical);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
for (const prefixName of prefix.names) {
|
|
531
|
-
for (const baseName of base.names) {
|
|
532
|
-
const singular = `${prefixName.singular}${baseName.singular}`;
|
|
533
|
-
const plural = `${prefixName.singular}${baseName.plural}`;
|
|
534
|
-
const hyphenSingular = prefixName.singular
|
|
535
|
-
? `${prefixName.singular}-${baseName.singular}`
|
|
536
|
-
: baseName.singular;
|
|
537
|
-
const hyphenPlural = prefixName.singular
|
|
538
|
-
? `${prefixName.singular}-${baseName.plural}`
|
|
539
|
-
: baseName.plural;
|
|
540
|
-
assignUnitSynonym(map, singular, canonical);
|
|
541
|
-
assignUnitSynonym(map, plural, canonical);
|
|
542
|
-
assignUnitSynonym(map, hyphenSingular, canonical);
|
|
543
|
-
assignUnitSynonym(map, hyphenPlural, canonical);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
exports.HOUSEHOLD_VOLUME_UNITS = ["tsp", "tbsp"];
|
|
550
|
-
const STATIC_UNIT_SYNONYMS = {
|
|
551
|
-
u: "U",
|
|
552
|
-
unit: "U",
|
|
553
|
-
units: "U",
|
|
554
|
-
iu: "IU",
|
|
555
|
-
"i.u": "IU",
|
|
556
|
-
"i.u.": "IU",
|
|
557
|
-
ius: "IU",
|
|
558
|
-
tab: "tab",
|
|
559
|
-
tabs: "tab",
|
|
560
|
-
tablet: "tab",
|
|
561
|
-
tablets: "tab",
|
|
562
|
-
cap: "cap",
|
|
563
|
-
caps: "cap",
|
|
564
|
-
capsule: "cap",
|
|
565
|
-
capsules: "cap",
|
|
566
|
-
puff: "puff",
|
|
567
|
-
puffs: "puff",
|
|
568
|
-
spray: "spray",
|
|
569
|
-
sprays: "spray",
|
|
570
|
-
drop: "drop",
|
|
571
|
-
drops: "drop",
|
|
572
|
-
patch: "patch",
|
|
573
|
-
patches: "patch",
|
|
574
|
-
supp: "suppository",
|
|
575
|
-
suppository: "suppository",
|
|
576
|
-
suppositories: "suppository",
|
|
577
|
-
tsp: "tsp",
|
|
578
|
-
"tsp.": "tsp",
|
|
579
|
-
tsps: "tsp",
|
|
580
|
-
"tsps.": "tsp",
|
|
581
|
-
teaspoon: "tsp",
|
|
582
|
-
teaspoons: "tsp",
|
|
583
|
-
tbsp: "tbsp",
|
|
584
|
-
"tbsp.": "tbsp",
|
|
585
|
-
tbs: "tbsp",
|
|
586
|
-
"tbs.": "tbsp",
|
|
587
|
-
tablespoon: "tbsp",
|
|
588
|
-
tablespoons: "tbsp",
|
|
589
|
-
};
|
|
590
|
-
exports.DEFAULT_UNIT_SYNONYMS = (() => {
|
|
591
|
-
const map = Object.assign({}, STATIC_UNIT_SYNONYMS);
|
|
592
|
-
addMetricUnitSynonyms(map);
|
|
593
|
-
return map;
|
|
594
|
-
})();
|
|
595
|
-
exports.TIMING_ABBREVIATIONS = {
|
|
596
|
-
qd: {
|
|
597
|
-
code: "QD",
|
|
598
|
-
frequency: 1,
|
|
599
|
-
period: 1,
|
|
600
|
-
periodUnit: types_1.FhirPeriodUnit.Day,
|
|
601
|
-
discouraged: "QD"
|
|
602
|
-
},
|
|
603
|
-
qod: {
|
|
604
|
-
code: "QOD",
|
|
605
|
-
period: 2,
|
|
606
|
-
periodUnit: types_1.FhirPeriodUnit.Day,
|
|
607
|
-
discouraged: "QOD"
|
|
608
|
-
},
|
|
609
|
-
od: {
|
|
610
|
-
code: "QD",
|
|
611
|
-
frequency: 1,
|
|
612
|
-
period: 1,
|
|
613
|
-
periodUnit: types_1.FhirPeriodUnit.Day
|
|
614
|
-
},
|
|
615
|
-
ad: {
|
|
616
|
-
period: 2,
|
|
617
|
-
periodUnit: types_1.FhirPeriodUnit.Day,
|
|
618
|
-
discouraged: "AD"
|
|
619
|
-
},
|
|
620
|
-
bid: {
|
|
621
|
-
code: "BID",
|
|
622
|
-
frequency: 2,
|
|
623
|
-
period: 1,
|
|
624
|
-
periodUnit: types_1.FhirPeriodUnit.Day
|
|
625
|
-
},
|
|
626
|
-
tid: {
|
|
627
|
-
code: "TID",
|
|
628
|
-
frequency: 3,
|
|
629
|
-
period: 1,
|
|
630
|
-
periodUnit: types_1.FhirPeriodUnit.Day
|
|
631
|
-
},
|
|
632
|
-
qid: {
|
|
633
|
-
code: "QID",
|
|
634
|
-
frequency: 4,
|
|
635
|
-
period: 1,
|
|
636
|
-
periodUnit: types_1.FhirPeriodUnit.Day
|
|
637
|
-
},
|
|
638
|
-
q1h: { code: "Q1H", period: 1, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
639
|
-
q2h: { code: "Q2H", period: 2, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
640
|
-
q3h: { code: "Q3H", period: 3, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
641
|
-
q4h: { code: "Q4H", period: 4, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
642
|
-
q6h: { code: "Q6H", period: 6, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
643
|
-
q8h: { code: "Q8H", period: 8, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
644
|
-
q12h: { code: "Q12H", period: 12, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
645
|
-
q24h: { code: "Q24H", period: 24, periodUnit: types_1.FhirPeriodUnit.Hour },
|
|
646
|
-
q1d: {
|
|
647
|
-
code: "QD",
|
|
648
|
-
frequency: 1,
|
|
649
|
-
period: 1,
|
|
650
|
-
periodUnit: types_1.FhirPeriodUnit.Day
|
|
651
|
-
},
|
|
652
|
-
q2d: { code: "Q2D", period: 2, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
653
|
-
q3d: { code: "Q3D", period: 3, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
654
|
-
q1wk: { code: "WK", period: 1, periodUnit: types_1.FhirPeriodUnit.Week },
|
|
655
|
-
q1w: { code: "WK", period: 1, periodUnit: types_1.FhirPeriodUnit.Week },
|
|
656
|
-
q2wk: { code: "Q2WK", period: 2, periodUnit: types_1.FhirPeriodUnit.Week },
|
|
657
|
-
q1mo: { code: "MO", period: 1, periodUnit: types_1.FhirPeriodUnit.Month },
|
|
658
|
-
q2mo: { code: "Q2MO", period: 2, periodUnit: types_1.FhirPeriodUnit.Month },
|
|
659
|
-
wk: { code: "WK", period: 1, periodUnit: types_1.FhirPeriodUnit.Week },
|
|
660
|
-
weekly: { code: "WK", period: 1, periodUnit: types_1.FhirPeriodUnit.Week },
|
|
661
|
-
mo: { code: "MO", period: 1, periodUnit: types_1.FhirPeriodUnit.Month },
|
|
662
|
-
monthly: { code: "MO", period: 1, periodUnit: types_1.FhirPeriodUnit.Month },
|
|
663
|
-
am: { code: "AM", when: [types_1.EventTiming.Morning] },
|
|
664
|
-
pm: { code: "PM", when: [types_1.EventTiming.Evening] }
|
|
665
|
-
};
|
|
666
|
-
exports.EVENT_TIMING_TOKENS = {
|
|
667
|
-
ac: types_1.EventTiming["Before Meal"],
|
|
668
|
-
acm: types_1.EventTiming["Before Breakfast"],
|
|
669
|
-
acl: types_1.EventTiming["Before Lunch"],
|
|
670
|
-
acd: types_1.EventTiming["Before Lunch"],
|
|
671
|
-
acv: types_1.EventTiming["Before Dinner"],
|
|
672
|
-
pc: types_1.EventTiming["After Meal"],
|
|
673
|
-
pcm: types_1.EventTiming["After Breakfast"],
|
|
674
|
-
pcl: types_1.EventTiming["After Lunch"],
|
|
675
|
-
pcd: types_1.EventTiming["After Lunch"],
|
|
676
|
-
pcv: types_1.EventTiming["After Dinner"],
|
|
677
|
-
wm: types_1.EventTiming.Meal,
|
|
678
|
-
c: types_1.EventTiming.Meal,
|
|
679
|
-
"with meals": types_1.EventTiming.Meal,
|
|
680
|
-
"with meal": types_1.EventTiming.Meal,
|
|
681
|
-
"with food": types_1.EventTiming.Meal,
|
|
682
|
-
cc: types_1.EventTiming.Meal,
|
|
683
|
-
"@m": types_1.EventTiming.Meal,
|
|
684
|
-
"@meal": types_1.EventTiming.Meal,
|
|
685
|
-
"@meals": types_1.EventTiming.Meal,
|
|
686
|
-
cm: types_1.EventTiming.Breakfast,
|
|
687
|
-
breakfast: types_1.EventTiming.Breakfast,
|
|
688
|
-
bfast: types_1.EventTiming.Breakfast,
|
|
689
|
-
brkfst: types_1.EventTiming.Breakfast,
|
|
690
|
-
meal: types_1.EventTiming.Meal,
|
|
691
|
-
meals: types_1.EventTiming.Meal,
|
|
692
|
-
food: types_1.EventTiming.Meal,
|
|
693
|
-
brk: types_1.EventTiming.Breakfast,
|
|
694
|
-
cd: types_1.EventTiming.Lunch,
|
|
695
|
-
lunch: types_1.EventTiming.Lunch,
|
|
696
|
-
lunchtime: types_1.EventTiming.Lunch,
|
|
697
|
-
cv: types_1.EventTiming.Dinner,
|
|
698
|
-
dinner: types_1.EventTiming.Dinner,
|
|
699
|
-
dinnertime: types_1.EventTiming.Dinner,
|
|
700
|
-
supper: types_1.EventTiming.Dinner,
|
|
701
|
-
suppertime: types_1.EventTiming.Dinner,
|
|
702
|
-
am: types_1.EventTiming.Morning,
|
|
703
|
-
morning: types_1.EventTiming.Morning,
|
|
704
|
-
morn: types_1.EventTiming.Morning,
|
|
705
|
-
noon: types_1.EventTiming.Noon,
|
|
706
|
-
midday: types_1.EventTiming.Noon,
|
|
707
|
-
"mid-day": types_1.EventTiming.Noon,
|
|
708
|
-
afternoon: types_1.EventTiming.Afternoon,
|
|
709
|
-
aft: types_1.EventTiming.Afternoon,
|
|
710
|
-
pm: types_1.EventTiming.Evening,
|
|
711
|
-
evening: types_1.EventTiming.Evening,
|
|
712
|
-
night: types_1.EventTiming.Night,
|
|
713
|
-
hs: types_1.EventTiming["Before Sleep"],
|
|
714
|
-
bedtime: types_1.EventTiming["Before Sleep"],
|
|
715
|
-
bed: types_1.EventTiming["Before Sleep"],
|
|
716
|
-
sleep: types_1.EventTiming["Before Sleep"],
|
|
717
|
-
wake: types_1.EventTiming.Wake,
|
|
718
|
-
waking: types_1.EventTiming.Wake,
|
|
719
|
-
stat: types_1.EventTiming.Immediate
|
|
720
|
-
};
|
|
721
|
-
const MEAL_KEYWORD_ENTRIES = [];
|
|
722
|
-
function registerMealKeywords(keys, meal) {
|
|
723
|
-
for (const key of keys) {
|
|
724
|
-
MEAL_KEYWORD_ENTRIES.push([key, meal]);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
registerMealKeywords(["breakfast", "bfast", "brkfst", "brk"], {
|
|
728
|
-
pc: types_1.EventTiming["After Breakfast"],
|
|
729
|
-
ac: types_1.EventTiming["Before Breakfast"]
|
|
730
|
-
});
|
|
731
|
-
registerMealKeywords(["lunch", "lunchtime"], {
|
|
732
|
-
pc: types_1.EventTiming["After Lunch"],
|
|
733
|
-
ac: types_1.EventTiming["Before Lunch"]
|
|
734
|
-
});
|
|
735
|
-
registerMealKeywords(["dinner", "dinnertime", "supper", "suppertime"], {
|
|
736
|
-
pc: types_1.EventTiming["After Dinner"],
|
|
737
|
-
ac: types_1.EventTiming["Before Dinner"]
|
|
738
|
-
});
|
|
739
|
-
registerMealKeywords(["meal", "meals", "food"], {
|
|
740
|
-
pc: types_1.EventTiming["After Meal"],
|
|
741
|
-
ac: types_1.EventTiming["Before Meal"]
|
|
742
|
-
});
|
|
743
|
-
exports.MEAL_KEYWORDS = (0, object_1.objectFromEntries)(MEAL_KEYWORD_ENTRIES);
|
|
744
|
-
exports.DISCOURAGED_TOKENS = {
|
|
745
|
-
qd: "QD",
|
|
746
|
-
qod: "QOD",
|
|
747
|
-
od: "OD",
|
|
748
|
-
bld: "BLD",
|
|
749
|
-
"b-l-d": "BLD",
|
|
750
|
-
ad: "AD"
|
|
751
|
-
};
|
|
752
|
-
exports.DAY_OF_WEEK_TOKENS = {
|
|
753
|
-
monday: types_1.FhirDayOfWeek.Monday,
|
|
754
|
-
mon: types_1.FhirDayOfWeek.Monday,
|
|
755
|
-
mond: types_1.FhirDayOfWeek.Monday,
|
|
756
|
-
tuesday: types_1.FhirDayOfWeek.Tuesday,
|
|
757
|
-
tue: types_1.FhirDayOfWeek.Tuesday,
|
|
758
|
-
tues: types_1.FhirDayOfWeek.Tuesday,
|
|
759
|
-
wednesday: types_1.FhirDayOfWeek.Wednesday,
|
|
760
|
-
wed: types_1.FhirDayOfWeek.Wednesday,
|
|
761
|
-
weds: types_1.FhirDayOfWeek.Wednesday,
|
|
762
|
-
thursday: types_1.FhirDayOfWeek.Thursday,
|
|
763
|
-
thu: types_1.FhirDayOfWeek.Thursday,
|
|
764
|
-
thur: types_1.FhirDayOfWeek.Thursday,
|
|
765
|
-
thurs: types_1.FhirDayOfWeek.Thursday,
|
|
766
|
-
friday: types_1.FhirDayOfWeek.Friday,
|
|
767
|
-
fri: types_1.FhirDayOfWeek.Friday,
|
|
768
|
-
saturday: types_1.FhirDayOfWeek.Saturday,
|
|
769
|
-
sat: types_1.FhirDayOfWeek.Saturday,
|
|
770
|
-
sunday: types_1.FhirDayOfWeek.Sunday,
|
|
771
|
-
sun: types_1.FhirDayOfWeek.Sunday,
|
|
772
|
-
จ: types_1.FhirDayOfWeek.Monday,
|
|
773
|
-
จัน: types_1.FhirDayOfWeek.Monday,
|
|
774
|
-
จันทร์: types_1.FhirDayOfWeek.Monday,
|
|
775
|
-
อ: types_1.FhirDayOfWeek.Tuesday,
|
|
776
|
-
อัง: types_1.FhirDayOfWeek.Tuesday,
|
|
777
|
-
อังคาร: types_1.FhirDayOfWeek.Tuesday,
|
|
778
|
-
พ: types_1.FhirDayOfWeek.Wednesday,
|
|
779
|
-
พุธ: types_1.FhirDayOfWeek.Wednesday,
|
|
780
|
-
พฤ: types_1.FhirDayOfWeek.Thursday,
|
|
781
|
-
พฤหัส: types_1.FhirDayOfWeek.Thursday,
|
|
782
|
-
พฤหัสบดี: types_1.FhirDayOfWeek.Thursday,
|
|
783
|
-
ศ: types_1.FhirDayOfWeek.Friday,
|
|
784
|
-
ศุก: types_1.FhirDayOfWeek.Friday,
|
|
785
|
-
ศุกร์: types_1.FhirDayOfWeek.Friday,
|
|
786
|
-
ส: types_1.FhirDayOfWeek.Saturday,
|
|
787
|
-
เสา: types_1.FhirDayOfWeek.Saturday,
|
|
788
|
-
เสาร์: types_1.FhirDayOfWeek.Saturday,
|
|
789
|
-
อา: types_1.FhirDayOfWeek.Sunday,
|
|
790
|
-
อาท: types_1.FhirDayOfWeek.Sunday,
|
|
791
|
-
อาทิตย์: types_1.FhirDayOfWeek.Sunday
|
|
792
|
-
};
|
|
793
|
-
exports.WORD_FREQUENCIES = {
|
|
794
|
-
daily: { frequency: 1, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
795
|
-
"once daily": { frequency: 1, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
796
|
-
once: { frequency: 1, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
797
|
-
twice: { frequency: 2, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
798
|
-
"twice daily": { frequency: 2, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
799
|
-
"three times": { frequency: 3, periodUnit: types_1.FhirPeriodUnit.Day },
|
|
800
|
-
"three times daily": { frequency: 3, periodUnit: types_1.FhirPeriodUnit.Day }
|
|
801
|
-
};
|
|
802
|
-
exports.KNOWN_DOSAGE_FORMS_TO_DOSE = {
|
|
803
|
-
"nasal spray, suspension": "nasal spray",
|
|
804
|
-
"implantation chain": "implantation chain",
|
|
805
|
-
capsule: "capsule",
|
|
806
|
-
"capsule, soft": "capsule",
|
|
807
|
-
"oral solution": "solution",
|
|
808
|
-
"oral suspension": "suspension",
|
|
809
|
-
"inhalation powder": "inhalation",
|
|
810
|
-
"nasal spray, solution": "nasal spray",
|
|
811
|
-
"pressurised inhalation, suspension": "inhalation",
|
|
812
|
-
"pressurised inhalation, solution": "inhalation",
|
|
813
|
-
"rectal foam": "rectal foam",
|
|
814
|
-
"sublingual spray, solution": "sublingual spray",
|
|
815
|
-
"inhalation vapour, solution": "inhalation vapour",
|
|
816
|
-
"inhalation powder, pre-dispensed": "inhalation powder",
|
|
817
|
-
"solution for injection": "injection",
|
|
818
|
-
"inhalation solution": "inhalation",
|
|
819
|
-
cream: "cream",
|
|
820
|
-
"cutaneous powder": "cutaneous powder",
|
|
821
|
-
"powder for solution for injection": "powder for solution for injection",
|
|
822
|
-
gel: "gel",
|
|
823
|
-
"granules for oral solution": "granules for oral solution",
|
|
824
|
-
"powder for oral solution": "powder for oral solution",
|
|
825
|
-
"oral paste": "oral paste",
|
|
826
|
-
"cutaneous stick": "cutaneous stick",
|
|
827
|
-
"prolonged-release granules": "prolonged-release granules",
|
|
828
|
-
"oromucosal gel": "oromucosal gel",
|
|
829
|
-
"oral powder": "oral powder",
|
|
830
|
-
ointment: "ointment",
|
|
831
|
-
"cutaneous paste": "cutaneous paste",
|
|
832
|
-
"powder for oral suspension": "powder for oral suspension",
|
|
833
|
-
"vaginal gel": "vaginal gel",
|
|
834
|
-
"nasal drops, powder for solution": "nasal drops, powder for solution",
|
|
835
|
-
"oral gel": "oral gel",
|
|
836
|
-
"eye gel": "eye gel",
|
|
837
|
-
"impregnated dressing": "impregnated dressing",
|
|
838
|
-
"vaginal cream": "vaginal cream",
|
|
839
|
-
"ear powder": "ear powder",
|
|
840
|
-
"cutaneous emulsion": "cutaneous emulsion",
|
|
841
|
-
"cutaneous liquid": "cutaneous liquid",
|
|
842
|
-
"cutaneous solution": "cutaneous solution",
|
|
843
|
-
"effervescent powder": "effervescent powder",
|
|
844
|
-
"bath additive": "bath additive",
|
|
845
|
-
"nasal spray, powder for solution": "nasal spray, powder for solution",
|
|
846
|
-
"powder for cutaneous solution": "powder for cutaneous solution",
|
|
847
|
-
"dental gel": "dental gel",
|
|
848
|
-
"nasal gel": "nasal gel",
|
|
849
|
-
"powder for oral/rectal suspension": "powder for oral/rectal suspension",
|
|
850
|
-
"gingival gel": "gingival gel",
|
|
851
|
-
"powder for solution for infusion": "powder for solution for infusion",
|
|
852
|
-
"gastro-resistant granules": "gastro-resistant granules",
|
|
853
|
-
"eye ointment": "eye ointment",
|
|
854
|
-
"oromucosal spray, solution": "oromucosal spray, solution",
|
|
855
|
-
granules: "granules",
|
|
856
|
-
collodion: "collodion",
|
|
857
|
-
"powder for rectal solution": "powder for rectal solution",
|
|
858
|
-
"eye drops, solution": "eye drops, solution",
|
|
859
|
-
// additional helpers
|
|
860
|
-
"eye drops": "eye drops, solution",
|
|
861
|
-
"eye drop": "eye drops, solution",
|
|
862
|
-
"oromucosal paste": "oromucosal paste",
|
|
863
|
-
"dental paste": "dental paste",
|
|
864
|
-
"solution for peritoneal dialysis": "solution for peritoneal dialysis",
|
|
865
|
-
paste: "paste",
|
|
866
|
-
"effervescent granules": "effervescent granules",
|
|
867
|
-
shampoo: "shampoo",
|
|
868
|
-
"solution for infusion": "solution for infusion",
|
|
869
|
-
syrup: "syrup",
|
|
870
|
-
"oral liquid": "oral liquid",
|
|
871
|
-
"oral drops, solution": "oral drops, solution",
|
|
872
|
-
"emulsion for infusion": "emulsion for infusion",
|
|
873
|
-
"irrigation solution": "irrigation solution",
|
|
874
|
-
"solution for injection/infusion": "solution for injection/infusion",
|
|
875
|
-
"solution for haemodialysis/haemofiltration": "solution for haemodialysis/haemofiltration",
|
|
876
|
-
"solution for organ preservation": "solution for organ preservation",
|
|
877
|
-
"gargle/mouthwash": "gargle/mouthwash",
|
|
878
|
-
"concentrate for solution for injection/infusion": "concentrate for solution for injection/infusion",
|
|
879
|
-
"concentrate for cutaneous solution": "concentrate for cutaneous solution",
|
|
880
|
-
"cutaneous spray, solution": "cutaneous spray, solution",
|
|
881
|
-
"concentrate for dip solution": "concentrate for dip solution",
|
|
882
|
-
"oral emulsion": "oral emulsion",
|
|
883
|
-
"concentrate for oral solution": "concentrate for oral solution",
|
|
884
|
-
"concentrate for haemodialysis solution": "concentrate for haemodialysis solution",
|
|
885
|
-
"suspension for injection": "suspension for injection",
|
|
886
|
-
"powder and solvent for solution for injection": "powder and solvent for solution for injection",
|
|
887
|
-
"powder and suspension for suspension for injection": "powder and suspension for suspension for injection",
|
|
888
|
-
"powder for suspension for injection": "powder for suspension for injection",
|
|
889
|
-
"transdermal patch": "transdermal patch",
|
|
890
|
-
"powder and solvent for suspension for injection": "powder and solvent for suspension for injection",
|
|
891
|
-
"endotracheopulmonary instillation, powder for solution": "endotracheopulmonary instillation, powder for solution",
|
|
892
|
-
"intrauterine delivery system": "intrauterine delivery system",
|
|
893
|
-
implant: "implant",
|
|
894
|
-
"powder for solution for injection/infusion": "powder for solution for injection/infusion",
|
|
895
|
-
"concentrate for solution for injection": "concentrate for solution for injection",
|
|
896
|
-
"eye drops, emulsion": "eye drops, emulsion",
|
|
897
|
-
"concentrate for dispersion for injection": "concentrate for dispersion for injection",
|
|
898
|
-
"concentrate for solution for infusion": "concentrate for solution for infusion",
|
|
899
|
-
"concentrate and solvent for solution for infusion": "concentrate and solvent for solution for infusion",
|
|
900
|
-
"concentrate and solvent for suspension for injection": "concentrate and solvent for suspension for injection",
|
|
901
|
-
"gel for injection": "gel for injection",
|
|
902
|
-
"prolonged-release suspension for injection": "prolonged-release suspension for injection",
|
|
903
|
-
"rectal solution": "rectal solution",
|
|
904
|
-
"emulsion for injection": "emulsion for injection",
|
|
905
|
-
"oromucosal solution": "oromucosal solution",
|
|
906
|
-
"powder and solvent for solution for infusion": "powder and solvent for solution for infusion",
|
|
907
|
-
"emulsion for injection/infusion": "emulsion for injection/infusion",
|
|
908
|
-
"solution for cardioplegia": "solution for cardioplegia",
|
|
909
|
-
"endotracheopulmonary instillation, suspension": "endotracheopulmonary instillation, suspension",
|
|
910
|
-
"ear drops, solution": "ear drops, solution",
|
|
911
|
-
"eye drops, suspension": "eye drops, suspension",
|
|
912
|
-
"nasal drops, solution": "nasal drops, solution",
|
|
913
|
-
"suspension and solution for spray": "suspension and solution for spray",
|
|
914
|
-
"solution for sealant": "solution for sealant",
|
|
915
|
-
"inhalation vapour, liquid": "inhalation vapour, liquid",
|
|
916
|
-
"ear drops, suspension": "ear drops, suspension",
|
|
917
|
-
"dental suspension": "dental suspension",
|
|
918
|
-
"nebuliser solution": "nebuliser solution",
|
|
919
|
-
"concentrate for gargle": "concentrate for gargle",
|
|
920
|
-
"ear/eye drops, solution": "ear/eye drops, solution",
|
|
921
|
-
"ear wash, solution": "ear wash, solution",
|
|
922
|
-
"oromucosal drops": "oromucosal drops",
|
|
923
|
-
"powder for syrup": "powder for syrup",
|
|
924
|
-
"cutaneous suspension": "cutaneous suspension",
|
|
925
|
-
"eye lotion": "eye lotion",
|
|
926
|
-
"rectal suspension": "rectal suspension",
|
|
927
|
-
"intestinal gel": "intestinal gel",
|
|
928
|
-
"dental solution": "dental solution",
|
|
929
|
-
"gingival solution": "gingival solution",
|
|
930
|
-
"oral drops, suspension": "oral drops, suspension",
|
|
931
|
-
"eye drops, tablet and solvent for solution": "eye drops, tablet and solvent for solution",
|
|
932
|
-
"nebuliser suspension": "nebuliser suspension",
|
|
933
|
-
"dispersion for injection": "dispersion for injection",
|
|
934
|
-
"powder and solvent for oral solution": "powder and solvent for oral solution",
|
|
935
|
-
solution: "solution",
|
|
936
|
-
"powder and solvent for oral suspension": "powder and solvent for oral suspension",
|
|
937
|
-
"suspension and effervescent granules for oral suspension": "suspension and effervescent granules for oral suspension",
|
|
938
|
-
"oral drops, emulsion": "oral drops, emulsion",
|
|
939
|
-
"oral drops, liquid": "oral drops, liquid",
|
|
940
|
-
"oral/rectal suspension": "oral/rectal suspension",
|
|
941
|
-
"intravesical solution": "intravesical solution",
|
|
942
|
-
"granules for oral suspension": "granules for oral suspension",
|
|
943
|
-
"granules for syrup": "granules for syrup",
|
|
944
|
-
tablet: "tablet",
|
|
945
|
-
"film-coated tablet": "film-coated tablet",
|
|
946
|
-
"coated tablet": "coated tablet",
|
|
947
|
-
"chewable tablet": "chewable tablet",
|
|
948
|
-
"capsule, hard": "capsule, hard",
|
|
949
|
-
"gastro-resistant tablet": "gastro-resistant tablet",
|
|
950
|
-
"gastro-resistant granules for oral suspension": "gastro-resistant granules for oral suspension",
|
|
951
|
-
"orodispersible tablet": "orodispersible tablet",
|
|
952
|
-
"gastro-resistant capsule, hard": "gastro-resistant capsule, hard",
|
|
953
|
-
"prolonged-release capsule, hard": "prolonged-release capsule, hard",
|
|
954
|
-
"prolonged-release tablet": "prolonged-release tablet",
|
|
955
|
-
suppository: "suppository",
|
|
956
|
-
lozenge: "lozenge",
|
|
957
|
-
"modified-release tablet": "modified-release tablet",
|
|
958
|
-
"dispersible tablet": "dispersible tablet",
|
|
959
|
-
injection: "injection",
|
|
960
|
-
"powder for concentrate for solution for infusion": "powder for concentrate for solution for infusion",
|
|
961
|
-
"powder and solvent for solution for injection/infusion": "powder and solvent for solution for injection/infusion",
|
|
962
|
-
"powder and solvent for prolonged-release suspension for injection": "powder and solvent for prolonged-release suspension for injection",
|
|
963
|
-
"powder and solvent for concentrate for solution for infusion": "powder and solvent for concentrate for solution for infusion",
|
|
964
|
-
"sublingual tablet": "sublingual tablet",
|
|
965
|
-
"effervescent tablet": "effervescent tablet",
|
|
966
|
-
"vaginal tablet": "vaginal tablet",
|
|
967
|
-
"inhalation powder, hard capsule": "inhalation powder, hard capsule",
|
|
968
|
-
pessary: "pessary",
|
|
969
|
-
"vaginal capsule, hard": "vaginal capsule, hard",
|
|
970
|
-
pastille: "pastille",
|
|
971
|
-
"medicated chewing-gum": "medicated chewing-gum",
|
|
972
|
-
"vaginal delivery system": "vaginal delivery system",
|
|
973
|
-
"medicated plaster": "medicated plaster",
|
|
974
|
-
"intravitreal implant in applicator": "intravitreal implant in applicator",
|
|
975
|
-
"vaginal capsule, soft": "vaginal capsule, soft",
|
|
976
|
-
"lyophilisate and solvent for solution for injection": "lyophilisate and solvent for solution for injection",
|
|
977
|
-
"powder for concentrate for dispersion for infusion": "powder for concentrate for dispersion for infusion",
|
|
978
|
-
"powder for suspension for infusion": "powder for suspension for infusion",
|
|
979
|
-
"cutaneous patch": "cutaneous patch",
|
|
980
|
-
"modified-release capsule, hard": "modified-release capsule, hard",
|
|
981
|
-
"oral lyophilisate": "oral lyophilisate",
|
|
982
|
-
"powders for solution for injection": "powders for solution for injection",
|
|
983
|
-
"capsule, hard-capsule, soft-tablet": "capsule, hard-capsule, soft-tablet",
|
|
984
|
-
"capsule, hard-tablet": "capsule, hard-tablet"
|
|
985
|
-
};
|
|
986
|
-
/**
|
|
987
|
-
* Map of normalized dosage-form labels to their associated SNOMED route code.
|
|
988
|
-
* The keys intentionally mirror KNOWN_DOSAGE_FORMS_TO_DOSE to keep lookups simple.
|
|
989
|
-
*/
|
|
990
|
-
exports.KNOWN_TMT_DOSAGE_FORM_TO_SNOMED_ROUTE = {
|
|
991
|
-
"nasal spray, suspension": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
992
|
-
"implantation chain": types_1.SNOMEDCTRouteCodes["Intralesional use"],
|
|
993
|
-
capsule: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
994
|
-
"capsule, soft": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
995
|
-
"oral solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
996
|
-
"oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
997
|
-
"inhalation powder": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
998
|
-
"nasal spray, solution": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
999
|
-
"pressurised inhalation, suspension": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1000
|
-
"pressurised inhalation, solution": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1001
|
-
"rectal foam": types_1.SNOMEDCTRouteCodes["Per rectum"],
|
|
1002
|
-
"sublingual spray, solution": types_1.SNOMEDCTRouteCodes["Sublingual route"],
|
|
1003
|
-
"inhalation vapour, solution": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1004
|
-
"inhalation powder, pre-dispensed": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1005
|
-
"solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1006
|
-
"inhalation solution": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1007
|
-
cream: types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1008
|
-
"cutaneous powder": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1009
|
-
"powder for solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1010
|
-
gel: types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1011
|
-
"granules for oral solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1012
|
-
"powder for oral solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1013
|
-
"oral paste": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1014
|
-
"cutaneous stick": types_1.SNOMEDCTRouteCodes["Transdermal route"],
|
|
1015
|
-
"prolonged-release granules": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1016
|
-
"oromucosal gel": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1017
|
-
"oral powder": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1018
|
-
ointment: types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1019
|
-
"cutaneous paste": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1020
|
-
"powder for oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1021
|
-
"vaginal gel": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1022
|
-
"nasal drops, powder for solution": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
1023
|
-
"oral gel": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1024
|
-
"eye gel": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1025
|
-
"impregnated dressing": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1026
|
-
"vaginal cream": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1027
|
-
"ear powder": types_1.SNOMEDCTRouteCodes["Otic route"],
|
|
1028
|
-
"cutaneous emulsion": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1029
|
-
"cutaneous liquid": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1030
|
-
"cutaneous solution": types_1.SNOMEDCTRouteCodes["Cutaneous route (qualifier value)"],
|
|
1031
|
-
"effervescent powder": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1032
|
-
"bath additive": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1033
|
-
"nasal spray, powder for solution": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
1034
|
-
"powder for cutaneous solution": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1035
|
-
"dental gel": types_1.SNOMEDCTRouteCodes["Gingival use"],
|
|
1036
|
-
"nasal gel": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
1037
|
-
"powder for oral/rectal suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1038
|
-
"gingival gel": types_1.SNOMEDCTRouteCodes["Gingival use"],
|
|
1039
|
-
"powder for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1040
|
-
"gastro-resistant granules": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1041
|
-
"eye ointment": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1042
|
-
"oromucosal spray, solution": types_1.SNOMEDCTRouteCodes["Oropharyngeal route (qualifier value)"],
|
|
1043
|
-
granules: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1044
|
-
collodion: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1045
|
-
"powder for rectal solution": types_1.SNOMEDCTRouteCodes["Per rectum"],
|
|
1046
|
-
"eye drops, solution": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1047
|
-
"eye drops": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1048
|
-
"eye drop": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1049
|
-
"oromucosal paste": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1050
|
-
"dental paste": types_1.SNOMEDCTRouteCodes["Dental use"],
|
|
1051
|
-
"solution for peritoneal dialysis": types_1.SNOMEDCTRouteCodes["Intradialytic route"],
|
|
1052
|
-
paste: types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1053
|
-
"effervescent granules": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1054
|
-
shampoo: types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1055
|
-
"solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1056
|
-
syrup: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1057
|
-
"oral liquid": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1058
|
-
"oral drops, solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1059
|
-
"emulsion for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1060
|
-
"irrigation solution": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1061
|
-
"solution for injection/infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1062
|
-
"solution for haemodialysis/haemofiltration": types_1.SNOMEDCTRouteCodes["Intradialytic route"],
|
|
1063
|
-
"solution for organ preservation": types_1.SNOMEDCTRouteCodes["Extracorporeal route (qualifier value)"],
|
|
1064
|
-
"gargle/mouthwash": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1065
|
-
"concentrate for solution for injection/infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1066
|
-
"concentrate for cutaneous solution": types_1.SNOMEDCTRouteCodes["Cutaneous route (qualifier value)"],
|
|
1067
|
-
"cutaneous spray, solution": types_1.SNOMEDCTRouteCodes["Cutaneous route (qualifier value)"],
|
|
1068
|
-
"concentrate for dip solution": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1069
|
-
"oral emulsion": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1070
|
-
"concentrate for oral solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1071
|
-
"concentrate for haemodialysis solution": types_1.SNOMEDCTRouteCodes["Intradialytic route"],
|
|
1072
|
-
"suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1073
|
-
"powder and solvent for solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1074
|
-
"powder and suspension for suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1075
|
-
"powder for suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1076
|
-
"transdermal patch": types_1.SNOMEDCTRouteCodes["Transdermal route"],
|
|
1077
|
-
"powder and solvent for suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1078
|
-
"endotracheopulmonary instillation, powder for solution": types_1.SNOMEDCTRouteCodes["Endotracheopulmonary use"],
|
|
1079
|
-
"intrauterine delivery system": types_1.SNOMEDCTRouteCodes["Intrauterine route"],
|
|
1080
|
-
implant: types_1.SNOMEDCTRouteCodes["Intradermal use"],
|
|
1081
|
-
"powder for solution for injection/infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1082
|
-
"concentrate for solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1083
|
-
"eye drops, emulsion": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1084
|
-
"concentrate for dispersion for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1085
|
-
"concentrate for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1086
|
-
"concentrate and solvent for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1087
|
-
"concentrate and solvent for suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1088
|
-
"gel for injection": types_1.SNOMEDCTRouteCodes["Intramuscular route"],
|
|
1089
|
-
"prolonged-release suspension for injection": types_1.SNOMEDCTRouteCodes["Intramuscular route"],
|
|
1090
|
-
"rectal solution": types_1.SNOMEDCTRouteCodes["Per rectum"],
|
|
1091
|
-
"emulsion for injection": types_1.SNOMEDCTRouteCodes["Intramuscular route"],
|
|
1092
|
-
"oromucosal solution": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1093
|
-
"powder and solvent for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1094
|
-
"emulsion for injection/infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1095
|
-
"solution for cardioplegia": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1096
|
-
"endotracheopulmonary instillation, suspension": types_1.SNOMEDCTRouteCodes["Endotracheopulmonary use"],
|
|
1097
|
-
"ear drops, solution": types_1.SNOMEDCTRouteCodes["Otic route"],
|
|
1098
|
-
"eye drops, suspension": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1099
|
-
"nasal drops, solution": types_1.SNOMEDCTRouteCodes["Nasal route"],
|
|
1100
|
-
"suspension and solution for spray": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1101
|
-
"solution for sealant": types_1.SNOMEDCTRouteCodes["Topical route"],
|
|
1102
|
-
"inhalation vapour, liquid": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1103
|
-
"ear drops, suspension": types_1.SNOMEDCTRouteCodes["Otic route"],
|
|
1104
|
-
"dental suspension": types_1.SNOMEDCTRouteCodes["Dental use"],
|
|
1105
|
-
"nebuliser solution": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1106
|
-
"concentrate for gargle": types_1.SNOMEDCTRouteCodes["Oropharyngeal route (qualifier value)"],
|
|
1107
|
-
"ear/eye drops, solution": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1108
|
-
"ear wash, solution": types_1.SNOMEDCTRouteCodes["Otic route"],
|
|
1109
|
-
"oromucosal drops": types_1.SNOMEDCTRouteCodes["Oromucosal use"],
|
|
1110
|
-
"powder for syrup": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1111
|
-
"cutaneous suspension": types_1.SNOMEDCTRouteCodes["Cutaneous route (qualifier value)"],
|
|
1112
|
-
"eye lotion": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1113
|
-
"rectal suspension": types_1.SNOMEDCTRouteCodes["Per rectum"],
|
|
1114
|
-
"intestinal gel": types_1.SNOMEDCTRouteCodes["Intestinal route (qualifier value)"],
|
|
1115
|
-
"dental solution": types_1.SNOMEDCTRouteCodes["Dental use"],
|
|
1116
|
-
"gingival solution": types_1.SNOMEDCTRouteCodes["Gingival use"],
|
|
1117
|
-
"oral drops, suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1118
|
-
"eye drops, tablet and solvent for solution": types_1.SNOMEDCTRouteCodes["Ocular route (qualifier value)"],
|
|
1119
|
-
"nebuliser suspension": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1120
|
-
"dispersion for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1121
|
-
"powder and solvent for oral solution": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1122
|
-
solution: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1123
|
-
"powder and solvent for oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1124
|
-
"suspension and effervescent granules for oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1125
|
-
"oral drops, emulsion": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1126
|
-
"oral drops, liquid": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1127
|
-
"oral/rectal suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1128
|
-
"intravesical solution": types_1.SNOMEDCTRouteCodes["Intralesional use"],
|
|
1129
|
-
"granules for oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1130
|
-
"granules for syrup": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1131
|
-
tablet: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1132
|
-
"film-coated tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1133
|
-
"coated tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1134
|
-
"chewable tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1135
|
-
"capsule, hard": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1136
|
-
"gastro-resistant tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1137
|
-
"gastro-resistant granules for oral suspension": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1138
|
-
"orodispersible tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1139
|
-
"gastro-resistant capsule, hard": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1140
|
-
"prolonged-release capsule, hard": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1141
|
-
"prolonged-release tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1142
|
-
suppository: types_1.SNOMEDCTRouteCodes["Per rectum"],
|
|
1143
|
-
lozenge: types_1.SNOMEDCTRouteCodes["Oropharyngeal route (qualifier value)"],
|
|
1144
|
-
"modified-release tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1145
|
-
"dispersible tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1146
|
-
injection: types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1147
|
-
"powder for concentrate for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1148
|
-
"powder and solvent for solution for injection/infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1149
|
-
"powder and solvent for prolonged-release suspension for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1150
|
-
"powder and solvent for concentrate for solution for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1151
|
-
"sublingual tablet": types_1.SNOMEDCTRouteCodes["Sublingual route"],
|
|
1152
|
-
"effervescent tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1153
|
-
"vaginal tablet": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1154
|
-
"inhalation powder, hard capsule": types_1.SNOMEDCTRouteCodes["Respiratory tract route (qualifier value)"],
|
|
1155
|
-
pessary: types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1156
|
-
"vaginal capsule, hard": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1157
|
-
pastille: types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1158
|
-
"medicated chewing-gum": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1159
|
-
"vaginal delivery system": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1160
|
-
"medicated plaster": types_1.SNOMEDCTRouteCodes["Transdermal route"],
|
|
1161
|
-
"intravitreal implant in applicator": types_1.SNOMEDCTRouteCodes["Intravitreal route (qualifier value)"],
|
|
1162
|
-
"vaginal capsule, soft": types_1.SNOMEDCTRouteCodes["Per vagina"],
|
|
1163
|
-
"lyophilisate and solvent for solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1164
|
-
"powder for concentrate for dispersion for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1165
|
-
"powder for suspension for infusion": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1166
|
-
"cutaneous patch": types_1.SNOMEDCTRouteCodes["Cutaneous route (qualifier value)"],
|
|
1167
|
-
"modified-release capsule, hard": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1168
|
-
"oral lyophilisate": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1169
|
-
"powders for solution for injection": types_1.SNOMEDCTRouteCodes["Intravenous route"],
|
|
1170
|
-
"capsule, hard-capsule, soft-tablet": types_1.SNOMEDCTRouteCodes["Oral route"],
|
|
1171
|
-
"capsule, hard-tablet": types_1.SNOMEDCTRouteCodes["Oral route"]
|
|
1172
|
-
};
|
|
1173
|
-
exports.DEFAULT_UNIT_BY_NORMALIZED_FORM = {
|
|
1174
|
-
tab: "tab",
|
|
1175
|
-
tabs: "tab",
|
|
1176
|
-
tablet: "tab",
|
|
1177
|
-
"film-coated tablet": "tab",
|
|
1178
|
-
"coated tablet": "tab",
|
|
1179
|
-
"chewable tablet": "tab",
|
|
1180
|
-
"dispersible tablet": "tab",
|
|
1181
|
-
"gastro-resistant tablet": "tab",
|
|
1182
|
-
"modified-release tablet": "tab",
|
|
1183
|
-
"orodispersible tablet": "tab",
|
|
1184
|
-
capsule: "cap",
|
|
1185
|
-
caps: "cap",
|
|
1186
|
-
"capsule, soft": "cap",
|
|
1187
|
-
"capsule, hard": "cap",
|
|
1188
|
-
"gastro-resistant capsule, hard": "cap",
|
|
1189
|
-
"prolonged-release capsule, hard": "cap",
|
|
1190
|
-
"modified-release capsule, hard": "cap",
|
|
1191
|
-
"inhalation powder, hard capsule": "cap",
|
|
1192
|
-
solution: "mL",
|
|
1193
|
-
"oral solution": "mL",
|
|
1194
|
-
"solution for injection": "mL",
|
|
1195
|
-
"solution for infusion": "mL",
|
|
1196
|
-
suspension: "mL",
|
|
1197
|
-
"oral suspension": "mL",
|
|
1198
|
-
"powder for oral suspension": "mL",
|
|
1199
|
-
syrup: "mL",
|
|
1200
|
-
"oral liquid": "mL",
|
|
1201
|
-
"oral drops, solution": "mL",
|
|
1202
|
-
"oral drops, suspension": "mL",
|
|
1203
|
-
"oral drops, emulsion": "mL",
|
|
1204
|
-
"oral drops, liquid": "mL",
|
|
1205
|
-
"oral emulsion": "mL",
|
|
1206
|
-
"granules for oral solution": "mL",
|
|
1207
|
-
"granules for oral suspension": "mL",
|
|
1208
|
-
"nasal spray": "spray",
|
|
1209
|
-
"nasal spray, suspension": "spray",
|
|
1210
|
-
"nasal spray, solution": "spray",
|
|
1211
|
-
"nasal spray, powder for solution": "spray",
|
|
1212
|
-
"sublingual spray": "spray",
|
|
1213
|
-
"sublingual spray, solution": "spray",
|
|
1214
|
-
spray: "spray",
|
|
1215
|
-
"cutaneous spray, solution": "spray",
|
|
1216
|
-
inhalation: "puff",
|
|
1217
|
-
"inhalation powder": "puff",
|
|
1218
|
-
"pressurised inhalation, suspension": "puff",
|
|
1219
|
-
"pressurised inhalation, solution": "puff",
|
|
1220
|
-
"inhalation solution": "puff",
|
|
1221
|
-
"inhalation vapour": "puff",
|
|
1222
|
-
"inhalation vapour, solution": "puff",
|
|
1223
|
-
"inhalation vapour, liquid": "puff",
|
|
1224
|
-
"nebuliser solution": "puff",
|
|
1225
|
-
"nebuliser suspension": "puff",
|
|
1226
|
-
ointment: "g",
|
|
1227
|
-
cream: "g",
|
|
1228
|
-
gel: "g",
|
|
1229
|
-
paste: "g",
|
|
1230
|
-
"oral paste": "g",
|
|
1231
|
-
suppository: "suppository",
|
|
1232
|
-
suppositories: "suppository",
|
|
1233
|
-
"rectal foam": "suppository",
|
|
1234
|
-
"rectal solution": "suppository",
|
|
1235
|
-
"rectal suspension": "suppository",
|
|
1236
|
-
patch: "patch",
|
|
1237
|
-
"transdermal patch": "patch",
|
|
1238
|
-
"cutaneous patch": "patch",
|
|
1239
|
-
"medicated plaster": "patch",
|
|
1240
|
-
"cutaneous stick": "stick",
|
|
1241
|
-
drop: "drop",
|
|
1242
|
-
drops: "drop",
|
|
1243
|
-
"eye drops, solution": "drop",
|
|
1244
|
-
"eye drops, suspension": "drop",
|
|
1245
|
-
"ear drops, solution": "drop",
|
|
1246
|
-
"ear drops, suspension": "drop",
|
|
1247
|
-
"ear/eye drops, solution": "drop",
|
|
1248
|
-
lozenge: "lozenge",
|
|
1249
|
-
pastille: "lozenge",
|
|
1250
|
-
pessary: "pessary",
|
|
1251
|
-
injection: "mL",
|
|
1252
|
-
implant: "implant",
|
|
1253
|
-
"implantation chain": "implant",
|
|
1254
|
-
"intrauterine delivery system": "implant",
|
|
1255
|
-
"intravitreal implant in applicator": "implant",
|
|
1256
|
-
"medicated chewing-gum": "piece"
|
|
1257
|
-
};
|
|
1258
|
-
const ROUTE_UNIT_FALLBACK_WHITELIST = new Set([
|
|
1259
|
-
"drop",
|
|
1260
|
-
"puff",
|
|
1261
|
-
"spray",
|
|
1262
|
-
"patch",
|
|
1263
|
-
"suppository",
|
|
1264
|
-
"implant",
|
|
1265
|
-
"piece",
|
|
1266
|
-
"stick",
|
|
1267
|
-
"pessary",
|
|
1268
|
-
"lozenge"
|
|
1269
|
-
]);
|
|
1270
|
-
exports.DEFAULT_UNIT_BY_ROUTE = (() => {
|
|
1271
|
-
const unitCandidates = new Map();
|
|
1272
|
-
for (const [form, snomed] of (0, object_1.objectEntries)(exports.KNOWN_TMT_DOSAGE_FORM_TO_SNOMED_ROUTE)) {
|
|
1273
|
-
const routeCode = exports.ROUTE_BY_SNOMED[snomed];
|
|
1274
|
-
if (!routeCode) {
|
|
1275
|
-
continue;
|
|
1276
|
-
}
|
|
1277
|
-
const unit = exports.DEFAULT_UNIT_BY_NORMALIZED_FORM[form];
|
|
1278
|
-
if (!unit) {
|
|
1279
|
-
continue;
|
|
1280
|
-
}
|
|
1281
|
-
let unitsForRoute = unitCandidates.get(routeCode);
|
|
1282
|
-
if (!unitsForRoute) {
|
|
1283
|
-
unitsForRoute = new Set();
|
|
1284
|
-
unitCandidates.set(routeCode, unitsForRoute);
|
|
1285
|
-
}
|
|
1286
|
-
unitsForRoute.add(unit);
|
|
1287
|
-
}
|
|
1288
|
-
const resolved = {};
|
|
1289
|
-
for (const [route, units] of unitCandidates) {
|
|
1290
|
-
if (units.size !== 1) {
|
|
1291
|
-
continue;
|
|
1292
|
-
}
|
|
1293
|
-
const [unit] = Array.from(units);
|
|
1294
|
-
if (unit && ROUTE_UNIT_FALLBACK_WHITELIST.has(unit)) {
|
|
1295
|
-
resolved[route] = unit;
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
const ensure = (route, unit) => {
|
|
1299
|
-
if (ROUTE_UNIT_FALLBACK_WHITELIST.has(unit)) {
|
|
1300
|
-
resolved[route] = unit;
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
ensure(types_1.RouteCode["Ophthalmic route"], "drop");
|
|
1304
|
-
ensure(types_1.RouteCode["Ocular route (qualifier value)"], "drop");
|
|
1305
|
-
ensure(types_1.RouteCode["Otic route"], "drop");
|
|
1306
|
-
ensure(types_1.RouteCode["Respiratory tract route (qualifier value)"], "puff");
|
|
1307
|
-
ensure(types_1.RouteCode["Transdermal route"], "patch");
|
|
1308
|
-
ensure(types_1.RouteCode["Per rectum"], "suppository");
|
|
1309
|
-
return resolved;
|
|
1310
|
-
})();
|
|
1311
|
-
function normalizePrnReasonKey(value) {
|
|
1312
|
-
return value
|
|
1313
|
-
.trim()
|
|
1314
|
-
.toLowerCase()
|
|
1315
|
-
.replace(/[^\p{L}\p{N}]+/gu, " ")
|
|
1316
|
-
.replace(/\s+/g, " ")
|
|
1317
|
-
.trim();
|
|
1318
|
-
}
|
|
1319
|
-
function normalizeAdditionalInstructionKey(value) {
|
|
1320
|
-
return value
|
|
1321
|
-
.trim()
|
|
1322
|
-
.toLowerCase()
|
|
1323
|
-
.replace(/[^\p{L}\p{N}]+/gu, " ")
|
|
1324
|
-
.replace(/\s+/g, " ")
|
|
1325
|
-
.trim();
|
|
1326
|
-
}
|
|
1327
|
-
const DEFAULT_PRN_REASON_SOURCE = [
|
|
1328
|
-
{
|
|
1329
|
-
names: ["pain", "ache", "aches", "pains"],
|
|
1330
|
-
definition: {
|
|
1331
|
-
coding: { system: SNOMED_SYSTEM, code: "22253000", display: "Pain" },
|
|
1332
|
-
text: "Pain",
|
|
1333
|
-
i18n: { th: "ปวด" }
|
|
1334
|
-
}
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
names: ["nausea", "queasiness", "vomiting", "n/v", "nausea and vomiting"],
|
|
1338
|
-
definition: {
|
|
1339
|
-
coding: { system: SNOMED_SYSTEM, code: "422587007", display: "Nausea" },
|
|
1340
|
-
text: "Nausea",
|
|
1341
|
-
i18n: { th: "คลื่นไส้" }
|
|
1342
|
-
}
|
|
1343
|
-
},
|
|
1344
|
-
{
|
|
1345
|
-
names: ["itch", "itching", "itchy"],
|
|
1346
|
-
definition: {
|
|
1347
|
-
coding: {
|
|
1348
|
-
system: SNOMED_SYSTEM,
|
|
1349
|
-
code: "418363000",
|
|
1350
|
-
display: "Itching of skin"
|
|
1351
|
-
},
|
|
1352
|
-
text: "Itching",
|
|
1353
|
-
i18n: { th: "คัน" }
|
|
1354
|
-
}
|
|
1355
|
-
},
|
|
1356
|
-
{
|
|
1357
|
-
names: ["anxiety", "nervousness"],
|
|
1358
|
-
definition: {
|
|
1359
|
-
coding: { system: SNOMED_SYSTEM, code: "48694002", display: "Anxiety" },
|
|
1360
|
-
text: "Anxiety",
|
|
1361
|
-
i18n: { th: "วิตกกังวล" }
|
|
1362
|
-
}
|
|
1363
|
-
},
|
|
1364
|
-
{
|
|
1365
|
-
names: ["sleep", "sleeping", "insomnia", "sleep issues"],
|
|
1366
|
-
definition: {
|
|
1367
|
-
coding: {
|
|
1368
|
-
system: SNOMED_SYSTEM,
|
|
1369
|
-
code: "193462001",
|
|
1370
|
-
display: "Insomnia"
|
|
1371
|
-
},
|
|
1372
|
-
text: "Sleep",
|
|
1373
|
-
i18n: { th: "นอนหลับ" }
|
|
1374
|
-
}
|
|
1375
|
-
},
|
|
1376
|
-
{
|
|
1377
|
-
names: ["sleepiness", "sleepy", "drowsiness", "drowsy"],
|
|
1378
|
-
definition: {
|
|
1379
|
-
coding: {
|
|
1380
|
-
system: SNOMED_SYSTEM,
|
|
1381
|
-
code: "79519003",
|
|
1382
|
-
display: "Drowsiness"
|
|
1383
|
-
},
|
|
1384
|
-
text: "Sleepiness",
|
|
1385
|
-
i18n: { th: "ง่วงนอน" }
|
|
1386
|
-
}
|
|
1387
|
-
},
|
|
1388
|
-
{
|
|
1389
|
-
names: ["cough", "coughing"],
|
|
1390
|
-
definition: {
|
|
1391
|
-
coding: { system: SNOMED_SYSTEM, code: "49727002", display: "Cough" },
|
|
1392
|
-
text: "Cough",
|
|
1393
|
-
i18n: { th: "ไอ" }
|
|
1394
|
-
}
|
|
1395
|
-
},
|
|
1396
|
-
{
|
|
1397
|
-
names: ["fever", "temperature", "pyrexia"],
|
|
1398
|
-
definition: {
|
|
1399
|
-
coding: { system: SNOMED_SYSTEM, code: "386661006", display: "Fever" },
|
|
1400
|
-
text: "Fever",
|
|
1401
|
-
i18n: { th: "ไข้" }
|
|
1402
|
-
}
|
|
1403
|
-
},
|
|
1404
|
-
{
|
|
1405
|
-
names: ["spasm", "spasms", "muscle spasm"],
|
|
1406
|
-
definition: {
|
|
1407
|
-
coding: { system: SNOMED_SYSTEM, code: "45352006", display: "Spasm" },
|
|
1408
|
-
text: "Spasm",
|
|
1409
|
-
i18n: { th: "ตะคริวหรือเกร็ง" }
|
|
1410
|
-
}
|
|
1411
|
-
},
|
|
1412
|
-
{
|
|
1413
|
-
names: ["constipation"],
|
|
1414
|
-
definition: {
|
|
1415
|
-
coding: {
|
|
1416
|
-
system: SNOMED_SYSTEM,
|
|
1417
|
-
code: "14760008",
|
|
1418
|
-
display: "Constipation"
|
|
1419
|
-
},
|
|
1420
|
-
text: "Constipation",
|
|
1421
|
-
i18n: { th: "ท้องผูก" }
|
|
1422
|
-
}
|
|
1423
|
-
},
|
|
1424
|
-
{
|
|
1425
|
-
names: ["irritation", "irritated"],
|
|
1426
|
-
definition: {
|
|
1427
|
-
coding: {
|
|
1428
|
-
system: SNOMED_SYSTEM,
|
|
1429
|
-
code: "257553007",
|
|
1430
|
-
display: "Irritation"
|
|
1431
|
-
},
|
|
1432
|
-
text: "Irritation",
|
|
1433
|
-
i18n: { th: "ระคายเคือง" }
|
|
1434
|
-
}
|
|
1435
|
-
},
|
|
1436
|
-
{
|
|
1437
|
-
names: ["dyspnea", "shortness of breath", "sob", "breathlessness"],
|
|
1438
|
-
definition: {
|
|
1439
|
-
coding: {
|
|
1440
|
-
system: SNOMED_SYSTEM,
|
|
1441
|
-
code: "267036007",
|
|
1442
|
-
display: "Dyspnea"
|
|
1443
|
-
},
|
|
1444
|
-
text: "Shortness of breath",
|
|
1445
|
-
i18n: { th: "เหนื่อยหรือหายใจลำบาก" }
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
];
|
|
1449
|
-
exports.DEFAULT_PRN_REASON_ENTRIES = DEFAULT_PRN_REASON_SOURCE.map((source) => {
|
|
1450
|
-
var _a, _b, _c;
|
|
1451
|
-
const canonicalTerm = (_c = (_a = source.definition.text) !== null && _a !== void 0 ? _a : (_b = source.definition.coding) === null || _b === void 0 ? void 0 : _b.display) !== null && _c !== void 0 ? _c : source.names[0];
|
|
1452
|
-
return {
|
|
1453
|
-
canonical: normalizePrnReasonKey(canonicalTerm !== null && canonicalTerm !== void 0 ? canonicalTerm : ""),
|
|
1454
|
-
definition: source.definition,
|
|
1455
|
-
terms: [...source.names]
|
|
1456
|
-
};
|
|
1457
|
-
});
|
|
1458
|
-
exports.DEFAULT_PRN_REASON_DEFINITIONS = (0, object_1.objectFromEntries)(DEFAULT_PRN_REASON_SOURCE.reduce((entries, source) => {
|
|
1459
|
-
for (const name of source.names) {
|
|
1460
|
-
const key = normalizePrnReasonKey(name);
|
|
1461
|
-
if (!key) {
|
|
1462
|
-
continue;
|
|
1463
|
-
}
|
|
1464
|
-
entries.push([key, source.definition]);
|
|
1465
|
-
}
|
|
1466
|
-
if (source.definition.aliases) {
|
|
1467
|
-
for (const alias of source.definition.aliases) {
|
|
1468
|
-
const key = normalizePrnReasonKey(alias);
|
|
1469
|
-
if (!key) {
|
|
1470
|
-
continue;
|
|
1471
|
-
}
|
|
1472
|
-
entries.push([key, source.definition]);
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
return entries;
|
|
1476
|
-
}, []));
|
|
1477
|
-
const DEFAULT_ADDITIONAL_INSTRUCTION_SOURCE = [
|
|
1478
|
-
{
|
|
1479
|
-
names: ["with food", "with meals", "with meal", "after food", "after meals"],
|
|
1480
|
-
definition: {
|
|
1481
|
-
coding: {
|
|
1482
|
-
system: SNOMED_SYSTEM,
|
|
1483
|
-
code: "311504000",
|
|
1484
|
-
display: "With or after food"
|
|
1485
|
-
},
|
|
1486
|
-
text: "Take with or after food",
|
|
1487
|
-
i18n: { th: "รับประทานพร้อมหรือหลังอาหาร" }
|
|
1488
|
-
}
|
|
1489
|
-
},
|
|
1490
|
-
{
|
|
1491
|
-
names: ["before food", "before meals", "before meal", "1 hour before food"],
|
|
1492
|
-
definition: {
|
|
1493
|
-
coding: {
|
|
1494
|
-
system: SNOMED_SYSTEM,
|
|
1495
|
-
code: "311501008",
|
|
1496
|
-
display: "Half to one hour before food"
|
|
1497
|
-
},
|
|
1498
|
-
text: "Take before food",
|
|
1499
|
-
i18n: { th: "รับประทานก่อนอาหาร" }
|
|
1500
|
-
}
|
|
1501
|
-
},
|
|
1502
|
-
{
|
|
1503
|
-
names: ["empty stomach", "on empty stomach"],
|
|
1504
|
-
definition: {
|
|
1505
|
-
coding: {
|
|
1506
|
-
system: SNOMED_SYSTEM,
|
|
1507
|
-
code: "717154004",
|
|
1508
|
-
display: "Take on an empty stomach (qualifier value)"
|
|
1509
|
-
},
|
|
1510
|
-
text: "Take on an empty stomach",
|
|
1511
|
-
i18n: { th: "รับประทานขณะท้องว่าง" }
|
|
1512
|
-
}
|
|
1513
|
-
},
|
|
1514
|
-
{
|
|
1515
|
-
names: ["with water", "with plenty of water", "drink water", "with lots of water"],
|
|
1516
|
-
definition: {
|
|
1517
|
-
coding: {
|
|
1518
|
-
system: SNOMED_SYSTEM,
|
|
1519
|
-
code: "419303009",
|
|
1520
|
-
display: "With plenty of water"
|
|
1521
|
-
},
|
|
1522
|
-
text: "Take with plenty of water",
|
|
1523
|
-
i18n: { th: "รับประทานพร้อมน้ำดื่มจำนวนมาก" }
|
|
1524
|
-
}
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
names: ["dissolve in water", "mix with water", "mix in water"],
|
|
1528
|
-
definition: {
|
|
1529
|
-
coding: {
|
|
1530
|
-
system: SNOMED_SYSTEM,
|
|
1531
|
-
code: "417995008",
|
|
1532
|
-
display: "Dissolve or mix with water before taking"
|
|
1533
|
-
},
|
|
1534
|
-
text: "Dissolve or mix with water before taking",
|
|
1535
|
-
i18n: { th: "ละลายหรือผสมน้ำก่อนรับประทาน" }
|
|
1536
|
-
}
|
|
1537
|
-
},
|
|
1538
|
-
{
|
|
1539
|
-
names: ["avoid alcohol", "no alcohol", "no alc", "avoid alcoholic drink"],
|
|
1540
|
-
definition: {
|
|
1541
|
-
coding: {
|
|
1542
|
-
system: SNOMED_SYSTEM,
|
|
1543
|
-
code: "419822006",
|
|
1544
|
-
display: "Warning. Avoid alcoholic drink (qualifier value)"
|
|
1545
|
-
},
|
|
1546
|
-
text: "Avoid alcoholic drinks",
|
|
1547
|
-
i18n: { th: "หลีกเลี่ยงเครื่องดื่มแอลกอฮอล์" }
|
|
1548
|
-
}
|
|
1549
|
-
},
|
|
1550
|
-
{
|
|
1551
|
-
names: ["may cause drowsiness", "do not drive", "avoid driving", "no driving", "no drive"],
|
|
1552
|
-
definition: {
|
|
1553
|
-
coding: {
|
|
1554
|
-
system: SNOMED_SYSTEM,
|
|
1555
|
-
code: "418954008",
|
|
1556
|
-
display: "Warning. May cause drowsiness. If affected do not drive or operate machinery (qualifier value)"
|
|
1557
|
-
},
|
|
1558
|
-
text: "May cause drowsiness; do not drive if affected",
|
|
1559
|
-
i18n: { th: "อาจทำให้ง่วงซึม; ห้ามขับขี่ยานพาหนะหรือทำงานกับเครื่องจักรหากมีอาการ" }
|
|
1560
|
-
}
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
names: [
|
|
1564
|
-
"drowsiness avoid alcohol",
|
|
1565
|
-
"may cause drowsiness avoid alcohol",
|
|
1566
|
-
"do not drive avoid alcohol",
|
|
1567
|
-
"drowsy avoid alc",
|
|
1568
|
-
"drowsy avoid drive",
|
|
1569
|
-
"drowsy avoid driving",
|
|
1570
|
-
"drowsy no drive",
|
|
1571
|
-
"drowsy no driving",
|
|
1572
|
-
"drowsy no alc"
|
|
1573
|
-
],
|
|
1574
|
-
definition: {
|
|
1575
|
-
coding: {
|
|
1576
|
-
system: SNOMED_SYSTEM,
|
|
1577
|
-
code: "418914006",
|
|
1578
|
-
display: "Warning. May cause drowsiness. If affected do not drive or operate machinery. Avoid alcoholic drink (qualifier value)"
|
|
1579
|
-
},
|
|
1580
|
-
text: "May cause drowsiness; avoid driving or alcohol",
|
|
1581
|
-
i18n: { th: "อาจทำให้ง่วงซึม; หลีกเลี่ยงการขับขี่ยานพาหนะหรือดื่มแอลกอฮอล์" }
|
|
1582
|
-
}
|
|
1583
|
-
},
|
|
1584
|
-
{
|
|
1585
|
-
names: [
|
|
1586
|
-
"drowsiness next day",
|
|
1587
|
-
"drowsiness next day avoid alcohol",
|
|
1588
|
-
"may cause drowsiness next day",
|
|
1589
|
-
"may next day drowsy",
|
|
1590
|
-
"may drowsy next day"
|
|
1591
|
-
],
|
|
1592
|
-
definition: {
|
|
1593
|
-
coding: {
|
|
1594
|
-
system: SNOMED_SYSTEM,
|
|
1595
|
-
code: "418071006",
|
|
1596
|
-
display: "Warning. Causes drowsiness which may continue the next day. If affected do not drive or operate machinery. Avoid alcoholic drink (qualifier value)"
|
|
1597
|
-
},
|
|
1598
|
-
text: "May cause next-day drowsiness; avoid driving or alcohol",
|
|
1599
|
-
i18n: { th: "อาจทำให้ง่วงซึมในวันถัดมา; หลีกเลี่ยงการขับขี่ยานพาหนะหรือดื่มแอลกอฮอล์" }
|
|
1600
|
-
}
|
|
1601
|
-
},
|
|
1602
|
-
{
|
|
1603
|
-
names: ["avoid sun", "avoid sunlight", "avoid sun lamps"],
|
|
1604
|
-
definition: {
|
|
1605
|
-
coding: {
|
|
1606
|
-
system: SNOMED_SYSTEM,
|
|
1607
|
-
code: "418521000",
|
|
1608
|
-
display: "Avoid exposure of skin to direct sunlight or sun lamps (qualifier value)"
|
|
1609
|
-
},
|
|
1610
|
-
text: "Avoid sunlight or sun lamps",
|
|
1611
|
-
i18n: { th: "หลีกเลี่ยงแสงแดดหรือหลอดไฟแสงยูวี" }
|
|
1612
|
-
}
|
|
1613
|
-
},
|
|
1614
|
-
{
|
|
1615
|
-
names: ["swallow whole", "do not chew", "do not crush", "do not crush or chew", "no chewing"],
|
|
1616
|
-
definition: {
|
|
1617
|
-
coding: {
|
|
1618
|
-
system: SNOMED_SYSTEM,
|
|
1619
|
-
code: "418693002",
|
|
1620
|
-
display: "Swallowed whole, not chewed (qualifier value)"
|
|
1621
|
-
},
|
|
1622
|
-
text: "Swallow whole; do not crush or chew",
|
|
1623
|
-
i18n: { th: "กลืนทั้งเม็ด; ห้ามเคี้ยวหรือบด" }
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
{
|
|
1627
|
-
names: ["chew", "chewed", "sucked or chewed", "please chew", "must chew"],
|
|
1628
|
-
definition: {
|
|
1629
|
-
coding: {
|
|
1630
|
-
system: SNOMED_SYSTEM,
|
|
1631
|
-
code: "418991002",
|
|
1632
|
-
display: "Sucked or chewed (qualifier value)"
|
|
1633
|
-
},
|
|
1634
|
-
text: "Suck or chew before swallowing",
|
|
1635
|
-
i18n: { th: "เคี้ยวหรืออมให้ละลายก่อนกลืน" }
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
];
|
|
1639
|
-
exports.DEFAULT_ADDITIONAL_INSTRUCTION_ENTRIES = DEFAULT_ADDITIONAL_INSTRUCTION_SOURCE.map((source) => {
|
|
1640
|
-
var _a, _b, _c;
|
|
1641
|
-
const canonicalTerm = (_c = (_a = source.definition.text) !== null && _a !== void 0 ? _a : (_b = source.definition.coding) === null || _b === void 0 ? void 0 : _b.display) !== null && _c !== void 0 ? _c : source.names[0];
|
|
1642
|
-
return {
|
|
1643
|
-
canonical: normalizeAdditionalInstructionKey(canonicalTerm !== null && canonicalTerm !== void 0 ? canonicalTerm : ""),
|
|
1644
|
-
definition: source.definition,
|
|
1645
|
-
terms: [...source.names]
|
|
1646
|
-
};
|
|
1647
|
-
});
|
|
1648
|
-
exports.DEFAULT_ADDITIONAL_INSTRUCTION_DEFINITIONS = (0, object_1.objectFromEntries)(DEFAULT_ADDITIONAL_INSTRUCTION_SOURCE.reduce((entries, source) => {
|
|
1649
|
-
for (const name of source.names) {
|
|
1650
|
-
const key = normalizeAdditionalInstructionKey(name);
|
|
1651
|
-
if (!key) {
|
|
1652
|
-
continue;
|
|
1653
|
-
}
|
|
1654
|
-
entries.push([key, source.definition]);
|
|
1655
|
-
}
|
|
1656
|
-
if (source.definition.aliases) {
|
|
1657
|
-
for (const alias of source.definition.aliases) {
|
|
1658
|
-
const key = normalizeAdditionalInstructionKey(alias);
|
|
1659
|
-
if (!key) {
|
|
1660
|
-
continue;
|
|
1661
|
-
}
|
|
1662
|
-
entries.push([key, source.definition]);
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
return entries;
|
|
1666
|
-
}, []));
|
|
1667
|
-
/**
|
|
1668
|
-
* Finds a default PRN reason definition by its SNOMED coding.
|
|
1669
|
-
*/
|
|
1670
|
-
function findPrnReasonDefinitionByCoding(system, code) {
|
|
1671
|
-
var _a;
|
|
1672
|
-
return (_a = DEFAULT_PRN_REASON_SOURCE.find((source) => { var _a, _b; return ((_a = source.definition.coding) === null || _a === void 0 ? void 0 : _a.system) === system && ((_b = source.definition.coding) === null || _b === void 0 ? void 0 : _b.code) === code; })) === null || _a === void 0 ? void 0 : _a.definition;
|
|
1673
|
-
}
|
|
1674
|
-
/**
|
|
1675
|
-
* Finds a default additional instruction definition by its SNOMED coding.
|
|
1676
|
-
*/
|
|
1677
|
-
function findAdditionalInstructionDefinitionByCoding(system, code) {
|
|
1678
|
-
var _a;
|
|
1679
|
-
return (_a = DEFAULT_ADDITIONAL_INSTRUCTION_SOURCE.find((source) => { var _a, _b; return ((_a = source.definition.coding) === null || _a === void 0 ? void 0 : _a.system) === system && ((_b = source.definition.coding) === null || _b === void 0 ? void 0 : _b.code) === code; })) === null || _a === void 0 ? void 0 : _a.definition;
|
|
1680
|
-
}
|