@alfadocs/ui-kit 1.138.0 → 1.140.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 (246) hide show
  1. package/dist/_chunks/{address-fields-DvSWdeR0.js → address-fields-Bh9JZJHZ.js} +4 -4
  2. package/dist/_chunks/{ai-prompt-input-CVNeusoW.js → ai-prompt-input-B2QFwuJ1.js} +2 -2
  3. package/dist/_chunks/{anamnesis-summary-rows-Dr2V1Rtf.js → anamnesis-summary-rows-YJGs2uWD.js} +5 -5
  4. package/dist/_chunks/{audio-recorder-BOF5YYoC.js → audio-recorder-6dUq8I38.js} +2 -2
  5. package/dist/_chunks/autocomplete-HZNW7_Pa.js +642 -0
  6. package/dist/_chunks/{balance-badge-cell-BSB02Bwo.js → balance-badge-cell-CRStPNDd.js} +4 -4
  7. package/dist/_chunks/{bill-line-table-By-YL2ms.js → bill-line-table-DTqXdBED.js} +3 -3
  8. package/dist/_chunks/{bishop-score-DWGESRP9.js → bishop-score-M7Fi-ykx.js} +2 -2
  9. package/dist/_chunks/{bmi-calculator-rri5vvMt.js → bmi-calculator-rq3ZsKp0.js} +2 -2
  10. package/dist/_chunks/{calendar-appointment-editor-dialog-SxSkOTnO.js → calendar-appointment-editor-dialog-BBrJlmyd.js} +7 -7
  11. package/dist/_chunks/{calendar-editor-discard-host-DjUhoFr2.js → calendar-editor-discard-host-BcMEgVEq.js} +2 -2
  12. package/dist/_chunks/{calendar-waiting-list-panel-331vzAdl.js → calendar-waiting-list-panel-Cdg9YssA.js} +3 -3
  13. package/dist/_chunks/{calendar.sheets-aodjllWd.js → calendar.sheets-DbMOO7YV.js} +113 -112
  14. package/dist/_chunks/{calls-panel-BIfatK90.js → calls-panel-CtxJAzkJ.js} +2 -2
  15. package/dist/_chunks/{city-input-DXipzTfZ.js → city-input-DARVDJhH.js} +2 -2
  16. package/dist/_chunks/{combobox-BBCVQS-S.js → combobox-BYl6mY4c.js} +12 -13
  17. package/dist/_chunks/{communications-panel-SQ-55e3V.js → communications-panel-DBWM9II9.js} +2 -2
  18. package/dist/_chunks/{country-select-C2GdvRtS.js → country-select-BPISkYVU.js} +3 -3
  19. package/dist/_chunks/{cycle-calculator-WFhMfJHt.js → cycle-calculator-Cb66X2Pf.js} +2 -2
  20. package/dist/_chunks/{data-grid-CxKz8flO.js → data-grid-CRUSZcVT.js} +16 -8
  21. package/dist/_chunks/{data-table-_tgj0C_T.js → data-table-CnLfOwxg.js} +2 -2
  22. package/dist/_chunks/{default-tabs-oDWQzbN7.js → default-tabs-CRbVCDSU.js} +3 -3
  23. package/dist/_chunks/{document-preview-CirR3C_m.js → document-preview-FTCHXYhk.js} +2 -2
  24. package/dist/_chunks/{due-date-calculator-CALlODZe.js → due-date-calculator-Dlqegxx9.js} +2 -2
  25. package/dist/_chunks/{face-scheme-D_Y1StPl.js → face-scheme-Bxt7ZnJn.js} +2 -2
  26. package/dist/_chunks/{fetal-weight-D0KofJJw.js → fetal-weight-DWj-_ME8.js} +2 -2
  27. package/dist/_chunks/{file-manager-CEi4z2i0.js → file-manager-Bsccb8Jj.js} +2 -2
  28. package/dist/_chunks/{forgot-password-form-YvI9vX-G.js → forgot-password-form-B4ufmBFn.js} +5 -4
  29. package/dist/_chunks/{gestational-age-calculator-CHbpC4vL.js → gestational-age-calculator-DXSPWG8u.js} +2 -2
  30. package/dist/_chunks/{hcg-doubling-Dhdt3Jyd.js → hcg-doubling-Dqbj6PQj.js} +2 -2
  31. package/dist/_chunks/{heatmap-_546qI2V.js → heatmap-CFPaEKD_.js} +2 -2
  32. package/dist/_chunks/{invoice-upload-list-CQI9MUl6.js → invoice-upload-list-BR6vycF7.js} +3 -3
  33. package/dist/_chunks/{kit-extensions-BNBf4m8O.js → kit-extensions-QddOSnIq.js} +7 -7
  34. package/dist/_chunks/{link-cell-renderer-Xx5T8u5Q.js → link-cell-renderer-hAJplRFF.js} +6 -6
  35. package/dist/_chunks/{login-dev-card-Dz3ezx1o.js → login-dev-card-oRh9h7N2.js} +18 -17
  36. package/dist/_chunks/medication-I6QvOq6k.js +21 -0
  37. package/dist/_chunks/medication-line-BohqbCYD.js +238 -0
  38. package/dist/_chunks/medication-search-DoEDakoM.js +380 -0
  39. package/dist/_chunks/{multi-select-Df3R8lv_.js → multi-select-DeMiHm8T.js} +4 -5
  40. package/dist/_chunks/{muscle-scheme-D_rSyGDj.js → muscle-scheme-BB2eBfww.js} +2 -2
  41. package/dist/_chunks/normalize-diacritics-DhJjQ3Bp.js +7 -0
  42. package/dist/_chunks/{notes-panel-DsEKNtsw.js → notes-panel-CnmQqhwq.js} +2 -2
  43. package/dist/_chunks/{number-input-DUSvP7Dq.js → number-input-Bi5Yk6PX.js} +135 -133
  44. package/dist/_chunks/{optical-prescription-DaSbsh4p.js → optical-prescription-GzeK_2cf.js} +3 -3
  45. package/dist/_chunks/{option-row-Dc7BrbK8.js → option-row-DpCnuUqo.js} +25 -12
  46. package/dist/_chunks/{patient-account-settings-Cs9y-pVA.js → patient-account-settings-DfEPHmCh.js} +2 -2
  47. package/dist/_chunks/{patient-check-in-resume-4qi_klQV.js → patient-check-in-resume-TWs8CPQr.js} +3 -3
  48. package/dist/_chunks/{patient-details-Dv7EiTCo.js → patient-details-D0PjzALT.js} +2 -2
  49. package/dist/_chunks/{patient-field-row-DuHWGlLz.js → patient-field-row-DlpIModg.js} +7 -7
  50. package/dist/_chunks/patient-picker-CQNsqYn2.js +163 -0
  51. package/dist/_chunks/{patient-search-DBvLFArV.js → patient-search-aTFd7p9s.js} +2 -2
  52. package/dist/_chunks/{patient-summary-card-D-cDzOim.js → patient-summary-card-BP_K7g_q.js} +2 -2
  53. package/dist/_chunks/{phone-input-BL8Sj6OG.js → phone-input-DRKcJUi4.js} +2 -2
  54. package/dist/_chunks/{portal-details-BGc_FLQk.js → portal-details-VfeOI4PB.js} +2 -2
  55. package/dist/_chunks/{portal-documents-BSI1U5lI.js → portal-documents-hGHlwmbv.js} +2 -2
  56. package/dist/_chunks/{pregnancy-dating-lJbzai73.js → pregnancy-dating-a6WIg4oy.js} +3 -3
  57. package/dist/_chunks/{pregnancy-weight-gain-DkGcEc_l.js → pregnancy-weight-gain-DmrVHk9y.js} +2 -2
  58. package/dist/_chunks/prescription-history-Bp_JHhdF.js +1719 -0
  59. package/dist/_chunks/print-sheet-gaxObGcm.js +328 -0
  60. package/dist/_chunks/{province-select-CTM8A9SM.js → province-select-D-iY9bQG.js} +3 -3
  61. package/dist/_chunks/{registration-form-CuLiTA52.js → registration-form-Cs9o6e5q.js} +7 -6
  62. package/dist/_chunks/{reserved.agent-CabZHFJC.js → reserved.agent-L2ElYPuj.js} +7 -7
  63. package/dist/_chunks/{reset-password-form-D_TePSM1.js → reset-password-form-DwtSNhnA.js} +18 -17
  64. package/dist/_chunks/{rich-text-editor-C48omVjq.js → rich-text-editor-DFsH5RAj.js} +2 -2
  65. package/dist/_chunks/save-Dn8uje3f.js +22 -0
  66. package/dist/_chunks/{search-bar-CQ9_V3EJ.js → search-bar-k1mS5yZl.js} +2 -2
  67. package/dist/_chunks/{select-CIXKyUMw.js → select-Bm8s3q-X.js} +16 -17
  68. package/dist/_chunks/{send-registration-link-form-BjkXr0TD.js → send-registration-link-form-C1vw6H1M.js} +6 -5
  69. package/dist/_chunks/{signature-request-vJDSHZld.js → signature-request-D3sLLOM6.js} +2 -2
  70. package/dist/_chunks/sync-tray-BhnkgXKK.js +567 -0
  71. package/dist/_chunks/{tabs-Czkmw5ou.js → tabs-BXr5XeGq.js} +2 -2
  72. package/dist/_chunks/{task-editor-wKbFbGqW.js → task-editor-DDVDPKJf.js} +26 -25
  73. package/dist/_chunks/{tasks-panel-DbtJS4QI.js → tasks-panel-BHXaPNOZ.js} +2 -2
  74. package/dist/_chunks/{toolbar-DjG-cpD_.js → toolbar-B7UHCMSr.js} +2 -2
  75. package/dist/_chunks/{unit-converter-CUAUTu2B.js → unit-converter-OBhSDXee.js} +3 -3
  76. package/dist/_chunks/{use-appointment-details-read-jGkJalX8.js → use-appointment-details-read-DeQnmmZw.js} +2 -2
  77. package/dist/_chunks/use-error-summary-CecJZo6w.js +32 -0
  78. package/dist/_chunks/use-registration-submit-CVukOAQk.js +84 -0
  79. package/dist/_chunks/{variables-menu-DQl8H4Gh.js → variables-menu-C4NcClKi.js} +2 -2
  80. package/dist/_chunks/{voice-control-panel-Cp4vs1iy.js → voice-control-panel-Dc_NFH2R.js} +2 -2
  81. package/dist/agent-catalog.json +449 -1
  82. package/dist/agent-i18n/en.json +53 -0
  83. package/dist/appointment-editor-panel/index.js +2 -2
  84. package/dist/browser-support.js +1 -1
  85. package/dist/components/_shared/medication.d.ts +28 -0
  86. package/dist/components/_shared/normalize-diacritics.d.ts +5 -0
  87. package/dist/components/_shared/patient-picker.d.ts +7 -0
  88. package/dist/components/address-fields/index.js +1 -1
  89. package/dist/components/ai-prompt-input/index.js +1 -1
  90. package/dist/components/appointment-details-panel/index.js +1 -1
  91. package/dist/components/audio-recorder/index.js +1 -1
  92. package/dist/components/autocomplete/autocomplete.d.ts +50 -0
  93. package/dist/components/autocomplete/index.d.ts +1 -1
  94. package/dist/components/autocomplete/index.js +1 -1
  95. package/dist/components/bill-line-table/index.js +1 -1
  96. package/dist/components/bill-table/index.js +1 -1
  97. package/dist/components/bishop-score/index.js +1 -1
  98. package/dist/components/bmi-calculator/index.js +1 -1
  99. package/dist/components/booking/index.js +1 -1
  100. package/dist/components/calls-panel/index.js +1 -1
  101. package/dist/components/city-input/index.js +1 -1
  102. package/dist/components/combobox/index.js +1 -1
  103. package/dist/components/communications-panel/index.js +1 -1
  104. package/dist/components/country-select/index.js +1 -1
  105. package/dist/components/cycle-calculator/index.js +1 -1
  106. package/dist/components/data-grid/index.js +2 -2
  107. package/dist/components/data-table/index.js +2 -2
  108. package/dist/components/document-preview/index.js +1 -1
  109. package/dist/components/due-date-calculator/index.js +1 -1
  110. package/dist/components/face-scheme/index.js +1 -1
  111. package/dist/components/fetal-weight/index.js +1 -1
  112. package/dist/components/file-manager/index.js +1 -1
  113. package/dist/components/gestational-age-calculator/index.js +1 -1
  114. package/dist/components/hcg-doubling/index.js +1 -1
  115. package/dist/components/heatmap/index.js +1 -1
  116. package/dist/components/index.d.ts +5 -0
  117. package/dist/components/invoice-upload-list/index.js +1 -1
  118. package/dist/components/medication-line/index.d.ts +6 -0
  119. package/dist/components/medication-line/index.js +7 -0
  120. package/dist/components/medication-line/medication-line.agent.d.ts +14 -0
  121. package/dist/components/medication-line/medication-line.d.ts +46 -0
  122. package/dist/components/medication-search/index.d.ts +6 -0
  123. package/dist/components/medication-search/index.js +10 -0
  124. package/dist/components/medication-search/medication-search.agent.d.ts +15 -0
  125. package/dist/components/medication-search/medication-search.d.ts +49 -0
  126. package/dist/components/multi-select/index.js +1 -1
  127. package/dist/components/muscle-scheme/index.js +1 -1
  128. package/dist/components/notes-panel/index.js +1 -1
  129. package/dist/components/number-input/index.js +1 -1
  130. package/dist/components/optical-prescription/index.js +1 -1
  131. package/dist/components/patient-details/index.js +1 -1
  132. package/dist/components/patient-search/index.js +1 -1
  133. package/dist/components/patient-summary-card/index.js +1 -1
  134. package/dist/components/patient-table/index.js +1 -1
  135. package/dist/components/phone-input/index.js +1 -1
  136. package/dist/components/pregnancy-dating/index.js +1 -1
  137. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  138. package/dist/components/print-sheet/index.d.ts +5 -0
  139. package/dist/components/print-sheet/index.js +6 -0
  140. package/dist/components/print-sheet/print-isolation.d.ts +17 -0
  141. package/dist/components/print-sheet/print-sheet.agent.d.ts +19 -0
  142. package/dist/components/print-sheet/print-sheet.d.ts +61 -0
  143. package/dist/components/province-select/index.js +1 -1
  144. package/dist/components/rich-text-editor/index.js +2 -2
  145. package/dist/components/search-bar/index.js +1 -1
  146. package/dist/components/select/index.js +1 -1
  147. package/dist/components/skeleton-scheme/index.js +1 -1
  148. package/dist/components/sync-tray/index.d.ts +4 -0
  149. package/dist/components/sync-tray/index.js +7 -0
  150. package/dist/components/sync-tray/sync-tray.agent.d.ts +15 -0
  151. package/dist/components/sync-tray/sync-tray.d.ts +77 -0
  152. package/dist/components/tabs/index.js +1 -1
  153. package/dist/components/task-editor/index.js +1 -1
  154. package/dist/components/tasks-panel/index.js +1 -1
  155. package/dist/components/unit-converter/index.js +1 -1
  156. package/dist/components/variables-menu/index.js +1 -1
  157. package/dist/components/voice-control-panel/index.js +1 -1
  158. package/dist/core.css +1 -1
  159. package/dist/find-free-slots-panel/index.js +1 -1
  160. package/dist/host-compat.css +18 -1
  161. package/dist/i18n/locales/ar.d.ts +151 -0
  162. package/dist/i18n/locales/ar.js +151 -0
  163. package/dist/i18n/locales/de.d.ts +151 -0
  164. package/dist/i18n/locales/de.js +151 -0
  165. package/dist/i18n/locales/el.d.ts +151 -0
  166. package/dist/i18n/locales/el.js +151 -0
  167. package/dist/i18n/locales/en.d.ts +151 -0
  168. package/dist/i18n/locales/en.js +151 -0
  169. package/dist/i18n/locales/es.d.ts +151 -0
  170. package/dist/i18n/locales/es.js +151 -0
  171. package/dist/i18n/locales/fr.d.ts +151 -0
  172. package/dist/i18n/locales/fr.js +151 -0
  173. package/dist/i18n/locales/hi.d.ts +151 -0
  174. package/dist/i18n/locales/hi.js +151 -0
  175. package/dist/i18n/locales/it.d.ts +151 -0
  176. package/dist/i18n/locales/it.js +151 -0
  177. package/dist/i18n/locales/ja.d.ts +151 -0
  178. package/dist/i18n/locales/ja.js +151 -0
  179. package/dist/i18n/locales/nl.d.ts +151 -0
  180. package/dist/i18n/locales/nl.js +151 -0
  181. package/dist/i18n/locales/pl.d.ts +151 -0
  182. package/dist/i18n/locales/pl.js +151 -0
  183. package/dist/i18n/locales/pt.d.ts +151 -0
  184. package/dist/i18n/locales/pt.js +151 -0
  185. package/dist/i18n/locales/ro.d.ts +151 -0
  186. package/dist/i18n/locales/ro.js +151 -0
  187. package/dist/i18n/locales/ru.d.ts +151 -0
  188. package/dist/i18n/locales/ru.js +151 -0
  189. package/dist/i18n/locales/sq.d.ts +151 -0
  190. package/dist/i18n/locales/sq.js +151 -0
  191. package/dist/i18n/locales/sv.d.ts +151 -0
  192. package/dist/i18n/locales/sv.js +151 -0
  193. package/dist/i18n/locales/tr.d.ts +151 -0
  194. package/dist/i18n/locales/tr.js +151 -0
  195. package/dist/i18n/locales/zh.d.ts +151 -0
  196. package/dist/i18n/locales/zh.js +151 -0
  197. package/dist/index.js +1006 -978
  198. package/dist/locales/ar.json +151 -0
  199. package/dist/locales/de.json +151 -0
  200. package/dist/locales/el.json +151 -0
  201. package/dist/locales/en.json +151 -0
  202. package/dist/locales/es.json +151 -0
  203. package/dist/locales/fr.json +151 -0
  204. package/dist/locales/hi.json +151 -0
  205. package/dist/locales/it.json +151 -0
  206. package/dist/locales/ja.json +151 -0
  207. package/dist/locales/nl.json +151 -0
  208. package/dist/locales/pl.json +151 -0
  209. package/dist/locales/pt.json +151 -0
  210. package/dist/locales/ro.json +151 -0
  211. package/dist/locales/ru.json +151 -0
  212. package/dist/locales/sq.json +151 -0
  213. package/dist/locales/sv.json +151 -0
  214. package/dist/locales/tr.json +151 -0
  215. package/dist/locales/zh.json +151 -0
  216. package/dist/online-bookings-panel/index.js +1 -1
  217. package/dist/patterns/anamnesis/index.js +1 -1
  218. package/dist/patterns/calendar/index.js +3 -3
  219. package/dist/patterns/forgot-password-form/index.js +1 -1
  220. package/dist/patterns/login-form/index.js +1 -1
  221. package/dist/patterns/patient-account-settings/index.js +1 -1
  222. package/dist/patterns/patient-check-in/index.js +1 -1
  223. package/dist/patterns/patient-portal/index.js +2 -2
  224. package/dist/patterns/prescription/index.d.ts +11 -0
  225. package/dist/patterns/prescription/index.js +13 -0
  226. package/dist/patterns/prescription/prescription-composer-errors.d.ts +6 -0
  227. package/dist/patterns/prescription/prescription-composer-item.d.ts +41 -0
  228. package/dist/patterns/prescription/prescription-composer.d.ts +94 -0
  229. package/dist/patterns/prescription/prescription-history.d.ts +48 -0
  230. package/dist/patterns/prescription/prescription-patient-block.d.ts +13 -0
  231. package/dist/patterns/prescription/prescription-sheet.d.ts +71 -0
  232. package/dist/patterns/prescription/prescription-status-badge.d.ts +5 -0
  233. package/dist/patterns/prescription/prescription-types.d.ts +122 -0
  234. package/dist/patterns/prescription/prescription-validation.d.ts +46 -0
  235. package/dist/patterns/registration-form/index.js +1 -1
  236. package/dist/patterns/reset-password-form/index.js +1 -1
  237. package/dist/patterns/send-registration-link-form/index.js +1 -1
  238. package/dist/patterns/signature-request/index.js +1 -1
  239. package/dist/tokens.css +1 -1
  240. package/dist/waiting-list-panel/index.js +2 -2
  241. package/package.json +21 -1
  242. package/dist/_chunks/autocomplete-D10ydpgi.js +0 -562
  243. package/dist/_chunks/group-options-BvKhQ3xb.js +0 -16
  244. package/dist/_chunks/normalize-diacritics-BNGbFNlJ.js +0 -7
  245. package/dist/_chunks/patient-picker-BZJuOgMw.js +0 -173
  246. package/dist/_chunks/use-registration-submit-CLGHxwoT.js +0 -112
