@mieweb/ui 0.10.0-dev.10 → 0.10.0-dev.12
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/Input-yN516s5_.d.cts +3 -0
- package/dist/Input-yN516s5_.d.ts +3 -0
- package/dist/ag-grid.d.cts +142 -1
- package/dist/ag-grid.d.ts +142 -1
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/index.d.cts +28 -3
- package/dist/components/AlertDialog/index.d.ts +28 -3
- package/dist/components/AudioRecorder/index.d.cts +2 -2
- package/dist/components/AudioRecorder/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.cts +8 -2
- package/dist/components/Autocomplete/index.d.ts +8 -2
- package/dist/components/Avatar/index.d.cts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BoardView/index.d.cts +91 -4
- package/dist/components/BoardView/index.d.ts +91 -4
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/CalendarView/index.d.cts +1 -2
- package/dist/components/CalendarView/index.d.ts +1 -2
- package/dist/components/Card/index.d.cts +3 -3
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/GanttView/index.d.cts +1 -2
- package/dist/components/GanttView/index.d.ts +1 -2
- package/dist/components/ListView/index.d.cts +2 -3
- package/dist/components/ListView/index.d.ts +2 -3
- package/dist/components/MediaEditor/index.d.cts +91 -2
- package/dist/components/MediaEditor/index.d.ts +91 -2
- package/dist/components/MediaPlayer/index.d.cts +1 -1
- package/dist/components/MediaPlayer/index.d.ts +1 -1
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PhoneInput/index.d.cts +36 -3
- package/dist/components/PhoneInput/index.d.ts +36 -3
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Q/index.d.cts +2 -2
- package/dist/components/Q/index.d.ts +2 -2
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.d.cts +7 -2
- package/dist/components/RichTextEditor/index.d.ts +7 -2
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Select/index.d.cts +1 -2
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Spinner/index.d.cts +2 -2
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/SuperChat/index.d.cts +2 -4
- package/dist/components/SuperChat/index.d.ts +2 -4
- package/dist/components/SuperChat/plugins/index.d.cts +2 -3
- package/dist/components/SuperChat/plugins/index.d.ts +2 -3
- package/dist/components/Text/index.d.cts +3 -3
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/Textarea/index.d.cts +1 -2
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/ThemeProvider/index.d.cts +3 -1
- package/dist/components/ThemeProvider/index.d.ts +3 -1
- package/dist/components/TranscriptView/index.d.cts +85 -4
- package/dist/components/TranscriptView/index.d.ts +85 -4
- package/dist/components/ViewSet/index.d.cts +120 -9
- package/dist/components/ViewSet/index.d.ts +120 -9
- package/dist/components/ViewSwitcher/index.d.cts +4 -40
- package/dist/components/ViewSwitcher/index.d.ts +4 -40
- package/dist/datavis.d.cts +167 -13
- package/dist/datavis.d.ts +167 -13
- package/dist/esheet.d.cts +183 -1
- package/dist/esheet.d.ts +183 -1
- package/dist/hooks/index.d.cts +383 -31
- package/dist/hooks/index.d.ts +383 -31
- package/dist/index-DoYYWsNc.d.cts +127 -0
- package/dist/index-DoYYWsNc.d.ts +127 -0
- package/dist/index.d.cts +7592 -414
- package/dist/index.d.ts +7592 -414
- package/dist/motion.d.cts +186 -2
- package/dist/motion.d.ts +186 -2
- package/dist/q.d.cts +25 -3
- package/dist/q.d.ts +25 -3
- package/dist/{types-B97JNRNQ.d.cts → types-DOxdTwmq.d.cts} +170 -2
- package/dist/{types-gZXrfLj6.d.ts → types-DOxdTwmq.d.ts} +170 -2
- package/dist/{types-CbWXIKbe.d.cts → types-DsdZvEI1.d.cts} +1 -28
- package/dist/{types-CbWXIKbe.d.ts → types-DsdZvEI1.d.ts} +1 -28
- package/dist/utils/index.d.cts +13 -2
- package/dist/utils/index.d.ts +13 -2
- package/package.json +3 -2
- package/dist/Animated-XmH6k8pZ.d.cts +0 -188
- package/dist/Animated-XmH6k8pZ.d.ts +0 -188
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
- package/dist/html-MdxqSzjD.d.cts +0 -13
- package/dist/html-MdxqSzjD.d.ts +0 -13
- package/dist/orderRows-BUJYgSc7.d.cts +0 -221
- package/dist/orderRows-BUJYgSc7.d.ts +0 -221
- package/dist/transcript-Cg7uSW-C.d.cts +0 -84
- package/dist/transcript-Cg7uSW-C.d.ts +0 -84
- package/dist/types-CnPEwzlp.d.cts +0 -254
- package/dist/types-CnPEwzlp.d.ts +0 -254
- package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
- package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
- package/dist/useTheme-B9SWu6ui.d.cts +0 -24
- package/dist/useTheme-B9SWu6ui.d.ts +0 -24
- package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
- package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/** Allergy category (FHIR AllergyIntolerance.category). */
|
|
4
|
-
type AllergyType = 'drug' | 'food' | 'environmental' | 'other';
|
|
5
|
-
/**
|
|
6
|
-
* Mechanism distinction (FHIR AllergyIntolerance.type): a true
|
|
7
|
-
* immune-mediated allergy vs a non-immune intolerance (e.g. GI upset).
|
|
8
|
-
* The distinction matters clinically — an intolerance mislabeled as an
|
|
9
|
-
* allergy causes unnecessary avoidance of first-line drugs.
|
|
10
|
-
*/
|
|
11
|
-
type AllergyKind = 'allergy' | 'intolerance';
|
|
12
|
-
/** Reaction severity (FHIR reaction.severity). */
|
|
13
|
-
type AllergySeverity = 'mild' | 'moderate' | 'severe';
|
|
14
|
-
/** Coding-system reference for an allergen (RxNorm / FDB / SNOMED …). */
|
|
15
|
-
interface AllergyCode {
|
|
16
|
-
system: string;
|
|
17
|
-
code: string;
|
|
18
|
-
display?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A single allergy / intolerance.
|
|
22
|
-
*
|
|
23
|
-
* Loosely follows FHIR AllergyIntolerance: allergen (+ optional code),
|
|
24
|
-
* category, reaction, severity, onset, and clinical status.
|
|
25
|
-
*/
|
|
26
|
-
interface Allergy {
|
|
27
|
-
/** Stable unique id */
|
|
28
|
-
id: string;
|
|
29
|
-
/** Allergen display name, e.g. "penicillin" */
|
|
30
|
-
allergen: string;
|
|
31
|
-
/** Category — groups the list */
|
|
32
|
-
type?: AllergyType;
|
|
33
|
-
/** Allergy vs intolerance (FHIR AllergyIntolerance.type; default 'allergy') */
|
|
34
|
-
kind?: AllergyKind;
|
|
35
|
-
/** Reaction description, e.g. "hives" */
|
|
36
|
-
reaction?: string;
|
|
37
|
-
/** Reaction severity — drives the badge color */
|
|
38
|
-
severity?: AllergySeverity;
|
|
39
|
-
/** Onset date (display string) */
|
|
40
|
-
onsetDate?: string;
|
|
41
|
-
/** Free-text note */
|
|
42
|
-
note?: string;
|
|
43
|
-
/** Inactive/resolved entries render struck through */
|
|
44
|
-
inactive?: boolean;
|
|
45
|
-
/** Code reference (RxNorm/FDB for drugs, SNOMED otherwise) */
|
|
46
|
-
code?: AllergyCode;
|
|
47
|
-
}
|
|
48
|
-
/** Row actions revealed on hover. */
|
|
49
|
-
type AllergyAction = 'correct' | 'note' | 'remove';
|
|
50
|
-
interface AllergyListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {
|
|
51
|
-
/** Allergies to display (controlled) */
|
|
52
|
-
allergies: Allergy[];
|
|
53
|
-
/**
|
|
54
|
-
* No-known-allergies flag (NKA/NKDA). An empty list is ambiguous —
|
|
55
|
-
* "not asked" vs "asked, none" — so this is explicit tri-state:
|
|
56
|
-
* undefined = not recorded, true = no known allergies.
|
|
57
|
-
* Ignored when `allergies` is non-empty.
|
|
58
|
-
*/
|
|
59
|
-
noKnownAllergies?: boolean;
|
|
60
|
-
/** Called when the no-known-allergies affordance is toggled */
|
|
61
|
-
onNoKnownAllergiesChange?: (value: boolean) => void;
|
|
62
|
-
/** Header title (pass null to hide) */
|
|
63
|
-
title?: string | null;
|
|
64
|
-
/** Row actions to show (default: all) */
|
|
65
|
-
actions?: AllergyAction[];
|
|
66
|
-
/** Called when a row action is clicked */
|
|
67
|
-
onAction?: (allergy: Allergy, action: AllergyAction) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Called with the full new id order after a drag/keyboard reorder.
|
|
70
|
-
* Omit to disable reordering. Drops are restricted to the same
|
|
71
|
-
* category group.
|
|
72
|
-
*/
|
|
73
|
-
onReorder?: (allergyIds: string[]) => void;
|
|
74
|
-
/** Custom add UI (e.g. an inline CodeLookup search) */
|
|
75
|
-
addSearch?: React.ReactNode;
|
|
76
|
-
/** Called when the "Add allergy" button is clicked (omit to hide) */
|
|
77
|
-
onAdd?: () => void;
|
|
78
|
-
/** Hide all action affordances (display only) */
|
|
79
|
-
readOnly?: boolean;
|
|
80
|
-
/** Additional CSS classes */
|
|
81
|
-
className?: string;
|
|
82
|
-
/** Test ID for testing */
|
|
83
|
-
'data-testid'?: string;
|
|
84
|
-
}
|
|
85
|
-
declare const ALLERGY_TYPE_LABELS: Record<AllergyType, string>;
|
|
86
|
-
/**
|
|
87
|
-
* Allergy / intolerance list — presentational layer.
|
|
88
|
-
*
|
|
89
|
-
* Controlled: allergies come in via props; every interaction is reported
|
|
90
|
-
* through callbacks. Entries group by category (Drug → Food →
|
|
91
|
-
* Environmental → Other); severity renders as a colored badge; hover (or
|
|
92
|
-
* keyboard-focus) a row for Correct / Notes / Remove.
|
|
93
|
-
*
|
|
94
|
-
* The empty state is explicit tri-state via `noKnownAllergies` (NKA):
|
|
95
|
-
* an empty list shows "Allergy status not recorded" until the No Known
|
|
96
|
-
* Allergies affordance is confirmed — an empty list must never silently
|
|
97
|
-
* read as "no allergies".
|
|
98
|
-
*
|
|
99
|
-
* Pair with `AllergyManager` for the batteries-included experience.
|
|
100
|
-
*/
|
|
101
|
-
declare const AllergyList: React.ForwardRefExoticComponent<AllergyListProps & React.RefAttributes<HTMLDivElement>>;
|
|
102
|
-
|
|
103
|
-
/** Reconciliation status of a medication. */
|
|
104
|
-
type MedicationStatus = 'unreconciled' | 'taking' | 'taking-noncompliant' | 'not-taking' | 'unknown';
|
|
105
|
-
/** Coding-system reference for a medication (RxNorm / FDB / NDC …). */
|
|
106
|
-
interface MedicationCode {
|
|
107
|
-
/** Coding system, e.g. 'RxNORM', 'FDB', 'NDC' */
|
|
108
|
-
system: string;
|
|
109
|
-
/** Code within the system */
|
|
110
|
-
code: string;
|
|
111
|
-
/** Human-readable label the code was selected under */
|
|
112
|
-
display?: string;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* A single medication in the presenting-medications list.
|
|
116
|
-
*
|
|
117
|
-
* Prescription-detail fields follow the NCPDP SCRIPT NewRx
|
|
118
|
-
* `MedicationPrescribed` composite — see the README for the field mapping.
|
|
119
|
-
* All are optional: a bare `{ id, name, status }` renders fine.
|
|
120
|
-
*/
|
|
121
|
-
interface Medication {
|
|
122
|
-
/** Stable unique id */
|
|
123
|
-
id: string;
|
|
124
|
-
/** Display name, e.g. "lisinopril 10 mg tablet" (NCPDP DrugDescription) */
|
|
125
|
-
name: string;
|
|
126
|
-
/** Patient-friendly instructions (NCPDP Sig / Directions) */
|
|
127
|
-
sig?: string;
|
|
128
|
-
/** Current reconciliation status */
|
|
129
|
-
status: MedicationStatus;
|
|
130
|
-
/** Whether the medication's end date has passed */
|
|
131
|
-
expired?: boolean;
|
|
132
|
-
/** Discontinued date (display string) — shown as "Discontinued on: date" */
|
|
133
|
-
discontinuedDate?: string;
|
|
134
|
-
/** Free-text note attached to the medication */
|
|
135
|
-
note?: string;
|
|
136
|
-
/** Follow-up task attached to the medication */
|
|
137
|
-
task?: string;
|
|
138
|
-
/** Code reference (RxNorm / FDB / NDC) */
|
|
139
|
-
code?: MedicationCode;
|
|
140
|
-
/** Strength, e.g. "10 mg" (Strength + StrengthUnitOfMeasure) */
|
|
141
|
-
strength?: string;
|
|
142
|
-
/** Dose form, e.g. "tablet" (DrugCoded/FormCode) */
|
|
143
|
-
doseForm?: string;
|
|
144
|
-
/** Quantity dispensed (Quantity/Value) */
|
|
145
|
-
quantity?: string;
|
|
146
|
-
/** Quantity unit of measure (Quantity/QuantityUnitOfMeasure) */
|
|
147
|
-
quantityUnit?: string;
|
|
148
|
-
/** Days supply (DaysSupply) */
|
|
149
|
-
daysSupply?: string;
|
|
150
|
-
/** Route of administration, e.g. "oral" */
|
|
151
|
-
route?: string;
|
|
152
|
-
/** Administration frequency, e.g. "Twice daily" */
|
|
153
|
-
frequency?: string;
|
|
154
|
-
/** As-needed flag (PRN) */
|
|
155
|
-
prn?: boolean;
|
|
156
|
-
/** Number of refills (NumberOfRefills) */
|
|
157
|
-
refills?: string;
|
|
158
|
-
/** Substitution / DAW: '0' permitted, '1' dispense as written */
|
|
159
|
-
substitution?: '0' | '1';
|
|
160
|
-
/** Start / written date (ISO yyyy-mm-dd) */
|
|
161
|
-
startDate?: string;
|
|
162
|
-
/** End date (ISO yyyy-mm-dd) */
|
|
163
|
-
endDate?: string;
|
|
164
|
-
/** Indication / diagnosis the medication treats */
|
|
165
|
-
indication?: string;
|
|
166
|
-
/** Note to pharmacy (Note) */
|
|
167
|
-
pharmacyNotes?: string;
|
|
168
|
-
}
|
|
169
|
-
/** Non-status row actions revealed on hover. */
|
|
170
|
-
type MedicationAction = 'open' | 'correct' | 'refill' | 'add-task' | 'note' | 'remove' | 'move-up' | 'move-down';
|
|
171
|
-
interface MedicationListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {
|
|
172
|
-
/** Medications to display (controlled — grouping is derived from status) */
|
|
173
|
-
medications: Medication[];
|
|
174
|
-
/** Header title (pass null to hide) */
|
|
175
|
-
title?: string | null;
|
|
176
|
-
/** Called when a status button is clicked on a row */
|
|
177
|
-
onStatusChange?: (medication: Medication, status: MedicationStatus) => void;
|
|
178
|
-
/** Called when a non-status row action is clicked */
|
|
179
|
-
onAction?: (medication: Medication, action: MedicationAction) => void;
|
|
180
|
-
/**
|
|
181
|
-
* Called with the full ordered list of medication ids after a drag —
|
|
182
|
-
* enables drag & drop reordering within a status group. The list renders in
|
|
183
|
-
* props order; persist the ids and feed them back in.
|
|
184
|
-
*/
|
|
185
|
-
onReorder?: (medicationIds: string[]) => void;
|
|
186
|
-
/** Which non-status actions to show on each row (default: all) */
|
|
187
|
-
actions?: MedicationAction[];
|
|
188
|
-
/** Common medication names for the quick-add list (omit to hide) */
|
|
189
|
-
quickAddOptions?: string[];
|
|
190
|
-
/** Called when a quick-add option is clicked */
|
|
191
|
-
onQuickAdd?: (name: string) => void;
|
|
192
|
-
/** Called when "Other…" is clicked in the quick-add list */
|
|
193
|
-
onAddOther?: () => void;
|
|
194
|
-
/** Hide all action buttons (display only) */
|
|
195
|
-
readOnly?: boolean;
|
|
196
|
-
/** Message shown when the Unreconciled group is empty */
|
|
197
|
-
reconciledMessage?: string;
|
|
198
|
-
/** Message shown when the medication list has no entries at all */
|
|
199
|
-
emptyMessage?: string;
|
|
200
|
-
/**
|
|
201
|
-
* Custom add UI (e.g. an inline CodeLookup search) rendered in the
|
|
202
|
-
* add-medication section, before any quick-add pills. Use for
|
|
203
|
-
* patient-facing entry where suggested medications would be leading.
|
|
204
|
-
*/
|
|
205
|
-
addSearch?: React.ReactNode;
|
|
206
|
-
/** Additional CSS classes */
|
|
207
|
-
className?: string;
|
|
208
|
-
/** Test ID for testing */
|
|
209
|
-
'data-testid'?: string;
|
|
210
|
-
}
|
|
211
|
-
declare const MEDICATION_STATUS_LABELS: Record<MedicationStatus, string>;
|
|
212
|
-
/**
|
|
213
|
-
* Presenting-medications list with medication reconciliation.
|
|
214
|
-
*
|
|
215
|
-
* Controlled component: medications (with their statuses) come in via props;
|
|
216
|
-
* every user interaction is reported through callbacks. Rows are grouped by
|
|
217
|
-
* reconciliation status; hovering (or keyboard-focusing) a row reveals the
|
|
218
|
-
* status buttons and other row actions.
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* ```tsx
|
|
222
|
-
* <MedicationList
|
|
223
|
-
* medications={meds}
|
|
224
|
-
* onStatusChange={(med, status) =>
|
|
225
|
-
* setMeds((prev) =>
|
|
226
|
-
* prev.map((m) => (m.id === med.id ? { ...m, status } : m))
|
|
227
|
-
* )
|
|
228
|
-
* }
|
|
229
|
-
* onAction={(med, action) => handleAction(med, action)}
|
|
230
|
-
* />
|
|
231
|
-
* ```
|
|
232
|
-
*/
|
|
233
|
-
declare const MedicationList: React.ForwardRefExoticComponent<MedicationListProps & React.RefAttributes<HTMLDivElement>>;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* MedicationEditor — prescription editor modal for a `Medication`.
|
|
237
|
-
*
|
|
238
|
-
* Captures the NCPDP SCRIPT NewRx `MedicationPrescribed` field set and codes
|
|
239
|
-
* the drug via `CodeLookup` (RxNorm / FDB, offline). Used by
|
|
240
|
-
* `MedicationReconciliation` for both **Correct** (edit) and **Add
|
|
241
|
-
* Medication**, and usable directly:
|
|
242
|
-
*
|
|
243
|
-
* ```tsx
|
|
244
|
-
* <MedicationEditor
|
|
245
|
-
* open={editing !== null}
|
|
246
|
-
* medication={editing ?? undefined}
|
|
247
|
-
* codeLookup={{ indexUrl: '/codify' }}
|
|
248
|
-
* onClose={() => setEditing(null)}
|
|
249
|
-
* onSave={(med) => upsert(med)}
|
|
250
|
-
* />
|
|
251
|
-
* ```
|
|
252
|
-
*
|
|
253
|
-
* NCPDP mapping (NewRx / MedicationPrescribed):
|
|
254
|
-
*
|
|
255
|
-
* | Editor field | NCPDP element |
|
|
256
|
-
* |----------------|----------------------------------------|
|
|
257
|
-
* | Medication | DrugDescription |
|
|
258
|
-
* | Code | DrugCoded (ProductCode / DrugDBCode) |
|
|
259
|
-
* | Strength | Strength + StrengthUnitOfMeasure |
|
|
260
|
-
* | Dose form | DrugCoded/FormCode |
|
|
261
|
-
* | Quantity | Quantity/Value |
|
|
262
|
-
* | Quantity unit | Quantity/QuantityUnitOfMeasure |
|
|
263
|
-
* | Days supply | DaysSupply |
|
|
264
|
-
* | Directions | Sig/SigText |
|
|
265
|
-
* | Refills | NumberOfRefills |
|
|
266
|
-
* | Substitution | Substitutions (0 permitted / 1 DAW) |
|
|
267
|
-
* | Start date | WrittenDate / EffectiveDate |
|
|
268
|
-
* | Indication | Diagnosis/Primary |
|
|
269
|
-
* | Pharmacy notes | Note |
|
|
270
|
-
*/
|
|
271
|
-
|
|
272
|
-
/** Minimal shape of a CodeLookup selection the editor consumes. */
|
|
273
|
-
interface MedicationLookupResult {
|
|
274
|
-
label: string;
|
|
275
|
-
codetype: string;
|
|
276
|
-
fullcode: string;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Structural subset of `CodeLookupProps` the editor uses. `CodeLookup`
|
|
280
|
-
* satisfies this — it is injected (not imported) because its Web Worker
|
|
281
|
-
* keeps it out of the library build (see CodeLookup/index.ts).
|
|
282
|
-
*/
|
|
283
|
-
interface MedicationLookupProps {
|
|
284
|
-
indexUrl: string;
|
|
285
|
-
locale?: string;
|
|
286
|
-
domains?: 'med'[];
|
|
287
|
-
bare?: boolean;
|
|
288
|
-
clearOnSelect?: boolean;
|
|
289
|
-
placeholder?: string;
|
|
290
|
-
initialQuery?: string;
|
|
291
|
-
initialSearch?: boolean;
|
|
292
|
-
onSelect?: (result: MedicationLookupResult) => void;
|
|
293
|
-
onFreeText?: (text: string) => void;
|
|
294
|
-
}
|
|
295
|
-
/** CodeLookup wiring for the editor (component injected by the consumer). */
|
|
296
|
-
interface CodeLookupConfig {
|
|
297
|
-
/** The CodeLookup component: `import { CodeLookup } from '…/CodeLookup'` */
|
|
298
|
-
component: React.ComponentType<MedicationLookupProps>;
|
|
299
|
-
/** Base URL of the codify index, e.g. '/codify' */
|
|
300
|
-
indexUrl: string;
|
|
301
|
-
/** Shard locale (default 'en') */
|
|
302
|
-
locale?: string;
|
|
303
|
-
}
|
|
304
|
-
interface MedicationEditorProps {
|
|
305
|
-
/** Whether the editor is open */
|
|
306
|
-
open: boolean;
|
|
307
|
-
/** Medication being edited — omit for "add" mode */
|
|
308
|
-
medication?: Medication;
|
|
309
|
-
/**
|
|
310
|
-
* Codify shard location for RxNorm/FDB coding. Defaults to the ambient
|
|
311
|
-
* `CodeLookupProvider`; pass `false` to force a plain name input.
|
|
312
|
-
*/
|
|
313
|
-
codeLookup?: CodeLookupConfig | false;
|
|
314
|
-
/** Called when the editor is dismissed without saving */
|
|
315
|
-
onClose: () => void;
|
|
316
|
-
/** Called with the complete medication on save */
|
|
317
|
-
onSave: (medication: Medication) => void;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Parse strength + dose form out of a coded drug label,
|
|
321
|
-
* e.g. "lisinopril 20 mg tablet" → { strength: '20 mg', doseForm: 'tablet' }.
|
|
322
|
-
*/
|
|
323
|
-
declare function parseMedicationLabel(label: string): {
|
|
324
|
-
strength?: string;
|
|
325
|
-
doseForm?: string;
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* Derive route / frequency / PRN from free-text sig,
|
|
329
|
-
* e.g. "1 tablet by mouth daily as needed" →
|
|
330
|
-
* { route: 'oral', frequency: 'Once daily', prn: true }.
|
|
331
|
-
*/
|
|
332
|
-
declare function parseSig(sig: string): {
|
|
333
|
-
route?: string;
|
|
334
|
-
frequency?: string;
|
|
335
|
-
prn: boolean;
|
|
336
|
-
};
|
|
337
|
-
/**
|
|
338
|
-
* Derive the label-parsed Medication fields — strength, dose form, and the
|
|
339
|
-
* form-implied quantity unit — from a drug display label,
|
|
340
|
-
* e.g. "lisinopril 10 mg tablet" → { strength: '10 mg', doseForm: 'tablet',
|
|
341
|
-
* quantityUnit: 'tablet' }.
|
|
342
|
-
*/
|
|
343
|
-
declare function labelToMedicationFields(label: string): Partial<Medication>;
|
|
344
|
-
/**
|
|
345
|
-
* Derive Medication fields from a CodeLookup pick: name, code reference,
|
|
346
|
-
* and — parsed from the label — strength, dose form, and quantity unit.
|
|
347
|
-
* Used by the editor and by inline add-search flows.
|
|
348
|
-
*/
|
|
349
|
-
declare function lookupToMedicationFields(result: MedicationLookupResult): Partial<Medication>;
|
|
350
|
-
declare function MedicationEditor({ open, medication, codeLookup, onClose, onSave, }: MedicationEditorProps): React.JSX.Element | null;
|
|
351
|
-
|
|
352
|
-
export { type Allergy as A, type CodeLookupConfig as C, type Medication as M, type MedicationAction as a, ALLERGY_TYPE_LABELS as b, type AllergyAction as c, type AllergyCode as d, type AllergyKind as e, AllergyList as f, type AllergyListProps as g, type AllergySeverity as h, type AllergyType as i, MEDICATION_STATUS_LABELS as j, type MedicationCode as k, MedicationEditor as l, type MedicationEditorProps as m, MedicationList as n, type MedicationListProps as o, type MedicationLookupProps as p, type MedicationLookupResult as q, type MedicationStatus as r, labelToMedicationFields as s, lookupToMedicationFields as t, parseMedicationLabel as u, parseSig as v };
|
package/dist/html-MdxqSzjD.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts visible text from an HTML string without using regex.
|
|
3
|
-
* Uses a simple character-by-character state machine to skip tags.
|
|
4
|
-
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
5
|
-
*/
|
|
6
|
-
declare function stripHtmlTags(html: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Returns true when an HTML string has no visible text content.
|
|
9
|
-
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
10
|
-
*/
|
|
11
|
-
declare function isHtmlEmpty(html: string): boolean;
|
|
12
|
-
|
|
13
|
-
export { isHtmlEmpty as i, stripHtmlTags as s };
|
package/dist/html-MdxqSzjD.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts visible text from an HTML string without using regex.
|
|
3
|
-
* Uses a simple character-by-character state machine to skip tags.
|
|
4
|
-
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
5
|
-
*/
|
|
6
|
-
declare function stripHtmlTags(html: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Returns true when an HTML string has no visible text content.
|
|
9
|
-
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
10
|
-
*/
|
|
11
|
-
declare function isHtmlEmpty(html: string): boolean;
|
|
12
|
-
|
|
13
|
-
export { isHtmlEmpty as i, stripHtmlTags as s };
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Patient history — the minimal longitudinal facts the health-surveillance
|
|
3
|
-
* due engine needs: who the patient is (age, sex) and what has been done or
|
|
4
|
-
* is in flight (orders with status, observations, procedures, immunizations),
|
|
5
|
-
* plus problem-list context (conditions) and allergies for display/interop.
|
|
6
|
-
*
|
|
7
|
-
* All clinical entries are keyed by `CODETYPE|FULLCODE` — the same keys used
|
|
8
|
-
* by programs.json order sets and the codify shards — so the due engine can
|
|
9
|
-
* match history against a program's satisfying orders with plain string
|
|
10
|
-
* equality.
|
|
11
|
-
*/
|
|
12
|
-
/** ISO date string (YYYY-MM-DD or full ISO timestamp). */
|
|
13
|
-
type IsoDate = string;
|
|
14
|
-
interface HistoryOrder {
|
|
15
|
-
/** CODETYPE|FULLCODE, e.g. "Quest Order|3058" or "HCPCS|92551" */
|
|
16
|
-
key: string;
|
|
17
|
-
/** Display label (optional; the due list falls back to the key) */
|
|
18
|
-
label?: string;
|
|
19
|
-
status: 'completed' | 'pending';
|
|
20
|
-
/** Completion date for completed orders; order date for pending ones */
|
|
21
|
-
date: IsoDate;
|
|
22
|
-
/** Ordering/performing provider display name (e.g. "Dr. Patel") */
|
|
23
|
-
provider?: string;
|
|
24
|
-
/** Requisition the order was bundled into — the document routing a batch
|
|
25
|
-
* of encounter orders to a provider/referral (e.g. "REQ-2024-0117") */
|
|
26
|
-
requisitionId?: string;
|
|
27
|
-
/** Encounter (visit) the order was placed in (e.g. "ENC-2024-0117") */
|
|
28
|
-
encounterId?: string;
|
|
29
|
-
}
|
|
30
|
-
interface HistoryObservation {
|
|
31
|
-
/** CODETYPE|FULLCODE, e.g. "LOINC|4548-4" (HbA1c) */
|
|
32
|
-
key: string;
|
|
33
|
-
label?: string;
|
|
34
|
-
/** Display value with units, e.g. "7.2 %" or "38 ug/dL" */
|
|
35
|
-
value?: string;
|
|
36
|
-
date: IsoDate;
|
|
37
|
-
}
|
|
38
|
-
interface HistoryProcedure {
|
|
39
|
-
key: string;
|
|
40
|
-
label?: string;
|
|
41
|
-
date: IsoDate;
|
|
42
|
-
}
|
|
43
|
-
interface HistoryImmunization {
|
|
44
|
-
/** CODETYPE|FULLCODE, e.g. "CVX|88" */
|
|
45
|
-
key: string;
|
|
46
|
-
label?: string;
|
|
47
|
-
date: IsoDate;
|
|
48
|
-
}
|
|
49
|
-
interface HistoryCondition {
|
|
50
|
-
key: string;
|
|
51
|
-
label?: string;
|
|
52
|
-
onset?: IsoDate;
|
|
53
|
-
}
|
|
54
|
-
interface HistoryAllergy {
|
|
55
|
-
/** Allergen key when coded (e.g. "RxNORM|7980"), else omit */
|
|
56
|
-
key?: string;
|
|
57
|
-
label: string;
|
|
58
|
-
reaction?: string;
|
|
59
|
-
severity?: 'mild' | 'moderate' | 'severe';
|
|
60
|
-
}
|
|
61
|
-
interface HistoryMedication {
|
|
62
|
-
key?: string;
|
|
63
|
-
label: string;
|
|
64
|
-
/** Sig / dose display, e.g. "10 mg daily" */
|
|
65
|
-
detail?: string;
|
|
66
|
-
}
|
|
67
|
-
interface PatientHistory {
|
|
68
|
-
/** Age in years */
|
|
69
|
-
age: number;
|
|
70
|
-
sex: 'M' | 'F';
|
|
71
|
-
/** Past + in-flight orders (completion drives the due engine) */
|
|
72
|
-
orders: HistoryOrder[];
|
|
73
|
-
observations?: HistoryObservation[];
|
|
74
|
-
procedures?: HistoryProcedure[];
|
|
75
|
-
immunizations?: HistoryImmunization[];
|
|
76
|
-
conditions?: HistoryCondition[];
|
|
77
|
-
allergies?: HistoryAllergy[];
|
|
78
|
-
medications?: HistoryMedication[];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Due-evaluation engine — the "knowledge" layer of health surveillance.
|
|
83
|
-
* Given a patient's history and the program metadata (programs.json from
|
|
84
|
-
* mieweb/codify, or a deployment's own), decides which programs/measures are
|
|
85
|
-
* due, overdue, pending, or satisfied. Pure functions, no I/O — the metadata
|
|
86
|
-
* is small, so this runs on the main thread.
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* One entry in a program's order set:
|
|
91
|
-
* - `"CODETYPE|FULLCODE"` — a plain required order
|
|
92
|
-
* - `{ alt: [a, b] }` — mutually exclusive alternatives (one-of): a
|
|
93
|
-
* colonoscopy OR a FIT satisfies colorectal screening
|
|
94
|
-
* - `{ key, after: […] }` — depends on completed prerequisites (Gantt edge):
|
|
95
|
-
* the RMO's fitness-for-duty determination needs the panel results first,
|
|
96
|
-
* and a program may carry several determinations (per panel / per SEG)
|
|
97
|
-
*/
|
|
98
|
-
type ProgramOrder = string | {
|
|
99
|
-
key?: string;
|
|
100
|
-
alt?: string[];
|
|
101
|
-
after?: string[];
|
|
102
|
-
};
|
|
103
|
-
/** Program metadata — mirrors programs.json (see mieweb/codify). */
|
|
104
|
-
interface ProgramMeta {
|
|
105
|
-
kind?: 'surveillance' | 'fitness' | 'credential' | 'quality';
|
|
106
|
-
/** Omitted = one-time / event-driven (satisfied forever once done) */
|
|
107
|
-
periodicityMonths?: number;
|
|
108
|
-
ageMin?: number;
|
|
109
|
-
ageMax?: number;
|
|
110
|
-
sex?: 'M' | 'F';
|
|
111
|
-
/** Satisfying orders — plain keys, one-of alternatives, or dependent
|
|
112
|
-
* entries (see ProgramOrder) */
|
|
113
|
-
orders?: ProgramOrder[];
|
|
114
|
-
}
|
|
115
|
-
type ProgramsMap = Record<string, ProgramMeta>;
|
|
116
|
-
type DueStatus = 'due' | 'overdue' | 'pending' | 'satisfied' | 'not-applicable';
|
|
117
|
-
interface DueItem {
|
|
118
|
-
/** Program key, CODETYPE|FULLCODE (e.g. "OSHA|1910.95", "eCQM|CMS125") */
|
|
119
|
-
key: string;
|
|
120
|
-
program: ProgramMeta;
|
|
121
|
-
status: DueStatus;
|
|
122
|
-
/** Most recent completion date of any satisfying order */
|
|
123
|
-
lastCompleted?: string;
|
|
124
|
-
/** When the current/last satisfaction lapses (satisfied/overdue only) */
|
|
125
|
-
dueDate?: string;
|
|
126
|
-
/** Satisfying orders currently pending */
|
|
127
|
-
pendingKeys: string[];
|
|
128
|
-
}
|
|
129
|
-
/** Is the patient inside the program's age/sex gates? */
|
|
130
|
-
declare function isApplicable(history: Pick<PatientHistory, 'age' | 'sex'>, program: ProgramMeta): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Evaluate one program against the history.
|
|
133
|
-
* `now` defaults to today; injectable for tests.
|
|
134
|
-
*/
|
|
135
|
-
declare function evaluateProgram(key: string, program: ProgramMeta, history: PatientHistory, now?: Date): DueItem;
|
|
136
|
-
/**
|
|
137
|
-
* Evaluate a set of programs against the history, most actionable first
|
|
138
|
-
* (overdue → due → pending → satisfied; not-applicable omitted unless
|
|
139
|
-
* `includeNotApplicable`).
|
|
140
|
-
*
|
|
141
|
-
* `enrolledKeys` restricts occupational programs to the patient's actual
|
|
142
|
-
* enrollments (a clerk isn't due for cadmium surveillance just because the
|
|
143
|
-
* program exists); quality measures apply to everyone passing their gates.
|
|
144
|
-
*/
|
|
145
|
-
declare function evaluateDue(history: PatientHistory, programs: ProgramsMap, options?: {
|
|
146
|
-
enrolledKeys?: string[];
|
|
147
|
-
includeNotApplicable?: boolean;
|
|
148
|
-
now?: Date;
|
|
149
|
-
}): DueItem[];
|
|
150
|
-
/**
|
|
151
|
-
* Ordering-time prompt: is this order key part of a due/overdue program?
|
|
152
|
-
* Returns the matching due items so the UI can badge "due for OSHA 1910.95"
|
|
153
|
-
* or warn "already satisfied" while the clinician is ordering.
|
|
154
|
-
*/
|
|
155
|
-
declare function dueForOrder(orderKey: string, dueItems: DueItem[]): DueItem[];
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Order-row builders — flatten the order history and the due-evaluation
|
|
159
|
-
* output into grid-friendly rows (one row per encounter order) for the
|
|
160
|
-
* NITRO-backed ChartOrdersGrid / EncounterOrdersGrid.
|
|
161
|
-
*
|
|
162
|
-
* Pure functions, no I/O. Every field is a flat string so the DataVis engine
|
|
163
|
-
* can group/filter/aggregate on any of them (reason, provider, requisition,
|
|
164
|
-
* status, kind, date).
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
/** Per-order status — finer grained than the program-level DueStatus. */
|
|
168
|
-
type OrderRowStatus = 'completed' | 'pending' | 'available' | 'blocked';
|
|
169
|
-
/** One encounter order as a flat grid row. */
|
|
170
|
-
interface OrderRow {
|
|
171
|
-
/** CODETYPE|FULLCODE of the order */
|
|
172
|
-
orderKey: string;
|
|
173
|
-
/** Order display label */
|
|
174
|
-
order: string;
|
|
175
|
-
/** Reason/concern — the surveillance program or quality measure label */
|
|
176
|
-
reason: string;
|
|
177
|
-
/** Program key (CODETYPE|FULLCODE); '' when no program matches */
|
|
178
|
-
reasonKey: string;
|
|
179
|
-
/** Program kind label ('surveillance', 'quality measure', …) */
|
|
180
|
-
kind: string;
|
|
181
|
-
status: OrderRowStatus;
|
|
182
|
-
/** Completion date (completed) or order date (pending); '' otherwise */
|
|
183
|
-
date: string;
|
|
184
|
-
/** Program due date, when known */
|
|
185
|
-
dueDate: string;
|
|
186
|
-
/** Ordering/performing provider; '' when unknown */
|
|
187
|
-
provider: string;
|
|
188
|
-
/** Requisition the order is bundled into; '' = unprocessed */
|
|
189
|
-
requisitionId: string;
|
|
190
|
-
/** Encounter the order was placed in; '' for not-yet-placed rows */
|
|
191
|
-
encounterId: string;
|
|
192
|
-
/** Unmet prerequisite labels, comma-joined ('' when unblocked) */
|
|
193
|
-
blockedBy: string;
|
|
194
|
-
}
|
|
195
|
-
interface OrderRowsOptions {
|
|
196
|
-
/** Occupational enrollments; quality measures apply to everyone in-gate */
|
|
197
|
-
enrolledKeys?: string[];
|
|
198
|
-
/** Evaluation clock (defaults to today; inject for determinism) */
|
|
199
|
-
now?: Date;
|
|
200
|
-
/** Display labels for program keys (falls back to the key) */
|
|
201
|
-
programLabels?: Record<string, string>;
|
|
202
|
-
/** Display labels for order keys (falls back to history labels, then key) */
|
|
203
|
-
orderLabels?: Record<string, string>;
|
|
204
|
-
/** Include not-yet-placed due-list orders as available/blocked rows
|
|
205
|
-
* (default true) */
|
|
206
|
-
includeDue?: boolean;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Chart-wide rows: every past + in-flight order in the history, plus (by
|
|
210
|
-
* default) the actionable due-list orders that haven't been placed yet
|
|
211
|
-
* (`available`, or `blocked` while prerequisites are incomplete).
|
|
212
|
-
*/
|
|
213
|
-
declare function buildChartOrderRows(history: PatientHistory, programs: ProgramsMap, options?: OrderRowsOptions): OrderRow[];
|
|
214
|
-
/**
|
|
215
|
-
* Current-encounter rows: the encounter's own orders (pending unprocessed
|
|
216
|
-
* ones are the mass-operation targets) plus the actionable due-list orders
|
|
217
|
-
* available to place this visit.
|
|
218
|
-
*/
|
|
219
|
-
declare function buildEncounterOrderRows(history: PatientHistory, programs: ProgramsMap, encounterId: string, options?: OrderRowsOptions): OrderRow[];
|
|
220
|
-
|
|
221
|
-
export { type DueItem as D, type HistoryAllergy as H, type IsoDate as I, type OrderRow as O, type PatientHistory as P, type ProgramsMap as a, type DueStatus as b, type HistoryCondition as c, type HistoryImmunization as d, type HistoryMedication as e, type HistoryObservation as f, type HistoryOrder as g, type HistoryProcedure as h, type OrderRowStatus as i, type OrderRowsOptions as j, type ProgramMeta as k, buildChartOrderRows as l, buildEncounterOrderRows as m, dueForOrder as n, evaluateDue as o, evaluateProgram as p, isApplicable as q };
|