ezmedicationinput 0.1.32 → 0.1.33

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/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { nextDueDoses, calculateTotalUnits } from "./schedule";
6
6
  export { parseStrength, parseStrengthIntoRatio } from "./utils/strength";
7
7
  export { getRegisteredSigLocalizations, registerSigLocalization, resolveSigLocalization, resolveSigTranslation } from "./i18n";
8
8
  export type { SigLocalization, SigLocalizationConfig, SigTranslation, SigTranslationConfig } from "./i18n";
9
+ export { DEFAULT_BODY_SITE_SNOMED, DEFAULT_BODY_SITE_SNOMED_SOURCE, DEFAULT_ROUTE_SYNONYMS, DEFAULT_UNIT_BY_ROUTE, KNOWN_DOSAGE_FORMS_TO_DOSE } from './maps';
9
10
  export declare function parseSig(input: string, options?: ParseOptions): ParseResult;
10
11
  export declare function lintSig(input: string, options?: ParseOptions): LintResult;
11
12
  export declare function parseSigAsync(input: string, options?: ParseOptions): Promise<ParseResult>;
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  });
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.resolveSigTranslation = exports.resolveSigLocalization = exports.registerSigLocalization = exports.getRegisteredSigLocalizations = exports.parseStrengthIntoRatio = exports.parseStrength = exports.calculateTotalUnits = exports.nextDueDoses = exports.suggestSig = exports.parseInternal = void 0;
26
+ exports.KNOWN_DOSAGE_FORMS_TO_DOSE = exports.DEFAULT_UNIT_BY_ROUTE = exports.DEFAULT_ROUTE_SYNONYMS = exports.DEFAULT_BODY_SITE_SNOMED_SOURCE = exports.DEFAULT_BODY_SITE_SNOMED = exports.resolveSigTranslation = exports.resolveSigLocalization = exports.registerSigLocalization = exports.getRegisteredSigLocalizations = exports.parseStrengthIntoRatio = exports.parseStrength = exports.calculateTotalUnits = exports.nextDueDoses = exports.suggestSig = exports.parseInternal = void 0;
27
27
  exports.parseSig = parseSig;
28
28
  exports.lintSig = lintSig;
29
29
  exports.parseSigAsync = parseSigAsync;
@@ -49,6 +49,12 @@ Object.defineProperty(exports, "getRegisteredSigLocalizations", { enumerable: tr
49
49
  Object.defineProperty(exports, "registerSigLocalization", { enumerable: true, get: function () { return i18n_2.registerSigLocalization; } });
50
50
  Object.defineProperty(exports, "resolveSigLocalization", { enumerable: true, get: function () { return i18n_2.resolveSigLocalization; } });
51
51
  Object.defineProperty(exports, "resolveSigTranslation", { enumerable: true, get: function () { return i18n_2.resolveSigTranslation; } });
52
+ var maps_1 = require("./maps");
53
+ Object.defineProperty(exports, "DEFAULT_BODY_SITE_SNOMED", { enumerable: true, get: function () { return maps_1.DEFAULT_BODY_SITE_SNOMED; } });
54
+ Object.defineProperty(exports, "DEFAULT_BODY_SITE_SNOMED_SOURCE", { enumerable: true, get: function () { return maps_1.DEFAULT_BODY_SITE_SNOMED_SOURCE; } });
55
+ Object.defineProperty(exports, "DEFAULT_ROUTE_SYNONYMS", { enumerable: true, get: function () { return maps_1.DEFAULT_ROUTE_SYNONYMS; } });
56
+ Object.defineProperty(exports, "DEFAULT_UNIT_BY_ROUTE", { enumerable: true, get: function () { return maps_1.DEFAULT_UNIT_BY_ROUTE; } });
57
+ Object.defineProperty(exports, "KNOWN_DOSAGE_FORMS_TO_DOSE", { enumerable: true, get: function () { return maps_1.KNOWN_DOSAGE_FORMS_TO_DOSE; } });
52
58
  function parseSig(input, options) {
53
59
  const internal = (0, parser_1.parseInternal)(input, options);
54
60
  (0, parser_1.applyPrnReasonCoding)(internal, options);
package/dist/maps.d.ts CHANGED
@@ -25,6 +25,10 @@ export declare const DEFAULT_ROUTE_SYNONYMS: Record<string, RouteSynonym>;
25
25
  * same logic to ensure consistent lookups.
26
26
  */
27
27
  export declare function normalizeBodySiteKey(value: string): string;
28
+ export declare const DEFAULT_BODY_SITE_SNOMED_SOURCE: Array<{
29
+ names: string[];
30
+ definition: BodySiteDefinition;
31
+ }>;
28
32
  export declare const DEFAULT_BODY_SITE_SNOMED: Record<string, BodySiteDefinition>;
29
33
  export declare const HOUSEHOLD_VOLUME_UNITS: readonly ["tsp", "tbsp"];
30
34
  export declare const DEFAULT_UNIT_SYNONYMS: Record<string, string>;
package/dist/maps.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
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_ROUTE_SYNONYMS = exports.ROUTE_BY_SNOMED = exports.ROUTE_TEXT = exports.ROUTE_SNOMED = void 0;
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
4
  exports.normalizeBodySiteKey = normalizeBodySiteKey;
5
5
  exports.normalizePrnReasonKey = normalizePrnReasonKey;
6
6
  exports.normalizeAdditionalInstructionKey = normalizeAdditionalInstructionKey;
@@ -182,7 +182,7 @@ function normalizeBodySiteKey(value) {
182
182
  .replace(/\s+/g, " ")
183
183
  .trim();
184
184
  }
185
- const DEFAULT_BODY_SITE_SNOMED_SOURCE = [
185
+ exports.DEFAULT_BODY_SITE_SNOMED_SOURCE = [
186
186
  {
187
187
  names: ["eye", "eyes"],
188
188
  definition: { coding: { code: "81745001", display: "Eye" } }
@@ -201,7 +201,7 @@ const DEFAULT_BODY_SITE_SNOMED_SOURCE = [
201
201
  },
202
202
  {
203
203
  names: ["both eyes", "bilateral eyes"],
204
- definition: { coding: { code: "362508001", display: "Both eyes, entire" } }
204
+ definition: { coding: { code: "40638003", display: "Structure of both eyes" } }
205
205
  },
206
206
  {
207
207
  names: ["ear", "ears"],
@@ -447,7 +447,7 @@ const DEFAULT_BODY_SITE_SNOMED_SOURCE = [
447
447
  }
448
448
  }
449
449
  ];
450
- exports.DEFAULT_BODY_SITE_SNOMED = (0, object_1.objectFromEntries)(DEFAULT_BODY_SITE_SNOMED_SOURCE.reduce((entries, source) => {
450
+ exports.DEFAULT_BODY_SITE_SNOMED = (0, object_1.objectFromEntries)(exports.DEFAULT_BODY_SITE_SNOMED_SOURCE.reduce((entries, source) => {
451
451
  const { names, definition } = source;
452
452
  for (const name of names) {
453
453
  const key = normalizeBodySiteKey(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezmedicationinput",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Parse concise medication sigs into FHIR R5 Dosage JSON",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",