@alfadocs/ui-kit-debug 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js → actions-cell-renderer-Ceah0ywE.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js.map → actions-cell-renderer-Ceah0ywE.js.map} +1 -1
  3. package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js +8720 -0
  4. package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js.map +1 -0
  5. package/dist/_chunks/arrow-up-BYvcvTkB.js +26 -0
  6. package/dist/_chunks/arrow-up-BYvcvTkB.js.map +1 -0
  7. package/dist/_chunks/{editable-currency-cell-renderer-Dus_sBvX.js → editable-currency-cell-renderer-Uhzkd0ZP.js} +68 -88
  8. package/dist/_chunks/editable-currency-cell-renderer-Uhzkd0ZP.js.map +1 -0
  9. package/dist/_chunks/{exceljs.min-DUJ-5CGx.js → exceljs.min-D2MHbJsF.js} +10 -9
  10. package/dist/_chunks/{exceljs.min-DUJ-5CGx.js.map → exceljs.min-D2MHbJsF.js.map} +1 -1
  11. package/dist/_chunks/{face-scheme-Cou2efl7.js → face-scheme-C00IvkUA.js} +237 -243
  12. package/dist/_chunks/face-scheme-C00IvkUA.js.map +1 -0
  13. package/dist/_chunks/{file-manager-CNSLiuLo.js → file-manager-lNjcSXoD.js} +174 -186
  14. package/dist/_chunks/file-manager-lNjcSXoD.js.map +1 -0
  15. package/dist/_chunks/minus-BQDHq1c1.js +12 -0
  16. package/dist/_chunks/minus-BQDHq1c1.js.map +1 -0
  17. package/dist/_chunks/notebook-pen-CO7HoM-W.js +25 -0
  18. package/dist/_chunks/notebook-pen-CO7HoM-W.js.map +1 -0
  19. package/dist/_chunks/notes-panel-DPsgB4Mv.js +351 -0
  20. package/dist/_chunks/notes-panel-DPsgB4Mv.js.map +1 -0
  21. package/dist/_chunks/{patient-table-DXk0wW8Q.js → patient-table-C7QHFC63.js} +2 -2
  22. package/dist/_chunks/{patient-table-DXk0wW8Q.js.map → patient-table-C7QHFC63.js.map} +1 -1
  23. package/dist/_chunks/share-2-B49jcW2I.js +18 -0
  24. package/dist/_chunks/share-2-B49jcW2I.js.map +1 -0
  25. package/dist/_chunks/sparkline-BTY4B5tv.js +509 -0
  26. package/dist/_chunks/sparkline-BTY4B5tv.js.map +1 -0
  27. package/dist/agent-catalog.json +27 -1
  28. package/dist/agent-i18n/en.json +4 -2
  29. package/dist/components/data-table/index.js +2 -2
  30. package/dist/components/face-scheme/index.js +1 -1
  31. package/dist/components/file-manager/index.js +1 -1
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/components/notes-panel/index.d.ts +1 -1
  35. package/dist/components/notes-panel/index.d.ts.map +1 -1
  36. package/dist/components/notes-panel/index.js +1 -1
  37. package/dist/components/notes-panel/notes-panel.agent.d.ts.map +1 -1
  38. package/dist/components/notes-panel/notes-panel.d.ts +45 -2
  39. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  40. package/dist/components/patient-table/index.js +1 -1
  41. package/dist/components/sparkline/index.js +1 -1
  42. package/dist/components/sparkline/sparkline.agent.d.ts.map +1 -1
  43. package/dist/components/sparkline/sparkline.d.ts +25 -0
  44. package/dist/components/sparkline/sparkline.d.ts.map +1 -1
  45. package/dist/host-compat.css +4 -1
  46. package/dist/i18n/locales/ar.d.ts +2 -0
  47. package/dist/i18n/locales/ar.d.ts.map +1 -1
  48. package/dist/i18n/locales/ar.js +2 -0
  49. package/dist/i18n/locales/ar.js.map +1 -1
  50. package/dist/i18n/locales/de.d.ts +2 -0
  51. package/dist/i18n/locales/de.d.ts.map +1 -1
  52. package/dist/i18n/locales/de.js +2 -0
  53. package/dist/i18n/locales/de.js.map +1 -1
  54. package/dist/i18n/locales/el.d.ts +2 -0
  55. package/dist/i18n/locales/el.d.ts.map +1 -1
  56. package/dist/i18n/locales/el.js +2 -0
  57. package/dist/i18n/locales/el.js.map +1 -1
  58. package/dist/i18n/locales/en.d.ts +2 -0
  59. package/dist/i18n/locales/en.d.ts.map +1 -1
  60. package/dist/i18n/locales/en.js +2 -0
  61. package/dist/i18n/locales/en.js.map +1 -1
  62. package/dist/i18n/locales/es.d.ts +2 -0
  63. package/dist/i18n/locales/es.d.ts.map +1 -1
  64. package/dist/i18n/locales/es.js +2 -0
  65. package/dist/i18n/locales/es.js.map +1 -1
  66. package/dist/i18n/locales/fr.d.ts +2 -0
  67. package/dist/i18n/locales/fr.d.ts.map +1 -1
  68. package/dist/i18n/locales/fr.js +2 -0
  69. package/dist/i18n/locales/fr.js.map +1 -1
  70. package/dist/i18n/locales/hi.d.ts +2 -0
  71. package/dist/i18n/locales/hi.d.ts.map +1 -1
  72. package/dist/i18n/locales/hi.js +2 -0
  73. package/dist/i18n/locales/hi.js.map +1 -1
  74. package/dist/i18n/locales/it.d.ts +2 -0
  75. package/dist/i18n/locales/it.d.ts.map +1 -1
  76. package/dist/i18n/locales/it.js +2 -0
  77. package/dist/i18n/locales/it.js.map +1 -1
  78. package/dist/i18n/locales/ja.d.ts +2 -0
  79. package/dist/i18n/locales/ja.d.ts.map +1 -1
  80. package/dist/i18n/locales/ja.js +2 -0
  81. package/dist/i18n/locales/ja.js.map +1 -1
  82. package/dist/i18n/locales/nl.d.ts +2 -0
  83. package/dist/i18n/locales/nl.d.ts.map +1 -1
  84. package/dist/i18n/locales/nl.js +2 -0
  85. package/dist/i18n/locales/nl.js.map +1 -1
  86. package/dist/i18n/locales/pl.d.ts +2 -0
  87. package/dist/i18n/locales/pl.d.ts.map +1 -1
  88. package/dist/i18n/locales/pl.js +2 -0
  89. package/dist/i18n/locales/pl.js.map +1 -1
  90. package/dist/i18n/locales/pt.d.ts +2 -0
  91. package/dist/i18n/locales/pt.d.ts.map +1 -1
  92. package/dist/i18n/locales/pt.js +2 -0
  93. package/dist/i18n/locales/pt.js.map +1 -1
  94. package/dist/i18n/locales/ro.d.ts +2 -0
  95. package/dist/i18n/locales/ro.d.ts.map +1 -1
  96. package/dist/i18n/locales/ro.js +2 -0
  97. package/dist/i18n/locales/ro.js.map +1 -1
  98. package/dist/i18n/locales/ru.d.ts +2 -0
  99. package/dist/i18n/locales/ru.d.ts.map +1 -1
  100. package/dist/i18n/locales/ru.js +2 -0
  101. package/dist/i18n/locales/ru.js.map +1 -1
  102. package/dist/i18n/locales/sq.d.ts +2 -0
  103. package/dist/i18n/locales/sq.d.ts.map +1 -1
  104. package/dist/i18n/locales/sq.js +2 -0
  105. package/dist/i18n/locales/sq.js.map +1 -1
  106. package/dist/i18n/locales/sv.d.ts +2 -0
  107. package/dist/i18n/locales/sv.d.ts.map +1 -1
  108. package/dist/i18n/locales/sv.js +2 -0
  109. package/dist/i18n/locales/sv.js.map +1 -1
  110. package/dist/i18n/locales/tr.d.ts +2 -0
  111. package/dist/i18n/locales/tr.d.ts.map +1 -1
  112. package/dist/i18n/locales/tr.js +2 -0
  113. package/dist/i18n/locales/tr.js.map +1 -1
  114. package/dist/i18n/locales/zh.d.ts +2 -0
  115. package/dist/i18n/locales/zh.d.ts.map +1 -1
  116. package/dist/i18n/locales/zh.js +2 -0
  117. package/dist/i18n/locales/zh.js.map +1 -1
  118. package/dist/index.js +132 -109
  119. package/dist/index.js.map +1 -1
  120. package/dist/locales/ar.json +2 -0
  121. package/dist/locales/de.json +2 -0
  122. package/dist/locales/el.json +2 -0
  123. package/dist/locales/en.json +2 -0
  124. package/dist/locales/es.json +2 -0
  125. package/dist/locales/fr.json +2 -0
  126. package/dist/locales/hi.json +2 -0
  127. package/dist/locales/it.json +2 -0
  128. package/dist/locales/ja.json +2 -0
  129. package/dist/locales/nl.json +2 -0
  130. package/dist/locales/pl.json +2 -0
  131. package/dist/locales/pt.json +2 -0
  132. package/dist/locales/ro.json +2 -0
  133. package/dist/locales/ru.json +2 -0
  134. package/dist/locales/sq.json +2 -0
  135. package/dist/locales/sv.json +2 -0
  136. package/dist/locales/tr.json +2 -0
  137. package/dist/locales/zh.json +2 -0
  138. package/dist/patterns/_shared/target-tile.d.ts +31 -0
  139. package/dist/patterns/_shared/target-tile.d.ts.map +1 -0
  140. package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts +23 -0
  141. package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts.map +1 -0
  142. package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts +82 -0
  143. package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts.map +1 -0
  144. package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts +46 -0
  145. package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts.map +1 -0
  146. package/dist/patterns/anamnesis/anamnesis-compile.d.ts +48 -0
  147. package/dist/patterns/anamnesis/anamnesis-compile.d.ts.map +1 -0
  148. package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts +26 -0
  149. package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts.map +1 -0
  150. package/dist/patterns/anamnesis/anamnesis-config.d.ts +62 -0
  151. package/dist/patterns/anamnesis/anamnesis-config.d.ts.map +1 -0
  152. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +194 -0
  153. package/dist/patterns/anamnesis/anamnesis-derive.d.ts.map +1 -0
  154. package/dist/patterns/anamnesis/anamnesis-digest.d.ts +84 -0
  155. package/dist/patterns/anamnesis/anamnesis-digest.d.ts.map +1 -0
  156. package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts +19 -0
  157. package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts.map +1 -0
  158. package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts +12 -0
  159. package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts.map +1 -0
  160. package/dist/patterns/anamnesis/anamnesis-events.d.ts +60 -0
  161. package/dist/patterns/anamnesis/anamnesis-events.d.ts.map +1 -0
  162. package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts +48 -0
  163. package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts.map +1 -0
  164. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +37 -0
  165. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts.map +1 -0
  166. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +10 -0
  167. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts.map +1 -0
  168. package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts +23 -0
  169. package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts.map +1 -0
  170. package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts +36 -0
  171. package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts.map +1 -0
  172. package/dist/patterns/anamnesis/anamnesis-export.d.ts +143 -0
  173. package/dist/patterns/anamnesis/anamnesis-export.d.ts.map +1 -0
  174. package/dist/patterns/anamnesis/anamnesis-field.d.ts +14 -0
  175. package/dist/patterns/anamnesis/anamnesis-field.d.ts.map +1 -0
  176. package/dist/patterns/anamnesis/anamnesis-format.d.ts +67 -0
  177. package/dist/patterns/anamnesis/anamnesis-format.d.ts.map +1 -0
  178. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +6 -0
  179. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts.map +1 -0
  180. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +53 -0
  181. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts.map +1 -0
  182. package/dist/patterns/anamnesis/anamnesis-intake.d.ts +16 -0
  183. package/dist/patterns/anamnesis/anamnesis-intake.d.ts.map +1 -0
  184. package/dist/patterns/anamnesis/anamnesis-matrix.d.ts +91 -0
  185. package/dist/patterns/anamnesis/anamnesis-matrix.d.ts.map +1 -0
  186. package/dist/patterns/anamnesis/anamnesis-notes.d.ts +19 -0
  187. package/dist/patterns/anamnesis/anamnesis-notes.d.ts.map +1 -0
  188. package/dist/patterns/anamnesis/anamnesis-readonly.d.ts +17 -0
  189. package/dist/patterns/anamnesis/anamnesis-readonly.d.ts.map +1 -0
  190. package/dist/patterns/anamnesis/anamnesis-summary.d.ts +35 -0
  191. package/dist/patterns/anamnesis/anamnesis-summary.d.ts.map +1 -0
  192. package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts +18 -0
  193. package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts.map +1 -0
  194. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +14 -0
  195. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts.map +1 -0
  196. package/dist/patterns/anamnesis/anamnesis-targets.d.ts +58 -0
  197. package/dist/patterns/anamnesis/anamnesis-targets.d.ts.map +1 -0
  198. package/dist/patterns/anamnesis/anamnesis-types.d.ts +336 -0
  199. package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -0
  200. package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts +35 -0
  201. package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts.map +1 -0
  202. package/dist/patterns/anamnesis/anamnesis-window.d.ts +37 -0
  203. package/dist/patterns/anamnesis/anamnesis-window.d.ts.map +1 -0
  204. package/dist/patterns/anamnesis/anamnesis.d.ts +48 -0
  205. package/dist/patterns/anamnesis/anamnesis.d.ts.map +1 -0
  206. package/dist/patterns/anamnesis/index.d.ts +8 -0
  207. package/dist/patterns/anamnesis/index.d.ts.map +1 -0
  208. package/dist/patterns/anamnesis/index.js +26 -0
  209. package/dist/patterns/anamnesis/index.js.map +1 -0
  210. package/dist/tokens.css +1 -1
  211. package/package.json +5 -1
  212. package/dist/_chunks/editable-currency-cell-renderer-Dus_sBvX.js.map +0 -1
  213. package/dist/_chunks/face-scheme-Cou2efl7.js.map +0 -1
  214. package/dist/_chunks/file-manager-CNSLiuLo.js.map +0 -1
  215. package/dist/_chunks/notes-panel-CTcOLLVo.js +0 -324
  216. package/dist/_chunks/notes-panel-CTcOLLVo.js.map +0 -1
  217. package/dist/_chunks/sparkline-DLq7xwic.js +0 -394
  218. package/dist/_chunks/sparkline-DLq7xwic.js.map +0 -1
