ezmedicationinput 0.1.44 → 0.1.46
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 +265 -2
- package/dist/body-site-grammar.d.ts +39 -0
- package/dist/body-site-lookup.d.ts +84 -0
- package/dist/body-site-resolution.d.ts +9 -0
- package/dist/body-site-spatial.d.ts +6 -0
- package/dist/clause-tail-grammar.d.ts +18 -0
- package/dist/fhir-translations.d.ts +4 -1
- package/dist/fhir.d.ts +9 -1
- package/dist/hpsg/chart.d.ts +14 -0
- package/dist/hpsg/clause-parser.d.ts +3 -0
- package/dist/hpsg/defaults.d.ts +9 -0
- package/dist/hpsg/lexical-classes.d.ts +89 -0
- package/dist/hpsg/method-lexicon.d.ts +13 -0
- package/dist/hpsg/projection.d.ts +12 -0
- package/dist/hpsg/rule-context.d.ts +32 -0
- package/dist/hpsg/rules/core-rules.d.ts +8 -0
- package/dist/hpsg/rules/instruction-rules.d.ts +4 -0
- package/dist/hpsg/rules/prn-rules.d.ts +3 -0
- package/dist/hpsg/rules/product-route.d.ts +2 -0
- package/dist/hpsg/rules/site-rules.d.ts +4 -0
- package/dist/hpsg/rules/timing-rules.d.ts +12 -0
- package/dist/hpsg/segmenter.d.ts +6 -0
- package/dist/hpsg/signature.d.ts +116 -0
- package/dist/hpsg/timing-lexicon.d.ts +31 -0
- package/dist/hpsg/unification.d.ts +8 -0
- package/dist/index.cjs +21052 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +20865 -680
- package/dist/maps.d.ts +4 -2
- package/dist/parser-state.d.ts +4 -1
- package/dist/parser.d.ts +3 -13
- package/dist/prn-reason-coding.d.ts +8 -0
- package/dist/site-coding.d.ts +5 -0
- package/dist/snomed-postcoordination.d.ts +25 -0
- package/dist/snomed.d.ts +13 -0
- package/dist/types.d.ts +61 -16
- package/dist/unit-lexicon.d.ts +4 -0
- package/package.json +17 -6
- package/dist/advice-rules.json +0 -772
- package/dist/advice-terminology.json +0 -104
- package/dist/advice.js +0 -1375
- package/dist/context.js +0 -50
- package/dist/event-trigger.d.ts +0 -14
- package/dist/event-trigger.js +0 -501
- package/dist/fhir-translations.js +0 -117
- package/dist/fhir.js +0 -693
- package/dist/format.js +0 -1034
- package/dist/i18n.js +0 -1341
- package/dist/internal-types.d.ts +0 -60
- package/dist/internal-types.js +0 -2
- package/dist/ir.js +0 -178
- package/dist/lexer/lex.js +0 -401
- package/dist/lexer/meaning.js +0 -619
- package/dist/lexer/surface.js +0 -62
- package/dist/lexer/token-types.js +0 -19
- package/dist/maps.js +0 -2226
- package/dist/package.json +0 -3
- package/dist/parser-state.js +0 -441
- package/dist/parser.js +0 -5631
- package/dist/prn.js +0 -59
- package/dist/safety.js +0 -15
- package/dist/schedule.js +0 -1636
- package/dist/segment.d.ts +0 -6
- package/dist/segment.js +0 -203
- package/dist/site-phrases.js +0 -344
- package/dist/suggest.js +0 -907
- package/dist/timing-summary.js +0 -138
- package/dist/types.js +0 -276
- 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/text.js +0 -48
- package/dist/utils/units.js +0 -82
package/dist/prn.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCanonicalPrnReasonText = getCanonicalPrnReasonText;
|
|
4
|
-
exports.joinCanonicalPrnReasonTexts = joinCanonicalPrnReasonTexts;
|
|
5
|
-
exports.getPreferredCanonicalPrnReasonText = getPreferredCanonicalPrnReasonText;
|
|
6
|
-
function getCanonicalPrnReasonText(reason) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
return (_a = reason === null || reason === void 0 ? void 0 : reason.text) !== null && _a !== void 0 ? _a : (_b = reason === null || reason === void 0 ? void 0 : reason.coding) === null || _b === void 0 ? void 0 : _b.display;
|
|
9
|
-
}
|
|
10
|
-
function joinCanonicalPrnReasonTexts(reasons, conjunction = "or") {
|
|
11
|
-
var _a;
|
|
12
|
-
if (!(reasons === null || reasons === void 0 ? void 0 : reasons.length)) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
const texts = [];
|
|
16
|
-
for (const reason of reasons) {
|
|
17
|
-
const text = (_a = getCanonicalPrnReasonText(reason)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
18
|
-
if (!text) {
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
texts.push(text);
|
|
22
|
-
}
|
|
23
|
-
switch (texts.length) {
|
|
24
|
-
case 0:
|
|
25
|
-
return undefined;
|
|
26
|
-
case 1:
|
|
27
|
-
return texts[0];
|
|
28
|
-
case 2:
|
|
29
|
-
return `${texts[0]} ${conjunction} ${texts[1]}`;
|
|
30
|
-
default: {
|
|
31
|
-
let combined = "";
|
|
32
|
-
for (let index = 0; index < texts.length; index += 1) {
|
|
33
|
-
if (index === 0) {
|
|
34
|
-
combined = texts[index];
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (index === texts.length - 1) {
|
|
38
|
-
combined += ` ${conjunction} ${texts[index]}`;
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
combined += `, ${texts[index]}`;
|
|
42
|
-
}
|
|
43
|
-
return combined;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function getPreferredCanonicalPrnReasonText(reason, reasons, conjunction = "or") {
|
|
48
|
-
var _a;
|
|
49
|
-
const direct = (_a = getCanonicalPrnReasonText(reason)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
50
|
-
if (!(reasons === null || reasons === void 0 ? void 0 : reasons.length)) {
|
|
51
|
-
return direct;
|
|
52
|
-
}
|
|
53
|
-
if (!direct) {
|
|
54
|
-
return joinCanonicalPrnReasonTexts(reasons, conjunction);
|
|
55
|
-
}
|
|
56
|
-
return /[,/;]/.test(direct)
|
|
57
|
-
? joinCanonicalPrnReasonTexts(reasons, conjunction)
|
|
58
|
-
: direct;
|
|
59
|
-
}
|
package/dist/safety.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkDiscouraged = checkDiscouraged;
|
|
4
|
-
const maps_1 = require("./maps");
|
|
5
|
-
function checkDiscouraged(token, options) {
|
|
6
|
-
const lower = token.toLowerCase();
|
|
7
|
-
if (!(lower in maps_1.DISCOURAGED_TOKENS)) {
|
|
8
|
-
return { allowed: true };
|
|
9
|
-
}
|
|
10
|
-
const code = maps_1.DISCOURAGED_TOKENS[lower];
|
|
11
|
-
if (options && options.allowDiscouraged === false) {
|
|
12
|
-
throw new Error(`Discouraged token '${token}' is not allowed`);
|
|
13
|
-
}
|
|
14
|
-
return { allowed: true, warning: `${code} is discouraged` };
|
|
15
|
-
}
|