ezmedicationinput 0.1.57 → 0.1.59

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.
@@ -0,0 +1,19 @@
1
+ import { AdviceFrame, AdviceModality } from "./types";
2
+ export interface AdviceLocaleRealizationInput {
3
+ frame: AdviceFrame;
4
+ predicate: string;
5
+ realizerProfile: string;
6
+ argText?: string;
7
+ modalityText?: string;
8
+ relationText?: string;
9
+ }
10
+ export interface AdviceLocaleAdapter {
11
+ locale: string;
12
+ realizeModality(modality: AdviceModality | undefined): string | undefined;
13
+ siteArgument(text: string): string;
14
+ joinArguments(texts: string[]): string | undefined;
15
+ realize(input: AdviceLocaleRealizationInput): string;
16
+ finalize(text: string): string;
17
+ }
18
+ export declare function registerAdviceLocaleAdapter(adapter: AdviceLocaleAdapter): void;
19
+ export declare function getAdviceLocaleAdapter(locale: string): AdviceLocaleAdapter;
@@ -0,0 +1,5 @@
1
+ export declare const AMBIGUOUS_DIGIT_SITE_KEYS: Set<string>;
2
+ export declare const HAND_CONTEXT_KEYS: Set<string>;
3
+ export declare const FOOT_CONTEXT_KEYS: Set<string>;
4
+ export declare const BODY_SITE_SOURCE_LEAD_PREFIXES: string[];
5
+ export declare function stripBodySiteSourceLead(value: string): string;
@@ -2,23 +2,41 @@ import { BodySiteDefinition, BodySiteSpatialRelation, FhirCoding } from "./types
2
2
  import type { BodySiteLocativeRelation } from "./relation-terminology";
3
3
  export type BodySiteGrammarKind = "nominal" | "partitive" | "locative";
4
4
  export type { BodySiteLocativeRelation };
5
+ export type BodySiteQualifierFeatures = {
6
+ kind: "symptom";
7
+ relation: string;
8
+ text: string;
9
+ canonical: string;
10
+ coding?: FhirCoding;
11
+ i18n?: Record<string, string>;
12
+ } | {
13
+ kind: "site";
14
+ relation: string;
15
+ text: string;
16
+ targetText: string;
17
+ targetCoding?: FhirCoding;
18
+ };
5
19
  export interface BodySiteNominalFeatures {
6
20
  kind: "nominal";
7
21
  text: string;
8
22
  canonical: string;
9
23
  coding?: FhirCoding;
10
24
  article: "definite" | "bare";
25
+ qualifier?: BodySiteQualifierFeatures;
11
26
  }
12
27
  export interface BodySitePartitiveFeatures {
13
28
  kind: "partitive";
14
29
  part: string;
15
30
  relationKey?: string;
16
31
  whole: BodySiteNominalFeatures;
32
+ attributive?: boolean;
33
+ qualifier?: BodySiteQualifierFeatures;
17
34
  }
18
35
  export interface BodySiteLocativeFeatures {
19
36
  kind: "locative";
20
37
  relation: BodySiteLocativeRelation;
21
38
  target: BodySiteNominalFeatures | BodySitePartitiveFeatures;
39
+ qualifier?: BodySiteQualifierFeatures;
22
40
  }
23
41
  export type BodySiteFeatureStructure = BodySiteNominalFeatures | BodySitePartitiveFeatures | BodySiteLocativeFeatures;