@@ -0,0 +1,62 @@
1
+ import type { IntakeFieldDef, IntakeSectionDef, NumericParameterDef, ParameterGroup, PathologyCode } from './anamnesis-types';
2
+ /** The only keys the derivation engine cannot lose. `bmi` is computed from
3
+ * `weight` + `height`; every other key in the kit is read generically. */
4
+ export declare const LOCKED_PARAMETER_KEYS: ReadonlySet<string>;
5
+ /** Whether a numeric parameter is locked against archiving / deletion. */
6
+ export declare function isParameterLocked(key: string): boolean;
7
+ /** Parameters a plan sets a per-patient GOAL for. Not every number is one: a
8
+ * height is a fact about the patient, and a blood test carries a population
9
+ * reference range rather than a target. The four the nutrition plan is written
10
+ * in — weight, BMI, daily energy, protein — plus waist, which practices have
11
+ * long set a goal for. */
12
+ export declare const TARGETABLE_PARAMETER_KEYS: ReadonlySet<string>;
13
+ /** Whether a per-patient target can be set for this parameter. */
14
+ export declare function isParameterTargetable(key: string): boolean;
15
+ /** A practice's anamnesis vocabulary. Every list is optional: an omitted list
16
+ * falls back to the kit-seeded catalogue, so `undefined` is a fully working
17
+ * configuration and every existing mount keeps rendering unchanged. */
18
+ export interface PracticeAnamnesisConfig {
19
+ /** Numeric parameters (anthropometrics + labs), in the practice's order. */
20
+ parameters?: readonly NumericParameterDef[];
21
+ /** The intake questionnaire — the practice's own form, transcribed. */
22
+ intakeSections?: readonly IntakeSectionDef[];
23
+ /** The coded pathology taxonomy. */
24
+ pathologies?: readonly PathologyCode[];
25
+ }
26
+ /** What the kit ships when a practice has configured nothing. Seeded, not
27
+ * empty — an empty vocabulary renders an empty record. */
28
+ export declare const SEEDED_ANAMNESIS_CONFIG: Required<PracticeAnamnesisConfig>;
29
+ /** Fill every omitted list from the seed. */
30
+ export declare function resolveConfig(config?: PracticeAnamnesisConfig): Required<PracticeAnamnesisConfig>;
31
+ /** CAPTURE surfaces: live parameters only. A locked parameter is never
32
+ * dropped, whatever the config says — archiving `weight` would silently break
33
+ * BMI everywhere. */
34
+ export declare function configuredParameters(config?: PracticeAnamnesisConfig, group?: ParameterGroup): NumericParameterDef[];
35
+ /** HISTORY surfaces: every parameter, archived ones included, so a value
36
+ * recorded under an archived parameter still renders. */
37
+ export declare function allParametersIncludingArchived(config?: PracticeAnamnesisConfig, group?: ParameterGroup): NumericParameterDef[];
38
+ /** Lookup over every parameter, archived included — callers resolving a key
39
+ * read from a record must never miss an archived one. */
40
+ export declare function parameterLookup(config?: PracticeAnamnesisConfig): Record<string, NumericParameterDef>;
41
+ /** CAPTURE: the questionnaire as the patient sees it — archived sections and
42
+ * fields dropped, and a section left with no live field dropped with them. */
43
+ export declare function configuredSections(config?: PracticeAnamnesisConfig): IntakeSectionDef[];
44
+ /** HISTORY: every section and field ever configured, so answers recorded under
45
+ * a since-archived question still render in the record and the read-only view.
46
+ * Using `configuredSections` here would erase them from the screen. */
47
+ export declare function allSectionsIncludingArchived(config?: PracticeAnamnesisConfig): IntakeSectionDef[];
48
+ /** Flat field lookup across every section, archived included. */
49
+ export declare function intakeFieldLookup(config?: PracticeAnamnesisConfig): Record<string, IntakeFieldDef>;
50
+ /** CAPTURE: live codes, in configured order. */
51
+ export declare function configuredPathologies(config?: PracticeAnamnesisConfig): PathologyCode[];
52
+ /** HISTORY: every code, archived included. A code assigned last year must
53
+ * still render its label this year. */
54
+ export declare function allPathologiesIncludingArchived(config?: PracticeAnamnesisConfig): PathologyCode[];
55
+ /** Lookup by code over the FULL taxonomy. Without this, reading
56
+ * `entry.parentCode` off a practice-added code throws. */
57
+ export declare function pathologyLookup(config?: PracticeAnamnesisConfig): Record<string, PathologyCode>;
58
+ /** Assignable codes: a family that carries sub-codes is a heading, not itself
59
+ * assignable. Derived from the LIVE taxonomy so an archived code cannot be
60
+ * newly assigned, but stays resolvable for history. */
61
+ export declare function assignablePathologyCodes(config?: PracticeAnamnesisConfig): string[];
62
+ //# sourceMappingURL=anamnesis-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-config.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-config.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M,EAAE,mBAAmB,CAAC,CAIrC;AAQD;8EAC8E;AAC9E,wBAAgB,kBAAkB,CAChC,MAAM,CAAC,EAAE,uBAAuB,GAC/B,gBAAgB,EAAE,CAQpB;AAED;;uEAEuE;AACvE,wBAAgB,4BAA4B,CAC1C,MAAM,CAAC,EAAE,uBAAuB,GAC/B,gBAAgB,EAAE,CAEpB;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAC/B,MAAM,CAAC,EAAE,uBAAuB,GAC/B,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAMhC;AAID,gDAAgD;AAChD,wBAAgB,qBAAqB,CACnC,MAAM,CAAC,EAAE,uBAAuB,GAC/B,aAAa,EAAE,CAEjB;AAED;uCACuC;AACvC,wBAAgB,+BAA+B,CAC7C,MAAM,CAAC,EAAE,uBAAuB,GAC/B,aAAa,EAAE,CAEjB;AAED;0DAC0D;AAC1D,wBAAgB,eAAe,CAC7B,MAAM,CAAC,EAAE,uBAAuB,GAC/B,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAI/B;AAED;;uDAEuD;AACvD,wBAAgB,wBAAwB,CACtC,MAAM,CAAC,EAAE,uBAAuB,GAC/B,MAAM,EAAE,CAKV"}
@@ -0,0 +1,194 @@
1
+ import type { AnamnesisRecord, MedicationEntry, NumericParameterDef, Visit } from './anamnesis-types';
2
+ /** Anthropometric parameter keys map to AnthropometricSet fields; `bmi` is
3
+ * computed. Kept as a lookup so the grid can treat anthropometrics + labs
4
+ * uniformly. */
5
+ export declare const ANTHRO_FIELD_BY_KEY: Record<string, keyof Visit['anthropometrics']>;
6
+ /** `Timestamp` options for the record's calendar dates (visit date, date of
7
+ * birth, cycle start). Every one of them is a date-only ISO string, which
8
+ * `Date` parses as UTC midnight — rendered with the viewer's zone that shows a
9
+ * phantom time ("13 Apr 2026, 2:00" in CEST) and, west of UTC, the WRONG DAY.
10
+ * Dropping the time fields and pinning the zone to UTC makes the calendar date
11
+ * render as written, identically in every timezone (and so deterministically
12
+ * in Chromatic). */
13
+ export declare const CALENDAR_DATE_FORMAT: Intl.DateTimeFormatOptions;
14
+ /** BMI = kg / m². Thin `undefined`-tolerant wrapper over the kit's canonical
15
+ * BMI maths — the anthropometric set leaves unmeasured fields `undefined`,
16
+ * which `bmi-calculator/bmi` (a form-backed component) does not model. The
17
+ * formula itself lives there and is not restated here. */
18
+ export declare function computeBmi(weightKg: number | null | undefined, heightCm: number | null | undefined): number | null;
19
+ /** Whether a stored ISO string is a date `Date` can actually read. An archive
20
+ * holds blanks and typos; nothing downstream may throw or print "NaN" on one. */
21
+ export declare function isReadableDate(iso: string | null | undefined): boolean;
22
+ /** Whole-years age at a reference instant, or `null` when either date is
23
+ * unreadable OR the reference predates the birth — an unknown age is absent,
24
+ * never `NaN` and never negative. Reference is the record's
25
+ * own visit date (deterministic for stories / Chromatic), not the wall clock.
26
+ * Read in UTC because both inputs are date-only strings, which `Date` parses as
27
+ * UTC midnight: local getters return the previous day west of UTC. */
28
+ export declare function ageAt(dobIso: string, referenceIso: string): number | null;
29
+ /** Where a parameter's value actually lives on a `Visit`. */
30
+ export type ParameterStorage = 'computed' | 'anthropometric' | 'dietary' | 'lab';
31
+ /** Keys stored in `visit.dietaryIntake`. Explicit, like `ANTHRO_FIELD_BY_KEY`:
32
+ * the kit's two shipped intake parameters have a drawer of their own, and
33
+ * anything else a practice adds falls through to the open-ended one below. */
34
+ export declare const DIETARY_STORAGE_KEYS: ReadonlySet<string>;
35
+ /** Resolve a parameter's STORAGE HOME. Read and write branch on this, never on
36
+ * `def.group`: `AnthropometricSet` is a fixed shape, so a practice-added
37
+ * anthropometric has no field of its own and must round-trip through the
38
+ * open-ended `labs` array. Branching on `group` made it read null and store
39
+ * nothing. `bmi` keeps its explicit guard — `def.computed` is a bare boolean
40
+ * with no formula registry to dispatch on.
41
+ *
42
+ * `labs` stays the FALLBACK, so a key with no drawer of its own still stores
43
+ * and reads back. There is no such thing as a parameter with no storage home. */
44
+ export declare function parameterStorage(def: NumericParameterDef): ParameterStorage;
45
+ /** The raw numeric value of a parameter at a visit (BMI computed on the fly,
46
+ * the six shipped anthropometrics read from the set, everything else looked up
47
+ * in `labs` by key). Non-finite stored values read as absent. */
48
+ export declare function parameterValueAt(visit: Visit, def: NumericParameterDef): number | null;
49
+ /** Write a numeric value onto a visit at its storage home, returning a new
50
+ * visit. Computed parameters are never written. Pure — the surfaces call it
51
+ * through their own working-state setters. */
52
+ export declare function setNumericOnVisit(visit: Visit, def: NumericParameterDef, value: number | null): Visit;
53
+ /** Set or clear a per-patient target, returning a new record. `null` clears
54
+ * it. Pure — the surfaces call it through their own working-state setters,
55
+ * exactly as they call `setNumericOnVisit`. A non-finite target is not a goal
56
+ * and clears rather than storing "NaN". */
57
+ export declare function setTargetOnRecord(record: AnamnesisRecord, parameterKey: string, target: number | null): AnamnesisRecord;
58
+ export type RangeFlag = 'low' | 'high' | null;
59
+ /** Whether a value sits outside its reference range. */
60
+ export declare function outOfRange(value: number | null, range: NumericParameterDef['referenceRange']): RangeFlag;
61
+ export type DeltaDirection = 'up' | 'down' | 'flat';
62
+ export type DeltaValence = 'good' | 'bad' | 'neutral';
63
+ export interface DeltaInfo {
64
+ /** Signed change vs the previous visit (current − previous). */
65
+ abs: number;
66
+ direction: DeltaDirection;
67
+ valence: DeltaValence;
68
+ }
69
+ /** Direction-aware good/bad. Uses the parameter's `betterDirection` and, for
70
+ * `toRange`, the reference range — never the sign of the delta alone. */
71
+ export declare function deltaInfo(current: number | null, previous: number | null, def: NumericParameterDef): DeltaInfo | null;
72
+ export interface ParameterCell {
73
+ visitId: string;
74
+ value: number | null;
75
+ outOfRange: RangeFlag;
76
+ /** Change vs the immediately preceding visit; null for the first column. */
77
+ delta: DeltaInfo | null;
78
+ }
79
+ export interface ParameterRow {
80
+ def: NumericParameterDef;
81
+ /** One cell per record visit, aligned to `record.visits` order. */
82
+ cells: ParameterCell[];
83
+ /** ONE ENTRY PER RECORD VISIT, in visit order — the sparkline series. A
84
+ * `null` is a visit where this parameter was not measured, and it holds its
85
+ * place: dropping it would compress a four-times-measured lab across the
86
+ * same width as a thirteen-times-measured weight, and an event annotation
87
+ * would then land on a different date in each row. */
88
+ series: (number | null)[];
89
+ /** Per-patient target for this parameter, when one is configured. */
90
+ target: number | null;
91
+ }
92
+ /** Build the transposed grid: one row per parameter definition, one cell per
93
+ * visit, with derived deltas / out-of-range flags / sparkline series. */
94
+ export declare function buildParameterRows(record: AnamnesisRecord, defs: NumericParameterDef[]): ParameterRow[];
95
+ export interface NumericChange {
96
+ def: NumericParameterDef;
97
+ from: number | null;
98
+ to: number | null;
99
+ delta: DeltaInfo | null;
100
+ }
101
+ export interface PathologyChange {
102
+ code: string;
103
+ change: 'added' | 'removed';
104
+ }
105
+ export interface MedicationChange {
106
+ entry: MedicationEntry;
107
+ change: 'added' | 'removed' | 'changed';
108
+ previous?: MedicationEntry;
109
+ }
110
+ export type TextField = 'nutritionalProposal' | 'clinicalNotes';
111
+ /** The free-text fields a visit carries, in diff order. */
112
+ export declare const TEXT_FIELDS: readonly TextField[];
113
+ export interface TextChange {
114
+ field: TextField;
115
+ from?: string;
116
+ to?: string;
117
+ }
118
+ export interface VisitDiff {
119
+ from: Visit;
120
+ to: Visit;
121
+ numeric: NumericChange[];
122
+ pathologies: PathologyChange[];
123
+ medications: MedicationChange[];
124
+ texts: TextChange[];
125
+ }
126
+ /** Everything that changed between two visits — numeric parameters plus the
127
+ * non-numeric fields (pathologies added/removed, medications added/removed/
128
+ * changed, free-text notes edited). Only entries that actually differ are
129
+ * returned, so compare mode can mark exactly the changed cells. */
130
+ export declare function compareVisits(from: Visit, to: Visit, defs: NumericParameterDef[]): VisitDiff;
131
+ export interface NumericSpanChange {
132
+ def: NumericParameterDef;
133
+ /** One entry per compared visit, rounded to the parameter's precision. */
134
+ values: (number | null)[];
135
+ /** Net change, first compared visit → last. Null when either end is absent. */
136
+ delta: DeltaInfo | null;
137
+ }
138
+ export interface PathologySpanChange {
139
+ code: string;
140
+ /** Whether the code was assigned at each compared visit. */
141
+ present: boolean[];
142
+ }
143
+ export interface MedicationSpanChange {
144
+ id: string;
145
+ /** The entry at each compared visit; `undefined` where it was not carried. */
146
+ entries: (MedicationEntry | undefined)[];
147
+ }
148
+ export interface TextSpanChange {
149
+ field: TextField;
150
+ /** The field's text at each compared visit, trimmed; '' where absent. */
151
+ values: string[];
152
+ }
153
+ export interface SpanDiff {
154
+ /** The compared visits, in the order given (record order). Never below two. */
155
+ visits: Visit[];
156
+ numeric: NumericSpanChange[];
157
+ pathologies: PathologySpanChange[];
158
+ medications: MedicationSpanChange[];
159
+ texts: TextSpanChange[];
160
+ }
161
+ /** Everything that is not constant across two or more visits. `null` below
162
+ * two visits — there is no span to read, and an empty diff would claim there
163
+ * was nothing to report. */
164
+ export declare function compareVisitSpan(visits: readonly Visit[], defs: NumericParameterDef[]): SpanDiff | null;
165
+ /** The newest visit — the editable one in compile mode, and the record's one
166
+ * reference instant for anything dated against "now": the patient's age, the
167
+ * header's visit date. Every surface must read it from here. Intake used to
168
+ * date itself to `visits[0]` while compile and read-only used the last visit,
169
+ * which printed two different ages for the same patient. */
170
+ export declare function latestVisit(record: AnamnesisRecord): Visit | undefined;
171
+ /** The one string every absent value renders as. Never a bare hyphen, never a
172
+ * blank, never "NaN". */
173
+ export declare const ABSENT_VALUE = "\u2014";
174
+ /** Format a numeric value to its parameter precision, or an em dash when
175
+ * absent. `0` formats as a value; a non-finite number is absent, because
176
+ * `NaN.toFixed(1)` is the string "NaN" and that must never reach a cell.
177
+ * Callers append the unit separately. */
178
+ export declare function formatValue(value: number | null, precision?: number): string;
179
+ /** Localised medium date (e.g. "12 May 2025") from an ISO date string.
180
+ * @deprecated Pins neither timezone nor locale. Use `visitDateLabel`
181
+ * (anamnesis-format.ts) for anything date-only; it is the reason this has no
182
+ * callers left. */
183
+ export declare function formatDateMedium(iso: string): string;
184
+ /** Localised calendar date from a date-only ISO string, pinned to UTC through
185
+ * `CALENDAR_DATE_FORMAT`. Prefer `visitDateLabel` (anamnesis-format.ts), which
186
+ * resolves `locale` from the surface's `t` — omitting it falls back to the
187
+ * BROWSER locale, which disagrees with `<Timestamp>` on the same screen.
188
+ * An unreadable date renders the em dash: `Intl` THROWS on one, which would
189
+ * take down the whole evolution surface rather than blank one label. */
190
+ export declare function formatCalendarDate(iso: string, locale?: string): string;
191
+ /** Signed, precision-formatted delta string (e.g. "+2.4", "−1.0"). Uses a
192
+ * real minus sign for the negative case. */
193
+ export declare function formatDelta(abs: number, precision?: number): string;
194
+ //# sourceMappingURL=anamnesis-derive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-derive.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-derive.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EACf,mBAAmB,EACnB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B;;gBAEgB;AAChB,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAQ/B,CAAC;AAEF;;;;;;oBAMoB;AACpB,eAAO,MAAM,oBAAoB,EAAE,IAAI,CAAC,qBAKvC,CAAC;AAEF;;;0DAG0D;AAC1D,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,MAAM,GAAG,IAAI,CAEf;AAED;iFACiF;AACjF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEtE;AAED;;;;;sEAKsE;AACtE,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAezE;AAID,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,gBAAgB,GAChB,SAAS,GACT,KAAK,C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BAAgB,CAC9B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,IAAI,EAAE,mBAAmB,EAAE,GAC1B,QAAQ,GAAG,IAAI,CA+CjB;AAiBD;;;;4DAI4D;AAC5D,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,KAAK,GAAG,SAAS,CAEtE;AAED;yBACyB;AACzB,eAAO,MAAM,YAAY,WAAM,CAAC;AAEhC;;;yCAGyC;AACzC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,SAAI,GAAG,MAAM,CAGvE;AAED;;;mBAGmB;AACnB,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;;;;wEAKwE;AACxE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED;4CAC4C;AAC5C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,MAAM,CAM9D"}
@@ -0,0 +1,84 @@
1
+ import type { RefObject } from 'react';
2
+ import type { TFunction } from 'i18next';
3
+ import { type AlertAnnounce } from '../../components/alert';
4
+ import type { IntakeAnswer, IntakeSectionDef, PatientSex } from './anamnesis-types';
5
+ /** How one digest group is built. Phase 3 adds a group by adding an entry
6
+ * here — the renderer switches on `kind` and never on a group id. */
7
+ export type DigestGroupKind = 'prose' | 'facts' | 'flags';
8
+ export type DigestGroupDef = {
9
+ id: string;
10
+ kind: 'prose';
11
+ fieldKeys: readonly string[];
12
+ } | {
13
+ id: string;
14
+ kind: 'facts';
15
+ fieldKeys: readonly string[];
16
+ } | {
17
+ id: string;
18
+ kind: 'flags';
19
+ };
20
+ /** Reading order for a clinician with the patient in the room: why they came,
21
+ * what they already carry, what they report, what they do every day. */
22
+ export declare const DIGEST_GROUPS: readonly DigestGroupDef[];
23
+ /** Reads one answer by field key. Both surfaces hold their answers in a
24
+ * different shape (a working map vs `Sourced<IntakeAnswer>`), so the digest
25
+ * takes a reader rather than either shape. */
26
+ export type AnswerReader = (key: string) => IntakeAnswer | undefined;
27
+ export interface DigestItem {
28
+ key: string;
29
+ label: string;
30
+ /** Already display-ready. Absent numerics are an em dash, never "NaN". */
31
+ value: string;
32
+ }
33
+ export interface DigestGroup {
34
+ id: string;
35
+ kind: DigestGroupKind;
36
+ items: DigestItem[];
37
+ }
38
+ export interface IntakeDigest {
39
+ /** Only groups that have something to say. */
40
+ groups: DigestGroup[];
41
+ answered: number;
42
+ total: number;
43
+ }
44
+ export interface MissingAnswer {
45
+ key: string;
46
+ sectionKey: string;
47
+ label: string;
48
+ }
49
+ /** The whole digest. Pure apart from `t`; safe on an absent questionnaire, a
50
+ * half-answered one, and a practice that archived half the form. */
51
+ export declare function buildIntakeDigest(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): IntakeDigest;
52
+ /** Mandatory questions the patient has not answered, in questionnaire order.
53
+ * "Not sure" counts as unanswered — provisional, and flagged in the `.mdx`. */
54
+ export declare function missingMandatoryAnswers(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): MissingAnswer[];
55
+ /** Jump-to-field seam. The caller opens whatever disclosures hide the target
56
+ * (on compile that is BOTH the section block and the answer review), then asks
57
+ * for the jump; this waits for the reveal to mount before moving focus. */
58
+ export declare function useFieldJump(): {
59
+ containerRef: RefObject<HTMLDivElement | null>;
60
+ requestJump: (key: string) => void;
61
+ };
62
+ export interface AnamnesisMissingAnswersProps {
63
+ missing: readonly MissingAnswer[];
64
+ t: TFunction;
65
+ /** Reveals the first missing answer and moves focus to it. */
66
+ onJump: (missing: MissingAnswer) => void;
67
+ /** How loudly this is announced. Pass `'off'` where the list RECOMPUTES as
68
+ * the user types — a live region re-announces its whole content on every
69
+ * change, so a per-keystroke summary is noise, not help. Default `'polite'`
70
+ * suits a list fixed at mount. */
71
+ announce?: AlertAnnounce;
72
+ /** Label for the jump action. Override where the jump LEAVES the surface —
73
+ * a button that changes tab has to say so before it moves focus. */
74
+ jumpKey?: string;
75
+ }
76
+ /** Guidance, not an interruption. Tint and urgency are independent in the kit,
77
+ * so the `info` tint here is a visual choice, separate from `announce`. */
78
+ export declare function AnamnesisMissingAnswers({ missing, t, onJump, announce, jumpKey, }: AnamnesisMissingAnswersProps): import("react/jsx-runtime").JSX.Element | null;
79
+ export interface AnamnesisDigestProps {
80
+ digest: IntakeDigest;
81
+ t: TFunction;
82
+ }
83
+ export declare function AnamnesisDigest({ digest, t }: AnamnesisDigestProps): import("react/jsx-runtime").JSX.Element;
84
+ //# sourceMappingURL=anamnesis-digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-digest.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-digest.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAS,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAUnE,OAAO,KAAK,EACV,YAAY,EAEZ,gBAAgB,EAChB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B;qEACqE;AACrE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3D;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3D;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElC;wEACwE;AACxE,eAAO,MAAM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AAa,EAAE,CAAC;IAClC,CAAC,EAAE,SAAS,CAAC;IACb,8DAA8D;IAC9D,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC;;;sCAGkC;IAClC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;wEACoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;2EAC2E;AAC3E,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,CAAC,EACD,MAAM,EACN,QAAmB,EACnB,OAAyC,GAC1C,EAAE,4BAA4B,kDA8B9B;AAID,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,CAAC,EAAE,SAAS,CAAC;CACd;AA8BD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,oBAAoB,2CAqBlE"}
@@ -0,0 +1,19 @@
1
+ /** Who a concept may be disclosed to. `clinician` is implicit on every row. */
2
+ export type DisclosureAudience = 'clinician' | 'patient' | 'external';
3
+ export interface DisclosureRule {
4
+ /** Stable concept id — never a UI label, never a data-model field path. */
5
+ id: string;
6
+ /** Where the concept is captured or rendered. */
7
+ surface: 'intake' | 'compile' | 'evolution' | 'readOnly' | 'export';
8
+ /** Audiences allowed to see it. Always includes 'clinician'. */
9
+ audiences: readonly DisclosureAudience[];
10
+ /** One English sentence, for the customer sign-off walkthrough. */
11
+ rationale: string;
12
+ /** 'provisional' = our judgement, not the customer's. */
13
+ status: 'provisional' | 'signedOff';
14
+ }
15
+ export declare const DISCLOSURE_RULES: readonly DisclosureRule[];
16
+ /** The one resolver. Never inline this logic. An unknown id is NOT disclosed —
17
+ * a concept with no row is a concept nobody has thought about yet. */
18
+ export declare function disclosedTo(id: string, audience: DisclosureAudience): boolean;
19
+ //# sourceMappingURL=anamnesis-disclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-disclosure.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-disclosure.ts"],"names":[],"mappings":"AAmBA,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpE,gEAAgE;IAChE,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACzC,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;CACrC;AAQD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAiMrD,CAAC;AAMF;sEACsE;AACtE,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAI7E"}
@@ -0,0 +1,12 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type EventMark } from './anamnesis-events';
3
+ export interface AnamnesisEventBarProps {
4
+ /** Events that HAVE a position on the plot, in the order they happened.
5
+ * One with no place on it never reaches here — see `eventMarks`. */
6
+ marks: readonly EventMark[];
7
+ activeIds: ReadonlySet<string>;
8
+ onToggle: (eventId: string) => void;
9
+ t: TFunction;
10
+ }
11
+ export declare function AnamnesisEventBar({ marks, activeIds, onToggle, t, }: AnamnesisEventBarProps): import("react/jsx-runtime").JSX.Element | null;
12
+ //# sourceMappingURL=anamnesis-event-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-event-bar.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-event-bar.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,sBAAsB;IACrC;wEACoE;IACpE,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,CAAC,EAAE,SAAS,CAAC;CACd;AAID,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,CAAC,GACF,EAAE,sBAAsB,kDAuExB"}
@@ -0,0 +1,60 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { MarkerShape } from '../../components/annotation-marker';
3
+ import type { SparklineAnnotation, SparklineAnnotationTone } from '../../components/sparkline';
4
+ import type { ClinicalEvent, ClinicalEventCategory, Visit } from './anamnesis-types';
5
+ /**
6
+ * ONE shape per category, and that is the whole vocabulary — five distinct
7
+ * glyphs, no per-category hue.
8
+ *
9
+ * Five saturated semantic tones (error / success / accent / warning / info)
10
+ * used to ride these shapes. Three or four events picked at once put four
11
+ * competing hues across a 32px-tall sparkline, nineteen rows deep, and the
12
+ * annotations then out-shouted the trend line they exist to annotate. Shape
13
+ * is already the accessible channel here (WCAG 1.4.1, and the kit's rule in
14
+ * `src/components/annotation-marker/`), so the hue was reinforcement the
15
+ * reader was paying for in noise.
16
+ */
17
+ export declare const EVENT_SHAPE: Record<ClinicalEventCategory, MarkerShape>;
18
+ /**
19
+ * The single restrained tone every annotation wears, chip and line alike.
20
+ *
21
+ * `neutral` resolves to `--muted-foreground`, the only hueless token that
22
+ * clears WCAG 1.4.11's 3:1 for a non-text graphic in all four themes
23
+ * (measured 6.9:1 light, 7.5:1 dark, 18.4:1 / 13.9:1 accessible, against
24
+ * `--card`). Hueless is the point: the trend line is tinted by VALENCE —
25
+ * green improving, red worsening — and an annotation with a hue of its own
26
+ * competes with that read.
27
+ */
28
+ export declare const EVENT_TONE: SparklineAnnotationTone;
29
+ /** An event that HAS a place on the plot, with the fraction it sits at. */
30
+ export interface EventMark {
31
+ event: ClinicalEvent;
32
+ /** Fraction of the shared x domain: 0 = first visit, 1 = latest. */
33
+ position: number;
34
+ }
35
+ /**
36
+ * Where an event sits on the domain every row shares, or `null` when it has
37
+ * no place on the plot.
38
+ *
39
+ * `null` — rather than a clamp to 0 or 1 — for an event outside the visit
40
+ * span: the plot covers first visit → latest, and pinning an event that
41
+ * predates the record to the left edge would invent a correlation with a
42
+ * measurement taken before it happened. Also `null` below two visits (no
43
+ * extent to sit on) and on any unreadable date.
44
+ *
45
+ * `visits` is read in ARRAY ORDER, and chronological order is an UNCHECKED
46
+ * precondition: an out-of-order array can bracket the event on a span that
47
+ * runs backwards and place the marker accordingly.
48
+ */
49
+ export declare function eventPosition(event: ClinicalEvent, visits: readonly Visit[]): number | null;
50
+ /** The events that can be drawn, in the order they happened. */
51
+ export declare function eventMarks(events: readonly ClinicalEvent[] | undefined, visits: readonly Visit[]): EventMark[];
52
+ /** "Chemotherapy started · 2 Sep 2024" — what the chip says. */
53
+ export declare function eventLabel(event: ClinicalEvent, t: TFunction): string;
54
+ /** Rides the chip as its accessible description: what kind of thing this was,
55
+ * and — when it was not this practice's own decision — who recorded it. */
56
+ export declare function eventDetail(event: ClinicalEvent, t: TFunction): string;
57
+ /** The picked events as sparkline annotations. Every row of the grid is given
58
+ * this SAME array, which is what pins one event to one x down the column. */
59
+ export declare function eventAnnotations(marks: readonly EventMark[], activeIds: ReadonlySet<string>, t: TFunction): SparklineAnnotation[];
60
+ //# sourceMappingURL=anamnesis-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-events.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-events.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,qBAAqB,EAAE,WAAW,CAMlE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,uBAAmC,CAAC;AAE7D,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,SAAS,KAAK,EAAE,GACvB,MAAM,GAAG,IAAI,CAmBf;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CACxB,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAC5C,MAAM,EAAE,SAAS,KAAK,EAAE,GACvB,SAAS,EAAE,CAOb;AAID,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAKrE;AAED;2EAC2E;AAC3E,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAOtE;AAED;6EAC6E;AAC7E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAC9B,CAAC,EAAE,SAAS,GACX,mBAAmB,EAAE,CAUvB"}
@@ -0,0 +1,48 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { SparklineAnnotation } from '../../components/sparkline';
3
+ import { type VisitColumn } from './anamnesis-window';
4
+ import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
5
+ export interface AnamnesisEvolutionGridProps {
6
+ record: AnamnesisRecord;
7
+ defs: NumericParameterDef[];
8
+ t: TFunction;
9
+ /** Make the newest visit column editable (compile mode). */
10
+ editable?: boolean;
11
+ onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
12
+ /** Compare mode: the visit ids under comparison (two or more) + the CELLS
13
+ * that differ from the compared column before them, keyed
14
+ * `<visitId>:<parameterKey>`. Per cell, never per parameter: at three or
15
+ * more compared visits a column equal to its predecessor did not change. */
16
+ compare?: {
17
+ visitIds: ReadonlySet<string>;
18
+ changedCells: ReadonlySet<string>;
19
+ } | null;
20
+ /** Draw the outer border + surface (standalone use). Set `false` when the
21
+ * grid already sits inside a card, to avoid a box-in-a-box. */
22
+ framed?: boolean;
23
+ /** Mount this visit's note popover already open. Demo/story hook only —
24
+ * Chromatic skips play functions, so a click-opened popover is never
25
+ * snapshotted. Ignored once `onOpenNote` is wired. */
26
+ defaultOpenNoteVisitId?: string;
27
+ /** Route a visit's note to the host's side panel instead of opening it in
28
+ * place. Omitted = read in place, which is all a standalone grid can do. */
29
+ onOpenNote?: OpenAnamnesisNote;
30
+ /** Which columns render, from the visit window. Omitted = every visit.
31
+ * Column order and `index` always follow `record.visits`; the window
32
+ * changes what is SHOWN, never what was computed. */
33
+ visitColumns?: readonly VisitColumn[];
34
+ /** Keys the practice still captures. A key outside this set renders its
35
+ * history read-only: archiving stops capture, it never erases the record.
36
+ * Omitted = every def is capturable. */
37
+ capturableKeys?: ReadonlySet<string>;
38
+ /** Event reference lines, positioned as a fraction of the record's visit
39
+ * span. Every row gets this SAME array, which is what makes one event one
40
+ * vertical line down the whole grid rather than one line per row. */
41
+ annotations?: readonly SparklineAnnotation[];
42
+ /** Make those lines pointer-selectable — pressing one is pressing the
43
+ * event's chip in the bar above. Omitted = the lines stay decorative, which
44
+ * is all a grid with no event bar above it can honestly offer. */
45
+ onSelectAnnotation?: (eventId: string) => void;
46
+ }
47
+ export declare function AnamnesisEvolutionGrid({ record, defs, t, editable, onCellChange, compare, framed, defaultOpenNoteVisitId, onOpenNote, visitColumns, capturableKeys, annotations, onSelectAnnotation, }: AnamnesisEvolutionGridProps): import("react/jsx-runtime").JSX.Element;
48
+ //# sourceMappingURL=anamnesis-evolution-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-evolution-grid.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution-grid.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAsBtE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AA0C3B,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,CAAC,EAAE,SAAS,CAAC;IACb,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV;;;gFAG4E;IAC5E,OAAO,CAAC,EAAE;QACR,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;KACnC,GAAG,IAAI,CAAC;IACT;mEAC+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;0DAEsD;IACtD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;gFAC4E;IAC5E,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;yDAEqD;IACrD,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC;;4CAEwC;IACxC,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC;;yEAEqE;IACrE,WAAW,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC7C;;sEAEkE;IAClE,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAID,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,IAAI,EACJ,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,OAAc,EACd,MAAa,EACb,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,GACnB,EAAE,2BAA2B,2CAwL7B"}
@@ -0,0 +1,37 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type PracticeAnamnesisConfig } from './anamnesis-config';
3
+ import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
4
+ export interface AnamnesisEvolutionProps {
5
+ record: AnamnesisRecord;
6
+ t: TFunction;
7
+ editable?: boolean;
8
+ onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
9
+ /** Draw the grid's own border/surface. `false` when this sits inside a card. */
10
+ framed?: boolean;
11
+ /** The practice's configured vocabulary. Omitted = the kit-seeded default. */
12
+ config?: PracticeAnamnesisConfig;
13
+ /** Mount with the compare panel already open. Demo/story hook only —
14
+ * Chromatic skips play functions, so a click-opened panel is never
15
+ * snapshotted. */
16
+ defaultCompareOpen?: boolean;
17
+ /** Mount with this visit selection instead of first + latest. Demo/story
18
+ * hook only, for the same Chromatic reason. */
19
+ defaultVisitIds?: readonly string[];
20
+ /** Mount the compare panel on this set of visits instead of first + latest.
21
+ * Demo/story hook only, for the same Chromatic reason. */
22
+ defaultCompareVisitIds?: readonly string[];
23
+ /** Mount with these events already drawn. Demo/story hook only — the
24
+ * arrival state picks none, and Chromatic skips play functions. */
25
+ defaultEventIds?: readonly string[];
26
+ /** The picker's live selection, whenever it changes (and once on mount).
27
+ * The Diagnosis surface's one export control needs to know which visit
28
+ * columns are on screen — the file must be the view that was asked for. */
29
+ onVisitSelectionChange?: (visitIds: readonly string[]) => void;
30
+ /** The host's side panel. Wired ⇒ a visit's note trigger routes there
31
+ * instead of opening a popover, and turning an event chip on navigates the
32
+ * panel to that event. Omitted ⇒ the note opens in place and the chip only
33
+ * draws its line, which is all a standalone surface can do. */
34
+ onOpenNote?: OpenAnamnesisNote;
35
+ }
36
+ export declare function AnamnesisEvolution({ record, t, editable, onCellChange, framed, config, defaultCompareOpen, defaultVisitIds, defaultCompareVisitIds, defaultEventIds, onVisitSelectionChange, onOpenNote, }: AnamnesisEvolutionProps): import("react/jsx-runtime").JSX.Element;
37
+ //# sourceMappingURL=anamnesis-evolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-evolution.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;sBAEkB;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;mDAC+C;IAC/C,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;8DAC0D;IAC1D,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;uEACmE;IACnE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;+EAE2E;IAC3E,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/D;;;mEAG+D;IAC/D,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,MAAa,EACb,MAAM,EACN,kBAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,UAAU,GACX,EAAE,uBAAuB,2CAmXzB"}
@@ -0,0 +1,10 @@
1
+ import { type CsvDialect, type ExportDocument } from './anamnesis-export';
2
+ /** Hand a Blob to the browser as a download. Returns `false` where there is no
3
+ * DOM to hand it to (SSR, a node test), so callers can fall back rather than
4
+ * throw. */
5
+ export declare function downloadBlob(blob: Blob, filename: string): boolean;
6
+ /** Download the document as a `.csv` in the dialect its locale calls for. */
7
+ export declare function downloadCsv(doc: ExportDocument, dialect?: CsvDialect): boolean;
8
+ /** Download the document as an `.xlsx`. Async: exceljs is dynamic-imported. */
9
+ export declare function downloadXlsx(doc: ExportDocument): Promise<boolean>;
10
+ //# sourceMappingURL=anamnesis-export-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export-download.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export-download.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAC;AAE5B;;YAEY;AACZ,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAqBlE;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CACzB,GAAG,EAAE,cAAc,EACnB,OAAO,GAAE,UAAsC,GAC9C,OAAO,CAET;AAED,+EAA+E;AAC/E,wBAAsB,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAExE"}
@@ -0,0 +1,23 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { PracticeAnamnesisConfig } from './anamnesis-config';
3
+ import type { DisclosureAudience } from './anamnesis-disclosure';
4
+ import { type AnamnesisExportTab } from './anamnesis-export';
5
+ import type { AnamnesisRecord } from './anamnesis-types';
6
+ export interface AnamnesisExportMenuProps {
7
+ /** The tab the surface is showing. The control acts on THIS view. */
8
+ tab: AnamnesisExportTab;
9
+ record: AnamnesisRecord;
10
+ t: TFunction;
11
+ config?: PracticeAnamnesisConfig;
12
+ /** Evolution only: the visit columns the grid is currently showing. */
13
+ shownVisitIds?: readonly string[];
14
+ /** Mount with the menu open. Demo/story hook only — Chromatic skips play
15
+ * functions, so a click-opened menu is never snapshotted. */
16
+ defaultOpen?: boolean;
17
+ /** Mount with the share preview open. Demo/story hook, same reason. */
18
+ defaultShareOpen?: boolean;
19
+ /** Mount on this audience instead of the practice copy. Demo/story hook. */
20
+ defaultAudience?: DisclosureAudience;
21
+ }
22
+ export declare function AnamnesisExportMenu({ tab, record, t, config, shownVisitIds, defaultOpen, defaultShareOpen, defaultAudience, }: AnamnesisExportMenuProps): import("react/jsx-runtime").JSX.Element;
23
+ //# sourceMappingURL=anamnesis-export-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export-menu.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export-menu.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAuBzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASzD,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,GAAG,EAAE,kBAAkB,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,uEAAuE;IACvE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;iEAC6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,MAAM,EACN,CAAC,EACD,MAAM,EACN,aAAa,EACb,WAAmB,EACnB,gBAAwB,EACxB,eAA6B,GAC9B,EAAE,wBAAwB,2CA+U1B"}