@alfadocs/ui-kit 1.138.0 → 1.139.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 (232) 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-BgfBnjp0.js} +4 -4
  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-CRrIv2hy.js} +4 -4
  7. package/dist/_chunks/{bill-line-table-By-YL2ms.js → bill-line-table-DCqxhode.js} +3 -3
  8. package/dist/_chunks/{bishop-score-DWGESRP9.js → bishop-score-M7Fi-ykx.js} +2 -2
  9. package/dist/_chunks/{calendar-appointment-editor-dialog-SxSkOTnO.js → calendar-appointment-editor-dialog-GdnaPIOV.js} +7 -7
  10. package/dist/_chunks/{calendar-editor-discard-host-DjUhoFr2.js → calendar-editor-discard-host-BcMEgVEq.js} +2 -2
  11. package/dist/_chunks/{calendar-waiting-list-panel-331vzAdl.js → calendar-waiting-list-panel-CkZBAv_E.js} +3 -3
  12. package/dist/_chunks/{calendar.sheets-aodjllWd.js → calendar.sheets-B0jP2Yt0.js} +112 -111
  13. package/dist/_chunks/{calls-panel-BIfatK90.js → calls-panel-CtxJAzkJ.js} +2 -2
  14. package/dist/_chunks/{city-input-DXipzTfZ.js → city-input-DARVDJhH.js} +2 -2
  15. package/dist/_chunks/{combobox-BBCVQS-S.js → combobox-BYl6mY4c.js} +12 -13
  16. package/dist/_chunks/{communications-panel-SQ-55e3V.js → communications-panel-DBWM9II9.js} +2 -2
  17. package/dist/_chunks/{country-select-C2GdvRtS.js → country-select-BPISkYVU.js} +3 -3
  18. package/dist/_chunks/{data-grid-CxKz8flO.js → data-grid-bQ6iFm10.js} +15 -7
  19. package/dist/_chunks/{data-table-_tgj0C_T.js → data-table-CnLfOwxg.js} +2 -2
  20. package/dist/_chunks/{default-tabs-oDWQzbN7.js → default-tabs-Dm_vk6hd.js} +3 -3
  21. package/dist/_chunks/{document-preview-CirR3C_m.js → document-preview-FTCHXYhk.js} +2 -2
  22. package/dist/_chunks/{face-scheme-D_Y1StPl.js → face-scheme-Bxt7ZnJn.js} +2 -2
  23. package/dist/_chunks/{file-manager-CEi4z2i0.js → file-manager-Bsccb8Jj.js} +2 -2
  24. package/dist/_chunks/{forgot-password-form-YvI9vX-G.js → forgot-password-form-B4ufmBFn.js} +5 -4
  25. package/dist/_chunks/{gestational-age-calculator-CHbpC4vL.js → gestational-age-calculator-DXSPWG8u.js} +2 -2
  26. package/dist/_chunks/{heatmap-_546qI2V.js → heatmap-CFPaEKD_.js} +2 -2
  27. package/dist/_chunks/{invoice-upload-list-CQI9MUl6.js → invoice-upload-list-Dz3CXHPP.js} +3 -3
  28. package/dist/_chunks/{kit-extensions-BNBf4m8O.js → kit-extensions-BB_ksnVl.js} +3 -3
  29. package/dist/_chunks/{link-cell-renderer-Xx5T8u5Q.js → link-cell-renderer-CSA0KKPe.js} +5 -5
  30. package/dist/_chunks/{login-dev-card-Dz3ezx1o.js → login-dev-card-oRh9h7N2.js} +18 -17
  31. package/dist/_chunks/medication-I6QvOq6k.js +21 -0
  32. package/dist/_chunks/medication-line-CHdlh-F7.js +222 -0
  33. package/dist/_chunks/medication-search-DoEDakoM.js +380 -0
  34. package/dist/_chunks/{multi-select-Df3R8lv_.js → multi-select-DeMiHm8T.js} +4 -5
  35. package/dist/_chunks/{muscle-scheme-D_rSyGDj.js → muscle-scheme-BB2eBfww.js} +2 -2
  36. package/dist/_chunks/normalize-diacritics-DhJjQ3Bp.js +7 -0
  37. package/dist/_chunks/{notes-panel-DsEKNtsw.js → notes-panel-CnmQqhwq.js} +2 -2
  38. package/dist/_chunks/{optical-prescription-DaSbsh4p.js → optical-prescription-C4jpDFOE.js} +2 -2
  39. package/dist/_chunks/{option-row-Dc7BrbK8.js → option-row-DpCnuUqo.js} +25 -12
  40. package/dist/_chunks/{patient-account-settings-Cs9y-pVA.js → patient-account-settings-DfEPHmCh.js} +2 -2
  41. package/dist/_chunks/{patient-check-in-resume-4qi_klQV.js → patient-check-in-resume-TWs8CPQr.js} +3 -3
  42. package/dist/_chunks/{patient-details-Dv7EiTCo.js → patient-details-DQTxSWY4.js} +2 -2
  43. package/dist/_chunks/{patient-field-row-DuHWGlLz.js → patient-field-row-CXuWQeQJ.js} +6 -6
  44. package/dist/_chunks/patient-picker-CQNsqYn2.js +163 -0
  45. package/dist/_chunks/{patient-search-DBvLFArV.js → patient-search-aTFd7p9s.js} +2 -2
  46. package/dist/_chunks/{patient-summary-card-D-cDzOim.js → patient-summary-card-j5u7c5Us.js} +2 -2
  47. package/dist/_chunks/{phone-input-BL8Sj6OG.js → phone-input-DRKcJUi4.js} +2 -2
  48. package/dist/_chunks/{portal-details-BGc_FLQk.js → portal-details-VfeOI4PB.js} +2 -2
  49. package/dist/_chunks/{portal-documents-BSI1U5lI.js → portal-documents-hGHlwmbv.js} +2 -2
  50. package/dist/_chunks/{pregnancy-dating-lJbzai73.js → pregnancy-dating-C-3NLI6K.js} +2 -2
  51. package/dist/_chunks/prescription-history-748qDVwZ.js +1544 -0
  52. package/dist/_chunks/print-sheet-CSeqkM3_.js +318 -0
  53. package/dist/_chunks/{province-select-CTM8A9SM.js → province-select-D-iY9bQG.js} +3 -3
  54. package/dist/_chunks/{registration-form-CuLiTA52.js → registration-form-Cs9o6e5q.js} +7 -6
  55. package/dist/_chunks/{reserved.agent-CabZHFJC.js → reserved.agent-L2ElYPuj.js} +7 -7
  56. package/dist/_chunks/{reset-password-form-D_TePSM1.js → reset-password-form-DwtSNhnA.js} +18 -17
  57. package/dist/_chunks/{rich-text-editor-C48omVjq.js → rich-text-editor-DFsH5RAj.js} +2 -2
  58. package/dist/_chunks/save-Dn8uje3f.js +22 -0
  59. package/dist/_chunks/{search-bar-CQ9_V3EJ.js → search-bar-k1mS5yZl.js} +2 -2
  60. package/dist/_chunks/{select-CIXKyUMw.js → select-Bm8s3q-X.js} +16 -17
  61. package/dist/_chunks/{send-registration-link-form-BjkXr0TD.js → send-registration-link-form-C1vw6H1M.js} +6 -5
  62. package/dist/_chunks/{signature-request-vJDSHZld.js → signature-request-D3sLLOM6.js} +2 -2
  63. package/dist/_chunks/sync-tray-BhnkgXKK.js +567 -0
  64. package/dist/_chunks/{tabs-Czkmw5ou.js → tabs-BXr5XeGq.js} +2 -2
  65. package/dist/_chunks/{task-editor-wKbFbGqW.js → task-editor-DDVDPKJf.js} +26 -25
  66. package/dist/_chunks/{tasks-panel-DbtJS4QI.js → tasks-panel-BHXaPNOZ.js} +2 -2
  67. package/dist/_chunks/{toolbar-DjG-cpD_.js → toolbar-Dz_hAUIZ.js} +2 -2
  68. package/dist/_chunks/{unit-converter-CUAUTu2B.js → unit-converter-CBy7S4Tl.js} +2 -2
  69. package/dist/_chunks/{use-appointment-details-read-jGkJalX8.js → use-appointment-details-read-CBSpX4DI.js} +2 -2
  70. package/dist/_chunks/use-error-summary-CecJZo6w.js +32 -0
  71. package/dist/_chunks/use-registration-submit-CVukOAQk.js +84 -0
  72. package/dist/_chunks/{variables-menu-DQl8H4Gh.js → variables-menu-C4NcClKi.js} +2 -2
  73. package/dist/_chunks/{voice-control-panel-Cp4vs1iy.js → voice-control-panel-Dc_NFH2R.js} +2 -2
  74. package/dist/agent-catalog.json +455 -1
  75. package/dist/agent-i18n/en.json +53 -0
  76. package/dist/appointment-editor-panel/index.js +2 -2
  77. package/dist/browser-support.js +1 -1
  78. package/dist/components/_shared/medication.d.ts +28 -0
  79. package/dist/components/_shared/normalize-diacritics.d.ts +5 -0
  80. package/dist/components/_shared/patient-picker.d.ts +7 -0
  81. package/dist/components/address-fields/index.js +1 -1
  82. package/dist/components/ai-prompt-input/index.js +1 -1
  83. package/dist/components/appointment-details-panel/index.js +1 -1
  84. package/dist/components/audio-recorder/index.js +1 -1
  85. package/dist/components/autocomplete/autocomplete.d.ts +50 -0
  86. package/dist/components/autocomplete/index.d.ts +1 -1
  87. package/dist/components/autocomplete/index.js +1 -1
  88. package/dist/components/bill-line-table/index.js +1 -1
  89. package/dist/components/bill-table/index.js +1 -1
  90. package/dist/components/bishop-score/index.js +1 -1
  91. package/dist/components/booking/index.js +1 -1
  92. package/dist/components/calls-panel/index.js +1 -1
  93. package/dist/components/city-input/index.js +1 -1
  94. package/dist/components/combobox/index.js +1 -1
  95. package/dist/components/communications-panel/index.js +1 -1
  96. package/dist/components/country-select/index.js +1 -1
  97. package/dist/components/data-grid/index.js +2 -2
  98. package/dist/components/data-table/index.js +2 -2
  99. package/dist/components/document-preview/index.js +1 -1
  100. package/dist/components/face-scheme/index.js +1 -1
  101. package/dist/components/file-manager/index.js +1 -1
  102. package/dist/components/gestational-age-calculator/index.js +1 -1
  103. package/dist/components/heatmap/index.js +1 -1
  104. package/dist/components/index.d.ts +5 -0
  105. package/dist/components/invoice-upload-list/index.js +1 -1
  106. package/dist/components/medication-line/index.d.ts +6 -0
  107. package/dist/components/medication-line/index.js +7 -0
  108. package/dist/components/medication-line/medication-line.agent.d.ts +14 -0
  109. package/dist/components/medication-line/medication-line.d.ts +40 -0
  110. package/dist/components/medication-search/index.d.ts +6 -0
  111. package/dist/components/medication-search/index.js +10 -0
  112. package/dist/components/medication-search/medication-search.agent.d.ts +15 -0
  113. package/dist/components/medication-search/medication-search.d.ts +49 -0
  114. package/dist/components/multi-select/index.js +1 -1
  115. package/dist/components/muscle-scheme/index.js +1 -1
  116. package/dist/components/notes-panel/index.js +1 -1
  117. package/dist/components/optical-prescription/index.js +1 -1
  118. package/dist/components/patient-details/index.js +1 -1
  119. package/dist/components/patient-search/index.js +1 -1
  120. package/dist/components/patient-summary-card/index.js +1 -1
  121. package/dist/components/patient-table/index.js +1 -1
  122. package/dist/components/phone-input/index.js +1 -1
  123. package/dist/components/pregnancy-dating/index.js +1 -1
  124. package/dist/components/print-sheet/index.d.ts +5 -0
  125. package/dist/components/print-sheet/index.js +6 -0
  126. package/dist/components/print-sheet/print-isolation.d.ts +17 -0
  127. package/dist/components/print-sheet/print-sheet.agent.d.ts +19 -0
  128. package/dist/components/print-sheet/print-sheet.d.ts +54 -0
  129. package/dist/components/province-select/index.js +1 -1
  130. package/dist/components/rich-text-editor/index.js +2 -2
  131. package/dist/components/search-bar/index.js +1 -1
  132. package/dist/components/select/index.js +1 -1
  133. package/dist/components/skeleton-scheme/index.js +1 -1
  134. package/dist/components/sync-tray/index.d.ts +4 -0
  135. package/dist/components/sync-tray/index.js +7 -0
  136. package/dist/components/sync-tray/sync-tray.agent.d.ts +15 -0
  137. package/dist/components/sync-tray/sync-tray.d.ts +77 -0
  138. package/dist/components/tabs/index.js +1 -1
  139. package/dist/components/task-editor/index.js +1 -1
  140. package/dist/components/tasks-panel/index.js +1 -1
  141. package/dist/components/unit-converter/index.js +1 -1
  142. package/dist/components/variables-menu/index.js +1 -1
  143. package/dist/components/voice-control-panel/index.js +1 -1
  144. package/dist/core.css +1 -1
  145. package/dist/find-free-slots-panel/index.js +1 -1
  146. package/dist/host-compat.css +13 -1
  147. package/dist/i18n/locales/ar.d.ts +134 -0
  148. package/dist/i18n/locales/ar.js +134 -0
  149. package/dist/i18n/locales/de.d.ts +134 -0
  150. package/dist/i18n/locales/de.js +134 -0
  151. package/dist/i18n/locales/el.d.ts +134 -0
  152. package/dist/i18n/locales/el.js +134 -0
  153. package/dist/i18n/locales/en.d.ts +134 -0
  154. package/dist/i18n/locales/en.js +134 -0
  155. package/dist/i18n/locales/es.d.ts +134 -0
  156. package/dist/i18n/locales/es.js +134 -0
  157. package/dist/i18n/locales/fr.d.ts +134 -0
  158. package/dist/i18n/locales/fr.js +134 -0
  159. package/dist/i18n/locales/hi.d.ts +134 -0
  160. package/dist/i18n/locales/hi.js +134 -0
  161. package/dist/i18n/locales/it.d.ts +134 -0
  162. package/dist/i18n/locales/it.js +134 -0
  163. package/dist/i18n/locales/ja.d.ts +134 -0
  164. package/dist/i18n/locales/ja.js +134 -0
  165. package/dist/i18n/locales/nl.d.ts +134 -0
  166. package/dist/i18n/locales/nl.js +134 -0
  167. package/dist/i18n/locales/pl.d.ts +134 -0
  168. package/dist/i18n/locales/pl.js +134 -0
  169. package/dist/i18n/locales/pt.d.ts +134 -0
  170. package/dist/i18n/locales/pt.js +134 -0
  171. package/dist/i18n/locales/ro.d.ts +134 -0
  172. package/dist/i18n/locales/ro.js +134 -0
  173. package/dist/i18n/locales/ru.d.ts +134 -0
  174. package/dist/i18n/locales/ru.js +134 -0
  175. package/dist/i18n/locales/sq.d.ts +134 -0
  176. package/dist/i18n/locales/sq.js +134 -0
  177. package/dist/i18n/locales/sv.d.ts +134 -0
  178. package/dist/i18n/locales/sv.js +134 -0
  179. package/dist/i18n/locales/tr.d.ts +134 -0
  180. package/dist/i18n/locales/tr.js +134 -0
  181. package/dist/i18n/locales/zh.d.ts +134 -0
  182. package/dist/i18n/locales/zh.js +134 -0
  183. package/dist/index.js +1002 -974
  184. package/dist/locales/ar.json +134 -0
  185. package/dist/locales/de.json +134 -0
  186. package/dist/locales/el.json +134 -0
  187. package/dist/locales/en.json +134 -0
  188. package/dist/locales/es.json +134 -0
  189. package/dist/locales/fr.json +134 -0
  190. package/dist/locales/hi.json +134 -0
  191. package/dist/locales/it.json +134 -0
  192. package/dist/locales/ja.json +134 -0
  193. package/dist/locales/nl.json +134 -0
  194. package/dist/locales/pl.json +134 -0
  195. package/dist/locales/pt.json +134 -0
  196. package/dist/locales/ro.json +134 -0
  197. package/dist/locales/ru.json +134 -0
  198. package/dist/locales/sq.json +134 -0
  199. package/dist/locales/sv.json +134 -0
  200. package/dist/locales/tr.json +134 -0
  201. package/dist/locales/zh.json +134 -0
  202. package/dist/online-bookings-panel/index.js +1 -1
  203. package/dist/patterns/anamnesis/index.js +1 -1
  204. package/dist/patterns/calendar/index.js +3 -3
  205. package/dist/patterns/forgot-password-form/index.js +1 -1
  206. package/dist/patterns/login-form/index.js +1 -1
  207. package/dist/patterns/patient-account-settings/index.js +1 -1
  208. package/dist/patterns/patient-check-in/index.js +1 -1
  209. package/dist/patterns/patient-portal/index.js +2 -2
  210. package/dist/patterns/prescription/index.d.ts +11 -0
  211. package/dist/patterns/prescription/index.js +13 -0
  212. package/dist/patterns/prescription/prescription-composer-errors.d.ts +6 -0
  213. package/dist/patterns/prescription/prescription-composer-item.d.ts +34 -0
  214. package/dist/patterns/prescription/prescription-composer.d.ts +89 -0
  215. package/dist/patterns/prescription/prescription-history.d.ts +48 -0
  216. package/dist/patterns/prescription/prescription-patient-block.d.ts +13 -0
  217. package/dist/patterns/prescription/prescription-sheet.d.ts +52 -0
  218. package/dist/patterns/prescription/prescription-status-badge.d.ts +5 -0
  219. package/dist/patterns/prescription/prescription-types.d.ts +97 -0
  220. package/dist/patterns/prescription/prescription-validation.d.ts +40 -0
  221. package/dist/patterns/registration-form/index.js +1 -1
  222. package/dist/patterns/reset-password-form/index.js +1 -1
  223. package/dist/patterns/send-registration-link-form/index.js +1 -1
  224. package/dist/patterns/signature-request/index.js +1 -1
  225. package/dist/tokens.css +1 -1
  226. package/dist/waiting-list-panel/index.js +2 -2
  227. package/package.json +21 -1
  228. package/dist/_chunks/autocomplete-D10ydpgi.js +0 -562
  229. package/dist/_chunks/group-options-BvKhQ3xb.js +0 -16
  230. package/dist/_chunks/normalize-diacritics-BNGbFNlJ.js +0 -7
  231. package/dist/_chunks/patient-picker-BZJuOgMw.js +0 -173
  232. package/dist/_chunks/use-registration-submit-CLGHxwoT.js +0 -112
