@moa1h/react-advanced-odontogram 0.0.0-stage → 2.8.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/LICENSE +21 -0
- package/README.md +175 -3
- package/THIRD-PARTY-NOTICES.md +211 -0
- package/dist/ar-BRtIm0sw.js +1011 -0
- package/dist/ar-BRtIm0sw.js.map +1 -0
- package/dist/index.d.ts +2131 -0
- package/dist/loader-DFvzjYP1.js +79 -0
- package/dist/loader-DFvzjYP1.js.map +1 -0
- package/dist/measured-D4LRLicF.js +19928 -0
- package/dist/measured-D4LRLicF.js.map +1 -0
- package/dist/notoArabic-En58EmGw.js +9 -0
- package/dist/notoArabic-En58EmGw.js.map +1 -0
- package/dist/odontogram.js +19011 -0
- package/dist/odontogram.js.map +1 -0
- package/dist/roboto-Bywi16HJ.js +9 -0
- package/dist/roboto-Bywi16HJ.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +111 -6
- package/tooth-settings.json +113 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2131 @@
|
|
|
1
|
+
import { Bundle } from 'fhir/r4';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { Resource } from 'fhir/r4';
|
|
5
|
+
|
|
6
|
+
/** User accepted the divergence: run the deferred edit (status only — the plan
|
|
7
|
+
* stays as planned), then notify (post-edit refresh + close the modal). No-op
|
|
8
|
+
* when nothing is pending. */
|
|
9
|
+
export declare function acceptDualStateConfirm(): void;
|
|
10
|
+
|
|
11
|
+
export declare type ActiveCaries = {
|
|
12
|
+
surfaces: ActiveCariesSurface[];
|
|
13
|
+
subcrownChecked: boolean;
|
|
14
|
+
subcrownDisabled: boolean;
|
|
15
|
+
subcrownLabel: string;
|
|
16
|
+
cariesActiveDepth: number;
|
|
17
|
+
rootCariesDisplay: string;
|
|
18
|
+
cariesDepthVisible: boolean;
|
|
19
|
+
rootCariesVisible: boolean;
|
|
20
|
+
cariesSectionVisible: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** One caries surface-cross cell's fully-resolved render state. */
|
|
24
|
+
export declare type ActiveCariesSurface = {
|
|
25
|
+
value: string;
|
|
26
|
+
surface: string;
|
|
27
|
+
pos: string;
|
|
28
|
+
letter: string;
|
|
29
|
+
label: string;
|
|
30
|
+
checked: boolean;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
depth: string;
|
|
33
|
+
icdas: number;
|
|
34
|
+
isIcdas: boolean;
|
|
35
|
+
radio: string | null;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** The active-tooth diagnoses card view-model (return shape of
|
|
39
|
+
* {@link getActiveDiagnoses}). */
|
|
40
|
+
export declare type ActiveDiagnoses = {
|
|
41
|
+
visible: boolean;
|
|
42
|
+
rows: ActiveDiagnosisRow[];
|
|
43
|
+
addableKeys: {
|
|
44
|
+
key: string;
|
|
45
|
+
icd10: string;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** One row in the active-tooth diagnoses card: a RAW rule-derived key (whether
|
|
50
|
+
* or not it's currently suppressed) or a key the user explicitly ADDED that no
|
|
51
|
+
* rule would have derived. */
|
|
52
|
+
export declare type ActiveDiagnosisRow = {
|
|
53
|
+
key: string;
|
|
54
|
+
icd10: string;
|
|
55
|
+
source: "derived" | "added";
|
|
56
|
+
suppressed: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export declare type ActiveFillings = {
|
|
60
|
+
surfaces: ActiveFillingSurface[];
|
|
61
|
+
fillingMaterial: string;
|
|
62
|
+
fillingOptions: {
|
|
63
|
+
value: string;
|
|
64
|
+
label: string;
|
|
65
|
+
}[];
|
|
66
|
+
surfaceGridVisible: boolean;
|
|
67
|
+
defectDisabled: boolean;
|
|
68
|
+
simpleMode: boolean;
|
|
69
|
+
simpleRowVisible: boolean;
|
|
70
|
+
simpleToggleChecked: boolean;
|
|
71
|
+
simpleDefectRowVisible: boolean;
|
|
72
|
+
simpleDefectValue: string;
|
|
73
|
+
simpleDefectOptions: {
|
|
74
|
+
value: string;
|
|
75
|
+
label: string;
|
|
76
|
+
}[];
|
|
77
|
+
fissureSealing: boolean;
|
|
78
|
+
fissureRowVisible: boolean;
|
|
79
|
+
fillingSectionVisible: boolean;
|
|
80
|
+
subcariesSummary: string;
|
|
81
|
+
defectSummary: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** One filling-surface cell's fully-resolved render state (mirrors the DOM the
|
|
85
|
+
* imperative `buildSurfaceCross` + `syncFillingSubcariesIndicator` +
|
|
86
|
+
* `syncFillingDefectIndicator` produced for `#fillingSurfaceChecks`). */
|
|
87
|
+
export declare type ActiveFillingSurface = {
|
|
88
|
+
value: string;
|
|
89
|
+
surface: string;
|
|
90
|
+
pos: string;
|
|
91
|
+
letter: string;
|
|
92
|
+
label: string;
|
|
93
|
+
labelId: string;
|
|
94
|
+
checked: boolean;
|
|
95
|
+
material: string;
|
|
96
|
+
hasSubcaries: boolean;
|
|
97
|
+
subDepth: string;
|
|
98
|
+
subIcdas: number;
|
|
99
|
+
isIcdas: boolean;
|
|
100
|
+
hasDefect: boolean;
|
|
101
|
+
defectValue: string | null;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export declare type ActiveOrtho = {
|
|
105
|
+
appliance: string;
|
|
106
|
+
drift: string;
|
|
107
|
+
vertical: string;
|
|
108
|
+
rotation: boolean;
|
|
109
|
+
visible: boolean;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare type ActiveRootPerio = {
|
|
113
|
+
sectionVisible: boolean;
|
|
114
|
+
rootBlockVisible: boolean;
|
|
115
|
+
perioBlockVisible: boolean;
|
|
116
|
+
pulpEndoValue: string;
|
|
117
|
+
pulpEndoNoneOption: RootPerioOption | null;
|
|
118
|
+
pulpEndoGroups: RootPerioOptGroup[];
|
|
119
|
+
pulpEndoDisabled: boolean;
|
|
120
|
+
apicalDxValue: string;
|
|
121
|
+
apicalDxOptions: RootPerioOption[];
|
|
122
|
+
apicalDxDisabled: boolean;
|
|
123
|
+
apicalDxRowVisible: boolean;
|
|
124
|
+
periapicalTypeValue: string;
|
|
125
|
+
periapicalTypeOptions: RootPerioOption[];
|
|
126
|
+
periapicalRowVisible: boolean;
|
|
127
|
+
resorptionValue: string;
|
|
128
|
+
resorptionOptions: RootPerioOption[];
|
|
129
|
+
resorptionDisabled: boolean;
|
|
130
|
+
resorptionRowVisible: boolean;
|
|
131
|
+
endoResectionChecked: boolean;
|
|
132
|
+
endoResectionDisabled: boolean;
|
|
133
|
+
parapulpalPinChecked: boolean;
|
|
134
|
+
parapulpalPinDisabled: boolean;
|
|
135
|
+
mobilityValue: string;
|
|
136
|
+
mobilityOptions: RootPerioOption[];
|
|
137
|
+
mobilityDisabled: boolean;
|
|
138
|
+
mobilityRowVisible: boolean;
|
|
139
|
+
perioRowVisible: boolean;
|
|
140
|
+
mods: ActiveRootPerioMod[];
|
|
141
|
+
calculusChecked: boolean;
|
|
142
|
+
calculusRowVisible: boolean;
|
|
143
|
+
periImplantValue: string;
|
|
144
|
+
periImplantOptions: RootPerioOption[];
|
|
145
|
+
periImplantRowVisible: boolean;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** One `#modsChecks` checkbox's fully-resolved render state. `hiddenClass`
|
|
149
|
+
* reproduces the `.hidden` class the sub-syncs toggled on the wrapping
|
|
150
|
+
* `<label>`; `styleHidden` reproduces the `style.display:none` the
|
|
151
|
+
* `setDisabled()`→`syncControlLabelVisibility()` path applied. */
|
|
152
|
+
export declare type ActiveRootPerioMod = {
|
|
153
|
+
value: string;
|
|
154
|
+
label: string;
|
|
155
|
+
checked: boolean;
|
|
156
|
+
disabled: boolean;
|
|
157
|
+
hiddenClass: boolean;
|
|
158
|
+
styleHidden: boolean;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export declare type ActiveToothDetails = {
|
|
162
|
+
toothSelectValue: string;
|
|
163
|
+
toothSelectOptions: ToothDetailsOption[];
|
|
164
|
+
substrateValue: string;
|
|
165
|
+
substrateOptions: ToothDetailsOption[];
|
|
166
|
+
substrateRowVisible: boolean;
|
|
167
|
+
extractionWoundChecked: boolean;
|
|
168
|
+
extractionRowVisible: boolean;
|
|
169
|
+
missingClosedChecked: boolean;
|
|
170
|
+
missingClosedRowVisible: boolean;
|
|
171
|
+
restorationValue: string;
|
|
172
|
+
restorationOptions: ToothDetailsOption[];
|
|
173
|
+
restorationRowVisible: boolean;
|
|
174
|
+
crownLeakageChecked: boolean;
|
|
175
|
+
crownLeakageRowVisible: boolean;
|
|
176
|
+
brokenMesialChecked: boolean;
|
|
177
|
+
brokenIncisalChecked: boolean;
|
|
178
|
+
brokenDistalChecked: boolean;
|
|
179
|
+
brokenCrownRowVisible: boolean;
|
|
180
|
+
contactMesialChecked: boolean;
|
|
181
|
+
contactDistalChecked: boolean;
|
|
182
|
+
contactPointRowVisible: boolean;
|
|
183
|
+
bruxismRowVisible: boolean;
|
|
184
|
+
wearSimple: boolean;
|
|
185
|
+
wearEdgeValue: string;
|
|
186
|
+
wearEdgeOptions: ToothDetailsOption[];
|
|
187
|
+
wearEdgeToggleChecked: boolean;
|
|
188
|
+
wearCervicalValue: string;
|
|
189
|
+
wearCervicalOptions: ToothDetailsOption[];
|
|
190
|
+
wearCervicalToggleChecked: boolean;
|
|
191
|
+
discolorationRowVisible: boolean;
|
|
192
|
+
discoSimple: boolean;
|
|
193
|
+
discolorationValue: string;
|
|
194
|
+
discolorationOptions: ToothDetailsOption[];
|
|
195
|
+
discolorationToggleChecked: boolean;
|
|
196
|
+
crownActionsRowVisible: boolean;
|
|
197
|
+
bridgePillarChecked: boolean;
|
|
198
|
+
bridgePillarRowVisible: boolean;
|
|
199
|
+
extractionPlanChecked: boolean;
|
|
200
|
+
extractionPlanRowVisible: boolean;
|
|
201
|
+
extractionPlanParent: ExtractionPlanParent;
|
|
202
|
+
crownReplaceChecked: boolean;
|
|
203
|
+
crownReplaceRowVisible: boolean;
|
|
204
|
+
crownNeededChecked: boolean;
|
|
205
|
+
crownNeededRowVisible: boolean;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/** Add a tooth-level diagnosis by writing its chart axis on the selection — a
|
|
209
|
+
* real finding (glyph + derived + exported), through the same DS-1-gated,
|
|
210
|
+
* repainting path as the clinical controls. Prototype-safe key guard; a
|
|
211
|
+
* non-reverse-mappable key (e.g. `caries`) is a silent no-op. */
|
|
212
|
+
export declare function addDiagnosisToSelection(key: string): void;
|
|
213
|
+
|
|
214
|
+
declare type Any = any;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Root React component for the Odontogram Editor (aka `OdontogramShell`).
|
|
218
|
+
*
|
|
219
|
+
* Renders the full dental chart UI: top bar with language/numbering/dark-mode
|
|
220
|
+
* controls, the SVG tooth grid, and the right-hand control panel for setting
|
|
221
|
+
* tooth states (caries, fillings, crowns, endo, inflammation, etc.).
|
|
222
|
+
*
|
|
223
|
+
* Since the composable-UI refactor (design/composable-ui.md, Tier 1) this is a
|
|
224
|
+
* THIN composition: it mounts {@link OdontogramProvider} (which owns all state,
|
|
225
|
+
* effects and handlers) and lays out the four surface components + the
|
|
226
|
+
* shell-managed perio bits and modals in the default arrangement. The default
|
|
227
|
+
* composition renders byte-identical DOM to the pre-refactor shell (frozen by
|
|
228
|
+
* `src/__tests__/parity/shell-dom.test.tsx`). A host can instead compose the
|
|
229
|
+
* exported surfaces under its own wrappers inside an `OdontogramProvider`.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```tsx
|
|
233
|
+
* // Standalone usage
|
|
234
|
+
* <App />
|
|
235
|
+
*
|
|
236
|
+
* // Controlled by a host application
|
|
237
|
+
* <App
|
|
238
|
+
* language="en"
|
|
239
|
+
* onLanguageChange={setLang}
|
|
240
|
+
* numberingSystem="FDI"
|
|
241
|
+
* onNumberingChange={setNumbering}
|
|
242
|
+
* darkMode={isDark}
|
|
243
|
+
* onDarkModeChange={setDark}
|
|
244
|
+
* />
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
declare function App(props: Omit<OdontogramProviderProps, "children">): JSX_2.Element;
|
|
248
|
+
export { App as OdontogramShell }
|
|
249
|
+
export default App;
|
|
250
|
+
|
|
251
|
+
/** Apply the MIXED dentition preset — see {@link applyPrimaryDentition}; gated
|
|
252
|
+
* STRUCTURAL edit with per-tooth no-op signaling and the `edentulous` flip
|
|
253
|
+
* inside the gated closure. */
|
|
254
|
+
export declare function applyMixedDentition(): void;
|
|
255
|
+
|
|
256
|
+
/** Apply the PRIMARY (deciduous) dentition preset — a STRUCTURAL
|
|
257
|
+
* interactive edit (not a reset), routed through the batch gate. `targetFor`
|
|
258
|
+
* is the state each tooth ends up in; only teeth that actually change are
|
|
259
|
+
* passed to the gate so unchanged teeth are not marked plan-edited / mirrored
|
|
260
|
+
* (per-tooth no-op signaling). Uninitialized plan stays a pure passthrough.
|
|
261
|
+
* The `edentulous` flip + button state live INSIDE the gated closure so on the
|
|
262
|
+
* deferred-confirm path they take effect only on Accept — otherwise Cancel
|
|
263
|
+
* would leave `edentulous` flipped while every tooth
|
|
264
|
+
* is untouched (flag/teeth mismatch). `notifyStateChange()` moves inside too so
|
|
265
|
+
* the whole-mouth refresh fires when the batch actually applies. */
|
|
266
|
+
export declare function applyPrimaryDentition(): void;
|
|
267
|
+
|
|
268
|
+
export declare function applyStatusExtra(option: Any): void;
|
|
269
|
+
|
|
270
|
+
/** User cancelled: do NOT apply the edit; re-sync the active tooth's controls
|
|
271
|
+
* from stored state so the control the user just changed snaps back (no stale
|
|
272
|
+
* UI), then notify (refresh + close the modal). No-op when nothing is pending. */
|
|
273
|
+
export declare function cancelDualStateConfirm(): void;
|
|
274
|
+
|
|
275
|
+
export declare function CariesCard(): JSX_2.Element;
|
|
276
|
+
|
|
277
|
+
/** Case-level (whole-mouth / regional) dental diagnosis identifiers — authored
|
|
278
|
+
* on the case, not derived from a tooth. Separate from the tooth-level
|
|
279
|
+
* `DiagnosisKey`/`DX_CODES`. */
|
|
280
|
+
declare type CaseConditionKey = "jawSizeAnomaly" | "jawBaseAnomaly" | "archRelationAnomaly" | "toothPositionAnomaly" | "malocclusionUnspecified" | "dentofacialFunctional" | "tmjDisorder" | "odontogenicCyst" | "nonOdontogenicCyst" | "jawCystOther" | "oralCystOther" | "salivaryAtrophy" | "salivaryHypertrophy" | "sialadenitis" | "salivaryAbscess" | "salivaryFistula" | "sialolithiasis" | "mucocele" | "salivarySecretion" | "recurrentAphthae" | "stomatitisOther" | "oralCellulitis" | "oralMucositis" | "anodontia" | "hereditaryStructure" | "lipDisease" | "leukoplakia" | "mucosalLesionOther";
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The "Case / regional diagnoses" pop-up. Moved out of the perio-status sidebar
|
|
284
|
+
* (`PerioSidebar`) into its own dialog, opened from the "Diagnoses" button next
|
|
285
|
+
* to the Odontogram / Periodontal-status view toggle. Mirrors `CreditsModal`'s
|
|
286
|
+
* dialog contract: `role="dialog"` + `aria-modal`, Escape closes, backdrop click
|
|
287
|
+
* closes, focus is trapped while open and returned to the opener on close.
|
|
288
|
+
*
|
|
289
|
+
* Owns its own `caseConds` state + a single `onStateChange` subscription (like
|
|
290
|
+
* `PerioSidebar` did), so it stays live while open. Rows are code-first and
|
|
291
|
+
* code-sorted (`getCaseConditions` sorts by ICD-10); the add-picker options are
|
|
292
|
+
* code-first (`{icd10} {label}`) and code-sorted too.
|
|
293
|
+
*/
|
|
294
|
+
export declare function CaseDiagnosesModal({ open, t, onClose, }: {
|
|
295
|
+
open: boolean;
|
|
296
|
+
/** Translation function — the `t` from `useI18n`. */
|
|
297
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
298
|
+
onClose: () => void;
|
|
299
|
+
}): JSX_2.Element;
|
|
300
|
+
|
|
301
|
+
declare type ChartMode = "status" | "plan";
|
|
302
|
+
|
|
303
|
+
/** Remove the stored entry for the active (or default) key. */
|
|
304
|
+
export declare function clearPersistedState(): void;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Clear the current tooth selection and reset the active tooth. Useful when
|
|
308
|
+
* switching to view or quote-builder mode from the host application.
|
|
309
|
+
*/
|
|
310
|
+
export declare function clearSelection(): void;
|
|
311
|
+
|
|
312
|
+
/** Close the perio-chart overlay. No-op (still notifies) if already closed. */
|
|
313
|
+
export declare function closePerioOverlay(): void;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* A national code overlay. `translation` packs keep the WHO codes and only
|
|
317
|
+
* localize the display (cheap: BNO-10, MKCH-10, and the dental chapter of
|
|
318
|
+
* ICD-10-GM/CIM-10). `modification` packs remap the code itself (US ICD-10-CM,
|
|
319
|
+
* added in DX-5).
|
|
320
|
+
*/
|
|
321
|
+
declare interface CodingPack {
|
|
322
|
+
id: string;
|
|
323
|
+
system: string;
|
|
324
|
+
kind: "translation" | "modification";
|
|
325
|
+
displays?: Partial<Record<DiagnosisKey, string>>;
|
|
326
|
+
caseDisplays?: Partial<Record<CaseConditionKey, string>>;
|
|
327
|
+
codes?: Partial<Record<DiagnosisKey, {
|
|
328
|
+
code: string;
|
|
329
|
+
display: string;
|
|
330
|
+
}>>;
|
|
331
|
+
caseCodes?: Partial<Record<CaseConditionKey, {
|
|
332
|
+
code: string;
|
|
333
|
+
display: string;
|
|
334
|
+
}>>;
|
|
335
|
+
/** DX-8: translation-pack displays keyed by a REFINED WHO code (e.g. `K02.1`)
|
|
336
|
+
* that `refineWho` may emit instead of the key's flat code. Falls back to
|
|
337
|
+
* `displays[key]` when absent. */
|
|
338
|
+
refinedDisplays?: Record<string, string>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Compare two EXPORTED exams of the same mouth — `before` as charted then,
|
|
343
|
+
* `after` as charted now.
|
|
344
|
+
*
|
|
345
|
+
* `getPlanChanges()` diffs the two charts of ONE exam (what the clinician plans
|
|
346
|
+
* to change); this diffs one chart across TWO exams (what actually changed
|
|
347
|
+
* since last time), which is the question a recall appointment asks. A host
|
|
348
|
+
* keeping a timeline of exports holds both payloads; nothing else is needed.
|
|
349
|
+
*
|
|
350
|
+
* Pure and read-only: it never touches the live charts, so it can be called
|
|
351
|
+
* while the clinician is working, and the active chart is irrelevant to the
|
|
352
|
+
* result. Each payload is hydrated under ITS OWN version rule (the same one
|
|
353
|
+
* `importStatus()` applies), so an old export compares faithfully. Tolerant of
|
|
354
|
+
* a malformed or empty payload — an unreadable tooth compares as the clinical
|
|
355
|
+
* default rather than throwing.
|
|
356
|
+
*/
|
|
357
|
+
export declare function compareExams(before: Any, after: Any): ExamComparison;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Tear down the odontogram engine: clear all DOM elements built by the engine,
|
|
361
|
+
* unsubscribe from i18n changes, and reset internal state. After this call,
|
|
362
|
+
* {@link initOdontogram} may be called again to re-initialise.
|
|
363
|
+
*/
|
|
364
|
+
export declare function destroyOdontogram(): void;
|
|
365
|
+
|
|
366
|
+
export declare function DiagnosesCard(): JSX_2.Element;
|
|
367
|
+
|
|
368
|
+
/** Internal dental-diagnosis identifiers. Extended per DX sub-project. */
|
|
369
|
+
declare type DiagnosisKey = "caries" | "periodontitis" | "gingivitis" | "cariesCementum" | "cariesArrested" | "pulpitis" | "pulpNecrosis" | "apicalPeriodontitisAcute" | "apicalPeriodontitisChronic" | "radicularCyst" | "periapicalAbscess" | "periapicalAbscessSinus" | "condensingOsteitis" | "resorption" | "attrition" | "abrasion" | "erosion" | "abfraction" | "calculus" | "fluorosis" | "tetracyclineStain" | "postEruptiveColour" | "toothLoss" | "retainedRoot" | "toothFracture" | "periImplantMucositis" | "periImplantitis";
|
|
370
|
+
|
|
371
|
+
/** Stop persisting. The stored entry is left in place (see clearPersistedState).
|
|
372
|
+
* A pending debounced save is flushed first so the last edit isn't lost. */
|
|
373
|
+
export declare function disablePersistence(): void;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Turn on localStorage persistence: restores a previously saved case (if any),
|
|
377
|
+
* then saves on every state change. Idempotent — calling again replaces the
|
|
378
|
+
* previous subscription and options. Call AFTER the odontogram has mounted.
|
|
379
|
+
*/
|
|
380
|
+
export declare function enablePersistence(options?: PersistenceOptions): void;
|
|
381
|
+
|
|
382
|
+
/** What {@link compareExams} answers: the same mouth, charted twice. */
|
|
383
|
+
export declare interface ExamComparison {
|
|
384
|
+
/** Axis-level changes, exactly the shape and labels `getPlanChanges()` uses —
|
|
385
|
+
* `from` is the earlier exam, `to` the later one. */
|
|
386
|
+
changes: PlanChange[];
|
|
387
|
+
/** The periodontal measurements, where the change is numeric rather than a
|
|
388
|
+
* label: per-site probing depth and attachment level, and what moved by a
|
|
389
|
+
* clinically meaningful amount. */
|
|
390
|
+
perio: PerioExamComparison;
|
|
391
|
+
/** The 2017 classification of each exam (derived, with the clinician's own
|
|
392
|
+
* per-axis overrides applied), so a stage or grade that moved is visible. */
|
|
393
|
+
classification: {
|
|
394
|
+
from: FinalPerioClassification;
|
|
395
|
+
to: FinalPerioClassification;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Export the current odontogram as an HL7 FHIR R4 collection Bundle (JSON).
|
|
401
|
+
* @param options - Optional subject reference (e.g. "Patient/123"); when
|
|
402
|
+
* omitted a placeholder Patient is embedded.
|
|
403
|
+
*/
|
|
404
|
+
export declare function exportFhir(options?: FhirExportOptions): Bundle<Resource>;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Export the odontogram as PNG or JPG. Renders the serialized SVG via the
|
|
408
|
+
* browser's native rasterizer (Image → canvas) — much faster than the previous
|
|
409
|
+
* html2canvas DOM rasterization, and sharper.
|
|
410
|
+
*/
|
|
411
|
+
export declare function exportImage(format?: "png" | "jpg"): Promise<void>;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Assemble a printable PDF report (jsPDF-native — vector text + raster chart
|
|
415
|
+
* PNGs, no svg2pdf.js). Gathers all `data` (SVG→PNG
|
|
416
|
+
* rasterization via `rasterizeSvgToPng`, summary/classification text,
|
|
417
|
+
* `hasAnyPerioData()`), drives the export-progress overlay, then hands off
|
|
418
|
+
* to the PURE `assemblePdf()` (`src/perioPdf.ts`), which decides section
|
|
419
|
+
* layout from `opts`/`data` alone.
|
|
420
|
+
*
|
|
421
|
+
* jsPDF-in-jsdom note: constructing a real `jsPDF` instance depends on
|
|
422
|
+
* browser canvas/font internals jsdom doesn't fully provide, so this
|
|
423
|
+
* wrapper is NOT unit-tested directly — `assemblePdf`'s section-gating IS
|
|
424
|
+
* thoroughly unit-tested with an injectable fake doc (see
|
|
425
|
+
* `ui3b-export-pdf.test.ts`). This wrapper's own raster→layout→save path is a
|
|
426
|
+
* browser-verify item.
|
|
427
|
+
*/
|
|
428
|
+
export declare function exportPdf(opts: PdfExportOptions): Promise<void>;
|
|
429
|
+
|
|
430
|
+
/** Export the full perio chart as PNG/JPG (SVG → canvas @2×, via the
|
|
431
|
+
* shared `rasterizeSvgToCanvas` raster core). */
|
|
432
|
+
export declare function exportPerioImage(format?: "png" | "jpg"): Promise<void>;
|
|
433
|
+
|
|
434
|
+
/** Export the full perio chart as a standalone vector SVG file. */
|
|
435
|
+
export declare function exportPerioSvg(): Promise<void>;
|
|
436
|
+
|
|
437
|
+
export declare function exportStatus(): void;
|
|
438
|
+
|
|
439
|
+
export declare function exportSvg(): Promise<void>;
|
|
440
|
+
|
|
441
|
+
export declare type ExtractionPlanParent = "brokenCrownRow" | "bruxismRow" | "crownActionsRow";
|
|
442
|
+
|
|
443
|
+
/** Options for buildFhirBundle / exportFhir. */
|
|
444
|
+
export declare interface FhirExportOptions {
|
|
445
|
+
/**
|
|
446
|
+
* FHIR reference string for the subject, e.g. "Patient/123".
|
|
447
|
+
* When omitted, a placeholder Patient resource is added to the Bundle and
|
|
448
|
+
* referenced by every Observation.
|
|
449
|
+
*/
|
|
450
|
+
subject?: string;
|
|
451
|
+
/** Active national diagnosis coding pack (adds a second coding to each
|
|
452
|
+
* Condition). Resolved and passed by the export entry point. */
|
|
453
|
+
codingPack?: CodingPack;
|
|
454
|
+
/** Emit a SNOMED CT coding on each Condition when true (DX-6 overlay). Set
|
|
455
|
+
* from the `snomedEnabled` session flag by the export entry point. */
|
|
456
|
+
snomed?: boolean;
|
|
457
|
+
/** Embed the engine's own `CodeSystem` resource in the Bundle (default `true`)
|
|
458
|
+
* so validators can resolve the LOCAL_SYSTEM codes from the Bundle itself.
|
|
459
|
+
* Pass `false` for a leaner Bundle when the consumer already hosts the
|
|
460
|
+
* published `fhir/CodeSystem-odontogram.json`. */
|
|
461
|
+
includeCodeSystem?: boolean;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** Fillings card complexity — "complex" = per-surface grid (default), "simple"
|
|
465
|
+
* = one filled/not-filled toggle for the whole tooth. */
|
|
466
|
+
export declare type FillingComplexity = "complex" | "simple";
|
|
467
|
+
|
|
468
|
+
export declare function FillingsCard(): JSX_2.Element;
|
|
469
|
+
|
|
470
|
+
/** The final (override ?? derived) classification for one axis each — see
|
|
471
|
+
* `getPerioClassification()` in odontogram.ts for the live-state
|
|
472
|
+
* equivalent this mirrors. */
|
|
473
|
+
/** The final periodontal classification of a serialized payload — derived,
|
|
474
|
+
* then overridden per axis by whatever the clinician pinned in `case`.
|
|
475
|
+
* Exported because the exam comparison reports it for both exams. */
|
|
476
|
+
declare interface FinalPerioClassification {
|
|
477
|
+
diagnosis: PerioDiagnosis;
|
|
478
|
+
stage: PerioStage;
|
|
479
|
+
grade: PerioGrade;
|
|
480
|
+
extent: PerioExtent;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** Formats a tooth number for display using the active numbering system AND
|
|
484
|
+
* the milktooth display-remap (`getDisplayedToothNumber`) — the exact
|
|
485
|
+
* same formatting {@link getOdontogramSummary} uses for every tooth number
|
|
486
|
+
* it prints (permanent/missing lists, per-section entries, implants). Exported
|
|
487
|
+
* so the "What changes" box in App.tsx can label a `PlanChange.toothNo`
|
|
488
|
+
* identically, without duplicating the numbering/milktooth logic. */
|
|
489
|
+
export declare function formatToothLabel(toothNo: number): string;
|
|
490
|
+
|
|
491
|
+
export declare function getActiveCaries(): ActiveCaries;
|
|
492
|
+
|
|
493
|
+
/** The active-tooth diagnoses card view-model — mirrors `getActiveRootPerio`'s
|
|
494
|
+
* active-tooth guard shape. `rows` covers the RAW derived set (each tagged
|
|
495
|
+
* `suppressed` per the tooth's `dxOverrides`) plus any `add`-mode override key
|
|
496
|
+
* that no rule derived; `addableKeys` is every other tooth-level diagnosis key
|
|
497
|
+
* not already covered by a row, for an "add a diagnosis" picker. Localized
|
|
498
|
+
* labels are resolved by the CARD via `t("dx."+key)` — this returns raw keys +
|
|
499
|
+
* codes only. `visible` is false (empty rows/addableKeys) with no active tooth
|
|
500
|
+
* or on a tooth that isn't naturally present (missing/implant/under-gum/
|
|
501
|
+
* extraction-socket — the same gate `deriveDentalDiagnoses` itself applies). */
|
|
502
|
+
export declare function getActiveDiagnoses(): ActiveDiagnoses;
|
|
503
|
+
|
|
504
|
+
export declare function getActiveFillings(): ActiveFillings;
|
|
505
|
+
|
|
506
|
+
export declare function getActiveOrtho(): ActiveOrtho | null;
|
|
507
|
+
|
|
508
|
+
export declare function getActiveRootPerio(): ActiveRootPerio;
|
|
509
|
+
|
|
510
|
+
export declare function getActiveToothDetails(): ActiveToothDetails;
|
|
511
|
+
|
|
512
|
+
export declare function getCariesDepthEnabled(): boolean;
|
|
513
|
+
|
|
514
|
+
export declare function getCariesDepthOptions(): Array<{
|
|
515
|
+
value: number;
|
|
516
|
+
label: string;
|
|
517
|
+
title?: string;
|
|
518
|
+
}>;
|
|
519
|
+
|
|
520
|
+
/** Current active chart mode ("status" | "plan"). */
|
|
521
|
+
export declare function getChartMode(): ChartMode;
|
|
522
|
+
|
|
523
|
+
export declare function getDiagnosisCodingPack(): string;
|
|
524
|
+
|
|
525
|
+
export declare function getDiscolorationDetailLevel(): ToothDetailLevel;
|
|
526
|
+
|
|
527
|
+
/** Read the whole-mouth edentulous flag. Backs the declarative Statuses card's
|
|
528
|
+
* `#btnEdentulous` `aria-pressed` via `useEngineState(getEdentulous)`, replacing
|
|
529
|
+
* the former imperative `setToggleButton($("#btnEdentulous"), …)` syncs — every
|
|
530
|
+
* path that flips `edentulous` fires `notifyStateChange()`, so the React button
|
|
531
|
+
* re-reads this and re-renders. */
|
|
532
|
+
export declare function getEdentulous(): boolean;
|
|
533
|
+
|
|
534
|
+
export declare function getFillingComplexity(): "complex" | "simple";
|
|
535
|
+
|
|
536
|
+
export declare function getFillingDefectEnabled(): boolean;
|
|
537
|
+
|
|
538
|
+
export declare function getFillingMaterialAvailability(): Record<string, boolean>;
|
|
539
|
+
|
|
540
|
+
export declare function getFissureSealingEnabled(): boolean;
|
|
541
|
+
|
|
542
|
+
export declare function getIcdasEnabled(): boolean;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Get the current notes-enabled state.
|
|
546
|
+
*/
|
|
547
|
+
export declare function getNotesEnabled(): boolean;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Switch the displayed tooth numbering system and re-render all tooth labels.
|
|
551
|
+
* @param system - The target {@link NumberingSystem}.
|
|
552
|
+
*/
|
|
553
|
+
/** The numbering system currently displayed. Defaults to `"FDI"`. */
|
|
554
|
+
export declare function getNumberingSystem(): NumberingSystem;
|
|
555
|
+
|
|
556
|
+
export declare function getOdontogramSummary(): OdontogramSummary;
|
|
557
|
+
|
|
558
|
+
export declare function getPdfSettings(): PdfSettings;
|
|
559
|
+
|
|
560
|
+
/** Current perio index-name display mode. Defaults to `"translated"`. */
|
|
561
|
+
export declare function getPerioIndexNameMode(): PerioIndexNameMode;
|
|
562
|
+
|
|
563
|
+
/** Current per-index perio-chart row visibility. Defaults to all-visible. */
|
|
564
|
+
export declare function getPerioRowVisibility(): Record<PerioRowId, boolean>;
|
|
565
|
+
|
|
566
|
+
/** Current perio-chart housing mode. Defaults to `"toggle"`. */
|
|
567
|
+
export declare function getPerioViewMode(): PerioViewMode;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Compare the "status" chart against the "plan" chart, tooth by tooth and
|
|
571
|
+
* axis by axis (see `DIFF_AXES`), and report every axis whose label
|
|
572
|
+
* differs. Pure and read-only: never mutates either chart, never touches the
|
|
573
|
+
* DOM, never renders — a `parity.test.ts`-safe addition.
|
|
574
|
+
*
|
|
575
|
+
* Returns `[]` whenever the plan chart hasn't been initialized yet (no plan
|
|
576
|
+
* exists to diff against). A tooth absent from either chart resolves via
|
|
577
|
+
* `defaultState()`, so a status-only or plan-only tooth still diffs correctly
|
|
578
|
+
* against the clinical default rather than throwing.
|
|
579
|
+
*
|
|
580
|
+
* Iterates the fixed `ALL_TEETH` list (not chart key insertion order), so
|
|
581
|
+
* results are always grouped by tooth in the same stable clinical order the
|
|
582
|
+
* rest of the app already uses (quadrant-by-quadrant); within a tooth,
|
|
583
|
+
* entries follow `DIFF_AXES` order.
|
|
584
|
+
*/
|
|
585
|
+
export declare function getPlanChanges(): PlanChange[];
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Export the PLAN chart's payload alone: same shape as the status export
|
|
589
|
+
* (`{version, globals, teeth}`), but `teeth` is collected from `charts.plan`.
|
|
590
|
+
* `globals` are shared app-level settings, not owned by either chart.
|
|
591
|
+
*/
|
|
592
|
+
export declare function getPlanChart(): Any;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Get a plugin's custom state for a specific tooth.
|
|
596
|
+
*
|
|
597
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
598
|
+
* @param pluginId - The plugin's unique identifier.
|
|
599
|
+
* @returns The custom state value, or `undefined` if not set.
|
|
600
|
+
*/
|
|
601
|
+
export declare function getPluginState(toothNo: number, pluginId: string): unknown;
|
|
602
|
+
|
|
603
|
+
export declare function getPulpDetailLevel(): PulpDetailLevel;
|
|
604
|
+
|
|
605
|
+
export declare function getRadiographicDepthMode(): RadiographicDepthMode;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Get the current read-only mode state.
|
|
609
|
+
*/
|
|
610
|
+
export declare function getReadOnly(): boolean;
|
|
611
|
+
|
|
612
|
+
export declare function getRootCariesMode(): RootCariesMode;
|
|
613
|
+
|
|
614
|
+
/** Current tooth-number size. Defaults to `"normal"`. */
|
|
615
|
+
export declare function getScreenToothNumberSize(): ScreenToothNumberSize;
|
|
616
|
+
|
|
617
|
+
/** Current inter-tooth spacing. Defaults to `"normal"`. */
|
|
618
|
+
export declare function getScreenToothSpacing(): ScreenToothSpacing;
|
|
619
|
+
|
|
620
|
+
export declare function getSecondaryCariesMode(): SecondaryCariesMode;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The currently selected teeth, as FDI numbers, in the order they were added to
|
|
624
|
+
* the selection. Empty when nothing is selected.
|
|
625
|
+
*
|
|
626
|
+
* Returns a fresh array — changing it never touches the selection. Every
|
|
627
|
+
* selection change fires {@link onStateChange}, so a host can follow the
|
|
628
|
+
* selection by re-reading this in its listener (to price a treatment for the
|
|
629
|
+
* selected teeth, for example).
|
|
630
|
+
*
|
|
631
|
+
* Contributed in a downstream fork (sofia-cluadette/React-Advanced-Odontogram).
|
|
632
|
+
*/
|
|
633
|
+
export declare function getSelectedTeeth(): number[];
|
|
634
|
+
|
|
635
|
+
/** Current selection-ring border style. Defaults to `"dashed"`. */
|
|
636
|
+
export declare function getSelectionBorderStyle(): SelectionBorderStyle;
|
|
637
|
+
|
|
638
|
+
/** Current selection-ring colour as `#rrggbb`. Defaults to `"#3b7bff"`. */
|
|
639
|
+
export declare function getSelectionColor(): string;
|
|
640
|
+
|
|
641
|
+
export declare function getSnomedEnabled(): boolean;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Export the STATUS chart's payload — identical to exportStatus()'s JSON
|
|
645
|
+
* (status-primary; unaffected by the current chart mode).
|
|
646
|
+
*/
|
|
647
|
+
export declare function getStatusChart(): Any;
|
|
648
|
+
|
|
649
|
+
export declare function getStatusExtras(): ({
|
|
650
|
+
label: string;
|
|
651
|
+
id: string;
|
|
652
|
+
labelKey: string;
|
|
653
|
+
type: string;
|
|
654
|
+
teeth: number[];
|
|
655
|
+
material: string;
|
|
656
|
+
arch?: undefined;
|
|
657
|
+
missingMaterial?: undefined;
|
|
658
|
+
implants?: undefined;
|
|
659
|
+
missing?: undefined;
|
|
660
|
+
} | {
|
|
661
|
+
label: string;
|
|
662
|
+
id: string;
|
|
663
|
+
labelKey: string;
|
|
664
|
+
type: string;
|
|
665
|
+
arch: string;
|
|
666
|
+
material: string;
|
|
667
|
+
missingMaterial: string;
|
|
668
|
+
teeth?: undefined;
|
|
669
|
+
implants?: undefined;
|
|
670
|
+
missing?: undefined;
|
|
671
|
+
} | {
|
|
672
|
+
label: string;
|
|
673
|
+
id: string;
|
|
674
|
+
labelKey: string;
|
|
675
|
+
type: string;
|
|
676
|
+
arch: string;
|
|
677
|
+
teeth?: undefined;
|
|
678
|
+
material?: undefined;
|
|
679
|
+
missingMaterial?: undefined;
|
|
680
|
+
implants?: undefined;
|
|
681
|
+
missing?: undefined;
|
|
682
|
+
} | {
|
|
683
|
+
label: string;
|
|
684
|
+
id: string;
|
|
685
|
+
labelKey: string;
|
|
686
|
+
type: string;
|
|
687
|
+
arch: string;
|
|
688
|
+
implants: number[];
|
|
689
|
+
missing: number[];
|
|
690
|
+
teeth?: undefined;
|
|
691
|
+
material?: undefined;
|
|
692
|
+
missingMaterial?: undefined;
|
|
693
|
+
})[];
|
|
694
|
+
|
|
695
|
+
export declare function getSurfaceNotation(): SurfaceNotation;
|
|
696
|
+
|
|
697
|
+
/** Current tooth-anatomy profile selector. Defaults to `"classic"`. */
|
|
698
|
+
export declare function getToothAnatomy(): ToothAnatomy;
|
|
699
|
+
|
|
700
|
+
/** A tooth's EFFECTIVE coded diagnoses (derived − suppressed + added), reused
|
|
701
|
+
* by both the tooltip (`getStateSummary`) and the whole-mouth summary
|
|
702
|
+
* ({@link getOdontogramSummary}). Reads the ACTIVE chart's tooth state (so
|
|
703
|
+
* it's transparently Status/Plan dual-state aware, like every other per-tooth
|
|
704
|
+
* getter). A tooth with no state (never touched) has no diagnoses. */
|
|
705
|
+
export declare function getToothDiagnoses(toothNo: number): ToothDiagnosis[];
|
|
706
|
+
|
|
707
|
+
/** Whether the tooth-information panel is shown. Defaults to `true`. */
|
|
708
|
+
export declare function getToothInfoVisible(): boolean;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Get a human-readable summary of all active states for a tooth.
|
|
712
|
+
* Useful for building custom tooltip or info-panel UIs.
|
|
713
|
+
*
|
|
714
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
715
|
+
* @returns Array of localized state description strings.
|
|
716
|
+
*/
|
|
717
|
+
export declare function getToothStateSummary(toothNo: number): string[];
|
|
718
|
+
|
|
719
|
+
/** Templates refused so far (and why). A profile whose artwork is not loaded yet reports when it loads. */
|
|
720
|
+
export declare function getToothTemplateRejections(): readonly TemplateRejection[];
|
|
721
|
+
|
|
722
|
+
export declare function getWearDetailLevel(): ToothDetailLevel;
|
|
723
|
+
|
|
724
|
+
/** True iff ANY periodontal axis has been charted anywhere in the mouth. Used
|
|
725
|
+
* to auto-skip the perio section of an export and to disable the
|
|
726
|
+
* perio image-export menu items on a blank chart. Derived entirely from
|
|
727
|
+
* `getPerioSummary()` — no new traversal. */
|
|
728
|
+
export declare function hasAnyPerioData(): boolean;
|
|
729
|
+
|
|
730
|
+
export declare function importStatus(data: Any): void;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Initialise the odontogram engine: wire up DOM controls, build the SVG tooth
|
|
734
|
+
* grid, and start listening for i18n changes. Safe to call multiple times
|
|
735
|
+
* (subsequent calls are no-ops).
|
|
736
|
+
*/
|
|
737
|
+
export declare function initOdontogram(): Promise<void>;
|
|
738
|
+
|
|
739
|
+
/** Whether a status-vs-plan divergence confirm is awaiting the user's choice. */
|
|
740
|
+
export declare function isDualStateConfirmPending(): boolean;
|
|
741
|
+
|
|
742
|
+
/** Whether the perio-chart overlay is currently open. */
|
|
743
|
+
export declare function isPerioOverlayOpen(): boolean;
|
|
744
|
+
|
|
745
|
+
/** True while a state-change subscription is active. */
|
|
746
|
+
export declare function isPersistenceEnabled(): boolean;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Supported UI languages.
|
|
750
|
+
*
|
|
751
|
+
* | Code | Language |
|
|
752
|
+
* |------|----------|
|
|
753
|
+
* | en | English |
|
|
754
|
+
* | ar | Arabic (RTL — UI mirrors, dental/perio charts pinned LTR) |
|
|
755
|
+
*
|
|
756
|
+
* The strings themselves live one file per language in `./locales/`. Only
|
|
757
|
+
* English is bundled statically; every other language is a separate chunk
|
|
758
|
+
* fetched the first time it is selected (see `./loader.ts`).
|
|
759
|
+
*/
|
|
760
|
+
declare type Language = "en" | "ar";
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Supported tooth numbering systems.
|
|
764
|
+
* - **FDI** – ISO 3950 two-digit notation (default in most countries).
|
|
765
|
+
* - **UNIVERSAL** – ADA numbering (1-32 adult, A-T primary).
|
|
766
|
+
* - **PALMER** – Quadrant-based notation (UR/UL/LL/LR + position).
|
|
767
|
+
*/
|
|
768
|
+
declare type NumberingSystem = "FDI" | "UNIVERSAL" | "PALMER";
|
|
769
|
+
|
|
770
|
+
export declare function OdontogramChartSurface(): JSX_2.Element;
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Custom SVG plugin definition for the Odontogram engine.
|
|
774
|
+
*
|
|
775
|
+
* Plugins can inject custom SVG content into each tooth's rendering and
|
|
776
|
+
* maintain per-tooth custom state that is automatically included in
|
|
777
|
+
* JSON export/import.
|
|
778
|
+
*
|
|
779
|
+
* @example
|
|
780
|
+
* ```typescript
|
|
781
|
+
* const implantBrandPlugin: OdontogramPlugin = {
|
|
782
|
+
* id: "implant-brand",
|
|
783
|
+
* label: { hu: "Implantátum márka", en: "Implant brand", de: "Implantat-Marke", ... },
|
|
784
|
+
* layer: "overlay",
|
|
785
|
+
* renderSvg: (toothNo, _quadrant, customState) => {
|
|
786
|
+
* if (!customState?.brand) return null;
|
|
787
|
+
* return `<text x="16" y="60" font-size="6" fill="#3b7bff">${customState.brand}</text>`;
|
|
788
|
+
* },
|
|
789
|
+
* };
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
|
+
export declare type OdontogramPlugin = {
|
|
793
|
+
/** Unique plugin identifier (used as key in customStates). */
|
|
794
|
+
id: string;
|
|
795
|
+
/** Localized display label for the plugin (shown in the state tooltip). */
|
|
796
|
+
label: Partial<Record<Language, string>>;
|
|
797
|
+
/**
|
|
798
|
+
* SVG layer where this plugin's output will be rendered.
|
|
799
|
+
* @see {@link PluginLayer}
|
|
800
|
+
*/
|
|
801
|
+
layer: PluginLayer;
|
|
802
|
+
/**
|
|
803
|
+
* Render SVG markup for a specific tooth. Return an SVG fragment string
|
|
804
|
+
* (will be wrapped in a `<g>` element) or `null`/`undefined` to render nothing.
|
|
805
|
+
*
|
|
806
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
807
|
+
* @param quadrant - The quadrant (1–4) derived from the tooth number.
|
|
808
|
+
* @param customState - The plugin's custom state for this tooth, or `undefined`.
|
|
809
|
+
*/
|
|
810
|
+
renderSvg: (toothNo: number, quadrant: 1 | 2 | 3 | 4, customState: unknown) => string | null | undefined;
|
|
811
|
+
/**
|
|
812
|
+
* Optional: which panel section this plugin adds controls to.
|
|
813
|
+
* When set to `"custom"`, the engine will render a dedicated panel
|
|
814
|
+
* section for the plugin (future expansion).
|
|
815
|
+
*/
|
|
816
|
+
panelSection?: "custom";
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Owns all odontogram shell state, effects, and handlers and provides them to
|
|
821
|
+
* composed surfaces + modals. Renders only the `.odontogram-root` wrapper around
|
|
822
|
+
* `children` — no extra DOM node.
|
|
823
|
+
*
|
|
824
|
+
* Holds its first render until the requested `language` has loaded: every UI
|
|
825
|
+
* language but English is a lazily fetched chunk, and mounting before it
|
|
826
|
+
* arrives would paint the whole chart in the English fallback and then repaint
|
|
827
|
+
* it — a visible flash of the wrong language on every page load. English (and
|
|
828
|
+
* any language already loaded) renders on the very first pass, as before.
|
|
829
|
+
*/
|
|
830
|
+
export declare function OdontogramProvider(props: OdontogramProviderProps): JSX_2.Element;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Props for {@link OdontogramProvider} — the full former `OdontogramShell`
|
|
834
|
+
* (`App`) props surface plus the composed `children`. All state/behavior props
|
|
835
|
+
* are optional: when omitted the provider operates in **standalone** mode with
|
|
836
|
+
* internal state; when provided it operates in **controlled** mode and delegates
|
|
837
|
+
* state to the parent.
|
|
838
|
+
*/
|
|
839
|
+
declare type OdontogramProviderProps = {
|
|
840
|
+
/** Override the UI language (controlled mode). */
|
|
841
|
+
language?: Language;
|
|
842
|
+
/** Callback when the user changes the language. */
|
|
843
|
+
onLanguageChange?: (lang: Language) => void;
|
|
844
|
+
/** Override the tooth numbering system (controlled mode). */
|
|
845
|
+
numberingSystem?: NumberingSystem;
|
|
846
|
+
/** Callback when the user changes the numbering system. */
|
|
847
|
+
onNumberingChange?: (system: NumberingSystem) => void;
|
|
848
|
+
/** Override dark mode state (controlled mode). */
|
|
849
|
+
darkMode?: boolean;
|
|
850
|
+
/** Callback when the user toggles dark mode. */
|
|
851
|
+
onDarkModeChange?: (dark: boolean) => void;
|
|
852
|
+
/**
|
|
853
|
+
* Custom theme configuration. Overrides the default color palette via
|
|
854
|
+
* CSS custom properties (`--odon-*`). See {@link OdontogramThemeConfig}.
|
|
855
|
+
*/
|
|
856
|
+
themeConfig?: OdontogramThemeConfig;
|
|
857
|
+
/**
|
|
858
|
+
* Custom SVG plugins for extending the odontogram with additional visual
|
|
859
|
+
* overlays and per-tooth custom state. See {@link OdontogramPlugin}.
|
|
860
|
+
*/
|
|
861
|
+
plugins?: OdontogramPlugin[];
|
|
862
|
+
/**
|
|
863
|
+
* Tooth drawings (SVG text) that replace the factory ones, per anatomy profile. The markup is vetted and a refused template keeps the
|
|
864
|
+
* factory one; see {@link ToothTemplateOverrides} and `getToothTemplateRejections()`. Omitted (the default): the factory artwork.
|
|
865
|
+
*/
|
|
866
|
+
toothTemplates?: ToothTemplateOverrides;
|
|
867
|
+
/**
|
|
868
|
+
* When true, disables all interactions (click, touch, keyboard).
|
|
869
|
+
* Useful for print/report/view modes.
|
|
870
|
+
*/
|
|
871
|
+
readOnly?: boolean;
|
|
872
|
+
/**
|
|
873
|
+
* When true, enables per-tooth notes. Double-click a tooth to add/edit a note.
|
|
874
|
+
* Notes are shown in hover tooltips and included in JSON export/import.
|
|
875
|
+
*/
|
|
876
|
+
enableNotes?: boolean;
|
|
877
|
+
/**
|
|
878
|
+
* Enable ICDAS II per-surface caries scoring (0–6). When enabled, the depth
|
|
879
|
+
* selector/popup expose ICDAS codes 1–6 and the surface indicator shows a
|
|
880
|
+
* numeric badge; otherwise the 3-level scale is used.
|
|
881
|
+
*/
|
|
882
|
+
enableIcdas?: boolean;
|
|
883
|
+
/**
|
|
884
|
+
* Pulp-diagnosis detail level for the pulp control:
|
|
885
|
+
* `"simple"` (healthy / pulpitis), `"aae"` (4 AAE pulp diagnoses, default) or
|
|
886
|
+
* `"latin"` (9 practical-Latin subtypes). A stored value round-trips at every
|
|
887
|
+
* level; the level only governs how the pulp control presents it.
|
|
888
|
+
*/
|
|
889
|
+
pulpDetailLevel?: PulpDetailLevel;
|
|
890
|
+
/**
|
|
891
|
+
* Secondary-caries (CARS) granularity for the per-surface score picker:
|
|
892
|
+
* `"simple"` ([0,3]), `"standard"` ([0,1,3,6], default) or `"full"` ([0..6]).
|
|
893
|
+
* A stored score round-trips at every mode; the mode only governs the offered
|
|
894
|
+
* option list. (The mode UI lives in the Settings modal; this prop is the
|
|
895
|
+
* controlled entry point.)
|
|
896
|
+
*/
|
|
897
|
+
secondaryCariesMode?: SecondaryCariesMode;
|
|
898
|
+
/**
|
|
899
|
+
* Root-caries granularity for the per-tooth picker: `"simple"` (none /
|
|
900
|
+
* present, default) or `"severity"` (the full none/active/arrested/
|
|
901
|
+
* active-cavitated enum). Non-collapsing across modes.
|
|
902
|
+
*/
|
|
903
|
+
rootCariesMode?: RootCariesMode;
|
|
904
|
+
/**
|
|
905
|
+
* Radiographic-depth granularity for the per-surface picker: `"off"`
|
|
906
|
+
* (hidden, default), `"threeLevel"` (superficial/middle/deep) or `"detailed"`
|
|
907
|
+
* (E1..D3). When off, the per-surface radiographic badge is not shown.
|
|
908
|
+
*/
|
|
909
|
+
radiographicDepthMode?: RadiographicDepthMode;
|
|
910
|
+
/**
|
|
911
|
+
* Whether the visual caries-depth encoding (per-surface depth picker + the
|
|
912
|
+
* opacity/contour depth tier in the render) is active. Default `true`; set
|
|
913
|
+
* `false` to render caried surfaces at the SVG default with no depth tier.
|
|
914
|
+
*/
|
|
915
|
+
cariesDepthEnabled?: boolean;
|
|
916
|
+
/**
|
|
917
|
+
* Detail level for the per-tooth wear control: `"simple"` (yes/no toggle for
|
|
918
|
+
* attrition) or `"complex"` (wear type per edge and cervix, default).
|
|
919
|
+
*/
|
|
920
|
+
wearDetailLevel?: ToothDetailLevel;
|
|
921
|
+
/**
|
|
922
|
+
* Detail level for the per-tooth discoloration control: `"simple"` (yes/no
|
|
923
|
+
* toggle) or `"complex"` (choose the discoloration cause, default).
|
|
924
|
+
*/
|
|
925
|
+
discolorationDetailLevel?: ToothDetailLevel;
|
|
926
|
+
/**
|
|
927
|
+
* Surface-notation mode for caries/filling surface letters + captions:
|
|
928
|
+
* `"full"` (default) makes them position-aware (incisal on an anterior
|
|
929
|
+
* tooth, labial on an anterior buccal surface, palatal on an upper lingual
|
|
930
|
+
* surface) or `"simple"` (always the tooth-independent B/O/L set).
|
|
931
|
+
*/
|
|
932
|
+
surfaceNotation?: SurfaceNotation;
|
|
933
|
+
/**
|
|
934
|
+
* Whether the Statuses panel (`#statusCard`) is shown. Default `true`. The
|
|
935
|
+
* panel visibility is a settings-driven wrapper around the section — the
|
|
936
|
+
* section's own imperative collapse/expand behavior is unaffected.
|
|
937
|
+
*/
|
|
938
|
+
showStatusCard?: boolean;
|
|
939
|
+
/**
|
|
940
|
+
* Whether the Orthodontics panel (`#orthoCard`) is shown. Default `true`.
|
|
941
|
+
* Composes with the panel's own imperative ortho-eligibility gate (hidden
|
|
942
|
+
* when no selected tooth is ortho-eligible) — both must be satisfied for
|
|
943
|
+
* the panel to render.
|
|
944
|
+
*/
|
|
945
|
+
showOrthoCard?: boolean;
|
|
946
|
+
/**
|
|
947
|
+
* Filling-complexity level for the Fillings card: `"simple"` (one material
|
|
948
|
+
* per tooth, no per-surface picker) or `"complex"` (per-surface materials,
|
|
949
|
+
* default). Contrast with `settings.panels` — this one mirrors the
|
|
950
|
+
* `fillingComplexity` engine flag (Settings → Fillings). When provided, the
|
|
951
|
+
* value overrides the engine/UI default; when omitted, whatever the engine
|
|
952
|
+
* holds (module default or a prior `setFillingComplexity` call) stays put.
|
|
953
|
+
*/
|
|
954
|
+
fillingComplexity?: FillingComplexity;
|
|
955
|
+
/**
|
|
956
|
+
* Called after the user changes the filling-complexity level in the
|
|
957
|
+
* Settings modal: `(value: FillingComplexity) => void`. Not fired for
|
|
958
|
+
* prop-driven restores. The write-back counterpart of {@link fillingComplexity}.
|
|
959
|
+
*/
|
|
960
|
+
onFillingComplexityChange?: (value: FillingComplexity) => void;
|
|
961
|
+
/**
|
|
962
|
+
* Whether filling-defect findings are enabled on the Fillings card. Default
|
|
963
|
+
* `true`. Mirrors the `fillingDefectEnabled` engine flag (Settings →
|
|
964
|
+
* Fillings); same controlled/standalone contract as {@link fillingComplexity}.
|
|
965
|
+
*/
|
|
966
|
+
fillingDefectEnabled?: boolean;
|
|
967
|
+
/** See {@link onFillingComplexityChange} — the defect toggle's counterpart. */
|
|
968
|
+
onFillingDefectEnabledChange?: (enabled: boolean) => void;
|
|
969
|
+
/**
|
|
970
|
+
* Available filling materials as a `Record<material, boolean>` over
|
|
971
|
+
* `"amalgam" | "composite" | "gic" | "temporary"` (unknown keys are
|
|
972
|
+
* ignored). Default: all four available. Mirrors the `fillingMaterialAvail`
|
|
973
|
+
* engine map (Settings → Fillings). Hosts may pass an inline literal — the
|
|
974
|
+
* sync effect keys on a canonical serialized form, so re-renders with
|
|
975
|
+
* identical content do not re-fire.
|
|
976
|
+
*/
|
|
977
|
+
fillingMaterialAvailability?: Record<string, boolean>;
|
|
978
|
+
/**
|
|
979
|
+
* Called after the user toggles a material in the Settings modal:
|
|
980
|
+
* `(material: string, enabled: boolean) => void` — per-material, mirroring
|
|
981
|
+
* the engine's `setFillingMaterialAvailability` setter (no whole-record
|
|
982
|
+
* change ever happens). Not fired for prop-driven restores.
|
|
983
|
+
*/
|
|
984
|
+
onFillingMaterialAvailabilityChange?: (material: string, enabled: boolean) => void;
|
|
985
|
+
/**
|
|
986
|
+
* Whether fissure-sealing is offered on the Fillings card. Default `true`.
|
|
987
|
+
* Mirrors the `fissureSealingEnabled` engine flag (Settings → Fillings);
|
|
988
|
+
* same controlled/standalone contract as {@link fillingComplexity}.
|
|
989
|
+
*/
|
|
990
|
+
fissureSealingEnabled?: boolean;
|
|
991
|
+
/** See {@link onFillingComplexityChange} — the fissure-sealing toggle's counterpart. */
|
|
992
|
+
onFissureSealingEnabledChange?: (enabled: boolean) => void;
|
|
993
|
+
/**
|
|
994
|
+
* Inter-tooth spacing of the on-screen grid (Settings → Odontogram). Mirrors
|
|
995
|
+
* the `screenToothSpacing` engine flag; same controlled/standalone contract
|
|
996
|
+
* as {@link fillingComplexity}.
|
|
997
|
+
*/
|
|
998
|
+
screenToothSpacing?: ScreenToothSpacing;
|
|
999
|
+
/** Tooth-number size of the on-screen grid; same contract as {@link screenToothSpacing}. */
|
|
1000
|
+
screenToothNumberSize?: ScreenToothNumberSize;
|
|
1001
|
+
/** Selection-ring colour as `#rrggbb`; same contract as {@link screenToothSpacing}. */
|
|
1002
|
+
selectionColor?: string;
|
|
1003
|
+
/** Selection-ring border style; same contract as {@link screenToothSpacing}. */
|
|
1004
|
+
selectionBorderStyle?: SelectionBorderStyle;
|
|
1005
|
+
/** Whether the optional Tooth Information surface is shown. */
|
|
1006
|
+
toothInfo?: boolean;
|
|
1007
|
+
/** The composed UI (surfaces + shell layout). */
|
|
1008
|
+
children?: ReactNode;
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
/** Structured, already-localized textual summary of the whole odontogram. */
|
|
1012
|
+
export declare type OdontogramSummary = {
|
|
1013
|
+
overview: string;
|
|
1014
|
+
permanentList: string | null;
|
|
1015
|
+
missingList: string | null;
|
|
1016
|
+
/** Grouped dentition table (the flat permanent/missing lists stay for
|
|
1017
|
+
* back-compat). */
|
|
1018
|
+
toothTable: OdontogramToothTable;
|
|
1019
|
+
/** True when any odontogram-markable periodontal finding
|
|
1020
|
+
* (inflammation, mobility, calculus, …) exists — drives showing the perio
|
|
1021
|
+
* summary line in the PDF's odontogram section even with no perio module. */
|
|
1022
|
+
periodontalHasFindings: boolean;
|
|
1023
|
+
sections: OdontogramSummarySection[];
|
|
1024
|
+
/** Implants heading + list — only present when at least one implant exists. */
|
|
1025
|
+
implants: {
|
|
1026
|
+
heading: string;
|
|
1027
|
+
text: string;
|
|
1028
|
+
} | null;
|
|
1029
|
+
periodontalTitle: string;
|
|
1030
|
+
periodontalText: string;
|
|
1031
|
+
/** The status->plan diff (see {@link getPlanChanges}), verbatim.
|
|
1032
|
+
* `[]` whenever the plan chart hasn't been initialized or plan === status —
|
|
1033
|
+
* a distinct field, not a section, since it's a diff rather than a status
|
|
1034
|
+
* list. The "What changes" box in App.tsx renders from this field only
|
|
1035
|
+
* when it's non-empty. */
|
|
1036
|
+
plannedChanges: PlanChange[];
|
|
1037
|
+
/** Per-tooth free-text notes — one "<tooth>: <note>" line per tooth
|
|
1038
|
+
* that carries a note (gated on the notes-enabled setting, like the tooltip).
|
|
1039
|
+
* `null` when no tooth has a note, so the panel/PDF omit the section entirely. */
|
|
1040
|
+
individualNotes: {
|
|
1041
|
+
heading: string;
|
|
1042
|
+
items: string[];
|
|
1043
|
+
} | null;
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
/** One heading + its per-tooth entries in the tooth-information summary. */
|
|
1047
|
+
export declare type OdontogramSummarySection = {
|
|
1048
|
+
key: "caries" | "fillings" | "endo" | "diagnoses" | "wear" | "discoloration" | "orthodontics" | "prosthetics";
|
|
1049
|
+
heading: string;
|
|
1050
|
+
items: string[];
|
|
1051
|
+
/** Localized "no such tooth" sentence, shown when `items` is empty. */
|
|
1052
|
+
emptyText: string;
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
export declare type OdontogramThemeConfig = {
|
|
1056
|
+
colors?: {
|
|
1057
|
+
/** Primary background. Default: `#f3f6fb` (light) / `#0f172a` (dark). */
|
|
1058
|
+
background?: string;
|
|
1059
|
+
/** Panel & card background. Default: `#ffffff` (light) / `#1e293b` (dark). */
|
|
1060
|
+
panel?: string;
|
|
1061
|
+
/** Card background. Default: same as panel. */
|
|
1062
|
+
card?: string;
|
|
1063
|
+
/** Primary text color. Default: `#1e2a3a` (light) / `#f1f5f9` (dark). */
|
|
1064
|
+
text?: string;
|
|
1065
|
+
/** Muted / secondary text color. Default: `#5b6b7d` (light) / `#94a3b8` (dark). */
|
|
1066
|
+
muted?: string;
|
|
1067
|
+
/** Border / divider color. Default: `#d7e0ec` (light) / `#334155` (dark). */
|
|
1068
|
+
line?: string;
|
|
1069
|
+
/** Primary accent (buttons, active states). Default: `#3b7bff`. */
|
|
1070
|
+
accent?: string;
|
|
1071
|
+
/** Secondary accent (success, selected states). Default: `#12b981`. */
|
|
1072
|
+
accent2?: string;
|
|
1073
|
+
};
|
|
1074
|
+
/**
|
|
1075
|
+
* Tooth-artwork colours.
|
|
1076
|
+
*
|
|
1077
|
+
* The drawings carry their colours as palette tokens with today's colour as
|
|
1078
|
+
* the fallback (`fill: var(--odon-tooth-body, #ebebeb)`), so an omitted
|
|
1079
|
+
* key leaves that surface exactly as drawn. Setting a key recolours that
|
|
1080
|
+
* surface across BOTH anatomy profiles at once, even where the classic and
|
|
1081
|
+
* measured artwork happen to be drawn in different shades.
|
|
1082
|
+
*
|
|
1083
|
+
* This is a curated subset. Every token — including the gradient stops and
|
|
1084
|
+
* the per-material restoration colours — can be set by name through
|
|
1085
|
+
* {@link OdontogramThemeConfig.tokens}.
|
|
1086
|
+
*/
|
|
1087
|
+
tooth?: {
|
|
1088
|
+
/** The tooth's own silhouette — crown AND root — and every broken or
|
|
1089
|
+
* prepared variant of it.
|
|
1090
|
+
*
|
|
1091
|
+
* In the `classic` profile this is the whole tooth: those drawings are one
|
|
1092
|
+
* shape, with no inner structure. In `measured` it is the outer shell —
|
|
1093
|
+
* enamel over the crown, cementum over the root — around `dentin` below,
|
|
1094
|
+
* which takes this colour unless it is set. Setting only `body` therefore
|
|
1095
|
+
* looks the same in both profiles. */
|
|
1096
|
+
body?: string;
|
|
1097
|
+
/** The dentin core inside the crown and root (`measured` profile only —
|
|
1098
|
+
* the classic drawings have no enamel/dentin boundary to colour).
|
|
1099
|
+
*
|
|
1100
|
+
* Unset, it follows `body`, so the boundary is invisible until you ask
|
|
1101
|
+
* for it. The occlusal view has no core: nothing of the dentin shows from
|
|
1102
|
+
* above. */
|
|
1103
|
+
dentin?: string;
|
|
1104
|
+
/** Crown and root outline. */
|
|
1105
|
+
outline?: string;
|
|
1106
|
+
/** The width of that outline, as a CSS length in SVG user units
|
|
1107
|
+
* (`"1"`, `"1.4"`, `"0.75"`). Not a colour — it is here because it is
|
|
1108
|
+
* the other half of `outline` above.
|
|
1109
|
+
*
|
|
1110
|
+
* It rides every layer that is the tooth's own silhouette, so the
|
|
1111
|
+
* contour keeps one thickness whatever the tooth is charted as: a
|
|
1112
|
+
* natural or deciduous crown, a root remnant, a prepared crown, a tooth
|
|
1113
|
+
* under the gum, any of the seven fracture states, or the occlusal
|
|
1114
|
+
* projection — whose tiles sit in the same chart grid as the side views
|
|
1115
|
+
* and therefore widen with them. The occlusal grooves are deliberately
|
|
1116
|
+
* not included and stay hairlines.
|
|
1117
|
+
*
|
|
1118
|
+
* Unset, the drawings declare no width at all and stroke at the SVG
|
|
1119
|
+
* initial value of `1`. */
|
|
1120
|
+
outlineWidth?: string;
|
|
1121
|
+
/** Crown sheen (the "beauty" layer). */
|
|
1122
|
+
highlight?: string;
|
|
1123
|
+
/** The deciduous tooth's silhouette. */
|
|
1124
|
+
milktoothBody?: string;
|
|
1125
|
+
/** Deciduous crown sheen. */
|
|
1126
|
+
milktoothHighlight?: string;
|
|
1127
|
+
/** Occlusal cusp field. */
|
|
1128
|
+
cusp?: string;
|
|
1129
|
+
/** Occlusal fissure lines. */
|
|
1130
|
+
groove?: string;
|
|
1131
|
+
/** Healthy pulp chamber. */
|
|
1132
|
+
pulpHealthy?: string;
|
|
1133
|
+
/** Inflamed pulp. */
|
|
1134
|
+
pulpInflamed?: string;
|
|
1135
|
+
/** Gingiva. */
|
|
1136
|
+
gum?: string;
|
|
1137
|
+
/** Alveolar bone. */
|
|
1138
|
+
bone?: string;
|
|
1139
|
+
/** Caries body. */
|
|
1140
|
+
caries?: string;
|
|
1141
|
+
/** Caries outline. */
|
|
1142
|
+
cariesOutline?: string;
|
|
1143
|
+
/** Bruxism wear facet. */
|
|
1144
|
+
wear?: string;
|
|
1145
|
+
/** Calculus deposit. */
|
|
1146
|
+
calculus?: string;
|
|
1147
|
+
/** Restoration outline. */
|
|
1148
|
+
restorationOutline?: string;
|
|
1149
|
+
/** Dark structural outline. */
|
|
1150
|
+
outlineDark?: string;
|
|
1151
|
+
};
|
|
1152
|
+
/**
|
|
1153
|
+
* Any palette token by its full CSS custom-property name, for the surfaces
|
|
1154
|
+
* {@link OdontogramThemeConfig.tooth} does not name — the per-material
|
|
1155
|
+
* restoration colours (`--odon-rest-gold`, `--odon-fill-composite`, …) and
|
|
1156
|
+
* the e.max / metal-ceramic gradient stops.
|
|
1157
|
+
*
|
|
1158
|
+
* Keys must start with `--odon-`; anything else is ignored, so this cannot
|
|
1159
|
+
* be used to set unrelated custom properties on the host's element.
|
|
1160
|
+
*
|
|
1161
|
+
* Not every token is a colour. `--odon-implant-tint` is a **CSS filter**
|
|
1162
|
+
* over the implant fixture as a whole: the drawing's ~65 metal greys encode
|
|
1163
|
+
* a light source, so they are deliberately not themable one by one, and a
|
|
1164
|
+
* filter shifts them together instead of flattening the shading. It is
|
|
1165
|
+
* `none` unless set, and it does not touch the peri-implant bone-loss
|
|
1166
|
+
* overlay, which sits outside the filtered group.
|
|
1167
|
+
*
|
|
1168
|
+
* `--odon-implant-fill` is the **flat** counterpart of that tint, for a
|
|
1169
|
+
* palette that wants one solid colour rather than shaded metal. It is a
|
|
1170
|
+
* colour, and it replaces the fill of every shape in the fixture at once.
|
|
1171
|
+
* Each of those shapes falls back to the grey it is drawn in, so unset it
|
|
1172
|
+
* changes nothing at all — there is no single default to state. The two
|
|
1173
|
+
* compose: the fill flattens the fixture, the filter then shifts it. It
|
|
1174
|
+
* leaves the peri-implant bone-loss overlay alone for the same reason the
|
|
1175
|
+
* tint does, and the occlusal screw-hole rims keep their outline, because
|
|
1176
|
+
* only `fill` is affected.
|
|
1177
|
+
*
|
|
1178
|
+
* @example
|
|
1179
|
+
* { tokens: { "--odon-rest-gold": "#d4af37", "--odon-fill-composite": "#eae0c8" } }
|
|
1180
|
+
* @example
|
|
1181
|
+
* { tokens: { "--odon-implant-tint": "hue-rotate(205deg) saturate(.85)" } }
|
|
1182
|
+
* @example
|
|
1183
|
+
* { tokens: { "--odon-implant-fill": "#8fa6b8" } }
|
|
1184
|
+
*/
|
|
1185
|
+
tokens?: Record<string, string>;
|
|
1186
|
+
/**
|
|
1187
|
+
* The tooth-selection highlight.
|
|
1188
|
+
*
|
|
1189
|
+
* Selection is an interaction state, not artwork — it is drawn by the chart
|
|
1190
|
+
* around a tile, not by any tooth drawing — but hosts look for it here when
|
|
1191
|
+
* they are deciding "what colour is everything". It is applied through the
|
|
1192
|
+
* existing session setters (`setSelectionColor` / `setSelectionBorderStyle`),
|
|
1193
|
+
* so it is NOT a CSS custom property and does not appear on the themed
|
|
1194
|
+
* element.
|
|
1195
|
+
*
|
|
1196
|
+
* The dedicated `selectionColor` / `selectionBorderStyle` props on the
|
|
1197
|
+
* provider are the more specific control and win when both are given.
|
|
1198
|
+
*/
|
|
1199
|
+
selection?: {
|
|
1200
|
+
color?: string;
|
|
1201
|
+
borderStyle?: SelectionBorderStyle;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1205
|
+
/** A grouped dentition overview: category columns (only non-empty ones) ×
|
|
1206
|
+
* anatomical group rows (whole mouth / jaw / quadrant / sextant), each cell a
|
|
1207
|
+
* list of that group's teeth of that category, tagged with a status. */
|
|
1208
|
+
declare interface OdontogramToothTable {
|
|
1209
|
+
columns: {
|
|
1210
|
+
key: string;
|
|
1211
|
+
label: string;
|
|
1212
|
+
}[];
|
|
1213
|
+
rows: {
|
|
1214
|
+
key: string;
|
|
1215
|
+
label: string;
|
|
1216
|
+
cells: Record<string, ToothTableCell[]>;
|
|
1217
|
+
}[];
|
|
1218
|
+
/** Localized note explaining the bold / bold-italic emphasis. */
|
|
1219
|
+
legend: string;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
export declare function OdontogramTopbar(): JSX_2.Element;
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Everything the surface components and shell-managed modals consume. Cross-cutting
|
|
1226
|
+
* state read across ≥2 regions/modals lives here; strictly region-local state
|
|
1227
|
+
* (the header dropdown open flags + outside-click effect) stays inside its surface.
|
|
1228
|
+
*/
|
|
1229
|
+
export declare type OdontogramUiContextValue = {
|
|
1230
|
+
t: TranslateFn;
|
|
1231
|
+
lang: Language;
|
|
1232
|
+
setLang: (lang: Language) => void;
|
|
1233
|
+
isDark: boolean;
|
|
1234
|
+
toggleDark: () => void;
|
|
1235
|
+
currentNumbering: NumberingSystem;
|
|
1236
|
+
setNumbering: (next: NumberingSystem) => void;
|
|
1237
|
+
viewMode: PerioViewMode;
|
|
1238
|
+
activeView: "odontogram" | "dentalChart";
|
|
1239
|
+
setActiveView: (view: "odontogram" | "dentalChart") => void;
|
|
1240
|
+
isPerioView: boolean;
|
|
1241
|
+
perioChartAvailable: boolean;
|
|
1242
|
+
perioOpen: boolean;
|
|
1243
|
+
confirmOpen: boolean;
|
|
1244
|
+
hasPerio: boolean;
|
|
1245
|
+
exportPngOn: boolean;
|
|
1246
|
+
exportJpgOn: boolean;
|
|
1247
|
+
exportSvgOn: boolean;
|
|
1248
|
+
exportPdfOn: boolean;
|
|
1249
|
+
importStatusOn: boolean;
|
|
1250
|
+
importFhirOn: boolean;
|
|
1251
|
+
summary: OdontogramSummary | null;
|
|
1252
|
+
toothInfoOn: boolean;
|
|
1253
|
+
screenSpacing: ScreenToothSpacing;
|
|
1254
|
+
screenNumberSize: ScreenToothNumberSize;
|
|
1255
|
+
selectionColor: string;
|
|
1256
|
+
selectionBorderStyle: SelectionBorderStyle;
|
|
1257
|
+
toothAnatomy: ToothAnatomy;
|
|
1258
|
+
planModeAvailable: boolean;
|
|
1259
|
+
showStatusCard: boolean;
|
|
1260
|
+
showOrthoCard: boolean;
|
|
1261
|
+
settingsState: SettingsState;
|
|
1262
|
+
settingsOpen: boolean;
|
|
1263
|
+
setSettingsOpen: (open: boolean) => void;
|
|
1264
|
+
pdfOpen: boolean;
|
|
1265
|
+
setPdfOpen: (open: boolean) => void;
|
|
1266
|
+
creditsOpen: boolean;
|
|
1267
|
+
setCreditsOpen: (open: boolean) => void;
|
|
1268
|
+
caseDxOpen: boolean;
|
|
1269
|
+
setCaseDxOpen: (open: boolean) => void;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Subscribe to odontogram state changes. The callback runs after any tooth
|
|
1274
|
+
* state edit, the edentulous toggle, an import, or a change to a session
|
|
1275
|
+
* setting (numbering system, notes, ICDAS, caries/pulp/wear/discoloration
|
|
1276
|
+
* detail, surface notation, fillings, perio display) — so a host that
|
|
1277
|
+
* persists the doctor's preferences can react to the settings modal too.
|
|
1278
|
+
*
|
|
1279
|
+
* @param cb - Callback invoked on each change.
|
|
1280
|
+
* @returns An unsubscribe function.
|
|
1281
|
+
*/
|
|
1282
|
+
export declare function onStateChange(cb: () => void): () => void;
|
|
1283
|
+
|
|
1284
|
+
/** Public entry point for the declarative `CariesCard`'s per-surface `.surf-depth`
|
|
1285
|
+
* indicator click: opens the contextual severity popup for `surface`, anchored
|
|
1286
|
+
* to `anchor`, on the currently-active tooth — the exact call `wireControls()`
|
|
1287
|
+
* made (`showCariesDepthPopup(surface, ind, activeTooth)`). Kept as a thin
|
|
1288
|
+
* wrapper so the popup overlay itself stays imperative (module-private state:
|
|
1289
|
+
* `activeTooth` / `applyToSelected`). */
|
|
1290
|
+
export declare function openCariesDepthPopup(surface: string, anchor: HTMLElement): void;
|
|
1291
|
+
|
|
1292
|
+
/** Public entry point for the declarative `FillingsCard`'s per-surface LEFT-side
|
|
1293
|
+
* `.surf-defect` indicator click: opens the contextual filling-defect popup for
|
|
1294
|
+
* `surface`, anchored to `anchor`, on the currently-active tooth — the exact
|
|
1295
|
+
* call `wireControls()` made (`showFillingDefectPopup(surface, ind,
|
|
1296
|
+
* activeTooth)`). Thin wrapper so the popup itself stays imperative. */
|
|
1297
|
+
export declare function openFillingDefectPopup(surface: string, anchor: HTMLElement): void;
|
|
1298
|
+
|
|
1299
|
+
/** Open the perio-chart overlay. No-op (still notifies) if already open. */
|
|
1300
|
+
export declare function openPerioOverlay(): void;
|
|
1301
|
+
|
|
1302
|
+
export declare function OrthodonticsCard(): JSX_2.Element;
|
|
1303
|
+
|
|
1304
|
+
/** Parameter map for template placeholders (`{{key}}`). */
|
|
1305
|
+
declare type Params = Record<string, string | number>;
|
|
1306
|
+
|
|
1307
|
+
declare type PdfBorderThickness = "thin" | "medium" | "thick";
|
|
1308
|
+
|
|
1309
|
+
/** Selectable report colour themes — the default is "blue"; the other three are
|
|
1310
|
+
* distinct but equally calm/medical. */
|
|
1311
|
+
declare type PdfColorTheme = "blue" | "teal" | "amber" | "slate";
|
|
1312
|
+
|
|
1313
|
+
declare type PdfDateFormat = "iso" | "dmy" | "mdy";
|
|
1314
|
+
|
|
1315
|
+
/** Which PDF sections the user opted into. The perio sections are additionally
|
|
1316
|
+
* auto-skipped whenever `data.hasPerio` is false (see {@link assemblePdf}),
|
|
1317
|
+
* regardless of these flags — a blank perio chart never gets an empty
|
|
1318
|
+
* "Periodontal status" page. */
|
|
1319
|
+
declare interface PdfExportOptions {
|
|
1320
|
+
patientData: boolean;
|
|
1321
|
+
/** The odontogram chart IMAGE — selectable independently of its prose
|
|
1322
|
+
* description in the export dialog. */
|
|
1323
|
+
odontogramChart: boolean;
|
|
1324
|
+
/** The whole-mouth odontogram summary PROSE. */
|
|
1325
|
+
odontogramDescription: boolean;
|
|
1326
|
+
/** The per-tooth "Individual notes" section — omitted whenever no tooth
|
|
1327
|
+
* carries a note (`data.individualNotes` empty), regardless of this flag. */
|
|
1328
|
+
individualNotes: boolean;
|
|
1329
|
+
perioStatus: boolean;
|
|
1330
|
+
perioDescription: boolean;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
declare type PdfPerioFontSize = "small" | "normal" | "xlarge";
|
|
1334
|
+
|
|
1335
|
+
declare type PdfPerioLabelPlacement = "center" | "edge";
|
|
1336
|
+
|
|
1337
|
+
declare interface PdfSettings {
|
|
1338
|
+
/** Optional placeholder patient name, printed when the case has none. Empty
|
|
1339
|
+
* by default: the report then prints "not specified" (`pdf.field.notSpecified`)
|
|
1340
|
+
* rather than inventing a name. */
|
|
1341
|
+
defaultName: string;
|
|
1342
|
+
/** Optional placeholder DOB (ISO `YYYY-MM-DD`), printed when the case has
|
|
1343
|
+
* none. Empty by default, as above. No age is ever derived from it. */
|
|
1344
|
+
defaultDob: string;
|
|
1345
|
+
/** Show the patient's age (in parentheses) after the DOB. */
|
|
1346
|
+
showAge: boolean;
|
|
1347
|
+
/** Date order for DOB / exam date / generation timestamp. */
|
|
1348
|
+
dateFormat: PdfDateFormat;
|
|
1349
|
+
/** Report colour theme. */
|
|
1350
|
+
colorTheme: PdfColorTheme;
|
|
1351
|
+
/** Show the bone/gum base layer on the dental chart. */
|
|
1352
|
+
showBone: boolean;
|
|
1353
|
+
/** Show the healthy-pulp layer on the dental chart. */
|
|
1354
|
+
showHealthyPulp: boolean;
|
|
1355
|
+
/** How close the teeth sit — closer spacing yields a taller chart image. */
|
|
1356
|
+
toothSpacing: PdfToothSpacing;
|
|
1357
|
+
/** Draw a frame around the dental-chart image. */
|
|
1358
|
+
border: boolean;
|
|
1359
|
+
borderThickness: PdfBorderThickness;
|
|
1360
|
+
/** Frame colour (CSS hex, default black). */
|
|
1361
|
+
borderColor: string;
|
|
1362
|
+
/** Tooth-number label size. */
|
|
1363
|
+
toothNumberSize: PdfToothNumberSize;
|
|
1364
|
+
/** Include the whole-mouth prose description of the chart. */
|
|
1365
|
+
includeOdontogramText: boolean;
|
|
1366
|
+
/** Include the tabular findings/prosthetic summary. */
|
|
1367
|
+
includeOdontogramTable: boolean;
|
|
1368
|
+
/** Perio-chart tooth spacing (closer → taller chart image). */
|
|
1369
|
+
perioToothSpacing: PdfToothSpacing;
|
|
1370
|
+
/** Show numeric rows that have no charted value anywhere. */
|
|
1371
|
+
perioShowEmptyRows: boolean;
|
|
1372
|
+
/** Buccal / Lingual-Palatal band-label placement. */
|
|
1373
|
+
perioLabelPlacement: PdfPerioLabelPlacement;
|
|
1374
|
+
/** Perio-chart row/label font size. */
|
|
1375
|
+
perioFontSize: PdfPerioFontSize;
|
|
1376
|
+
/** Include the periodontal metrics + classification table. */
|
|
1377
|
+
includePerioTable: boolean;
|
|
1378
|
+
/** Include the abbreviation glossary. */
|
|
1379
|
+
includePerioAbbrev: boolean;
|
|
1380
|
+
/** Show the medical disclaimer at the bottom of the report. */
|
|
1381
|
+
showDisclaimer: boolean;
|
|
1382
|
+
/** Custom disclaimer text; empty = use the localized default. Editable only
|
|
1383
|
+
* while `showDisclaimer` is on. */
|
|
1384
|
+
disclaimerText: string;
|
|
1385
|
+
/** Show the generation / version / attribution stamp. */
|
|
1386
|
+
showGenerator: boolean;
|
|
1387
|
+
/** How the dentition overview table is grouped (also drives the on-screen
|
|
1388
|
+
* Tooth-information panel table). */
|
|
1389
|
+
summaryGrouping: PdfSummaryGrouping;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
declare type PdfSummaryGrouping = "whole" | "jaw" | "quadrant" | "sextant";
|
|
1393
|
+
|
|
1394
|
+
declare type PdfToothNumberSize = "small" | "normal" | "xlarge";
|
|
1395
|
+
|
|
1396
|
+
declare type PdfToothSpacing = "wide" | "medium" | "close";
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* Full-mouth perio-chart. The 32-tooth x 6-site grid (~450+ interactive
|
|
1400
|
+
* cells) is built with plain DOM (`buildArch`), NOT JSX/React state, and
|
|
1401
|
+
* updated via targeted `syncToothCells` calls rather than a full React
|
|
1402
|
+
* re-render — see `syncOneTooth`/`fullResync` below. Only the compact summary
|
|
1403
|
+
* bar is React-controlled (`useState`), since re-rendering ~4 numbers on every
|
|
1404
|
+
* edit is cheap. `suppressResyncRef` prevents the grid's own edits from ALSO
|
|
1405
|
+
* triggering a redundant full resync via the `onStateChange` subscription
|
|
1406
|
+
* (setPerioSite/setToothMobility both fire it synchronously) — external edits
|
|
1407
|
+
* (dual-state chart-mode switch, or another consumer editing perio data while
|
|
1408
|
+
* the overlay is open) still trigger the full resync normally. All writes go
|
|
1409
|
+
* through the data core (`setPerioSite`/`getToothPerio`/`getToothCal`/
|
|
1410
|
+
* `getPerioSummary`/`getPerioChart`); keyboard auto-advance between cells is
|
|
1411
|
+
* handled by `handleGridKeyDown`.
|
|
1412
|
+
*
|
|
1413
|
+
* Layers OVER the odontogram, which it never unmounts: `position: fixed`,
|
|
1414
|
+
* full-screen, high z-index (`.perio-overlay` in `index.css`). Mirrors
|
|
1415
|
+
* `SettingsModal`'s dialog contract — `role="dialog"` + `aria-modal`, Esc
|
|
1416
|
+
* closes, backdrop click closes, focus trap + focus-restore on close — on a
|
|
1417
|
+
* single element (`#perioOverlay` itself is the dialog; there is no separate
|
|
1418
|
+
* backdrop element, unlike `SettingsModal`).
|
|
1419
|
+
*
|
|
1420
|
+
* The optional `inline` prop selects a second chrome for the SAME body (grid +
|
|
1421
|
+
* summary bar) — a plain panel (`#perioInlinePanel`) meant to fill the chart
|
|
1422
|
+
* area in place of the hidden-but-mounted odontogram, instead of the
|
|
1423
|
+
* fixed-position modal dialog. `open`/`onClose` are the MODAL chrome's
|
|
1424
|
+
* contract and are ignored when `inline` is true (the caller controls
|
|
1425
|
+
* mount/unmount of an inline instance directly via conditional rendering) —
|
|
1426
|
+
* there is nothing to "close" in an embedded panel. Dialog-only concerns
|
|
1427
|
+
* (focus trap/restore, Esc-to-close, backdrop click, `role="dialog"`) do not
|
|
1428
|
+
* apply to the inline chrome at all.
|
|
1429
|
+
*/
|
|
1430
|
+
export declare function PerioChart({ open, onClose, inline, }: {
|
|
1431
|
+
open?: boolean;
|
|
1432
|
+
onClose?: () => void;
|
|
1433
|
+
inline?: boolean;
|
|
1434
|
+
}): JSX_2.Element;
|
|
1435
|
+
|
|
1436
|
+
declare type PerioDiagnosis = "health" | "gingivitis" | "periodontitis";
|
|
1437
|
+
|
|
1438
|
+
/** Whole-mouth figures for one exam — the subset of `getPerioSummary()` that
|
|
1439
|
+
* can be derived from a payload alone. */
|
|
1440
|
+
export declare interface PerioExamAggregate {
|
|
1441
|
+
chartedSites: number;
|
|
1442
|
+
bleedingSites: number;
|
|
1443
|
+
/** Bleeding sites ÷ charted sites, as a percentage with one decimal. */
|
|
1444
|
+
bopPercent: number;
|
|
1445
|
+
maxPd: number | null;
|
|
1446
|
+
worstCal: number | null;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export declare interface PerioExamComparison {
|
|
1450
|
+
from: PerioExamAggregate;
|
|
1451
|
+
to: PerioExamAggregate;
|
|
1452
|
+
/** Every site whose probing depth or attachment level moved at all, including
|
|
1453
|
+
* sites charted in only one of the two exams. Tooth order is the clinical
|
|
1454
|
+
* `ALL_TEETH` order; sites follow `PERIO_SITES`. */
|
|
1455
|
+
changed: PerioSiteDelta[];
|
|
1456
|
+
/** Sites charted in BOTH exams whose attachment worsened by at least
|
|
1457
|
+
* {@link PROGRESSION_MM} — the clinically meaningful subset of `changed`. */
|
|
1458
|
+
attachmentLoss: PerioSiteDelta[];
|
|
1459
|
+
/** …and improved by at least as much. */
|
|
1460
|
+
attachmentGain: PerioSiteDelta[];
|
|
1461
|
+
/** Sites charted in both whose POCKET deepened by at least {@link PROGRESSION_MM}. */
|
|
1462
|
+
deepened: PerioSiteDelta[];
|
|
1463
|
+
/** Sites charted now but not then, and the other way round. */
|
|
1464
|
+
newlyCharted: number;
|
|
1465
|
+
noLongerCharted: number;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
declare type PerioExtent = "na" | "localized" | "generalized" | "molar-incisor";
|
|
1469
|
+
|
|
1470
|
+
declare type PerioGrade = "A" | "B" | "C" | "indeterminate";
|
|
1471
|
+
|
|
1472
|
+
/** How perio-chart index row labels are rendered. */
|
|
1473
|
+
export declare type PerioIndexNameMode = "translated" | "canonical";
|
|
1474
|
+
|
|
1475
|
+
/** The 16 toggleable periodontal index rows the Dental Chart can show/hide. */
|
|
1476
|
+
export declare type PerioRowId = "plaque" | "bop" | "cal" | "gm" | "pd" | "furcation" | "mobility" | "cej" | "rootConcavity" | "pi" | "gi" | "mpi" | "mbi" | "kg" | "gt" | "miller";
|
|
1477
|
+
|
|
1478
|
+
export declare function PerioSidebar(): JSX_2.Element;
|
|
1479
|
+
|
|
1480
|
+
/** One site, measured in both exams (or in only one of them). */
|
|
1481
|
+
export declare interface PerioSiteDelta {
|
|
1482
|
+
toothNo: number;
|
|
1483
|
+
site: string;
|
|
1484
|
+
/** Probing depth in mm, or `null` when the site was not charted in that exam. */
|
|
1485
|
+
pdFrom: number | null;
|
|
1486
|
+
pdTo: number | null;
|
|
1487
|
+
/** Clinical attachment level (pd + gm) in mm, or `null` when not charted. */
|
|
1488
|
+
calFrom: number | null;
|
|
1489
|
+
calTo: number | null;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
declare type PerioStage = "na" | "I" | "II" | "III" | "IV" | "indeterminate";
|
|
1493
|
+
|
|
1494
|
+
export declare type PerioViewMode = "toggle" | "popup";
|
|
1495
|
+
|
|
1496
|
+
export declare type PersistenceOptions = {
|
|
1497
|
+
/** localStorage key. Default: "react-advanced-odontogram". */
|
|
1498
|
+
key?: string;
|
|
1499
|
+
/** Persist the plan chart too (payload's `plan` field). Default: false. */
|
|
1500
|
+
includePlan?: boolean;
|
|
1501
|
+
/** Called on any storage/parse error instead of console.warn. */
|
|
1502
|
+
onError?: (err: Error) => void;
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
declare type PlanChange = {
|
|
1506
|
+
toothNo: number;
|
|
1507
|
+
axis: string;
|
|
1508
|
+
from: string;
|
|
1509
|
+
to: string;
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* Defines the SVG layer where a plugin's visual output will be inserted.
|
|
1514
|
+
*
|
|
1515
|
+
* | Layer | Z-order | Description |
|
|
1516
|
+
* |---------------|---------|----------------------------------------|
|
|
1517
|
+
* | `base` | 0 | Below the tooth — background indicators |
|
|
1518
|
+
* | `restoration` | 3 | Between endo and crown layers |
|
|
1519
|
+
* | `overlay` | 6 | Top-most — badges, markers, highlights |
|
|
1520
|
+
*/
|
|
1521
|
+
export declare type PluginLayer = "base" | "restoration" | "overlay";
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* Millimetres of change that count as real movement rather than measurement
|
|
1525
|
+
* noise. Probing is reproducible to about ±1 mm between visits and examiners,
|
|
1526
|
+
* so 2 mm is the threshold the periodontal literature uses for attachment
|
|
1527
|
+
* loss/gain — and the one the 2017 classification's own progression reasoning
|
|
1528
|
+
* rests on. Exported so a caller can report on its own threshold instead.
|
|
1529
|
+
*/
|
|
1530
|
+
export declare const PROGRESSION_MM = 2;
|
|
1531
|
+
|
|
1532
|
+
export declare type PulpDetailLevel = "simple" | "aae" | "latin";
|
|
1533
|
+
|
|
1534
|
+
export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Rebuild the SVG tooth grid after the chart column remounts (composable-UI
|
|
1538
|
+
* Tier 2). Preserves the current selection/active tooth across buildGrid()'s
|
|
1539
|
+
* internal reset, clears+rebuilds the four grid element maps, and bumps
|
|
1540
|
+
* `initToken` so any in-flight/toggle-spam build supersedes cleanly. No-op
|
|
1541
|
+
* before init or if a newer build/teardown supersedes this one mid-await.
|
|
1542
|
+
*/
|
|
1543
|
+
export declare function rebuildGrid(): Promise<void>;
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* Register one or more custom SVG plugins. Plugins can inject visual overlays
|
|
1547
|
+
* into the tooth SVG and maintain per-tooth custom state included in export/import.
|
|
1548
|
+
*
|
|
1549
|
+
* @param plugins - Array of {@link OdontogramPlugin} definitions.
|
|
1550
|
+
*/
|
|
1551
|
+
export declare function registerPlugins(plugins: OdontogramPlugin[]): void;
|
|
1552
|
+
|
|
1553
|
+
/** Remove a tooth-level diagnosis from the current selection: clears the
|
|
1554
|
+
* underlying chart axis (so the glyph disappears too, through the repainting
|
|
1555
|
+
* apply path) AND drops any coded-layer override (add/suppress) for the key.
|
|
1556
|
+
* The card's delete (×) uses this — the full inverse of
|
|
1557
|
+
* {@link addDiagnosisToSelection}, extended to `caries` (clears the surfaces)
|
|
1558
|
+
* so every listed diagnosis is fully removable. Prototype-safe key guard. */
|
|
1559
|
+
export declare function removeDiagnosisFromSelection(key: string): void;
|
|
1560
|
+
|
|
1561
|
+
/** Reset the WHOLE mouth to a blank slate — the exact closure the imperative
|
|
1562
|
+
* `#btnResetAll` handler used, now called directly from the declarative Statuses
|
|
1563
|
+
* card's onClick. Clears the edentulous flag + case-level metadata, resets every
|
|
1564
|
+
* tooth to `defaultState()`, re-syncs the active tooth's controls, and notifies
|
|
1565
|
+
* once at the end so the mounted case-metadata/Statuses subscribers re-read the
|
|
1566
|
+
* cleared state. */
|
|
1567
|
+
export declare function resetMouth(): void;
|
|
1568
|
+
|
|
1569
|
+
/** Reset the whole current selection to `defaultState()` — the exact closure the
|
|
1570
|
+
* imperative `#btnResetTooth` handler used, now called from the declarative card
|
|
1571
|
+
* title button's onClick. */
|
|
1572
|
+
export declare function resetTooth(): void;
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* Re-run control wiring after a controls surface remounts (composable-UI Tier 2).
|
|
1576
|
+
* `wireControls()` is idempotent per-element (bindOnce + populated-container
|
|
1577
|
+
* guards), so this wires ONLY the freshly-mounted nodes and leaves still-mounted
|
|
1578
|
+
* ones untouched; the trailing syncControlsFromState() re-derives the active
|
|
1579
|
+
* tooth's per-tooth option lists/values on the (possibly new) select nodes.
|
|
1580
|
+
* No-op before init (the provider's own init effect does the first wiring).
|
|
1581
|
+
*/
|
|
1582
|
+
export declare function rewireControls(): void;
|
|
1583
|
+
|
|
1584
|
+
export declare type RootCariesMode = "simple" | "severity";
|
|
1585
|
+
|
|
1586
|
+
/** Root-caries options at a given mode (defaults to the module setting).
|
|
1587
|
+
* simple -> none / present (present writes the canonical "active-cavitated"
|
|
1588
|
+
* enum — the most-severe value, so simple-mode "present" renders at full
|
|
1589
|
+
* opacity); severity -> the full rootCaries enum. Pure. */
|
|
1590
|
+
export declare function rootCariesOptions(mode?: RootCariesMode): {
|
|
1591
|
+
value: string;
|
|
1592
|
+
label: string;
|
|
1593
|
+
}[];
|
|
1594
|
+
|
|
1595
|
+
export declare function RootPeriodontiumCard(): JSX_2.Element;
|
|
1596
|
+
|
|
1597
|
+
export declare type RootPerioOptGroup = {
|
|
1598
|
+
label: string;
|
|
1599
|
+
options: RootPerioOption[];
|
|
1600
|
+
};
|
|
1601
|
+
|
|
1602
|
+
export declare type RootPerioOption = {
|
|
1603
|
+
value: string;
|
|
1604
|
+
label: string;
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1607
|
+
/** Tooth-number font size in the live grid. */
|
|
1608
|
+
export declare type ScreenToothNumberSize = "small" | "normal" | "xlarge";
|
|
1609
|
+
|
|
1610
|
+
/** Inter-tooth gap in the live grid. */
|
|
1611
|
+
export declare type ScreenToothSpacing = "wide" | "normal" | "close";
|
|
1612
|
+
|
|
1613
|
+
export declare type SecondaryCariesMode = "simple" | "standard" | "full";
|
|
1614
|
+
|
|
1615
|
+
/** Selection-ring border style (default dashed). */
|
|
1616
|
+
export declare type SelectionBorderStyle = "solid" | "dashed" | "dotted";
|
|
1617
|
+
|
|
1618
|
+
/** Apical (AAE) diagnosis on the current selection — clears the periapical
|
|
1619
|
+
* lesion subtype unless the diagnosis is (a)symptomatic apical periodontitis. */
|
|
1620
|
+
export declare function setApicalDxForSelection(value: string): void;
|
|
1621
|
+
|
|
1622
|
+
/** Bridge-abutment toggle on the current selection. */
|
|
1623
|
+
export declare function setBridgePillarForSelection(on: boolean): void;
|
|
1624
|
+
|
|
1625
|
+
/** Broken distal corner toggle on the current selection. */
|
|
1626
|
+
export declare function setBrokenDistalForSelection(on: boolean): void;
|
|
1627
|
+
|
|
1628
|
+
/** Broken incisal corner toggle on the current selection. */
|
|
1629
|
+
export declare function setBrokenIncisalForSelection(on: boolean): void;
|
|
1630
|
+
|
|
1631
|
+
/** Broken mesial corner toggle on the current selection. */
|
|
1632
|
+
export declare function setBrokenMesialForSelection(on: boolean): void;
|
|
1633
|
+
|
|
1634
|
+
/** Calculus toggle on the current selection. */
|
|
1635
|
+
export declare function setCalculusForSelection(on: boolean): void;
|
|
1636
|
+
|
|
1637
|
+
/** Set the default (active) caries depth for newly-tapped surfaces. */
|
|
1638
|
+
export declare function setCariesActiveDepthForSelection(value: number): void;
|
|
1639
|
+
|
|
1640
|
+
export declare function setCariesDepthEnabled(value: boolean): void;
|
|
1641
|
+
|
|
1642
|
+
/** Toggle one caries surface (or the subcrown) on the current selection —
|
|
1643
|
+
* wraps the exact `cariesOnToggle` closure `wireControls()` bound. */
|
|
1644
|
+
export declare function setCariesSurfaceForSelection(id: string, on: boolean): void;
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* Switch the active chart between "status" (current findings) and "plan"
|
|
1648
|
+
* (proposed treatment). The first time "plan" is entered, it is deep-cloned
|
|
1649
|
+
* from "status" (see `cloneChart`); later switches reuse the existing
|
|
1650
|
+
* plan chart untouched. Re-renders every tooth from the newly active chart
|
|
1651
|
+
* via the SAME full-repaint mechanism `importStatus()` uses, so no new
|
|
1652
|
+
* render path is introduced and SVG output stays byte-identical to the
|
|
1653
|
+
* single-chart render (parity is unaffected — only WHICH chart is active
|
|
1654
|
+
* changes, never how a chart renders).
|
|
1655
|
+
*
|
|
1656
|
+
* @param mode - "status" or "plan"; any other value is ignored.
|
|
1657
|
+
*/
|
|
1658
|
+
export declare function setChartMode(mode: ChartMode): void;
|
|
1659
|
+
|
|
1660
|
+
/** Distal contact-loss toggle on the current selection. */
|
|
1661
|
+
export declare function setContactDistalForSelection(on: boolean): void;
|
|
1662
|
+
|
|
1663
|
+
/** Mesial contact-loss toggle on the current selection. */
|
|
1664
|
+
export declare function setContactMesialForSelection(on: boolean): void;
|
|
1665
|
+
|
|
1666
|
+
/** Crown marginal-leakage toggle on the current selection. */
|
|
1667
|
+
export declare function setCrownLeakageForSelection(on: boolean): void;
|
|
1668
|
+
|
|
1669
|
+
/** Crown-needed toggle on the current selection. */
|
|
1670
|
+
export declare function setCrownNeededForSelection(on: boolean): void;
|
|
1671
|
+
|
|
1672
|
+
/** Crown-replacement toggle on the current selection. */
|
|
1673
|
+
export declare function setCrownReplaceForSelection(on: boolean): void;
|
|
1674
|
+
|
|
1675
|
+
export declare function setDiagnosisCodingPack(id: string): void;
|
|
1676
|
+
|
|
1677
|
+
export declare function setDiscolorationDetailLevel(value: ToothDetailLevel): void;
|
|
1678
|
+
|
|
1679
|
+
/** Discoloration cause on the current selection (complex-mode select). */
|
|
1680
|
+
export declare function setDiscolorationForSelection(value: string): void;
|
|
1681
|
+
|
|
1682
|
+
/** Discoloration simple-mode toggle (other / none) on the selection. */
|
|
1683
|
+
export declare function setDiscolorationToggleForSelection(on: boolean): void;
|
|
1684
|
+
|
|
1685
|
+
/** Add/suppress/clear one coded diagnosis on the current selection —
|
|
1686
|
+
* validates `key` against {@link TOOTH_LEVEL_DX_KEYS} and `mode` against
|
|
1687
|
+
* {@link VALID_DX_OVERRIDE_VALUE} (or `null`, which clears any existing
|
|
1688
|
+
* override for `key`); anything else is a silent no-op. Routed through
|
|
1689
|
+
* `gateToothEditBatch` directly (not `applyToSelected`) since
|
|
1690
|
+
* `dxOverrides` has no SVG/DOM side effect to re-render per tooth. */
|
|
1691
|
+
export declare function setDxOverrideForSelection(key: string, mode: "add" | "suppress" | null): void;
|
|
1692
|
+
|
|
1693
|
+
export declare function setEdentulous(on: Any): void;
|
|
1694
|
+
|
|
1695
|
+
/** Apicoectomy (resected tooth) toggle on the current selection. */
|
|
1696
|
+
export declare function setEndoResectionForSelection(on: boolean): void;
|
|
1697
|
+
|
|
1698
|
+
/** Planned-extraction toggle on the current selection. */
|
|
1699
|
+
export declare function setExtractionPlanForSelection(on: boolean): void;
|
|
1700
|
+
|
|
1701
|
+
/** Extraction-wound toggle on the current selection. */
|
|
1702
|
+
export declare function setExtractionWoundForSelection(on: boolean): void;
|
|
1703
|
+
|
|
1704
|
+
export declare function setFillingComplexity(v: "complex" | "simple"): void;
|
|
1705
|
+
|
|
1706
|
+
export declare function setFillingDefectEnabled(v: boolean): void;
|
|
1707
|
+
|
|
1708
|
+
export declare function setFillingMaterialAvailability(material: string, v: boolean): void;
|
|
1709
|
+
|
|
1710
|
+
/** Set the active filling material on the current selection — wraps the exact
|
|
1711
|
+
* `#fillingSelect` closure `wireControls()` bound (clearing "none" removes any
|
|
1712
|
+
* orphaned per-surface fillings). */
|
|
1713
|
+
export declare function setFillingMaterialForSelection(mat: string): void;
|
|
1714
|
+
|
|
1715
|
+
/** Simple-mode filling-defect select — applies a defect to EVERY filled surface.
|
|
1716
|
+
* Wraps the `#fillingSimpleDefectSelect` closure. */
|
|
1717
|
+
export declare function setFillingSimpleDefectForSelection(value: string): void;
|
|
1718
|
+
|
|
1719
|
+
/** Simple-mode filled/not-filled toggle — applies the current material to ALL
|
|
1720
|
+
* surfaces (or clears them). Wraps the `#fillingSimpleToggle` closure. */
|
|
1721
|
+
export declare function setFillingSimpleToggleForSelection(on: boolean): void;
|
|
1722
|
+
|
|
1723
|
+
/** Toggle one filling surface on the current selection — wraps the exact
|
|
1724
|
+
* `buildSurfaceCross($("#fillingSurfaceChecks"), …)` closure. */
|
|
1725
|
+
export declare function setFillingSurfaceForSelection(surf: string, on: boolean): void;
|
|
1726
|
+
|
|
1727
|
+
export declare function setFissureSealingEnabled(v: boolean): void;
|
|
1728
|
+
|
|
1729
|
+
/** Fissure-sealing toggle on the current selection. Wraps the `#fissureSealing`
|
|
1730
|
+
* closure. */
|
|
1731
|
+
export declare function setFissureSealingForSelection(on: boolean): void;
|
|
1732
|
+
|
|
1733
|
+
/** Toggle visibility of the healthy-pulp layer on all teeth. */
|
|
1734
|
+
export declare function setHealthyPulpVisible(on: Any): void;
|
|
1735
|
+
|
|
1736
|
+
export declare function setIcdasEnabled(value: boolean): void;
|
|
1737
|
+
|
|
1738
|
+
/** Set which parser the next file import uses. Defaults back to "status" after each import. */
|
|
1739
|
+
export declare function setImportFormat(format: "status" | "fhir"): void;
|
|
1740
|
+
|
|
1741
|
+
/** Closed-gap toggle on the current selection. */
|
|
1742
|
+
export declare function setMissingClosedForSelection(on: boolean): void;
|
|
1743
|
+
|
|
1744
|
+
/** Tooth mobility grade on the current selection. */
|
|
1745
|
+
export declare function setMobilityForSelection(value: string): void;
|
|
1746
|
+
|
|
1747
|
+
/** Toggle one `#modsChecks` modifier (parodontal / inflammation) on the current
|
|
1748
|
+
* selection — wraps the exact set add/delete closure `wireControls()` bound. */
|
|
1749
|
+
export declare function setModForSelection(id: string, on: boolean): void;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Enable or disable per-tooth notes. When enabled, double-clicking a tooth
|
|
1753
|
+
* opens a note editor popover, and notes are shown in hover tooltips with
|
|
1754
|
+
* a badge indicator.
|
|
1755
|
+
*
|
|
1756
|
+
* @param value - `true` to enable notes, `false` to disable.
|
|
1757
|
+
*/
|
|
1758
|
+
export declare function setNotesEnabled(value: boolean): void;
|
|
1759
|
+
|
|
1760
|
+
export declare function setNumberingSystem(system: NumberingSystem): void;
|
|
1761
|
+
|
|
1762
|
+
/** Toggle visibility of occlusal-view tiles (premolars and molars). */
|
|
1763
|
+
export declare function setOcclusalVisible(on: Any): void;
|
|
1764
|
+
|
|
1765
|
+
export declare function setOrthoApplianceForSelection(value: string): void;
|
|
1766
|
+
|
|
1767
|
+
export declare function setOrthoDriftForSelection(value: string): void;
|
|
1768
|
+
|
|
1769
|
+
export declare function setOrthoRotationForSelection(on: boolean): void;
|
|
1770
|
+
|
|
1771
|
+
export declare function setOrthoVerticalForSelection(value: string): void;
|
|
1772
|
+
|
|
1773
|
+
/** Parapulpal pin toggle on the current selection. */
|
|
1774
|
+
export declare function setParapulpalPinForSelection(on: boolean): void;
|
|
1775
|
+
|
|
1776
|
+
export declare function setPdfSettings(patch: Partial<PdfSettings>): void;
|
|
1777
|
+
|
|
1778
|
+
/** Periapical lesion subtype on the current selection. */
|
|
1779
|
+
export declare function setPeriapicalTypeForSelection(value: string): void;
|
|
1780
|
+
|
|
1781
|
+
/** Peri-implant status on the current selection. */
|
|
1782
|
+
export declare function setPeriImplantForSelection(value: string): void;
|
|
1783
|
+
|
|
1784
|
+
/** Switch the perio index-name display mode. No-op (does not notify) if unchanged. */
|
|
1785
|
+
export declare function setPerioIndexNameMode(mode: PerioIndexNameMode): void;
|
|
1786
|
+
|
|
1787
|
+
/** Show/hide one perio-chart index row. No-op (does not notify) if unchanged. */
|
|
1788
|
+
export declare function setPerioRowVisibility(id: PerioRowId, visible: boolean): void;
|
|
1789
|
+
|
|
1790
|
+
/** Switch the perio-chart housing mode. No-op (does not notify) if unchanged. */
|
|
1791
|
+
export declare function setPerioViewMode(mode: PerioViewMode): void;
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Hydrate `payload.teeth` into the PLAN chart ONLY (status is left
|
|
1795
|
+
* untouched), mirroring the per-tooth hydrate importStatus() performs for
|
|
1796
|
+
* the status chart. Marks the plan chart initialized. Repaints the DOM only
|
|
1797
|
+
* when PLAN is the currently active chart mode — hydrating a chart that
|
|
1798
|
+
* isn't on screen must not visibly disturb whatever IS on screen (mirrors
|
|
1799
|
+
* setChartMode()'s own full-repaint-on-activation behavior).
|
|
1800
|
+
*/
|
|
1801
|
+
export declare function setPlanChart(payload: Any): void;
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* Set a plugin's custom state for a specific tooth. Triggers SVG re-render
|
|
1805
|
+
* for that tooth and updates the tooltip.
|
|
1806
|
+
*
|
|
1807
|
+
* @param toothNo - The FDI tooth number (11–48).
|
|
1808
|
+
* @param pluginId - The plugin's unique identifier.
|
|
1809
|
+
* @param value - The custom state value (any JSON-serializable value, or `undefined` to clear).
|
|
1810
|
+
*/
|
|
1811
|
+
export declare function setPluginState(toothNo: number, pluginId: string, value: unknown): void;
|
|
1812
|
+
|
|
1813
|
+
export declare function setPulpDetailLevel(value: PulpDetailLevel): void;
|
|
1814
|
+
|
|
1815
|
+
/** Merged pulp/endo selection on the current selection — wraps the exact
|
|
1816
|
+
* `pulpEndoOnSelect` closure `wireControls()` bound (incl. the endo↔pulpDx
|
|
1817
|
+
* mutual-exclusion normalization). */
|
|
1818
|
+
export declare function setPulpEndoForSelection(value: string): void;
|
|
1819
|
+
|
|
1820
|
+
export declare function setRadiographicDepthMode(value: RadiographicDepthMode): void;
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Enable or disable read-only mode. When read-only, all click, touch, and
|
|
1824
|
+
* keyboard interactions are disabled. The control panel is dimmed and
|
|
1825
|
+
* non-interactive. Useful for print/report views.
|
|
1826
|
+
*
|
|
1827
|
+
* @param value - `true` to enable read-only mode, `false` to disable.
|
|
1828
|
+
*/
|
|
1829
|
+
export declare function setReadOnly(value: boolean): void;
|
|
1830
|
+
|
|
1831
|
+
/** Root resorption type on the current selection. */
|
|
1832
|
+
export declare function setResorptionForSelection(value: string): void;
|
|
1833
|
+
|
|
1834
|
+
/** Combined restoration dropdown on the current selection — wraps the exact
|
|
1835
|
+
* `#restorationSelect` closure (`applyRestorationSelection` decode of
|
|
1836
|
+
* `${type}|${material}` / `prosthesis|<value>` + the trailing
|
|
1837
|
+
* `setEdentulous(false)`). */
|
|
1838
|
+
export declare function setRestorationForSelection(value: string): void;
|
|
1839
|
+
|
|
1840
|
+
/** Set the per-tooth root-caries value (the picker already emits the canonical
|
|
1841
|
+
* enum value; simple-mode "present" maps to "active-cavitated"). */
|
|
1842
|
+
export declare function setRootCariesForSelection(value: string): void;
|
|
1843
|
+
|
|
1844
|
+
export declare function setRootCariesMode(value: RootCariesMode): void;
|
|
1845
|
+
|
|
1846
|
+
/** Set the tooth-number size. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
|
|
1847
|
+
export declare function setScreenToothNumberSize(value: ScreenToothNumberSize): void;
|
|
1848
|
+
|
|
1849
|
+
/** Set the inter-tooth spacing. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
|
|
1850
|
+
export declare function setScreenToothSpacing(value: ScreenToothSpacing): void;
|
|
1851
|
+
|
|
1852
|
+
export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void;
|
|
1853
|
+
|
|
1854
|
+
/** Set the selection-ring border style. Sanitizes to the literal set; no-op (does not notify) if unchanged. */
|
|
1855
|
+
export declare function setSelectionBorderStyle(value: SelectionBorderStyle): void;
|
|
1856
|
+
|
|
1857
|
+
/** Set the selection-ring colour. Anything but a `#rrggbb` hex is ignored; no-op (does not notify) if unchanged. */
|
|
1858
|
+
export declare function setSelectionColor(value: string): void;
|
|
1859
|
+
|
|
1860
|
+
/** Toggle visibility of the bone/gum base layer on all teeth. */
|
|
1861
|
+
export declare function setShowBase(on: Any): void;
|
|
1862
|
+
|
|
1863
|
+
export declare function setSnomedEnabled(v: boolean): void;
|
|
1864
|
+
|
|
1865
|
+
/** Substrate (natural / radix / broken / crown-prep) on the current selection —
|
|
1866
|
+
* wraps the exact `#substrateSelect` closure (broken-part + crown-needed clears
|
|
1867
|
+
* and the trailing `setEdentulous(false)`). */
|
|
1868
|
+
export declare function setSubstrateForSelection(value: string): void;
|
|
1869
|
+
|
|
1870
|
+
export declare function setSurfaceNotation(value: SurfaceNotation): void;
|
|
1871
|
+
|
|
1872
|
+
declare type SettingsState = {
|
|
1873
|
+
numbering: NumberingSystem;
|
|
1874
|
+
onNumbering: (value: NumberingSystem) => void;
|
|
1875
|
+
language: Language;
|
|
1876
|
+
onLanguage: (value: Language) => void;
|
|
1877
|
+
isDark: boolean;
|
|
1878
|
+
onToggleDark: () => void;
|
|
1879
|
+
toothInfo: boolean;
|
|
1880
|
+
onToothInfo: (value: boolean) => void;
|
|
1881
|
+
exportPng: boolean;
|
|
1882
|
+
onExportPng: (value: boolean) => void;
|
|
1883
|
+
exportJpg: boolean;
|
|
1884
|
+
onExportJpg: (value: boolean) => void;
|
|
1885
|
+
exportSvg: boolean;
|
|
1886
|
+
onExportSvg: (value: boolean) => void;
|
|
1887
|
+
exportPdf: boolean;
|
|
1888
|
+
onExportPdf: (value: boolean) => void;
|
|
1889
|
+
importStatus: boolean;
|
|
1890
|
+
onImportStatus: (value: boolean) => void;
|
|
1891
|
+
importFhir: boolean;
|
|
1892
|
+
onImportFhir: (value: boolean) => void;
|
|
1893
|
+
codingPack: string;
|
|
1894
|
+
onDiagnosisCodingPack: (value: string) => void;
|
|
1895
|
+
snomedEnabled: boolean;
|
|
1896
|
+
onSnomedEnabled: (value: boolean) => void;
|
|
1897
|
+
secondaryCariesMode: SecondaryCariesMode;
|
|
1898
|
+
onSecondaryCariesMode: (value: SecondaryCariesMode) => void;
|
|
1899
|
+
icdas: boolean;
|
|
1900
|
+
onIcdas: (value: boolean) => void;
|
|
1901
|
+
cariesDepth: boolean;
|
|
1902
|
+
onCariesDepth: (value: boolean) => void;
|
|
1903
|
+
rootCariesMode: RootCariesMode;
|
|
1904
|
+
onRootCariesMode: (value: RootCariesMode) => void;
|
|
1905
|
+
radiographicDepthMode: RadiographicDepthMode;
|
|
1906
|
+
onRadiographicDepthMode: (value: RadiographicDepthMode) => void;
|
|
1907
|
+
selectionColor: string;
|
|
1908
|
+
onSelectionColor: (value: string) => void;
|
|
1909
|
+
selectionBorderStyle: SelectionBorderStyle;
|
|
1910
|
+
onSelectionBorderStyle: (value: SelectionBorderStyle) => void;
|
|
1911
|
+
pulpLevel: PulpDetailLevel;
|
|
1912
|
+
onPulpLevel: (value: PulpDetailLevel) => void;
|
|
1913
|
+
wearDetailLevel: ToothDetailLevel;
|
|
1914
|
+
onWearDetailLevel: (value: ToothDetailLevel) => void;
|
|
1915
|
+
discolorationDetailLevel: ToothDetailLevel;
|
|
1916
|
+
onDiscolorationDetailLevel: (value: ToothDetailLevel) => void;
|
|
1917
|
+
surfaceNotation: SurfaceNotation;
|
|
1918
|
+
onSurfaceNotation: (value: SurfaceNotation) => void;
|
|
1919
|
+
notes: boolean;
|
|
1920
|
+
onNotes: (value: boolean) => void;
|
|
1921
|
+
planModeAvailable: boolean;
|
|
1922
|
+
onPlanModeAvailable: (value: boolean) => void;
|
|
1923
|
+
screenToothSpacing: ScreenToothSpacing;
|
|
1924
|
+
onScreenToothSpacing: (value: ScreenToothSpacing) => void;
|
|
1925
|
+
screenToothNumberSize: ScreenToothNumberSize;
|
|
1926
|
+
onScreenToothNumberSize: (value: ScreenToothNumberSize) => void;
|
|
1927
|
+
toothAnatomy: ToothAnatomy;
|
|
1928
|
+
onToothAnatomy: (value: ToothAnatomy) => void;
|
|
1929
|
+
showStatusCard: boolean;
|
|
1930
|
+
onShowStatusCard: (value: boolean) => void;
|
|
1931
|
+
showOrthoCard: boolean;
|
|
1932
|
+
onShowOrthoCard: (value: boolean) => void;
|
|
1933
|
+
perioChartAvailable: boolean;
|
|
1934
|
+
onPerioChartAvailable: (value: boolean) => void;
|
|
1935
|
+
perioViewMode: PerioViewMode;
|
|
1936
|
+
onPerioViewMode: (value: PerioViewMode) => void;
|
|
1937
|
+
perioRowVisibility: Record<PerioRowId, boolean>;
|
|
1938
|
+
onPerioRowVisibility: (id: PerioRowId, visible: boolean) => void;
|
|
1939
|
+
perioIndexNameMode: PerioIndexNameMode;
|
|
1940
|
+
onPerioIndexNameMode: (value: PerioIndexNameMode) => void;
|
|
1941
|
+
fillingDefectEnabled: boolean;
|
|
1942
|
+
onFillingDefectEnabled: (value: boolean) => void;
|
|
1943
|
+
fillingComplexity: FillingComplexity;
|
|
1944
|
+
onFillingComplexity: (value: FillingComplexity) => void;
|
|
1945
|
+
fillingMaterials: Record<string, boolean>;
|
|
1946
|
+
onFillingMaterial: (material: string, value: boolean) => void;
|
|
1947
|
+
fissureSealingEnabled: boolean;
|
|
1948
|
+
onFissureSealingEnabled: (value: boolean) => void;
|
|
1949
|
+
pdfSettings: PdfSettings;
|
|
1950
|
+
onPdfSettings: (patch: Partial<PdfSettings>) => void;
|
|
1951
|
+
};
|
|
1952
|
+
|
|
1953
|
+
/** Switch the tooth-anatomy profile, and rebuild the chart onto it.
|
|
1954
|
+
*
|
|
1955
|
+
* ASYNC since 2.7.0: the measured artwork is code-split, so selecting it first
|
|
1956
|
+
* awaits its chunk — the profile is always loaded before the flag flips, which
|
|
1957
|
+
* keeps `activeAnatomyProfile()` synchronous for every render path. The grid is
|
|
1958
|
+
* then rebuilt HERE (a no-op until `initOdontogram()`), so the pre-2.7.0
|
|
1959
|
+
* `setToothAnatomy(v); rebuildGrid();` idiom stays correct without awaiting:
|
|
1960
|
+
* the caller's own rebuild may run early on the old profile, and this one puts
|
|
1961
|
+
* the grid right once the profile is in place.
|
|
1962
|
+
*
|
|
1963
|
+
* No-op (does not notify) when the profile is already selected or already on
|
|
1964
|
+
* its way in. Never rejects: a chunk that fails to load is reported on the
|
|
1965
|
+
* console and leaves the current profile selected, so an un-awaited call can
|
|
1966
|
+
* never raise an unhandled rejection in a host app. Also invalidates the
|
|
1967
|
+
* perio-chart template cache so that chart re-parses the new profile's
|
|
1968
|
+
* templates on its next load.
|
|
1969
|
+
*
|
|
1970
|
+
* `notifyStateChange()` fires only AFTER the rebuild, so a subscriber (the
|
|
1971
|
+
* React context mirrors this flag into `data-anatomy`) can never style a grid
|
|
1972
|
+
* that is still drawn on the other profile. */
|
|
1973
|
+
export declare function setToothAnatomy(v: ToothAnatomy): Promise<void>;
|
|
1974
|
+
|
|
1975
|
+
/** Show or hide the tooth-information panel. No-op (does not notify) if unchanged. */
|
|
1976
|
+
export declare function setToothInfoVisible(value: boolean): void;
|
|
1977
|
+
|
|
1978
|
+
/** Base tooth picker on the current selection — wraps the exact `#toothSelect`
|
|
1979
|
+
* closure `wireControls()` bound (the `defaultState()` reset with the milk-block
|
|
1980
|
+
* guard + the extraction/caries/endo/filling clears, and the trailing
|
|
1981
|
+
* `setEdentulous(false)` when the base is not "none"). */
|
|
1982
|
+
export declare function setToothSelectionForSelection(value: string): void;
|
|
1983
|
+
|
|
1984
|
+
/** Replace the factory tooth drawings with host-supplied SVG, per anatomy profile (see `anatomy/templateOverrides.ts`: the markup is vetted,
|
|
1985
|
+
* a refused template is reported by `getToothTemplateRejections()` and the factory one stays). Pass `null` to go back to the factory artwork.
|
|
1986
|
+
* Invalidates the perio-chart template cache; the grid is rebuilt by the caller (`OdontogramProvider`'s `toothTemplates` prop does it). */
|
|
1987
|
+
export declare function setToothTemplateOverrides(overrides: ToothTemplateOverrides | null): void;
|
|
1988
|
+
|
|
1989
|
+
/** Cervical wear type on the current selection (complex-mode select). */
|
|
1990
|
+
export declare function setWearCervicalForSelection(value: string): void;
|
|
1991
|
+
|
|
1992
|
+
/** Cervical wear simple-mode toggle (abrasion / none) on the selection. */
|
|
1993
|
+
export declare function setWearCervicalToggleForSelection(on: boolean): void;
|
|
1994
|
+
|
|
1995
|
+
export declare function setWearDetailLevel(value: ToothDetailLevel): void;
|
|
1996
|
+
|
|
1997
|
+
/** Incisal/occlusal wear type on the current selection (complex-mode select). */
|
|
1998
|
+
export declare function setWearEdgeForSelection(value: string): void;
|
|
1999
|
+
|
|
2000
|
+
/** Incisal/occlusal wear simple-mode toggle (attrition / none) on the selection. */
|
|
2001
|
+
export declare function setWearEdgeToggleForSelection(on: boolean): void;
|
|
2002
|
+
|
|
2003
|
+
/** Toggle visibility of wisdom teeth (18, 28, 38, 48). */
|
|
2004
|
+
export declare function setWisdomVisible(on: Any): void;
|
|
2005
|
+
|
|
2006
|
+
/** Start the interactive intro tour. */
|
|
2007
|
+
export declare function startIntroTour(): void;
|
|
2008
|
+
|
|
2009
|
+
export declare function StatusesCard(): JSX_2.Element;
|
|
2010
|
+
|
|
2011
|
+
/** One surface-cross cell's fully-resolved render state. */
|
|
2012
|
+
export declare type SurfaceCell = {
|
|
2013
|
+
value: string;
|
|
2014
|
+
pos: string;
|
|
2015
|
+
letter: string;
|
|
2016
|
+
label: string;
|
|
2017
|
+
labelId: string;
|
|
2018
|
+
checked: boolean;
|
|
2019
|
+
disabled: boolean;
|
|
2020
|
+
onToggle: (checked: boolean) => void;
|
|
2021
|
+
indicators?: SurfaceIndicator[];
|
|
2022
|
+
attrs?: Record<string, string>;
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
export declare function SurfaceCross({ cells }: {
|
|
2026
|
+
cells: SurfaceCell[];
|
|
2027
|
+
}): JSX_2.Element;
|
|
2028
|
+
|
|
2029
|
+
/** One injected per-cell indicator span (e.g. the `.surf-depth` severity popup
|
|
2030
|
+
* affordance). `side` decides whether it renders before the checkbox (left) or
|
|
2031
|
+
* after the caption (right), matching the imperative insert order. */
|
|
2032
|
+
export declare type SurfaceIndicator = {
|
|
2033
|
+
key: string;
|
|
2034
|
+
className: string;
|
|
2035
|
+
title: string;
|
|
2036
|
+
side: "left" | "right";
|
|
2037
|
+
attrs?: Record<string, string>;
|
|
2038
|
+
children?: ReactNode;
|
|
2039
|
+
onClick?: (anchor: HTMLElement) => void;
|
|
2040
|
+
};
|
|
2041
|
+
|
|
2042
|
+
export declare type SurfaceNotation = "simple" | "full";
|
|
2043
|
+
|
|
2044
|
+
export declare type TemplateRejection = {
|
|
2045
|
+
profile: "classic" | "measured";
|
|
2046
|
+
set: keyof ToothTemplateSet;
|
|
2047
|
+
key: number;
|
|
2048
|
+
reason: string;
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
/** Selectable tooth-anatomy profiles. Stage A: only `classic` is realized;
|
|
2052
|
+
* `measured` is accepted but falls back to the classic profile (harmless). */
|
|
2053
|
+
export declare type ToothAnatomy = "classic" | "measured";
|
|
2054
|
+
|
|
2055
|
+
export declare function ToothControlsSurface(): JSX_2.Element;
|
|
2056
|
+
|
|
2057
|
+
export declare type ToothDetailLevel = "simple" | "complex";
|
|
2058
|
+
|
|
2059
|
+
export declare function ToothDetailsCard(): JSX_2.Element;
|
|
2060
|
+
|
|
2061
|
+
export declare type ToothDetailsOption = {
|
|
2062
|
+
value: string;
|
|
2063
|
+
label: string;
|
|
2064
|
+
disabled?: boolean;
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
/** One EFFECTIVE coded diagnosis on a tooth (after `dxOverrides` are applied):
|
|
2068
|
+
* a rule-derived finding not suppressed, or an explicitly added one. */
|
|
2069
|
+
export declare type ToothDiagnosis = {
|
|
2070
|
+
key: DiagnosisKey;
|
|
2071
|
+
icd10: string | null;
|
|
2072
|
+
icd10Display: string;
|
|
2073
|
+
source: "derived" | "added";
|
|
2074
|
+
};
|
|
2075
|
+
|
|
2076
|
+
export declare function ToothInfoSurface(): JSX_2.Element;
|
|
2077
|
+
|
|
2078
|
+
declare interface ToothTableCell {
|
|
2079
|
+
toothNo: number;
|
|
2080
|
+
label: string;
|
|
2081
|
+
status: ToothTableStatus;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
/** Per-tooth status in the grouped dentition table — `empty`
|
|
2085
|
+
* (nothing charted), `content` (has some finding/treatment — shown bold/accent),
|
|
2086
|
+
* `problem` (caries / root inflammation / diagnosis / wear / discoloration —
|
|
2087
|
+
* shown bold-italic in a warning colour). */
|
|
2088
|
+
declare type ToothTableStatus = "empty" | "content" | "problem";
|
|
2089
|
+
|
|
2090
|
+
export declare type ToothTemplateOverrides = Partial<Record<"classic" | "measured", ToothTemplateSet>>;
|
|
2091
|
+
|
|
2092
|
+
/** The four template maps of a profile that a host may replace. Keys are the template numbers of THAT profile;
|
|
2093
|
+
* the `primary*` maps are the deciduous artwork of a profile that has it (`measured`), keyed by the permanent
|
|
2094
|
+
* FDI position the milk tooth occupies. */
|
|
2095
|
+
export declare type ToothTemplateSet = {
|
|
2096
|
+
templates?: Record<number, string>;
|
|
2097
|
+
templatesOccl?: Record<number, string>;
|
|
2098
|
+
primaryTemplates?: Record<number, string>;
|
|
2099
|
+
primaryTemplatesOccl?: Record<number, string>;
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
/** The translate function surfaced by {@link useI18n}. */
|
|
2103
|
+
declare type TranslateFn = ReturnType<typeof useI18n>["t"];
|
|
2104
|
+
|
|
2105
|
+
export declare function useEngineState<T>(read: () => T): T;
|
|
2106
|
+
|
|
2107
|
+
/**
|
|
2108
|
+
* React hook for i18n. Supports both **controlled** mode (parent provides
|
|
2109
|
+
* `language` prop) and **standalone** mode (internal state).
|
|
2110
|
+
*
|
|
2111
|
+
* @param options - Optional controlled-mode props.
|
|
2112
|
+
* @returns `{ lang, setLang, t }` — current language, setter, and scoped translate function.
|
|
2113
|
+
*/
|
|
2114
|
+
declare function useI18n(options?: UseI18nOptions): {
|
|
2115
|
+
lang: Language;
|
|
2116
|
+
setLang: (next: Language) => void;
|
|
2117
|
+
t: (key: string, params?: Params) => string;
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
declare type UseI18nOptions = {
|
|
2121
|
+
language?: Language;
|
|
2122
|
+
onLanguageChange?: (lang: Language) => void;
|
|
2123
|
+
};
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Read the shared odontogram UI context. Throws when used outside an
|
|
2127
|
+
* {@link OdontogramProvider}, so a misplaced surface fails loudly at mount.
|
|
2128
|
+
*/
|
|
2129
|
+
export declare function useOdontogramUi(): OdontogramUiContextValue;
|
|
2130
|
+
|
|
2131
|
+
export { }
|