24
42
  export interface ResolvedBodySitePhrase {
@@ -13,12 +13,14 @@ type CompoundDoseUnit = {
13
13
  tails: string[];
14
14
  tailSequences?: string[][];
15
15
  requiresSiteContext?: boolean;
16
+ requiresProductContext?: boolean;
16
17
  unit: string;
17
18
  };
18
- type InstructionQuantityUnitLabel = {
19
- th: string;
20
- enOne: string;
21
- enOther: string;
19
+ export type InstructionQuantityUnitLabel = {
20
+ locales: Record<string, {
21
+ one: string;
22
+ other: string;
23
+ }>;
22
24
  };
23
25
  export declare const SITE_ANCHORS: Set<string>;
24
26
  export declare const SITE_SELF_DISPLAY_ANCHORS: Set<string>;
@@ -27,7 +29,9 @@ export declare const BODY_SITE_PARTITIVE_HEADS: Set<string>;
27
29
  export declare const BODY_SITE_PARTITIVE_MODIFIERS: Set<string>;
28
30
  export declare const BODY_SITE_PARTITIVE_CONNECTORS: Set<string>;
29
31
  export declare const BODY_SITE_BARE_NOMINAL_PREFIXES: Set<string>;
32
+ export declare const BODY_SITE_BARE_NOMINAL_PREFIX_I18N: Record<string, Record<string, string>>;
30
33
  export declare const BODY_SITE_ATTRIBUTIVE_MODIFIERS: Set<string>;
34
+ export declare const BODY_SITE_ATTRIBUTIVE_MODIFIER_I18N: Record<string, Record<string, string>>;
31
35
  export declare const OTIC_SITE_WORDS: Set<string>;
32
36
  export declare const OPHTHALMIC_SITE_WORDS: Set<string>;
33
37
  export declare const NASAL_SITE_WORDS: Set<string>;
@@ -35,7 +39,7 @@ export declare const BODY_SITE_ADJECTIVE_SUFFIXES: readonly string[];
35
39
  export declare const BODY_SITE_DISPLAY_PENALTY_WORDS: Set<string>;
36
40
  export declare const BODY_SITE_FEATURE_SCORE_BONUS: Map<BodySiteFeatureKind, number>;
37
41
  export declare const CONNECTORS: Set<string>;
38
- export declare const THAI_METHOD_AUXILIARY_VERBS: Set<string>;
42
+ export declare function methodAuxiliaryVerbsForLocale(locale: string): ReadonlySet<string>;
39
43
  export declare const COORDINATED_NOUN_METHOD_VERBS: Set<string>;
40
44
  export declare const METHOD_NOUN_LEFT_CONTEXT: Map<string, Set<string>>;
41
45
  export declare const PRODUCT_EXTERNAL_MODIFIERS: Set<string>;
@@ -63,8 +67,8 @@ export declare const PRN_GENERIC_LOCATED_HEADS: Map<string, string>;
63
67
  export declare const PRN_DEFAULT_SITE_CONNECTOR: string;
64
68
  export declare const PRN_COMPACT_REASON_SEPARATORS: Set<string>;
65
69
  export declare const SITE_ROUTE_HINTS_ALLOWED_IN_GRAMMAR: Set<import("../types").SNOMEDCTRouteCodes>;
66
- export declare const PRODUCT_METHOD_TEXT: Record<string, Partial<Record<string, string>>>;
67
- export declare const PRODUCT_METHOD_THAI: Record<string, string>;
70
+ export declare const PRODUCT_METHOD_REALIZATIONS: Record<string, Partial<Record<string, Record<string, string>>>>;
71
+ export declare function productMethodRealizations(verb: string, product: string): Record<string, string> | undefined;
68
72
  export declare const PRODUCT_FORM_MODIFIERS: Set<string>;
69
73
  export declare const COMPOUND_DOSE_UNITS: CompoundDoseUnit[];
70
74
  export declare const IMPLICIT_SINGLE_DOSE_UNITS: Set<string>;
@@ -125,6 +129,7 @@ export declare const ACTION_DIRECTIVE_PREFIXES: {
125
129
  modality: AdviceModality | undefined;
126
130
  }[];
127
131
  export declare const ACTION_COORDINATION_CONNECTORS: Set<string>;
132
+ export declare const ACTION_COORDINATION_CONNECTOR_I18N: Record<string, Record<string, string>>;
128
133
  export declare const ACTION_SEQUENCE_RELATION_TOKENS: ReadonlySet<string>;
129
134
  export declare const INSTRUCTION_DURATION_UNITS: Map<string, string>;
130
135
  export declare const INSTRUCTION_DURATION_APPROXIMATION_LEADS: Set<string>;
@@ -140,6 +145,7 @@ export declare const ALTERNATE_EVENT_CADENCES: {
140
145
  export declare const ADMINISTRATION_WINDOW_INSTRUCTIONS: {
141
146
  parts: string[];
142
147
  text: string;
148
+ offsetOnly: boolean;
143
149
  i18n: {
144
150
  th: string;
145
151
  } | undefined;
@@ -17,6 +17,12 @@ export declare function normalizePeriodRange(low: number, high: number, unit: Fh
17
17
  high: number;
18
18
  unit: FhirPeriodUnit;
19
19
  };
20
+ /** Normalize a range whose endpoints use different exact-duration units. */
21
+ export declare function normalizeMixedPeriodRange(low: number, lowUnit: FhirPeriodUnit, high: number, highUnit: FhirPeriodUnit): {
22
+ low: number;
23
+ high: number;
24
+ unit: FhirPeriodUnit;
25
+ } | undefined;
20
26
  export declare function periodUnitSuffix(unit: FhirPeriodUnit): string | undefined;
21
27
  export declare function applyPeriod(internal: ParserState, period: number, unit: FhirPeriodUnit): void;
22
28
  export declare function buildPeriodScheduleFeature(period: number, unit: FhirPeriodUnit): HpsgScheduleFeature;