@@ -0,0 +1,71 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import type { PrescriptionRecord } from './prescription-types';
3
+ export type PrescriptionSheetAction = 'resend' | 'print' | 'downloadPdf' | 'sendEmail' | 'sendSms' | 'sendWhatsApp';
4
+ type ActionHandler = (record: PrescriptionRecord) => void | Promise<void>;
5
+ export interface PrescriptionSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
6
+ record: PrescriptionRecord;
7
+ /** Letterhead slot, passed to PrintSheet's header. The kit ships no practice data. */
8
+ practiceHeader?: ReactNode;
9
+ /** Paper size. Default 'a4'. */
10
+ size?: 'a4' | 'a5';
11
+ /** 'compact' tightens the sheet for print. Default 'default'. */
12
+ density?: 'default' | 'compact';
13
+ /** Label printed before a medication code, for example "AIC". */
14
+ codeLabel?: string;
15
+ /** Masks the patient's identity. The sheet prints exactly what it shows. */
16
+ privacyMode?: boolean;
17
+ /**
18
+ * Print only this sheet when the user prints from the browser itself
19
+ * (Ctrl or Cmd+P). Off by default, so other prints on the page are not taken
20
+ * over. Only in `printMode="sheet"`: the Print button and `handle.print()`
21
+ * print only the sheet. In host mode the kit never prints, so this does
22
+ * nothing there (it is forced off).
23
+ */
24
+ isolateBrowserPrint?: boolean;
25
+ /**
26
+ * Who prints. `'host'`: the Print action only calls `onPrint(record)`, and
27
+ * your app opens the official document the registry issues; the kit does
28
+ * not print the sheet, which is an on-screen summary (a note says so).
29
+ * `'sheet'`: the kit prints the sheet through PrintSheet, then calls
30
+ * `onPrint(record)`. Default `'host'` when the record has a `sendStatus`
31
+ * (an electronic prescription) and `'sheet'` when it has none.
32
+ */
33
+ printMode?: 'host' | 'sheet';
34
+ /** Replaces the label of the PIN line. Default "PIN". Already translated. */
35
+ pinLabel?: string;
36
+ /** Replaces the label of the prescription number line, for example "NRBE". Default "Prescription number". Already translated. */
37
+ numberLabel?: string;
38
+ /** Each share button renders ONLY when its callback is passed. */
39
+ /**
40
+ * Given: a Print button. In `'host'` print mode it only calls
41
+ * `onPrint(record)`. In `'sheet'` mode the kit prints this sheet through
42
+ * PrintSheet (the browser print dialog, only the sheet), then calls it.
43
+ */
44
+ onPrint?: ActionHandler;
45
+ onDownloadPdf?: ActionHandler;
46
+ onSendEmail?: ActionHandler;
47
+ onSendSms?: ActionHandler;
48
+ onSendWhatsApp?: ActionHandler;
49
+ /**
50
+ * Given: a failed send shows "Send again". A promise puts the button in its
51
+ * loading state until it settles. The host sends and passes the updated
52
+ * record.
53
+ */
54
+ onResend?: ActionHandler;
55
+ id?: string;
56
+ }
57
+ export interface PrescriptionSheetHandle {
58
+ /**
59
+ * Print mode `'sheet'`: prints only the sheet, whether or not `onPrint` is
60
+ * passed (and does not call it). Print mode `'host'`: calls `onPrint(record)`
61
+ * and does nothing without it; the kit prints nothing. In both modes it does
62
+ * nothing while the send is under way or failed.
63
+ */
64
+ print(): void;
65
+ getRecordId(): string;
66
+ /** Moves focus to the sheet's title, after a change of view. */
67
+ focusTitle(): void;
68
+ }
69
+ export declare const PrescriptionSheet: import("react").ForwardRefExoticComponent<PrescriptionSheetProps & import("react").RefAttributes<PrescriptionSheetHandle>>;
70
+ export {};
71
+ //# sourceMappingURL=prescription-sheet.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { PrescriptionSendStatus } from './prescription-types';
2
+ export declare function PrescriptionStatusBadge({ status, }: {
3
+ status: PrescriptionSendStatus;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=prescription-status-badge.d.ts.map
@@ -0,0 +1,122 @@
1
+ import type { MedicationOption } from '../../components/_shared/medication';
2
+ export type { MedicationOption };
3
+ /** The patient a prescription is for. Every field here is personal data and
4
+ * is masked under privacy mode. */
5
+ export interface PrescriptionPatient {
6
+ id: string;
7
+ firstName: string;
8
+ lastName: string;
9
+ /** Calendar date, `YYYY-MM-DD`. Formatted for the active locale. */
10
+ dateOfBirth?: string;
11
+ /** Italian codice fiscale, or the host market's equivalent. */
12
+ fiscalCode?: string;
13
+ }
14
+ /** Someone allowed to prescribe. There are no "doctor" or "secretary"
15
+ * roles here: the host lists only the people with the permission. */
16
+ export interface PrescriptionPrescriber {
17
+ id: string;
18
+ /** Display name, with any title the host wants printed. */
19
+ name: string;
20
+ specialty?: string;
21
+ /** The prescriber's own tax code: platform `DoctorOperator.italianFiscalCode`. The host needs it to send to the registry; the kit only shows it. Staff data, not masked. */
22
+ fiscalCode?: string;
23
+ /** The prescriber's registration number with the professional order: platform `DoctorOperator.professionalRegistrationNumber`. The host needs it to send to the registry; the kit only shows it. */
24
+ registrationNumber?: string;
25
+ }
26
+ /** A treatment of the patient, as the Treatment select lists it. Every
27
+ * prescription is for one treatment.
28
+ * A treatment inside a care plan is the platform's `DoctorCarePlanEntry`,
29
+ * and `carePlan` its `DoctorCarePlan`. A treatment without a care plan is not
30
+ * yet mapped to a platform entity: the kit treats ids as opaque, and they
31
+ * must be unique within the list. */
32
+ export interface PrescriptionTreatmentOption {
33
+ id: string;
34
+ label: string;
35
+ /** The care plan the treatment belongs to, when it belongs to one. */
36
+ carePlan?: {
37
+ id: string;
38
+ label: string;
39
+ };
40
+ }
41
+ /** The treatment a saved prescription is for: the same shape as the option
42
+ * the composer lists. */
43
+ export type PrescriptionTreatment = PrescriptionTreatmentOption;
44
+ /** One medication line of a draft. */
45
+ export interface PrescriptionItem {
46
+ /** Catalogue id. Empty while the line has no medication yet. */
47
+ medicationId: string;
48
+ /** How and when to take it. Required to save. */
49
+ dosage: string;
50
+ /** Optional free text. */
51
+ notes: string;
52
+ /** Whole packs, at least 1. A new line starts at 1; required on every line that is not blank. */
53
+ quantity: number;
54
+ /** The medicine may not be replaced by another with the same active ingredient. Only possible when the medication has a code (the specification allows it only when the medicine is identified by its code). */
55
+ notSubstitutable: boolean;
56
+ /** Optional free text: how long the therapy lasts, for example "6 days". */
57
+ duration: string;
58
+ }
59
+ /** What the composer edits and hands to `onSubmit`. Ids only: the host
60
+ * resolves them. */
61
+ export interface PrescriptionDraft {
62
+ /** Empty while no patient is chosen. */
63
+ patientId: string;
64
+ /** Empty while no prescriber is chosen. */
65
+ prescriberId: string;
66
+ /** The treatment the prescription is for. Empty while none is chosen. Required to save. */
67
+ treatmentId: string;
68
+ items: PrescriptionItem[];
69
+ }
70
+ /** One line of a saved prescription, resolved so it can be shown and
71
+ * printed without a lookup. */
72
+ export interface PrescriptionRecordItem {
73
+ medication: MedicationOption;
74
+ dosage: string;
75
+ notes?: string;
76
+ /** Whole packs. */
77
+ quantity: number;
78
+ notSubstitutable?: boolean;
79
+ duration?: string;
80
+ }
81
+ /** Where a prescription is in its send to the national registry. */
82
+ export type PrescriptionSendStatus = 'sending' | 'sent' | 'failed';
83
+ /** A saved prescription, as the host returns it from `onSubmit`. It is
84
+ * self-contained: the sheet and the history need nothing else.
85
+ *
86
+ * The kit sends nothing. The host's `onSubmit` creates the prescription and
87
+ * sends it, and returns the record in whatever state it is then in; the host
88
+ * passes the updated record when the send settles. The four send fields are
89
+ * optional, so a host that sends prescriptions nowhere is unaffected. */
90
+ export interface PrescriptionRecord {
91
+ id: string;
92
+ /** ISO 8601 instant the prescription was saved. */
93
+ createdAt: string;
94
+ patient: PrescriptionPatient;
95
+ prescriber: PrescriptionPrescriber;
96
+ /** The treatment the prescription is for, resolved, with its care plan if it has one. */
97
+ treatment: PrescriptionTreatment;
98
+ items: PrescriptionRecordItem[];
99
+ /** The number the registry gave the prescription (Italy: NRBE). Present once it is sent. */
100
+ number?: string;
101
+ /** The PIN the registry returns with the number. With the number and the patient's tax code it is what the pharmacy needs. Sensitive: shown on the sheet only, never in a `data-*` attribute or agent state. */
102
+ pin?: string;
103
+ /** State of the send to the national registry (Italy: Sistema TS). Omit when the host sends prescriptions nowhere. */
104
+ sendStatus?: PrescriptionSendStatus;
105
+ /** ISO 8601 instant it was sent. */
106
+ sentAt?: string;
107
+ /** Host message for a failed send, already translated. */
108
+ sendError?: string;
109
+ }
110
+ /** Host medication search, as `MedicationSearch` calls it. */
111
+ export type PrescriptionMedicationSearch = (query: string, options: {
112
+ signal: AbortSignal;
113
+ locale: string;
114
+ }) => Promise<readonly MedicationOption[]>;
115
+ /** Host patient search. Reject on failure; `[]` is no match. */
116
+ export type PrescriptionPatientSearch = (query: string, options: {
117
+ signal: AbortSignal;
118
+ }) => Promise<readonly PrescriptionPatient[]>;
119
+ export declare const EMPTY_PRESCRIPTION_ITEM: Readonly<PrescriptionItem>;
120
+ /** A draft with no patient and one empty line, ready to fill. */
121
+ export declare function createEmptyPrescriptionDraft(prescriberId?: string): PrescriptionDraft;
122
+ //# sourceMappingURL=prescription-types.d.ts.map
@@ -0,0 +1,46 @@
1
+ import type { PrescriptionDraft, PrescriptionItem, PrescriptionTreatmentOption } from './prescription-types';
2
+ /** Why a field was refused. `invalid` is a treatment that is not one of the
3
+ * patient's treatments. */
4
+ export type PrescriptionFieldError = 'required' | 'invalid';
5
+ export interface PrescriptionItemErrors {
6
+ medicationId?: 'required';
7
+ dosage?: 'required';
8
+ /** `required`: empty or not a number. `invalid`: below 1 or not whole. */
9
+ quantity?: PrescriptionFieldError;
10
+ }
11
+ export interface PrescriptionDraftErrors {
12
+ patientId?: 'required';
13
+ prescriberId?: 'required';
14
+ treatmentId?: PrescriptionFieldError;
15
+ /** No line names a medication. */
16
+ items?: 'required';
17
+ /** One entry per draft line, in order; `undefined` for a valid line. */
18
+ itemErrors?: (PrescriptionItemErrors | undefined)[];
19
+ }
20
+ export interface PrescriptionValidationOptions {
21
+ /** The chosen patient's treatments. When given, a treatment that is not in
22
+ * the list is `invalid`. */
23
+ treatmentOptions?: readonly PrescriptionTreatmentOption[];
24
+ /**
25
+ * The patient `treatmentOptions` belongs to. While the host reloads the list
26
+ * after a patient change, the list is still the previous patient's: when this
27
+ * differs from the draft's `patientId`, a non-empty treatment is `invalid`.
28
+ */
29
+ treatmentOptionsPatientId?: string;
30
+ }
31
+ /** True for a line the user has not touched: nothing to validate or save. */
32
+ export declare function isBlankPrescriptionItem(item: PrescriptionItem): boolean;
33
+ /**
34
+ * Checks a draft. Returns an empty object when it can be saved.
35
+ *
36
+ * Rules: a patient, a prescriber, a treatment of the patient and
37
+ * at least one medication line. Every line that is not blank needs a
38
+ * medication, a dosage and a whole number of packs of 1 or more. Blank lines are ignored, except that a draft of
39
+ * only blank lines has no medication at all, and its first line is marked.
40
+ */
41
+ export declare function validatePrescriptionDraft(draft: PrescriptionDraft, options?: PrescriptionValidationOptions): PrescriptionDraftErrors;
42
+ export declare function isPrescriptionDraftValid(errors: PrescriptionDraftErrors): boolean;
43
+ /** The draft as it is saved: blank lines dropped, text trimmed. Call it only
44
+ * on a draft that passed `validatePrescriptionDraft`. */
45
+ export declare function normalisePrescriptionDraft(draft: PrescriptionDraft): PrescriptionDraft;
46
+ //# sourceMappingURL=prescription-validation.d.ts.map
@@ -1,4 +1,4 @@
1
- import { R as o, a as r } from "../../_chunks/registration-form-CuLiTA52.js";
1
+ import { R as o, a as r } from "../../_chunks/registration-form-Cs9o6e5q.js";
2
2
  export {
3
3
  o as REGISTRATION_FORM_FIELDS,
4
4
  r as RegistrationForm
@@ -1,4 +1,4 @@
1
- import { R as a, a as o } from "../../_chunks/reset-password-form-D_TePSM1.js";
1
+ import { R as a, a as o } from "../../_chunks/reset-password-form-DwtSNhnA.js";
2
2
  export {
3
3
  a as RESET_PASSWORD_FORM_FIELDS,
4
4
  o as ResetPasswordForm
@@ -1,4 +1,4 @@
1
- import { S as o, a as r } from "../../_chunks/send-registration-link-form-BjkXr0TD.js";
1
+ import { S as o, a as r } from "../../_chunks/send-registration-link-form-C1vw6H1M.js";
2
2
  export {
3
3
  o as SEND_REGISTRATION_LINK_FIELDS,
4
4
  r as SendRegistrationLinkForm
@@ -1,4 +1,4 @@
1
- import { S as o } from "../../_chunks/signature-request-vJDSHZld.js";
1
+ import { S as o } from "../../_chunks/signature-request-D3sLLOM6.js";
2
2
  export {
3
3
  o as SignatureRequestModal
4
4
  };