@@ -0,0 +1,97 @@
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
+ }
22
+ export type PrescriptionLinkKind = 'treatment' | 'carePlan';
23
+ /** What a prescription is linked to: one treatment or one care plan of the
24
+ * patient, never both. */
25
+ export interface PrescriptionLink {
26
+ kind: PrescriptionLinkKind;
27
+ id: string;
28
+ }
29
+ /** One choice in the "Linked to" select, for the chosen patient. */
30
+ export interface PrescriptionLinkOption extends PrescriptionLink {
31
+ label: string;
32
+ }
33
+ /** One medication line of a draft. */
34
+ export interface PrescriptionItem {
35
+ /** Catalogue id. Empty while the line has no medication yet. */
36
+ medicationId: string;
37
+ /** How and when to take it. Required to save. */
38
+ dosage: string;
39
+ /** Optional free text. */
40
+ notes: string;
41
+ }
42
+ /** What the composer edits and hands to `onSubmit`. Ids only: the host
43
+ * resolves them. */
44
+ export interface PrescriptionDraft {
45
+ /** Empty while no patient is chosen. */
46
+ patientId: string;
47
+ /** Empty while no prescriber is chosen. */
48
+ prescriberId: string;
49
+ link: PrescriptionLink | null;
50
+ items: PrescriptionItem[];
51
+ }
52
+ /** One line of a saved prescription, resolved so it can be shown and
53
+ * printed without a lookup. */
54
+ export interface PrescriptionRecordItem {
55
+ medication: MedicationOption;
56
+ dosage: string;
57
+ notes?: string;
58
+ }
59
+ /** Where a prescription is in its send to the national registry. */
60
+ export type PrescriptionSendStatus = 'sending' | 'sent' | 'failed';
61
+ /** A saved prescription, as the host returns it from `onSubmit`. It is
62
+ * self-contained: the sheet and the history need nothing else.
63
+ *
64
+ * The kit sends nothing. The host's `onSubmit` creates the prescription and
65
+ * sends it, and returns the record in whatever state it is then in; the host
66
+ * passes the updated record when the send settles. The four send fields are
67
+ * optional, so a host that sends prescriptions nowhere is unaffected. */
68
+ export interface PrescriptionRecord {
69
+ id: string;
70
+ /** ISO 8601 instant the prescription was saved. */
71
+ createdAt: string;
72
+ patient: PrescriptionPatient;
73
+ prescriber: PrescriptionPrescriber;
74
+ link: PrescriptionLinkOption | null;
75
+ items: PrescriptionRecordItem[];
76
+ /** The number the registry gave the prescription (Italy: NRBE). Present once it is sent. */
77
+ number?: string;
78
+ /** State of the send to the national registry (Italy: Sistema TS). Omit when the host sends prescriptions nowhere. */
79
+ sendStatus?: PrescriptionSendStatus;
80
+ /** ISO 8601 instant it was sent. */
81
+ sentAt?: string;
82
+ /** Host message for a failed send, already translated. */
83
+ sendError?: string;
84
+ }
85
+ /** Host medication search, as `MedicationSearch` calls it. */
86
+ export type PrescriptionMedicationSearch = (query: string, options: {
87
+ signal: AbortSignal;
88
+ locale: string;
89
+ }) => Promise<readonly MedicationOption[]>;
90
+ /** Host patient search. Reject on failure; `[]` is no match. */
91
+ export type PrescriptionPatientSearch = (query: string, options: {
92
+ signal: AbortSignal;
93
+ }) => Promise<readonly PrescriptionPatient[]>;
94
+ export declare const EMPTY_PRESCRIPTION_ITEM: Readonly<PrescriptionItem>;
95
+ /** A draft with no patient and one empty line, ready to fill. */
96
+ export declare function createEmptyPrescriptionDraft(prescriberId?: string): PrescriptionDraft;
97
+ //# sourceMappingURL=prescription-types.d.ts.map
@@ -0,0 +1,40 @@
1
+ import type { PrescriptionDraft, PrescriptionItem, PrescriptionLinkOption } from './prescription-types';
2
+ /** Why a field was refused. `invalid` is a link that is malformed or is not
3
+ * one of the patient's treatments or care plans. */
4
+ export type PrescriptionFieldError = 'required' | 'invalid';
5
+ export interface PrescriptionItemErrors {
6
+ medicationId?: 'required';
7
+ dosage?: 'required';
8
+ }
9
+ export interface PrescriptionDraftErrors {
10
+ patientId?: 'required';
11
+ prescriberId?: 'required';
12
+ link?: PrescriptionFieldError;
13
+ /** No line names a medication. */
14
+ items?: 'required';
15
+ /** One entry per draft line, in order; `undefined` for a valid line. */
16
+ itemErrors?: (PrescriptionItemErrors | undefined)[];
17
+ }
18
+ export interface PrescriptionValidationOptions {
19
+ /** A treatment or a care plan must be chosen. Default true. */
20
+ requireLink?: boolean;
21
+ /** The chosen patient's treatments and care plans. When given, a link
22
+ * that is not in the list is `invalid`. */
23
+ linkOptions?: readonly PrescriptionLinkOption[];
24
+ }
25
+ /** True for a line the user has not touched: nothing to validate or save. */
26
+ export declare function isBlankPrescriptionItem(item: PrescriptionItem): boolean;
27
+ /**
28
+ * Checks a draft. Returns an empty object when it can be saved.
29
+ *
30
+ * Rules: a patient, a prescriber, a link (unless `requireLink` is false) and
31
+ * at least one medication line. Every line that is not blank needs a
32
+ * medication and a dosage. Blank lines are ignored, except that a draft of
33
+ * only blank lines has no medication at all, and its first line is marked.
34
+ */
35
+ export declare function validatePrescriptionDraft(draft: PrescriptionDraft, options?: PrescriptionValidationOptions): PrescriptionDraftErrors;
36
+ export declare function isPrescriptionDraftValid(errors: PrescriptionDraftErrors): boolean;
37
+ /** The draft as it is saved: blank lines dropped, text trimmed. Call it only
38
+ * on a draft that passed `validatePrescriptionDraft`. */
39
+ export declare function normalisePrescriptionDraft(draft: PrescriptionDraft): PrescriptionDraft;
40
+ //# 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
  };