@alfadocs/ui-kit-debug 1.2.0 → 1.3.0
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/_chunks/{actions-cell-renderer-ClGCSQnA.js → actions-cell-renderer-Ceah0ywE.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js.map → actions-cell-renderer-Ceah0ywE.js.map} +1 -1
- package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js +8720 -0
- package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js.map +1 -0
- package/dist/_chunks/arrow-up-BYvcvTkB.js +26 -0
- package/dist/_chunks/arrow-up-BYvcvTkB.js.map +1 -0
- package/dist/_chunks/{editable-currency-cell-renderer-Dus_sBvX.js → editable-currency-cell-renderer-Uhzkd0ZP.js} +68 -88
- package/dist/_chunks/editable-currency-cell-renderer-Uhzkd0ZP.js.map +1 -0
- package/dist/_chunks/{exceljs.min-DUJ-5CGx.js → exceljs.min-D2MHbJsF.js} +10 -9
- package/dist/_chunks/{exceljs.min-DUJ-5CGx.js.map → exceljs.min-D2MHbJsF.js.map} +1 -1
- package/dist/_chunks/{face-scheme-Cou2efl7.js → face-scheme-C00IvkUA.js} +237 -243
- package/dist/_chunks/face-scheme-C00IvkUA.js.map +1 -0
- package/dist/_chunks/{file-manager-CNSLiuLo.js → file-manager-lNjcSXoD.js} +174 -186
- package/dist/_chunks/file-manager-lNjcSXoD.js.map +1 -0
- package/dist/_chunks/minus-BQDHq1c1.js +12 -0
- package/dist/_chunks/minus-BQDHq1c1.js.map +1 -0
- package/dist/_chunks/notebook-pen-CO7HoM-W.js +25 -0
- package/dist/_chunks/notebook-pen-CO7HoM-W.js.map +1 -0
- package/dist/_chunks/{notes-panel-CCz0J140.js → notes-panel-DPsgB4Mv.js} +73 -92
- package/dist/_chunks/notes-panel-DPsgB4Mv.js.map +1 -0
- package/dist/_chunks/{patient-table-DXk0wW8Q.js → patient-table-C7QHFC63.js} +2 -2
- package/dist/_chunks/{patient-table-DXk0wW8Q.js.map → patient-table-C7QHFC63.js.map} +1 -1
- package/dist/_chunks/share-2-B49jcW2I.js +18 -0
- package/dist/_chunks/share-2-B49jcW2I.js.map +1 -0
- package/dist/_chunks/{sparkline-DJtZBe7O.js → sparkline-BTY4B5tv.js} +153 -145
- package/dist/_chunks/sparkline-BTY4B5tv.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.d.ts +1 -1
- package/dist/components/notes-panel/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.d.ts +5 -4
- package/dist/components/sparkline/sparkline.d.ts.map +1 -1
- package/dist/index.js +132 -109
- package/dist/index.js.map +1 -1
- package/dist/patterns/_shared/target-tile.d.ts +31 -0
- package/dist/patterns/_shared/target-tile.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts +23 -0
- package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts +82 -0
- package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts +46 -0
- package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-compile.d.ts +48 -0
- package/dist/patterns/anamnesis/anamnesis-compile.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts +26 -0
- package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-config.d.ts +62 -0
- package/dist/patterns/anamnesis/anamnesis-config.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts +194 -0
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-digest.d.ts +84 -0
- package/dist/patterns/anamnesis/anamnesis-digest.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts +19 -0
- package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts +12 -0
- package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-events.d.ts +60 -0
- package/dist/patterns/anamnesis/anamnesis-events.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts +48 -0
- package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +37 -0
- package/dist/patterns/anamnesis/anamnesis-evolution.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +10 -0
- package/dist/patterns/anamnesis/anamnesis-export-download.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts +23 -0
- package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts +36 -0
- package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-export.d.ts +143 -0
- package/dist/patterns/anamnesis/anamnesis-export.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-field.d.ts +14 -0
- package/dist/patterns/anamnesis/anamnesis-field.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-format.d.ts +67 -0
- package/dist/patterns/anamnesis/anamnesis-format.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +6 -0
- package/dist/patterns/anamnesis/anamnesis-i18n.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +53 -0
- package/dist/patterns/anamnesis/anamnesis-indicators.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-intake.d.ts +16 -0
- package/dist/patterns/anamnesis/anamnesis-intake.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-matrix.d.ts +91 -0
- package/dist/patterns/anamnesis/anamnesis-matrix.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-notes.d.ts +19 -0
- package/dist/patterns/anamnesis/anamnesis-notes.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-readonly.d.ts +17 -0
- package/dist/patterns/anamnesis/anamnesis-readonly.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-summary.d.ts +35 -0
- package/dist/patterns/anamnesis/anamnesis-summary.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts +18 -0
- package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +14 -0
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-targets.d.ts +58 -0
- package/dist/patterns/anamnesis/anamnesis-targets.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-types.d.ts +336 -0
- package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts +35 -0
- package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis-window.d.ts +37 -0
- package/dist/patterns/anamnesis/anamnesis-window.d.ts.map +1 -0
- package/dist/patterns/anamnesis/anamnesis.d.ts +48 -0
- package/dist/patterns/anamnesis/anamnesis.d.ts.map +1 -0
- package/dist/patterns/anamnesis/index.d.ts +8 -0
- package/dist/patterns/anamnesis/index.d.ts.map +1 -0
- package/dist/patterns/anamnesis/index.js +26 -0
- package/dist/patterns/anamnesis/index.js.map +1 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/editable-currency-cell-renderer-Dus_sBvX.js.map +0 -1
- package/dist/_chunks/face-scheme-Cou2efl7.js.map +0 -1
- package/dist/_chunks/file-manager-CNSLiuLo.js.map +0 -1
- package/dist/_chunks/notes-panel-CCz0J140.js.map +0 -1
- package/dist/_chunks/sparkline-DJtZBe7O.js.map +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/** The three host contexts the one pattern renders in. */
|
|
2
|
+
export type AnamnesisMode = 'intake' | 'compile' | 'readOnly';
|
|
3
|
+
/** Recorded biological sex — gates the menstrual-cycle / pregnancy fields. */
|
|
4
|
+
export type PatientSex = 'female' | 'male' | 'unspecified';
|
|
5
|
+
/** Who authored a value. Patient-submitted values render a "from patient"
|
|
6
|
+
* origin marker in compile mode until the clinician confirms or edits them,
|
|
7
|
+
* at which point the origin flips to `clinician` and the marker drops. */
|
|
8
|
+
export type AnswerOrigin = 'patient' | 'clinician';
|
|
9
|
+
/** First visit vs any subsequent follow-up. */
|
|
10
|
+
export type VisitType = 'first' | 'followUp';
|
|
11
|
+
/** Structured yes/no answer (with optional free-text detail alongside). */
|
|
12
|
+
export type YesNo = 'yes' | 'no' | 'unknown';
|
|
13
|
+
/** A value carrying its provenance. */
|
|
14
|
+
export interface Sourced<T> {
|
|
15
|
+
value: T;
|
|
16
|
+
origin: AnswerOrigin;
|
|
17
|
+
}
|
|
18
|
+
/** The fields every practice-configurable descriptor carries — numeric
|
|
19
|
+
* parameters, intake fields, intake sections and pathology codes.
|
|
20
|
+
*
|
|
21
|
+
* PRESENTATION (`label` / `helpText` / `order`) is always editable, including
|
|
22
|
+
* on a locked descriptor. EXISTENCE (`enabled`) is not: archiving a locked key
|
|
23
|
+
* would break the derivation engine. Resolvers live in `anamnesis-config.ts`;
|
|
24
|
+
* nothing here enforces the rule on its own. */
|
|
25
|
+
export interface ConfigurableDescriptor {
|
|
26
|
+
/** Practice-authored label. When present it wins over the i18n key derived
|
|
27
|
+
* from the descriptor's `key`/`code` — the same exemption
|
|
28
|
+
* `PatientCustomFieldDef.label` carries: a practice's own wording is data,
|
|
29
|
+
* not a design-system string. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Practice-authored help text rendered beside the control. */
|
|
32
|
+
helpText?: string;
|
|
33
|
+
/** `false` ARCHIVES the descriptor: it stops being offered for capture but
|
|
34
|
+
* still renders in history, so answers already recorded under it survive.
|
|
35
|
+
* Defaults to `true`. Never honoured on a locked descriptor. */
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
/** The derivation engine depends on this key: relabel and reorder freely,
|
|
38
|
+
* but never archive, rename or delete it. Stamped by the resolvers from
|
|
39
|
+
* `LOCKED_PARAMETER_KEYS` — do not hand-set it on seeded data. */
|
|
40
|
+
locked?: boolean;
|
|
41
|
+
/** Sort position within the descriptor's own group or section. Lower first;
|
|
42
|
+
* descriptors without one keep their seeded position. */
|
|
43
|
+
order?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface PatientHeader {
|
|
46
|
+
/** Given name. Placeholder data only — never a real patient. */
|
|
47
|
+
firstName: string;
|
|
48
|
+
lastName: string;
|
|
49
|
+
/** ISO-8601 date of birth. Age is derived, never stored. */
|
|
50
|
+
dateOfBirthIso: string;
|
|
51
|
+
sex: PatientSex;
|
|
52
|
+
}
|
|
53
|
+
/** Discriminated union of every answer shape the intake form can hold.
|
|
54
|
+
* The field registry (INTAKE_SECTIONS) declares which `kind` each field
|
|
55
|
+
* uses; the renderer switches on `kind`. Keeping the union small keeps the
|
|
56
|
+
* form strict without `any`. */
|
|
57
|
+
export type IntakeAnswer = {
|
|
58
|
+
kind: 'text';
|
|
59
|
+
text: string;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'number';
|
|
62
|
+
value: number | null;
|
|
63
|
+
unit?: string;
|
|
64
|
+
} | {
|
|
65
|
+
kind: 'yesNo';
|
|
66
|
+
present: YesNo;
|
|
67
|
+
detail?: string;
|
|
68
|
+
} | {
|
|
69
|
+
kind: 'choice';
|
|
70
|
+
selected: string | null;
|
|
71
|
+
detail?: string;
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'multiChoice';
|
|
74
|
+
selected: string[];
|
|
75
|
+
} | {
|
|
76
|
+
kind: 'frequency';
|
|
77
|
+
perWeek: number | null;
|
|
78
|
+
detail?: string;
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'meal';
|
|
81
|
+
time: string;
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
export type IntakeAnswerKind = IntakeAnswer['kind'];
|
|
85
|
+
/** Field keys used across the intake registry, the record, and i18n keys.
|
|
86
|
+
* Kept as a string alias (not a closed enum) so the demo stays extensible. */
|
|
87
|
+
export type IntakeFieldKey = string;
|
|
88
|
+
/** A patient's self-completed pre-visit questionnaire. Each answer is
|
|
89
|
+
* `Sourced` so compile mode can mark which values still come straight from
|
|
90
|
+
* the patient. In `intake` mode every origin is `patient`. */
|
|
91
|
+
export interface IntakeResponse {
|
|
92
|
+
/** ISO-8601 submission timestamp; absent while still a draft. */
|
|
93
|
+
submittedAtIso?: string;
|
|
94
|
+
answers: Partial<Record<IntakeFieldKey, Sourced<IntakeAnswer>>>;
|
|
95
|
+
}
|
|
96
|
+
/** How an intake field is captured. Drives which primitive renders.
|
|
97
|
+
* `choice` is single-select (one answer); `multiChoice` is multi-select
|
|
98
|
+
* (any number of the options); `yesNoDetail` is the binary choice. */
|
|
99
|
+
export type IntakeFieldType = 'text' | 'textarea' | 'number' | 'yesNoDetail' | 'choice' | 'multiChoice' | 'frequency' | 'meal';
|
|
100
|
+
/** Only show a field when it is relevant to the patient's recorded sex. */
|
|
101
|
+
export type SexRelevance = PatientSex | 'any';
|
|
102
|
+
export interface IntakeFieldDef extends ConfigurableDescriptor {
|
|
103
|
+
key: IntakeFieldKey;
|
|
104
|
+
type: IntakeFieldType;
|
|
105
|
+
/** Display unit for `number` fields (kg, cm, glasses/day, cups/day…). */
|
|
106
|
+
unit?: string;
|
|
107
|
+
/** `number` fields: capture with decimals instead of integer-only. The
|
|
108
|
+
* kit-seeded decimal fields keep working through the legacy key set; this
|
|
109
|
+
* flag is how a practice-added field opts in. */
|
|
110
|
+
decimal?: boolean;
|
|
111
|
+
/** Choice options for `choice` / `multiChoice` fields — i18n key suffixes
|
|
112
|
+
* for kit-seeded fields, verbatim practice wording for practice-added
|
|
113
|
+
* ones. */
|
|
114
|
+
options?: string[];
|
|
115
|
+
/** Optional free-text detail beside a yes/no, frequency or single-choice
|
|
116
|
+
* answer (the platform's `_with_text` question variants). */
|
|
117
|
+
detail?: boolean;
|
|
118
|
+
/** Restrict visibility by recorded sex (menstrual cycle, pregnancies). */
|
|
119
|
+
relevance?: SexRelevance;
|
|
120
|
+
/** The answer is mandatory: the missing-answers alert counts it and the
|
|
121
|
+
* compile gaps block asks for it. Practice-configurable like `enabled`
|
|
122
|
+
* and `order` — replaces the old kit-constant mandatory set. */
|
|
123
|
+
required?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface IntakeSectionDef extends ConfigurableDescriptor {
|
|
126
|
+
key: string;
|
|
127
|
+
fields: IntakeFieldDef[];
|
|
128
|
+
}
|
|
129
|
+
/** Anthropometric measurements captured per visit. BMI is DERIVED from
|
|
130
|
+
* weight + height and never stored. */
|
|
131
|
+
export interface AnthropometricSet {
|
|
132
|
+
/** Body weight in kilograms. */
|
|
133
|
+
weightKg: number | null;
|
|
134
|
+
/** Standing height in centimetres. Usually constant across visits. */
|
|
135
|
+
heightCm: number | null;
|
|
136
|
+
waistCm: number | null;
|
|
137
|
+
hipsCm: number | null;
|
|
138
|
+
armCm: number | null;
|
|
139
|
+
/** Bioimpedance phase angle in degrees — higher is healthier. */
|
|
140
|
+
phaseAngleDeg: number | null;
|
|
141
|
+
}
|
|
142
|
+
/** The direction of change that counts as an improvement for a numeric
|
|
143
|
+
* parameter. `toRange` = moving into the reference range is good (the sign
|
|
144
|
+
* of the delta alone cannot say whether it is good or bad). */
|
|
145
|
+
export type BetterDirection = 'down' | 'up' | 'toRange';
|
|
146
|
+
/** Which numeric family a parameter belongs to (drives grouping + which visit
|
|
147
|
+
* block edits it). `dietary` is what the patient EATS — daily energy and
|
|
148
|
+
* protein — and carries its own storage array on the visit. */
|
|
149
|
+
export type ParameterGroup = 'anthropometric' | 'lab' | 'dietary';
|
|
150
|
+
/** Definition of a single numeric parameter shown as a row in the evolution
|
|
151
|
+
* grid. The catalogue of these is module-level config, not per-patient. */
|
|
152
|
+
export interface NumericParameterDef extends ConfigurableDescriptor {
|
|
153
|
+
key: string;
|
|
154
|
+
group: ParameterGroup;
|
|
155
|
+
/** Display unit (kg, cm, mg/dL, %, °…). */
|
|
156
|
+
unit?: string;
|
|
157
|
+
/** Reference range for out-of-range detection (labs, some anthropometrics). */
|
|
158
|
+
referenceRange?: {
|
|
159
|
+
min?: number;
|
|
160
|
+
max?: number;
|
|
161
|
+
};
|
|
162
|
+
/** Which direction reads as improvement (drives delta valence). */
|
|
163
|
+
betterDirection: BetterDirection;
|
|
164
|
+
/** Decimal places for display + delta formatting. */
|
|
165
|
+
precision?: number;
|
|
166
|
+
/** Derived from other fields (BMI) — never entered by hand. */
|
|
167
|
+
computed?: boolean;
|
|
168
|
+
/** Rides the goals strip above the clinician record: the practice CHOOSES
|
|
169
|
+
* its tracked goals, sets each target on the tile, and reads
|
|
170
|
+
* current-vs-target status there. Seeded `true` for the plan's four
|
|
171
|
+
* figures; toggleable per practice like `enabled` and `order`. */
|
|
172
|
+
goal?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/** One numeric parameter's value at one visit, stored by key. The reference
|
|
175
|
+
* range + out-of-range flag are derived by joining to the parameter definition,
|
|
176
|
+
* so only the raw value lives here. */
|
|
177
|
+
export interface MeasurementResult {
|
|
178
|
+
parameterKey: string;
|
|
179
|
+
value: number | null;
|
|
180
|
+
}
|
|
181
|
+
/** A lab result value for one parameter at one visit. */
|
|
182
|
+
export type LabResult = MeasurementResult;
|
|
183
|
+
/** A dietary-intake value (daily energy, protein) for one visit. Its own type
|
|
184
|
+
* because it is not a lab result: `visit.labs` is what the Blood tests block
|
|
185
|
+
* reads, and intake does not belong in that drawer. */
|
|
186
|
+
export type DietaryIntakeResult = MeasurementResult;
|
|
187
|
+
/** Definition of a lab parameter — a NumericParameterDef pinned to the `lab`
|
|
188
|
+
* group. Aliased for the name the brief asks for. */
|
|
189
|
+
export type LabParameterDefinition = NumericParameterDef & {
|
|
190
|
+
group: 'lab';
|
|
191
|
+
};
|
|
192
|
+
/** A per-patient numeric target (e.g. target weight / target BMI), read
|
|
193
|
+
* against the current value as well as against the previous visit. ONE
|
|
194
|
+
* CONCEPT: the care plan's "Nutrition targets" tiles read this same goal, and
|
|
195
|
+
* the anamnesis is its authoritative, editable side. No story shares live
|
|
196
|
+
* state, so reconciling the two surfaces is a platform ticket. */
|
|
197
|
+
export interface ParameterTarget {
|
|
198
|
+
parameterKey: string;
|
|
199
|
+
target: number;
|
|
200
|
+
}
|
|
201
|
+
/** A pathology code in the (mock) taxonomy. Many-to-many with patients: a
|
|
202
|
+
* patient can hold several at once, and the assigned set can change per visit.
|
|
203
|
+
* `parentCode` present ⇒ this is a sub-code of a broader family. */
|
|
204
|
+
export interface PathologyCode extends ConfigurableDescriptor {
|
|
205
|
+
code: string;
|
|
206
|
+
/** Parent family code, when this is a sub-code. */
|
|
207
|
+
parentCode?: string;
|
|
208
|
+
}
|
|
209
|
+
/** Oncological history block (clinician-only). */
|
|
210
|
+
export interface OncologicalHistory {
|
|
211
|
+
tumourType?: string;
|
|
212
|
+
stage?: string;
|
|
213
|
+
metastases?: {
|
|
214
|
+
present: YesNo;
|
|
215
|
+
site?: string;
|
|
216
|
+
};
|
|
217
|
+
treatmentStatus?: string;
|
|
218
|
+
}
|
|
219
|
+
/** A single medication or supplement entry. Compare mode detects entries
|
|
220
|
+
* added / removed / changed between two visits. */
|
|
221
|
+
export interface MedicationEntry {
|
|
222
|
+
/** Stable id so compare can match the same entry across visits. */
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
dose?: string;
|
|
226
|
+
kind: 'medication' | 'supplement';
|
|
227
|
+
}
|
|
228
|
+
/** What kind of thing a clinical event was. One category per available
|
|
229
|
+
* marker shape — the shape is the accessible channel, so the vocabulary is
|
|
230
|
+
* closed at five. */
|
|
231
|
+
export type ClinicalEventCategory = 'therapy' | 'diet' | 'fmd' | 'surgery' | 'lifestyle';
|
|
232
|
+
/** Something that happened to the patient on a date, recorded against the
|
|
233
|
+
* RECORD rather than against a visit — it need not have happened at one, and
|
|
234
|
+
* need not have been this practice's own decision. */
|
|
235
|
+
export interface ClinicalEvent {
|
|
236
|
+
/** Stable id — the toggle key and the sparkline annotation key. */
|
|
237
|
+
id: string;
|
|
238
|
+
/** ISO-8601 calendar date. */
|
|
239
|
+
dateIso: string;
|
|
240
|
+
category: ClinicalEventCategory;
|
|
241
|
+
/** i18n key suffix under `anamnesis.event.label.*`. */
|
|
242
|
+
labelKey: string;
|
|
243
|
+
/** i18n key suffix under `anamnesis.event.source.*`. Present ⇒ recorded by
|
|
244
|
+
* a professional OUTSIDE this practice, so the practice owns the date but
|
|
245
|
+
* not the decision. */
|
|
246
|
+
sourceKey?: string;
|
|
247
|
+
}
|
|
248
|
+
/** One cycle of a fasting-mimicking programme. */
|
|
249
|
+
export interface FmdCycle {
|
|
250
|
+
cycleNumber: number;
|
|
251
|
+
startDateIso: string;
|
|
252
|
+
completed: boolean;
|
|
253
|
+
notes?: string;
|
|
254
|
+
}
|
|
255
|
+
/** The annual-programme proposal block. */
|
|
256
|
+
export interface AnnualProgramme {
|
|
257
|
+
proposed: boolean;
|
|
258
|
+
accepted: boolean;
|
|
259
|
+
/** Reason recorded when the programme was declined. */
|
|
260
|
+
declineReason?: string;
|
|
261
|
+
}
|
|
262
|
+
/** Everything captured at a single visit. Anthropometrics + labs feed the
|
|
263
|
+
* evolution grid; the non-numeric blocks feed compare mode. */
|
|
264
|
+
export interface Visit {
|
|
265
|
+
/** Stable id (used as the grid column key + compare selection). */
|
|
266
|
+
id: string;
|
|
267
|
+
visitType: VisitType;
|
|
268
|
+
dateIso: string;
|
|
269
|
+
/** Practice site (multi-site clinic). i18n key suffix, not a display name. */
|
|
270
|
+
siteKey?: string;
|
|
271
|
+
/** Practitioner display name (placeholder only). */
|
|
272
|
+
practitioner?: string;
|
|
273
|
+
anthropometrics: AnthropometricSet;
|
|
274
|
+
labs: LabResult[];
|
|
275
|
+
/** Estimated daily intake at this visit (energy, protein). Optional: a
|
|
276
|
+
* record migrated before intake was tracked has none, and absent reads as
|
|
277
|
+
* "not measured" rather than as zero. */
|
|
278
|
+
dietaryIntake?: DietaryIntakeResult[];
|
|
279
|
+
/** Pathology codes assigned as of this visit (many-to-many). */
|
|
280
|
+
pathologyCodes: string[];
|
|
281
|
+
oncological?: OncologicalHistory;
|
|
282
|
+
therapy: MedicationEntry[];
|
|
283
|
+
fmdCycles: FmdCycle[];
|
|
284
|
+
/** Free-text nutritional proposal for this visit. */
|
|
285
|
+
nutritionalProposal?: string;
|
|
286
|
+
/** Free-text clinical notes. */
|
|
287
|
+
clinicalNotes?: string;
|
|
288
|
+
annualProgramme?: AnnualProgramme;
|
|
289
|
+
}
|
|
290
|
+
/** The complete anamnesis record for one patient. `visits` is chronological
|
|
291
|
+
* (oldest first); the newest visit is the editable one in compile mode. */
|
|
292
|
+
export interface AnamnesisRecord {
|
|
293
|
+
patient: PatientHeader;
|
|
294
|
+
/** The pre-visit self-completed questionnaire, when one was submitted. */
|
|
295
|
+
intake?: IntakeResponse;
|
|
296
|
+
visits: Visit[];
|
|
297
|
+
targets: ParameterTarget[];
|
|
298
|
+
/** Dated things that happened between or outside the visits, drawn as
|
|
299
|
+
* reference lines down the evolution trends. Absent = none recorded. */
|
|
300
|
+
events?: ClinicalEvent[];
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* What the reader asked to read, handed OUT of the pattern so the host's side
|
|
304
|
+
* panel can navigate to it. An address, not a payload: the host already holds
|
|
305
|
+
* the record, so an id is all it needs to find the note.
|
|
306
|
+
*/
|
|
307
|
+
export type AnamnesisNoteTarget = {
|
|
308
|
+
kind: 'visit';
|
|
309
|
+
visitId: string;
|
|
310
|
+
} | {
|
|
311
|
+
kind: 'event';
|
|
312
|
+
eventId: string;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* The host's side-panel router. Wire it to whatever the host uses to open a
|
|
316
|
+
* panel (in the AlfaDocs shell, the Control Room's imperative `openTool`).
|
|
317
|
+
* Absent = there is no panel to route to, and every surface that would route
|
|
318
|
+
* falls back to reading in place.
|
|
319
|
+
*
|
|
320
|
+
* TWO OBLIGATIONS the host takes on by wiring this, because the pattern
|
|
321
|
+
* cannot keep them from its side:
|
|
322
|
+
* 1. Actually render a panel. Wired but panel-less leaves a live control
|
|
323
|
+
* that does nothing — worse than the in-place fallback it replaced.
|
|
324
|
+
* 2. Move focus to the addressed entry, or announce it. `openTool` selects
|
|
325
|
+
* a tool and nothing more: it moves no focus and says nothing, so a
|
|
326
|
+
* keyboard or screen-reader reader gets no perceivable answer to a
|
|
327
|
+
* control whose name promises one. Feed `anamnesisNoteId(target)` to the
|
|
328
|
+
* kit `NotesPanel`'s `currentNoteId` — it keeps this half.
|
|
329
|
+
* 3. Offer a keyboard-reachable entry into the notes view itself. The
|
|
330
|
+
* sparkline annotation bands that route events here are pointer-only by
|
|
331
|
+
* design, and the event chips are pure line toggles — so without a host
|
|
332
|
+
* affordance (a Notes button, a rail tool) a keyboard reader has no way
|
|
333
|
+
* into the routed timeline.
|
|
334
|
+
*/
|
|
335
|
+
export type OpenAnamnesisNote = (target: AnamnesisNoteTarget) => void;
|
|
336
|
+
//# sourceMappingURL=anamnesis-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis-types.d.ts","sourceRoot":"","sources":["../../../src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AAE,CAAC;IACtB,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED;2EAC2E;AAC3E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,aAAa,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B;4EACwE;IACxE,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAID;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import { type TextField } from './anamnesis-derive';
|
|
3
|
+
import type { OpenAnamnesisNote, Visit } from './anamnesis-types';
|
|
4
|
+
/** One free-text note recorded at a visit. */
|
|
5
|
+
export interface VisitNote {
|
|
6
|
+
field: TextField;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
/** The visit's notes, blank ones dropped. Whitespace-only text is not a note —
|
|
10
|
+
* an empty string would otherwise open a popover onto nothing. */
|
|
11
|
+
export declare function visitNotes(visit: Visit): VisitNote[];
|
|
12
|
+
/** Whether this visit has anything to read. Drives the trigger's existence. */
|
|
13
|
+
export declare function hasVisitNotes(visit: Visit): boolean;
|
|
14
|
+
/** One visit's notes as a term↔detail list, under the same labels the compile
|
|
15
|
+
* form uses. Exported so a HOST side panel renders the note the same way the
|
|
16
|
+
* in-place fallback does — one definition of what a note looks like. */
|
|
17
|
+
export declare function AnamnesisVisitNoteList({ visit, t, }: {
|
|
18
|
+
visit: Visit;
|
|
19
|
+
t: TFunction;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export interface AnamnesisVisitNoteProps {
|
|
22
|
+
visit: Visit;
|
|
23
|
+
t: TFunction;
|
|
24
|
+
/** Render already open. Chromatic never runs play functions, so the story
|
|
25
|
+
* that snapshots the note has to mount it open. Ignored when `onOpenNote`
|
|
26
|
+
* is wired — the host owns the panel and its open state. */
|
|
27
|
+
defaultOpen?: boolean;
|
|
28
|
+
/** The host's side panel. Supplied ⇒ the trigger routes there instead of
|
|
29
|
+
* opening a popover; omitted ⇒ it opens the note in place. Wiring it obliges
|
|
30
|
+
* the host to render a panel AND to move focus to or announce the addressed
|
|
31
|
+
* note — see `OpenAnamnesisNote`. */
|
|
32
|
+
onOpenNote?: OpenAnamnesisNote;
|
|
33
|
+
}
|
|
34
|
+
export declare function AnamnesisVisitNote({ visit, t, defaultOpen, onOpenNote, }: AnamnesisVisitNoteProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
+
//# sourceMappingURL=anamnesis-visit-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis-visit-note.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-visit-note.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAIlE,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAQD;kEACkE;AAClE,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,CAKpD;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEnD;AAID;;wEAEwE;AACxE,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,CAAC,GACF,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CACd,2CAiBA;AAUD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;IACb;;gEAE4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;yCAGqC;IACrC,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,CAAC,EACD,WAAmB,EACnB,UAAU,GACX,EAAE,uBAAuB,kDAgFzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Visit } from './anamnesis-types';
|
|
2
|
+
/** One rendered column. `index` is the position in the FULL visit array, so
|
|
3
|
+
* the grid still reads the cell whose delta was computed there. */
|
|
4
|
+
export interface VisitColumn {
|
|
5
|
+
key: string;
|
|
6
|
+
visit: Visit;
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export interface VisitWindow {
|
|
10
|
+
columns: VisitColumn[];
|
|
11
|
+
shownCount: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
hiddenCount: number;
|
|
14
|
+
/** First / last date among the SHOWN columns, in record order (never
|
|
15
|
+
* re-sorted). Null when nothing is shown. */
|
|
16
|
+
firstIso: string | null;
|
|
17
|
+
lastIso: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface VisitWindowOptions {
|
|
20
|
+
/** Visit ids rendered on top of the selection — the compare anchors, so a
|
|
21
|
+
* compared column is never one the picker left out. */
|
|
22
|
+
alsoShowIds?: Iterable<string>;
|
|
23
|
+
}
|
|
24
|
+
/** The selection the picker opens on: the first visit and the latest. On a
|
|
25
|
+
* single-visit record the two collapse to one. */
|
|
26
|
+
export declare function defaultSelectedVisitIds(visits: readonly Visit[]): string[];
|
|
27
|
+
/** Resolve which visit columns render, in RECORD order — never in the order
|
|
28
|
+
* the reader happened to tick them. Safe on an empty record, a single-visit
|
|
29
|
+
* record, same-date visits and out-of-order visits. */
|
|
30
|
+
export declare function windowVisits(visits: readonly Visit[], selectedIds: Iterable<string>, options?: VisitWindowOptions): VisitWindow;
|
|
31
|
+
/** Every visit as its own column — the unwindowed default. */
|
|
32
|
+
export declare function allVisitColumns(visits: readonly Visit[]): VisitColumn[];
|
|
33
|
+
/** Whether the picker has more than one visit to offer. With one visit it is
|
|
34
|
+
* chrome the clinician has to read and cannot use, so the toolbar leaves it
|
|
35
|
+
* out entirely. */
|
|
36
|
+
export declare function visitPickerIsUseful(visits: readonly Visit[]): boolean;
|
|
37
|
+
//# sourceMappingURL=anamnesis-window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis-window.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-window.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C;mEACmE;AACnE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB;iDAC6C;IAC7C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;2DACuD;IACvD,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAChC;AAID;kDACkD;AAClD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,EAAE,CAK1E;AAED;;uDAEuD;AACvD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC7B,OAAO,GAAE,kBAAuB,GAC/B,WAAW,CAiBb;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,WAAW,EAAE,CAKvE;AAED;;mBAEmB;AACnB,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,OAAO,CAErE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TFunction } from 'i18next';
|
|
3
|
+
import type { PracticeAnamnesisConfig } from './anamnesis-config';
|
|
4
|
+
import { type AnamnesisCompileView } from './anamnesis-compile';
|
|
5
|
+
import type { DisclosureAudience } from './anamnesis-disclosure';
|
|
6
|
+
import type { AnamnesisMode, AnamnesisRecord, OpenAnamnesisNote } from './anamnesis-types';
|
|
7
|
+
export interface AnamnesisProps {
|
|
8
|
+
/** Which host context to render. */
|
|
9
|
+
mode: AnamnesisMode;
|
|
10
|
+
record: AnamnesisRecord;
|
|
11
|
+
t: TFunction;
|
|
12
|
+
/** Override the cascade / test marker (defaults to `anamnesis`). Stories
|
|
13
|
+
* pass a per-mode marker so each render is independently addressable. */
|
|
14
|
+
dataComponent?: string;
|
|
15
|
+
/** Mount flush inside a host section tab: drops the full-page chrome + own
|
|
16
|
+
* page heading, and renders a `<div>` instead of a `<main>` landmark. */
|
|
17
|
+
embedded?: boolean;
|
|
18
|
+
/** The practice's own vocabulary — parameters, questionnaire, pathology
|
|
19
|
+
* codes. Omit it and the kit-seeded default is used, so every existing
|
|
20
|
+
* mount keeps working unchanged. */
|
|
21
|
+
config?: PracticeAnamnesisConfig;
|
|
22
|
+
/** Compile mode only: a per-patient target was set or cleared. The surface
|
|
23
|
+
* keeps its own working copy either way — this is the seam a platform host
|
|
24
|
+
* persists through. */
|
|
25
|
+
onTargetChange?: (parameterKey: string, target: number | null) => void;
|
|
26
|
+
/** Compile mode only: host status chips (signature / expiry / renew /
|
|
27
|
+
* save feedback) rendered at the surface header's end. */
|
|
28
|
+
statusSlot?: ReactNode;
|
|
29
|
+
/** Compile mode only: omit the nutrition-targets strip above the record —
|
|
30
|
+
* for hosts that present the record without the goals (e.g. the isolated
|
|
31
|
+
* single-section demo). Default false: the strip renders. */
|
|
32
|
+
hideTargetStrip?: boolean;
|
|
33
|
+
/** Compile / readOnly modes: the host's side panel. Wire it to whatever
|
|
34
|
+
* opens a panel in the host shell — in the AlfaDocs folder, the Control
|
|
35
|
+
* Room's `openTool`. Omitted = notes are read in place. */
|
|
36
|
+
onOpenNote?: OpenAnamnesisNote;
|
|
37
|
+
/** Compile mode only: mount on this view instead of Summary. Demo/story
|
|
38
|
+
* hook only, for the same Chromatic reason as the flags below. */
|
|
39
|
+
defaultView?: AnamnesisCompileView;
|
|
40
|
+
/** Compile mode only: mount the export control open / on a given audience.
|
|
41
|
+
* Demo/story hooks only — Chromatic skips play functions, so a click-opened
|
|
42
|
+
* menu or dialog is never snapshotted. */
|
|
43
|
+
defaultExportMenuOpen?: boolean;
|
|
44
|
+
defaultShareOpen?: boolean;
|
|
45
|
+
defaultExportAudience?: DisclosureAudience;
|
|
46
|
+
}
|
|
47
|
+
export declare function Anamnesis({ mode, record, t, dataComponent, embedded, config, onTargetChange, hideTargetStrip, statusSlot, onOpenNote, defaultView, defaultExportMenuOpen, defaultShareOpen, defaultExportAudience, }: AnamnesisProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=anamnesis.d.ts.map
|
|
@@ -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;CAC5C;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,MAAM,EACN,CAAC,EACD,aAA2B,EAC3B,QAAgB,EAChB,MAAM,EACN,cAAc,EACd,eAAe,EACf,UAAU,EACV,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,GACtB,EAAE,cAAc,2CA0DhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Anamnesis, type AnamnesisProps } from './anamnesis';
|
|
2
|
+
export { AnamnesisConfigEditor, keyFromLabel, seededConfigDraft, type AnamnesisConfigEditorProps, } from './anamnesis-config-editor';
|
|
3
|
+
export { LOCKED_PARAMETER_KEYS, SEEDED_ANAMNESIS_CONFIG, TARGETABLE_PARAMETER_KEYS, allParametersIncludingArchived, allPathologiesIncludingArchived, allSectionsIncludingArchived, assignablePathologyCodes, configuredParameters, configuredPathologies, configuredSections, isParameterLocked, isParameterTargetable, resolveConfig, type PracticeAnamnesisConfig, } from './anamnesis-config';
|
|
4
|
+
export { anamnesisNoteId, anamnesisNotes } from './anamnesis-notes';
|
|
5
|
+
export { stripParameters } from './anamnesis-targets';
|
|
6
|
+
export { PATTERN_NS, registerAnamnesisBundles } from './anamnesis-i18n';
|
|
7
|
+
export type { AnamnesisMode, AnamnesisNoteTarget, AnamnesisRecord, BetterDirection, ClinicalEvent, ConfigurableDescriptor, IntakeAnswer, IntakeFieldDef, IntakeFieldType, IntakeResponse, IntakeSectionDef, NumericParameterDef, OpenAnamnesisNote, ParameterGroup, PathologyCode, Visit, } from './anamnesis-types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,KAAK,0BAA0B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACxE,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,GACN,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { A as e, a as i, L as n, P as r, S as o, T as l, b as t, c as d, d as g, e as A, f as E, g as c, h as m, i as P, j as f, k as S, l as T, m as h, r as u, n as N, s as _, o as C } from "../../_chunks/anamnesis-i18n-DGRdwc0i.js";
|
|
2
|
+
export {
|
|
3
|
+
e as Anamnesis,
|
|
4
|
+
i as AnamnesisConfigEditor,
|
|
5
|
+
n as LOCKED_PARAMETER_KEYS,
|
|
6
|
+
r as PATTERN_NS,
|
|
7
|
+
o as SEEDED_ANAMNESIS_CONFIG,
|
|
8
|
+
l as TARGETABLE_PARAMETER_KEYS,
|
|
9
|
+
t as allParametersIncludingArchived,
|
|
10
|
+
d as allPathologiesIncludingArchived,
|
|
11
|
+
g as allSectionsIncludingArchived,
|
|
12
|
+
A as anamnesisNoteId,
|
|
13
|
+
E as anamnesisNotes,
|
|
14
|
+
c as assignablePathologyCodes,
|
|
15
|
+
m as configuredParameters,
|
|
16
|
+
P as configuredPathologies,
|
|
17
|
+
f as configuredSections,
|
|
18
|
+
S as isParameterLocked,
|
|
19
|
+
T as isParameterTargetable,
|
|
20
|
+
h as keyFromLabel,
|
|
21
|
+
u as registerAnamnesisBundles,
|
|
22
|
+
N as resolveConfig,
|
|
23
|
+
_ as seededConfigDraft,
|
|
24
|
+
C as stripParameters
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|