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.
Files changed (75) hide show
  1. package/README.md +265 -2
  2. package/dist/body-site-grammar.d.ts +39 -0
  3. package/dist/body-site-lookup.d.ts +84 -0
  4. package/dist/body-site-resolution.d.ts +9 -0
  5. package/dist/body-site-spatial.d.ts +6 -0
  6. package/dist/clause-tail-grammar.d.ts +18 -0
  7. package/dist/fhir-translations.d.ts +4 -1
  8. package/dist/fhir.d.ts +9 -1
  9. package/dist/hpsg/chart.d.ts +14 -0
  10. package/dist/hpsg/clause-parser.d.ts +3 -0
  11. package/dist/hpsg/defaults.d.ts +9 -0
  12. package/dist/hpsg/lexical-classes.d.ts +89 -0
  13. package/dist/hpsg/method-lexicon.d.ts +13 -0
  14. package/dist/hpsg/projection.d.ts +12 -0
  15. package/dist/hpsg/rule-context.d.ts +32 -0
  16. package/dist/hpsg/rules/core-rules.d.ts +8 -0
  17. package/dist/hpsg/rules/instruction-rules.d.ts +4 -0
  18. package/dist/hpsg/rules/prn-rules.d.ts +3 -0
  19. package/dist/hpsg/rules/product-route.d.ts +2 -0
  20. package/dist/hpsg/rules/site-rules.d.ts +4 -0
  21. package/dist/hpsg/rules/timing-rules.d.ts +12 -0
  22. package/dist/hpsg/segmenter.d.ts +6 -0
  23. package/dist/hpsg/signature.d.ts +116 -0
  24. package/dist/hpsg/timing-lexicon.d.ts +31 -0
  25. package/dist/hpsg/unification.d.ts +8 -0
  26. package/dist/index.cjs +21052 -0
  27. package/dist/index.d.ts +5 -0
  28. package/dist/index.js +20865 -680
  29. package/dist/maps.d.ts +4 -2
  30. package/dist/parser-state.d.ts +4 -1
  31. package/dist/parser.d.ts +3 -13
  32. package/dist/prn-reason-coding.d.ts +8 -0
  33. package/dist/site-coding.d.ts +5 -0
  34. package/dist/snomed-postcoordination.d.ts +25 -0
  35. package/dist/snomed.d.ts +13 -0
  36. package/dist/types.d.ts +61 -16
  37. package/dist/unit-lexicon.d.ts +4 -0
  38. package/package.json +17 -6
  39. package/dist/advice-rules.json +0 -772
  40. package/dist/advice-terminology.json +0 -104
  41. package/dist/advice.js +0 -1375
  42. package/dist/context.js +0 -50
  43. package/dist/event-trigger.d.ts +0 -14
  44. package/dist/event-trigger.js +0 -501
  45. package/dist/fhir-translations.js +0 -117
  46. package/dist/fhir.js +0 -693
  47. package/dist/format.js +0 -1034
  48. package/dist/i18n.js +0 -1341
  49. package/dist/internal-types.d.ts +0 -60
  50. package/dist/internal-types.js +0 -2
  51. package/dist/ir.js +0 -178
  52. package/dist/lexer/lex.js +0 -401
  53. package/dist/lexer/meaning.js +0 -619
  54. package/dist/lexer/surface.js +0 -62
  55. package/dist/lexer/token-types.js +0 -19
  56. package/dist/maps.js +0 -2226
  57. package/dist/package.json +0 -3
  58. package/dist/parser-state.js +0 -441
  59. package/dist/parser.js +0 -5631
  60. package/dist/prn.js +0 -59
  61. package/dist/safety.js +0 -15
  62. package/dist/schedule.js +0 -1636
  63. package/dist/segment.d.ts +0 -6
  64. package/dist/segment.js +0 -203
  65. package/dist/site-phrases.js +0 -344
  66. package/dist/suggest.js +0 -907
  67. package/dist/timing-summary.js +0 -138
  68. package/dist/types.js +0 -276
  69. package/dist/utils/array.js +0 -11
  70. package/dist/utils/enum.d.ts +0 -2
  71. package/dist/utils/enum.js +0 -7
  72. package/dist/utils/object.js +0 -34
  73. package/dist/utils/strength.js +0 -149
  74. package/dist/utils/text.js +0 -48
  75. 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
- }