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/README.md
CHANGED
|
@@ -307,7 +307,7 @@ const result = await parseSigAsync("apply to {left temple} nightly", {
|
|
|
307
307
|
text: "Scalp"
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
|
-
coding: { system: "http://snomed.info/sct", code: "
|
|
310
|
+
coding: { system: "http://snomed.info/sct", code: "450721000", display: "Temple region structure" },
|
|
311
311
|
text: "Temple"
|
|
312
312
|
}
|
|
313
313
|
];
|
|
@@ -375,6 +375,9 @@ You can specify the number of times (total count) the medication is supposed to
|
|
|
375
375
|
combinations (e.g. `1x3` → breakfast/lunch/dinner). This also respects
|
|
376
376
|
`context.mealRelation` when provided and only applies to schedules with four
|
|
377
377
|
or fewer daily doses.
|
|
378
|
+
- `smartMealExpansionScope`: optional include/exclude overrides for route codes
|
|
379
|
+
and dosage forms. When omitted, smart meal expansion uses the built-in
|
|
380
|
+
default heuristic. Exclusions take precedence over includes.
|
|
378
381
|
- `enableMealDashSyntax`: when `true`, enables shorthand meal-dose patterns
|
|
379
382
|
such as `1-0-1`, `1-0-1 pc`, `10-12-0 ac`, and `1-0-0-1 ac`. The parser
|
|
380
383
|
expands them into multiple dosage clauses aligned to breakfast/lunch/dinner
|
package/dist/advice.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdditionalInstructionDefinition, AdviceForce, AdviceFrame, FhirCoding, TextRange } from "./types";
|
|
2
|
+
export interface ParsedAdditionalInstruction {
|
|
3
|
+
text?: string;
|
|
4
|
+
coding?: FhirCoding & {
|
|
5
|
+
i18n?: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
frames: AdviceFrame[];
|
|
8
|
+
}
|
|
9
|
+
export interface AdviceParseContext {
|
|
10
|
+
defaultPredicate: string;
|
|
11
|
+
defaultForce?: AdviceForce;
|
|
12
|
+
allowFreeTextFallback?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseAdditionalInstructions(sourceText: string, span: TextRange, context?: AdviceParseContext): ParsedAdditionalInstruction[];
|
|
15
|
+
export declare function findAdditionalInstructionDefinitionByCoding(system: string, code: string): AdditionalInstructionDefinition | undefined;
|
|
16
|
+
export declare function buildAdditionalInstructionFramesFromCoding(system: string, code: string, sourceText?: string, span?: TextRange): AdviceFrame[] | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FhirPrimitiveElement } from "./types";
|
|
2
|
+
export declare const FHIR_TRANSLATION_EXTENSION_URL = "http://hl7.org/fhir/StructureDefinition/translation";
|
|
3
|
+
export declare function clonePrimitiveElement(element: FhirPrimitiveElement | undefined): FhirPrimitiveElement | undefined;
|
|
4
|
+
export declare function buildTranslationPrimitiveElement(translations: Record<string, string> | undefined, base?: FhirPrimitiveElement): FhirPrimitiveElement | undefined;
|
|
5
|
+
export declare function getPrimitiveTranslation(element: FhirPrimitiveElement | undefined, locale: string | undefined): string | undefined;
|
package/dist/fhir.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FhirDosage } from "./types";
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
1
|
+
import { ParserState } from "./parser-state";
|
|
2
|
+
import { CanonicalSigClause, FhirDosage } from "./types";
|
|
3
|
+
export declare function canonicalToFhir(clause: CanonicalSigClause, textOverride?: string): FhirDosage;
|
|
4
|
+
export declare function toFhir(state: ParserState): FhirDosage;
|
|
5
|
+
export declare function canonicalFromFhir(dosage: FhirDosage): CanonicalSigClause;
|
|
6
|
+
export declare function parserStateFromFhir(dosage: FhirDosage): ParserState;
|
package/dist/format.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserState } from "./parser-state";
|
|
2
2
|
import type { SigLocalization } from "./i18n";
|
|
3
|
+
import { CanonicalSigClause } from "./types";
|
|
3
4
|
import { type TimingSummaryOptions } from "./timing-summary";
|
|
4
|
-
export declare function
|
|
5
|
+
export declare function formatCanonicalClause(clause: CanonicalSigClause, style: "short" | "long", localization?: SigLocalization, options?: TimingSummaryOptions): string;
|
|
6
|
+
export declare function formatInternal(internal: ParserState, style: "short" | "long", localization?: SigLocalization, options?: TimingSummaryOptions): string;
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CanonicalSigClause } from "./types";
|
|
2
2
|
export interface SigFormatContext {
|
|
3
3
|
readonly style: "short" | "long";
|
|
4
|
-
readonly
|
|
4
|
+
readonly clause: CanonicalSigClause;
|
|
5
5
|
readonly defaultText: string;
|
|
6
6
|
readonly groupMealTimingsByRelation: boolean;
|
|
7
7
|
readonly includeTimesPerDaySummary: boolean;
|