@photonhealth/react 2.0.0-rc.1 → 2.0.0-rc.3

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 (272) hide show
  1. package/README.md +52 -9
  2. package/dist/adapters/tailwind.d.ts.map +1 -1
  3. package/dist/adapters/tailwind.js +7 -4
  4. package/dist/adapters/tailwind.js.map +1 -1
  5. package/dist/analytics/PhotonAnalyticsProvider.d.ts +19 -0
  6. package/dist/analytics/PhotonAnalyticsProvider.d.ts.map +1 -0
  7. package/dist/analytics/PhotonAnalyticsProvider.js +76 -0
  8. package/dist/analytics/PhotonAnalyticsProvider.js.map +1 -0
  9. package/dist/analytics/cardLifecycle.d.ts +10 -0
  10. package/dist/analytics/cardLifecycle.d.ts.map +1 -0
  11. package/dist/analytics/cardLifecycle.js +43 -0
  12. package/dist/analytics/cardLifecycle.js.map +1 -0
  13. package/dist/analytics/fieldInteraction.d.ts +18 -0
  14. package/dist/analytics/fieldInteraction.d.ts.map +1 -0
  15. package/dist/analytics/fieldInteraction.js +102 -0
  16. package/dist/analytics/fieldInteraction.js.map +1 -0
  17. package/dist/analytics/lifecycleOutcomes.d.ts +8 -0
  18. package/dist/analytics/lifecycleOutcomes.d.ts.map +1 -0
  19. package/dist/analytics/lifecycleOutcomes.js +16 -0
  20. package/dist/analytics/lifecycleOutcomes.js.map +1 -0
  21. package/dist/analytics/tracker.d.ts +19 -0
  22. package/dist/analytics/tracker.d.ts.map +1 -0
  23. package/dist/analytics/tracker.js +41 -0
  24. package/dist/analytics/tracker.js.map +1 -0
  25. package/dist/analytics/viewed.d.ts +11 -0
  26. package/dist/analytics/viewed.d.ts.map +1 -0
  27. package/dist/analytics/viewed.js +16 -0
  28. package/dist/analytics/viewed.js.map +1 -0
  29. package/dist/components/PhotonOrder.d.ts +18 -18
  30. package/dist/components/PhotonOrder.d.ts.map +1 -1
  31. package/dist/components/PhotonOrder.js +34 -19
  32. package/dist/components/PhotonOrder.js.map +1 -1
  33. package/dist/components/PhotonPatient.d.ts +7 -35
  34. package/dist/components/PhotonPatient.d.ts.map +1 -1
  35. package/dist/components/PhotonPatient.js +6 -78
  36. package/dist/components/PhotonPatient.js.map +1 -1
  37. package/dist/components/PhotonPrescription.d.ts +15 -26
  38. package/dist/components/PhotonPrescription.d.ts.map +1 -1
  39. package/dist/components/PhotonPrescription.js +6 -360
  40. package/dist/components/PhotonPrescription.js.map +1 -1
  41. package/dist/components/format.d.ts +2 -2
  42. package/dist/components/format.js +2 -2
  43. package/dist/components/index.d.ts +1 -1
  44. package/dist/components/index.d.ts.map +1 -1
  45. package/dist/components/index.js +1 -1
  46. package/dist/components/index.js.map +1 -1
  47. package/dist/components/open.d.ts +11 -13
  48. package/dist/components/open.d.ts.map +1 -1
  49. package/dist/components/open.js +7 -2
  50. package/dist/components/open.js.map +1 -1
  51. package/dist/components/order/DraftOrderPrompt.d.ts +18 -0
  52. package/dist/components/order/DraftOrderPrompt.d.ts.map +1 -0
  53. package/dist/components/order/DraftOrderPrompt.js +26 -0
  54. package/dist/components/order/DraftOrderPrompt.js.map +1 -0
  55. package/dist/components/patient/PatientCard/PatientCard.d.ts +30 -0
  56. package/dist/components/patient/PatientCard/PatientCard.d.ts.map +1 -0
  57. package/dist/components/patient/PatientCard/PatientCard.js +101 -0
  58. package/dist/components/patient/PatientCard/PatientCard.js.map +1 -0
  59. package/dist/components/patient/PatientCard/usePatientToShow.d.ts +22 -0
  60. package/dist/components/patient/PatientCard/usePatientToShow.d.ts.map +1 -0
  61. package/dist/components/patient/PatientCard/usePatientToShow.js +40 -0
  62. package/dist/components/patient/PatientCard/usePatientToShow.js.map +1 -0
  63. package/dist/components/patient/PatientIntakeForm.d.ts +16 -0
  64. package/dist/components/patient/PatientIntakeForm.d.ts.map +1 -0
  65. package/dist/components/patient/PatientIntakeForm.js +114 -0
  66. package/dist/components/patient/PatientIntakeForm.js.map +1 -0
  67. package/dist/components/patient/PatientSearch.d.ts +12 -0
  68. package/dist/components/patient/PatientSearch.d.ts.map +1 -0
  69. package/dist/components/patient/PatientSearch.js +148 -0
  70. package/dist/components/patient/PatientSearch.js.map +1 -0
  71. package/dist/components/patient/{Benefits.d.ts → PatientSummary/BenefitsInputForm.d.ts} +2 -2
  72. package/dist/components/patient/PatientSummary/BenefitsInputForm.d.ts.map +1 -0
  73. package/dist/components/patient/{Benefits.js → PatientSummary/BenefitsInputForm.js} +6 -5
  74. package/dist/components/patient/PatientSummary/BenefitsInputForm.js.map +1 -0
  75. package/dist/components/patient/{Clinical.d.ts → PatientSummary/ClinicalInputForm.d.ts} +15 -16
  76. package/dist/components/patient/PatientSummary/ClinicalInputForm.d.ts.map +1 -0
  77. package/dist/components/patient/{Clinical.js → PatientSummary/ClinicalInputForm.js} +29 -28
  78. package/dist/components/patient/PatientSummary/ClinicalInputForm.js.map +1 -0
  79. package/dist/components/patient/PatientSummary/CollapsedSummary.d.ts +5 -0
  80. package/dist/components/patient/PatientSummary/CollapsedSummary.d.ts.map +1 -0
  81. package/dist/components/patient/PatientSummary/CollapsedSummary.js +30 -0
  82. package/dist/components/patient/PatientSummary/CollapsedSummary.js.map +1 -0
  83. package/dist/components/patient/PatientSummary/PatientDetailsForm.d.ts +10 -0
  84. package/dist/components/patient/PatientSummary/PatientDetailsForm.d.ts.map +1 -0
  85. package/dist/components/patient/PatientSummary/PatientDetailsForm.js +65 -0
  86. package/dist/components/patient/PatientSummary/PatientDetailsForm.js.map +1 -0
  87. package/dist/components/patient/PatientSummary/PatientDetailsSchema.d.ts +53 -0
  88. package/dist/components/patient/PatientSummary/PatientDetailsSchema.d.ts.map +1 -0
  89. package/dist/components/patient/PatientSummary/PatientDetailsSchema.js +78 -0
  90. package/dist/components/patient/PatientSummary/PatientDetailsSchema.js.map +1 -0
  91. package/dist/components/patient/PatientSummary/PatientSummary.d.ts +46 -0
  92. package/dist/components/patient/PatientSummary/PatientSummary.d.ts.map +1 -0
  93. package/dist/components/patient/PatientSummary/PatientSummary.js +57 -0
  94. package/dist/components/patient/PatientSummary/PatientSummary.js.map +1 -0
  95. package/dist/components/patient/PatientSummary/SummaryHeader.d.ts +19 -0
  96. package/dist/components/patient/PatientSummary/SummaryHeader.d.ts.map +1 -0
  97. package/dist/components/patient/PatientSummary/SummaryHeader.js +22 -0
  98. package/dist/components/patient/PatientSummary/SummaryHeader.js.map +1 -0
  99. package/dist/components/patient/fields.d.ts +7 -26
  100. package/dist/components/patient/fields.d.ts.map +1 -1
  101. package/dist/components/patient/fields.js +11 -52
  102. package/dist/components/patient/fields.js.map +1 -1
  103. package/dist/components/patient/parsePatientSearchQuery.d.ts +16 -0
  104. package/dist/components/patient/parsePatientSearchQuery.d.ts.map +1 -0
  105. package/dist/components/patient/{query.js → parsePatientSearchQuery.js} +3 -10
  106. package/dist/components/patient/parsePatientSearchQuery.js.map +1 -0
  107. package/dist/components/prescription/PrescriptionCard.d.ts +51 -0
  108. package/dist/components/prescription/PrescriptionCard.d.ts.map +1 -0
  109. package/dist/components/prescription/PrescriptionCard.js +186 -0
  110. package/dist/components/prescription/PrescriptionCard.js.map +1 -0
  111. package/dist/components/prescription/PrescriptionDetailsForm/DirectionsInput.d.ts +15 -0
  112. package/dist/components/prescription/PrescriptionDetailsForm/DirectionsInput.d.ts.map +1 -0
  113. package/dist/components/prescription/PrescriptionDetailsForm/DirectionsInput.js +18 -0
  114. package/dist/components/prescription/PrescriptionDetailsForm/DirectionsInput.js.map +1 -0
  115. package/dist/components/prescription/PrescriptionDetailsForm/DispenseInputs.d.ts +23 -0
  116. package/dist/components/prescription/PrescriptionDetailsForm/DispenseInputs.d.ts.map +1 -0
  117. package/dist/components/prescription/PrescriptionDetailsForm/DispenseInputs.js +42 -0
  118. package/dist/components/prescription/PrescriptionDetailsForm/DispenseInputs.js.map +1 -0
  119. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.d.ts +27 -0
  120. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.d.ts.map +1 -0
  121. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.js +169 -0
  122. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.js.map +1 -0
  123. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.d.ts +8 -0
  124. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.d.ts.map +1 -0
  125. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.js +12 -0
  126. package/dist/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.js.map +1 -0
  127. package/dist/components/prescription/PrescriptionDetailsForm/TemplatePicker.d.ts +11 -0
  128. package/dist/components/prescription/PrescriptionDetailsForm/TemplatePicker.d.ts.map +1 -0
  129. package/dist/components/prescription/PrescriptionDetailsForm/TemplatePicker.js +25 -0
  130. package/dist/components/prescription/PrescriptionDetailsForm/TemplatePicker.js.map +1 -0
  131. package/dist/components/prescription/TreatmentSearch/TreatmentPicker.d.ts +50 -0
  132. package/dist/components/prescription/TreatmentSearch/TreatmentPicker.d.ts.map +1 -0
  133. package/dist/components/{TreatmentPicker.js → prescription/TreatmentSearch/TreatmentPicker.js} +113 -105
  134. package/dist/components/prescription/TreatmentSearch/TreatmentPicker.js.map +1 -0
  135. package/dist/components/prescription/TreatmentSearch/TreatmentSearch.d.ts +28 -0
  136. package/dist/components/prescription/TreatmentSearch/TreatmentSearch.d.ts.map +1 -0
  137. package/dist/components/prescription/TreatmentSearch/TreatmentSearch.js +146 -0
  138. package/dist/components/prescription/TreatmentSearch/TreatmentSearch.js.map +1 -0
  139. package/dist/components/schemaErrors.d.ts +13 -0
  140. package/dist/components/schemaErrors.d.ts.map +1 -0
  141. package/dist/components/schemaErrors.js +25 -0
  142. package/dist/components/schemaErrors.js.map +1 -0
  143. package/dist/components/search.d.ts +1 -1
  144. package/dist/components/search.js +1 -1
  145. package/dist/index.d.ts +2 -0
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +1 -0
  148. package/dist/index.js.map +1 -1
  149. package/dist/meta/version.d.ts +5 -0
  150. package/dist/meta/version.d.ts.map +1 -0
  151. package/dist/meta/version.js +5 -0
  152. package/dist/meta/version.js.map +1 -0
  153. package/dist/primitives/PhotonProvider.d.ts +3 -1
  154. package/dist/primitives/PhotonProvider.d.ts.map +1 -1
  155. package/dist/primitives/PhotonProvider.js +23 -11
  156. package/dist/primitives/PhotonProvider.js.map +1 -1
  157. package/dist/primitives/defaults.d.ts.map +1 -1
  158. package/dist/primitives/defaults.js +6 -3
  159. package/dist/primitives/defaults.js.map +1 -1
  160. package/dist/primitives/photonContext.d.ts +3 -0
  161. package/dist/primitives/photonContext.d.ts.map +1 -0
  162. package/dist/primitives/photonContext.js +3 -0
  163. package/dist/primitives/photonContext.js.map +1 -0
  164. package/dist/primitives/types.d.ts +15 -3
  165. package/dist/primitives/types.d.ts.map +1 -1
  166. package/dist/primitives/types.js.map +1 -1
  167. package/dist/primitives/useProvidedPhoton.d.ts +8 -0
  168. package/dist/primitives/useProvidedPhoton.d.ts.map +1 -0
  169. package/dist/primitives/useProvidedPhoton.js +8 -0
  170. package/dist/primitives/useProvidedPhoton.js.map +1 -0
  171. package/dist/styles.css +45 -3
  172. package/dist/test-utils/contract.d.ts.map +1 -1
  173. package/dist/test-utils/contract.js +23 -2
  174. package/dist/test-utils/contract.js.map +1 -1
  175. package/package.json +8 -3
  176. package/src/adapters/tailwind.tsx +52 -24
  177. package/src/analytics/PhotonAnalyticsProvider.test.tsx +190 -0
  178. package/src/analytics/PhotonAnalyticsProvider.tsx +151 -0
  179. package/src/analytics/cardLifecycle.test.tsx +272 -0
  180. package/src/analytics/cardLifecycle.ts +44 -0
  181. package/src/analytics/fieldInteraction.test.tsx +186 -0
  182. package/src/analytics/fieldInteraction.tsx +148 -0
  183. package/src/analytics/lifecycleOutcomes.test.ts +78 -0
  184. package/src/analytics/lifecycleOutcomes.ts +29 -0
  185. package/src/analytics/tracker.test.ts +52 -0
  186. package/src/analytics/tracker.ts +49 -0
  187. package/src/analytics/usePhotonAnalytics.test.tsx +106 -0
  188. package/src/analytics/viewed.ts +27 -0
  189. package/src/components/PhotonOrder.test.tsx +394 -0
  190. package/src/components/PhotonOrder.tsx +79 -53
  191. package/src/components/PhotonPatient.tsx +15 -166
  192. package/src/components/PhotonPrescription.test.tsx +120 -0
  193. package/src/components/PhotonPrescription.tsx +23 -583
  194. package/src/components/ScreeningAlerts.test.tsx +81 -0
  195. package/src/components/format.ts +2 -2
  196. package/src/components/index.ts +1 -1
  197. package/src/components/open.ts +13 -16
  198. package/src/components/order/DraftOrderPrompt.test.tsx +77 -0
  199. package/src/components/order/DraftOrderPrompt.tsx +81 -0
  200. package/src/components/patient/PatientCard/PatientCard.test.tsx +255 -0
  201. package/src/components/patient/PatientCard/PatientCard.tsx +177 -0
  202. package/src/components/patient/PatientCard/usePatientToShow.ts +44 -0
  203. package/src/components/patient/PatientIntakeForm.test.tsx +262 -0
  204. package/src/components/patient/PatientIntakeForm.tsx +222 -0
  205. package/src/components/patient/PatientSearch.test.tsx +204 -0
  206. package/src/components/patient/PatientSearch.tsx +221 -0
  207. package/src/components/patient/PatientSummary/BenefitsInputForm.test.tsx +164 -0
  208. package/src/components/patient/{Benefits.tsx → PatientSummary/BenefitsInputForm.tsx} +24 -16
  209. package/src/components/patient/PatientSummary/ClinicalInputForm.test.tsx +247 -0
  210. package/src/components/patient/{Clinical.tsx → PatientSummary/ClinicalInputForm.tsx} +53 -48
  211. package/src/components/patient/PatientSummary/CollapsedSummary.test.tsx +90 -0
  212. package/src/components/patient/PatientSummary/CollapsedSummary.tsx +46 -0
  213. package/src/components/patient/PatientSummary/PatientDetailsForm.test.tsx +201 -0
  214. package/src/components/patient/PatientSummary/PatientDetailsForm.tsx +320 -0
  215. package/src/components/patient/PatientSummary/PatientDetailsSchema.test.ts +296 -0
  216. package/src/components/patient/PatientSummary/PatientDetailsSchema.ts +95 -0
  217. package/src/components/patient/PatientSummary/PatientSummary.test.tsx +194 -0
  218. package/src/components/patient/PatientSummary/PatientSummary.tsx +225 -0
  219. package/src/components/patient/PatientSummary/SummaryHeader.test.tsx +183 -0
  220. package/src/components/patient/PatientSummary/SummaryHeader.tsx +85 -0
  221. package/src/components/patient/fields.tsx +12 -124
  222. package/src/components/patient/parsePatientSearchQuery.test.ts +107 -0
  223. package/src/components/patient/{query.ts → parsePatientSearchQuery.ts} +4 -15
  224. package/src/components/prescription/PrescriptionCard.test.tsx +247 -0
  225. package/src/components/prescription/PrescriptionCard.tsx +361 -0
  226. package/src/components/prescription/PrescriptionDetailsForm/DirectionsInput.test.tsx +82 -0
  227. package/src/components/prescription/PrescriptionDetailsForm/DirectionsInput.tsx +41 -0
  228. package/src/components/prescription/PrescriptionDetailsForm/DispenseInputs.test.tsx +206 -0
  229. package/src/components/prescription/PrescriptionDetailsForm/DispenseInputs.tsx +99 -0
  230. package/src/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.test.tsx +453 -0
  231. package/src/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsForm.tsx +238 -0
  232. package/src/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.test.ts +63 -0
  233. package/src/components/prescription/PrescriptionDetailsForm/PrescriptionDetailsSchema.ts +15 -0
  234. package/src/components/prescription/PrescriptionDetailsForm/TemplatePicker.test.tsx +72 -0
  235. package/src/components/prescription/PrescriptionDetailsForm/TemplatePicker.tsx +41 -0
  236. package/src/components/prescription/TreatmentSearch/TreatmentPicker.tsx +375 -0
  237. package/src/components/prescription/TreatmentSearch/TreatmentSearch.test.tsx +695 -0
  238. package/src/components/prescription/TreatmentSearch/TreatmentSearch.tsx +220 -0
  239. package/src/components/schemaErrors.test.ts +49 -0
  240. package/src/components/schemaErrors.ts +34 -0
  241. package/src/components/search.tsx +1 -1
  242. package/src/index.ts +2 -0
  243. package/src/meta/version.test.ts +11 -0
  244. package/src/meta/version.ts +4 -0
  245. package/src/primitives/PhotonProvider.tsx +30 -15
  246. package/src/primitives/defaults.tsx +44 -21
  247. package/src/primitives/photonContext.ts +4 -0
  248. package/src/primitives/types.ts +15 -3
  249. package/src/primitives/useProvidedPhoton.ts +21 -0
  250. package/src/styles.css +45 -3
  251. package/src/test-utils/contract.tsx +45 -2
  252. package/dist/components/TreatmentPicker.d.ts +0 -45
  253. package/dist/components/TreatmentPicker.d.ts.map +0 -1
  254. package/dist/components/TreatmentPicker.js.map +0 -1
  255. package/dist/components/patient/Benefits.d.ts.map +0 -1
  256. package/dist/components/patient/Benefits.js.map +0 -1
  257. package/dist/components/patient/Clinical.d.ts.map +0 -1
  258. package/dist/components/patient/Clinical.js.map +0 -1
  259. package/dist/components/patient/IntakeForm.d.ts +0 -10
  260. package/dist/components/patient/IntakeForm.d.ts.map +0 -1
  261. package/dist/components/patient/IntakeForm.js +0 -324
  262. package/dist/components/patient/IntakeForm.js.map +0 -1
  263. package/dist/components/patient/Summary.d.ts +0 -48
  264. package/dist/components/patient/Summary.d.ts.map +0 -1
  265. package/dist/components/patient/Summary.js +0 -80
  266. package/dist/components/patient/Summary.js.map +0 -1
  267. package/dist/components/patient/query.d.ts +0 -23
  268. package/dist/components/patient/query.d.ts.map +0 -1
  269. package/dist/components/patient/query.js.map +0 -1
  270. package/src/components/TreatmentPicker.tsx +0 -350
  271. package/src/components/patient/IntakeForm.tsx +0 -532
  272. package/src/components/patient/Summary.tsx +0 -310
@@ -6,7 +6,7 @@ export type BenefitInput = {
6
6
  memberId?: string;
7
7
  };
8
8
  /** Insurance on file: chips, "Add insurance" (BIN + member id required, PCN / group optional), "No insurance". */
9
- export declare function BenefitsSection({ benefits, saving, onAdd, onRemove, onNone, }: {
9
+ export declare function BenefitsInputForm({ benefits, saving, onAdd, onRemove, onNone, }: {
10
10
  /** null: not recorded; []: "no insurance" recorded. */
11
11
  benefits: {
12
12
  id: string;
@@ -22,4 +22,4 @@ export declare function BenefitsSection({ benefits, saving, onAdd, onRemove, onN
22
22
  }) => void;
23
23
  onNone: () => void;
24
24
  }): import("react").JSX.Element;
25
- //# sourceMappingURL=Benefits.d.ts.map
25
+ //# sourceMappingURL=BenefitsInputForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BenefitsInputForm.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/BenefitsInputForm.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5G,kHAAkH;AAClH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE;IACD,uDAAuD;IACvD,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;IAC7G,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,+BA8GA"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /** The patient's insurance on file. */
3
3
  import { useState } from "react";
4
- import { useComponents } from "../../primitives/index.js";
5
- import { noAutofill } from "./fields.js";
4
+ import { useComponents } from "../../../primitives/index.js";
5
+ import { noAutofill } from "../fields.js";
6
+ import { TrackedField } from "../../../analytics/fieldInteraction.js";
6
7
  /** Insurance on file: chips, "Add insurance" (BIN + member id required, PCN / group optional), "No insurance". */
7
- export function BenefitsSection({ benefits, saving, onAdd, onRemove, onNone, }) {
8
+ export function BenefitsInputForm({ benefits, saving, onAdd, onRemove, onNone, }) {
8
9
  const { Badge, Button, Grid, Input, Row, Stack, Text } = useComponents();
9
10
  const [adding, setAdding] = useState(false);
10
11
  const [bin, setBin] = useState("");
@@ -42,6 +43,6 @@ export function BenefitsSection({ benefits, saving, onAdd, onRemove, onNone, })
42
43
  groupId: groupId.trim() || undefined,
43
44
  });
44
45
  reset();
45
- }, children: _jsxs(Stack, { gap: "2", children: [_jsxs(Grid, { min: "72px", gap: "2", children: [_jsx(Input, { label: "BIN", value: bin, onChange: (e) => setBin(e.target.value), inputMode: "numeric", autoFocus: true, ...noAutofill }), _jsx(Input, { label: "PCN", value: pcn, onChange: (e) => setPcn(e.target.value), ...noAutofill }), _jsx(Input, { label: "Group", value: groupId, onChange: (e) => setGroupId(e.target.value), ...noAutofill }), _jsx(Input, { label: "Member ID", value: memberId, onChange: (e) => setMemberId(e.target.value), ...noAutofill })] }), _jsxs(Row, { justify: "end", gap: "2", children: [_jsx(Button, { variant: "ghost", onClick: reset, children: "Cancel" }), _jsx(Button, { type: "submit", variant: "secondary", loading: saving, disabled: !canSave, children: "Save insurance" })] })] }) }))] }));
46
+ }, children: _jsxs(Stack, { gap: "2", children: [_jsx(TrackedField, { formName: "update_patient_form", fieldName: "insurance", isOptional: true, children: _jsxs(Grid, { min: "72px", gap: "2", children: [_jsx(Input, { label: "BIN", value: bin, onChange: (e) => setBin(e.target.value), inputMode: "numeric", autoFocus: true, ...noAutofill }), _jsx(Input, { label: "PCN", value: pcn, onChange: (e) => setPcn(e.target.value), ...noAutofill }), _jsx(Input, { label: "Group", value: groupId, onChange: (e) => setGroupId(e.target.value), ...noAutofill }), _jsx(Input, { label: "Member ID", value: memberId, onChange: (e) => setMemberId(e.target.value), ...noAutofill })] }) }), _jsxs(Row, { justify: "end", gap: "2", children: [_jsx(Button, { variant: "ghost", onClick: reset, children: "Cancel" }), _jsx(Button, { type: "submit", variant: "secondary", loading: saving, disabled: !canSave, children: "Save insurance" })] })] }) }))] }));
46
47
  }
47
- //# sourceMappingURL=Benefits.js.map
48
+ //# sourceMappingURL=BenefitsInputForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BenefitsInputForm.js","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/BenefitsInputForm.tsx"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAyC,CAAC;AAIvE,kHAAkH;AAClH,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GAQP;IACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC;IACzE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,QAAQ,EAAE,MAA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MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACvC,SAAS,EAAC,SAAS,EACnB,SAAS,WACL,UAAU,GACd,EACF,KAAC,KAAK,IAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAM,UAAU,GAAI,EAC1F,KAAC,KAAK,IAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAM,UAAU,GAAI,EACpG,KAAC,KAAK,IACJ,KAAK,EAAC,WAAW,EACjB,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KACxC,UAAU,GACd,IACG,GACM,EACf,MAAC,GAAG,IAAC,OAAO,EAAC,KAAK,EAAC,GAAG,EAAC,GAAG,aACxB,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,KAAK,uBAE7B,EACT,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,+BAEpE,IACL,IACA,GACH,CACR,IACK,CACT,CAAC;AACJ,CAAC"}
@@ -6,45 +6,44 @@ export declare const sectionOf: (key: string) => "allergies" | "medications" | "
6
6
  export declare const choicesIn: (choices: ClassifiedChanges["needsChoice"], section: (typeof CLINICAL_SECTIONS)[number]) => import("@photonhealth/client").Change[];
7
7
  /** Everything but what a clinical list shows under its own field — its choices and its problems (e.g. a rejected name). */
8
8
  export declare const withoutInline: (changes: ClassifiedChanges) => ClassifiedChanges;
9
- /** An ICD-10 code ("J02.0") goes as a code; anything else as free text for the server to resolve. */
10
- export declare const diagnosisRef: (text: string) => {
9
+ export type DiagnosisInput = {
11
10
  icd10Code: string;
12
- name?: undefined;
13
11
  } | {
14
12
  name: string;
15
- icd10Code?: undefined;
16
13
  };
14
+ /** An ICD-10 code ("J02.0") goes as a code; anything else as free text for the server to resolve. */
15
+ export declare const diagnosisRef: (text: string) => DiagnosisInput;
17
16
  /**
18
17
  * A clinical list (allergies, medications, diagnoses): chips for what's on file, plus "Add …" and "No …"
19
- * (records none — `confirmedNone` is the record's `[]`; network-api can't read it back yet, docs/api-gaps.md).
18
+ * (records none — `confirmedNone` is the record's `[]`; network-api can't read it back yet).
20
19
  *
21
20
  * "Add …" is a search field (search.tsx) — type-ahead, its spinner, its results (the server's choices, e.g.
22
21
  * which penicillin) and keys. Each search is an add, by design: what's typed, once it matches one entry, is that
23
22
  * entry — added then, as is a single row or the one match the server is sure of (core takes it). The field closes as soon as an entry lands, or once what's committed (Enter,
24
23
  * leaving it, a choice) is answered. Escape closes it.
25
24
  */
26
- export declare function ClinicalList<T extends {
25
+ export declare function ClinicalInputForm<T extends {
27
26
  id: string;
28
27
  name: string;
29
- }>({ label, items, tone, addLabel, noneLabel, noneAction, confirmedNone, unknownLabel, pickedNames, saving, onAdd, onRemove, onNone, choices, problems, onChoose, }: {
28
+ }>({ label, fieldName, items, tone, addLabel, noneLabel, noneAction, confirmedNone, unknownLabel, saving, onAdd, onRemove, onNone, choices, problems, onChoose, }: {
30
29
  label: string;
30
+ fieldName: "allergies" | "medications" | "diagnoses";
31
31
  items: T[];
32
32
  tone: "warning" | "neutral";
33
33
  addLabel: string;
34
- /** Offer "none" (e.g. No known allergies). Omit for lists where "none" isn't worth recording. */
35
- noneLabel?: string;
34
+ /** Shown once "none" is recorded (e.g. No known allergies). */
35
+ noneLabel: string;
36
36
  /** The button that records "none" (e.g. "Mark NKDA") — an action, so it can't be read as a status. */
37
- noneAction?: string;
37
+ noneAction: string;
38
38
  /** "None" was recorded this session. */
39
- confirmedNone?: boolean;
40
- /** Shown when the server returns no real name (today allergies come back with name = id). */
39
+ confirmedNone: boolean;
40
+ /** Shown for an entry the server returns without a name. */
41
41
  unknownLabel: string;
42
- /** Names the prescriber picked this session, by id — shown when the server returns only the id. */
43
- pickedNames: Readonly<Record<string, string>>;
44
42
  saving: boolean;
45
43
  onAdd: (name: string) => void;
46
44
  onRemove: (item: T) => void;
47
- onNone?: () => void;
45
+ /** Records "none" for this list. */
46
+ onNone: () => void;
48
47
  /** The server's choices for what was just entered (e.g. which penicillin) — shown right under the field. */
49
48
  choices: ClassifiedChanges["needsChoice"];
50
49
  /** What the server rejected for this list (e.g. a name nothing matches) — shown in the same place. */
@@ -52,4 +51,4 @@ export declare function ClinicalList<T extends {
52
51
  onChoose: (option: ChangeOption) => void;
53
52
  }): import("react").JSX.Element;
54
53
  export {};
55
- //# sourceMappingURL=Clinical.d.ts.map
54
+ //# sourceMappingURL=ClinicalInputForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClinicalInputForm.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/ClinicalInputForm.tsx"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AASjF,kHAAkH;AAClH,QAAA,MAAM,iBAAiB,oDAAqD,CAAC;AAC7E,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,qDAAuE,CAAC;AAC7G,eAAO,MAAM,SAAS,GAAI,SAAS,iBAAiB,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,OAAO,iBAAiB,EAAE,MAAM,CAAC,4CAC3D,CAAC;AACtD,2HAA2H;AAC3H,eAAO,MAAM,aAAa,GAAI,SAAS,iBAAiB,KAAG,iBAIzD,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,E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,11 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /** The patient's clinical lists — allergies, medications, diagnoses — and which server changes belong to them. */
3
3
  import {} from "@photonhealth/client";
4
4
  import { useRef, useState } from "react";
5
- import { useComponents } from "../../primitives/index.js";
6
- import { useHeldActivity } from "../activity.js";
7
- import { ChangeList } from "../ChangeList.js";
8
- import { afterPress, searchKeys, useTypeAhead } from "../search.js";
9
- import { noAutofill } from "./fields.js";
5
+ import { useComponents } from "../../../primitives/index.js";
6
+ import { useHeldActivity } from "../../activity.js";
7
+ import { ChangeList } from "../../ChangeList.js";
8
+ import { afterPress, searchKeys, useTypeAhead } from "../../search.js";
9
+ import { noAutofill } from "../fields.js";
10
+ import { TrackedField } from "../../../analytics/fieldInteraction.js";
10
11
  /** Which clinical list a server change belongs to (keys look like "clinical.allergies.add.0" / "allergies.0"). */
11
12
  const CLINICAL_SECTIONS = ["allergies", "medications", "diagnoses"];
12
13
  export const sectionOf = (key) => CLINICAL_SECTIONS.find((section) => key.includes(section)) ?? null;
@@ -21,14 +22,14 @@ export const withoutInline = (changes) => ({
21
22
  export const diagnosisRef = (text) => /^[A-TV-Z]\d{2}(\.[0-9A-Z]{1,4})?$/i.test(text) ? { icd10Code: text.toUpperCase() } : { name: text };
22
23
  /**
23
24
  * A clinical list (allergies, medications, diagnoses): chips for what's on file, plus "Add …" and "No …"
24
- * (records none — `confirmedNone` is the record's `[]`; network-api can't read it back yet, docs/api-gaps.md).
25
+ * (records none — `confirmedNone` is the record's `[]`; network-api can't read it back yet).
25
26
  *
26
27
  * "Add …" is a search field (search.tsx) — type-ahead, its spinner, its results (the server's choices, e.g.
27
28
  * which penicillin) and keys. Each search is an add, by design: what's typed, once it matches one entry, is that
28
29
  * entry — added then, as is a single row or the one match the server is sure of (core takes it). The field closes as soon as an entry lands, or once what's committed (Enter,
29
30
  * leaving it, a choice) is answered. Escape closes it.
30
31
  */
31
- export function ClinicalList({ label, items, tone, addLabel, noneLabel, noneAction, confirmedNone, unknownLabel, pickedNames, saving, onAdd, onRemove, onNone, choices, problems = [], onChoose, }) {
32
+ export function ClinicalInputForm({ label, fieldName, items, tone, addLabel, noneLabel, noneAction, confirmedNone, unknownLabel, saving, onAdd, onRemove, onNone, choices, problems = [], onChoose, }) {
32
33
  const { Badge, Button, Input, Row, Stack, Text } = useComponents();
33
34
  const [adding, setAdding] = useState(false);
34
35
  const [value, setValue] = useState("");
@@ -59,7 +60,7 @@ export function ClinicalList({ label, items, tone, addLabel, noneLabel, noneActi
59
60
  const spinning = useHeldActivity(adding && before !== null && saving ? "add" : null) === "add";
60
61
  const results = useRef(null);
61
62
  const field = useRef(null);
62
- const none = Boolean(confirmedNone) && items.length === 0;
63
+ const none = confirmedNone && items.length === 0;
63
64
  /** Add what's typed — unless it was just sent. */
64
65
  const send = (name) => {
65
66
  if (name === sent)
@@ -93,25 +94,25 @@ export function ClinicalList({ label, items, tone, addLabel, noneLabel, noneActi
93
94
  onChoose(option);
94
95
  };
95
96
  return (_jsxs(Stack, { gap: "2", children: [_jsxs(Row, { gap: "2", justify: "between", children: [_jsxs(Row, { gap: "2", children: [_jsx("strong", { children: label }), !adding && (_jsx(Button, { variant: "ghost", "aria-label": addLabel, title: addLabel, onClick: () => setAdding(true), icon: "add" })), items.map((item) => {
96
- const name = item.name && item.name !== item.id ? item.name : (pickedNames[item.id] ?? unknownLabel);
97
+ const name = item.name || unknownLabel;
97
98
  return (_jsx(Badge, { tone: tone, onRemove: () => onRemove(item), removeLabel: `Remove ${name}`, children: name }, item.id));
98
- }), none && noneLabel && _jsx(Badge, { tone: "success", children: noneLabel }), noneLabel && !none && items.length === 0 && !adding && _jsx(Text, { tone: "tertiary", children: "Not recorded" })] }), noneLabel && onNone && !adding && items.length === 0 && !none && (_jsx(Button, { variant: "ghost", onClick: onNone, "aria-label": noneAction === "Mark none" ? `Mark no ${label.toLowerCase()}` : undefined, children: noneAction ?? noneLabel }))] }), (adding || choices.length > 0 || problems.length > 0) && (_jsx("div", { ref: field, children: _jsxs(Stack, { gap: "2", children: [adding && (_jsx(Input, { label: addLabel, value: value, autoFocus: true, loading: spinning, ...noAutofill, onChange: (e) => {
99
- setValue(e.target.value);
100
- typeAhead.typed("add", e.target.value);
101
- }, onBlur: (e) => {
102
- // Into its results isn't leaving; anywhere else sends what's typed (or closes an empty field).
103
- if (field.current?.contains(e.relatedTarget) || results.current?.pointing?.())
104
- return;
105
- afterPress(add); // e.g. pressing "Mark none" below: it mustn't move before the click lands
106
- }, onKeyDown: (e) => {
107
- if (searchKeys(e, results.current, value.trim() === sent && !saving))
108
- return;
109
- if (e.key === "Enter") {
110
- e.preventDefault();
111
- add();
112
- }
113
- if (e.key === "Escape")
114
- close();
115
- } })), (choices.length > 0 || problems.length > 0) && (_jsx(ChangeList, { changes: { needsChoice: choices, blocking: problems, advisories: [], applied: [], settled: false }, onChoose: choose, busy: saving, handleRef: results, onBack: () => field.current?.querySelector("input")?.focus() }))] }) }))] }));
99
+ }), none && _jsx(Badge, { tone: "success", children: noneLabel }), !none && items.length === 0 && !adding && _jsx(Text, { tone: "tertiary", children: "Not recorded" })] }), !adding && items.length === 0 && !none && (_jsx(Button, { variant: "ghost", onClick: onNone, "aria-label": noneAction === "Mark none" ? `Mark no ${label.toLowerCase()}` : undefined, children: noneAction }))] }), (adding || choices.length > 0 || problems.length > 0) && (_jsx("div", { ref: field, children: _jsxs(Stack, { gap: "2", children: [adding && (_jsx(TrackedField, { formName: "update_patient_form", fieldName: fieldName, isOptional: true, children: _jsx(Input, { label: addLabel, value: value, autoFocus: true, loading: spinning, ...noAutofill, onChange: (e) => {
100
+ setValue(e.target.value);
101
+ typeAhead.typed("add", e.target.value);
102
+ }, onBlur: (e) => {
103
+ // Into its results isn't leaving; anywhere else sends what's typed (or closes an empty field).
104
+ if (field.current?.contains(e.relatedTarget) || results.current?.pointing?.())
105
+ return;
106
+ afterPress(add); // e.g. pressing "Mark none" below: it mustn't move before the click lands
107
+ }, onKeyDown: (e) => {
108
+ if (searchKeys(e, results.current, value.trim() === sent && !saving))
109
+ return;
110
+ if (e.key === "Enter") {
111
+ e.preventDefault();
112
+ add();
113
+ }
114
+ if (e.key === "Escape")
115
+ close();
116
+ } }) })), (choices.length > 0 || problems.length > 0) && (_jsx(ChangeList, { changes: { needsChoice: choices, blocking: problems, advisories: [], applied: [], settled: false }, onChoose: choose, busy: saving, handleRef: results, onBack: () => field.current?.querySelector("input")?.focus() }))] }) }))] }));
116
117
  }
117
- //# sourceMappingURL=Clinical.js.map
118
+ //# sourceMappingURL=ClinicalInputForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClinicalInputForm.js","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/ClinicalInputForm.tsx"],"names":[],"mappings":";AAAA,kHAAkH;AAClH,OAAO,EAA6C,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,iBAAkB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,cAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAyC,CAAC;AAEvE,kHAAkH;AAClH,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;AAC7G,MAAM,CAAC,MAAM,SAAS,GA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AK,OAAO,EAAE,CAAC;wCACtB,CAAC,CAAC,cAAc,EAAE,CAAC;wCACnB,GAAG,EAAE,CAAC;oCACR,CAAC;oCACD,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;wCAAE,KAAK,EAAE,CAAC;gCAClC,CAAC,GACD,GACW,CAChB,EACA,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAC9C,KAAC,UAAU,IACT,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAClG,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,GAC5D,CACH,IACK,GACJ,CACP,IACK,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type PatientRecord } from "@photonhealth/client";
2
+ export declare function CollapsedSummary({ patient }: {
3
+ patient: PatientRecord;
4
+ }): import("react").JSX.Element;
5
+ //# sourceMappingURL=CollapsedSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsedSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/CollapsedSummary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,+BAwCvE"}
@@ -0,0 +1,30 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ /** PatientSummary's collapsed summary: the patient's allergies, active meds, diagnoses and insurance, in one line. */
3
+ import { useComponents } from "../../../primitives/index.js";
4
+ import {} from "@photonhealth/client";
5
+ import { Fragment } from "react";
6
+ export function CollapsedSummary({ patient }) {
7
+ const { Badge, Text } = useComponents();
8
+ // Each list: null when nothing is recorded, [] when "none" is (core's PatientRecord).
9
+ const recorded = {
10
+ allergies: patient.clinical?.allergies ?? null,
11
+ medications: patient.clinical?.medications ?? null,
12
+ diagnoses: patient.clinical?.diagnoses ?? null,
13
+ benefits: patient.benefits,
14
+ };
15
+ const allergies = recorded.allergies ?? [];
16
+ const meds = (recorded.medications ?? []).filter((m) => m.status === "ACTIVE");
17
+ const diagnoses = (recorded.diagnoses ?? []).map((x) => ({ ...x, name: x.name ?? x.icd10Code ?? "" }));
18
+ const benefits = recorded.benefits ?? [];
19
+ const named = (items, unknown) => items.map((x) => x.name || unknown).join(", ");
20
+ const facts = [
21
+ allergies.length ? (_jsxs(Badge, { tone: "warning", children: [allergies.length === 1 ? "Allergy" : "Allergies", ": ", named(allergies, "Unknown allergy")] })) : recorded.allergies?.length === 0 ? ("No known allergies") : ("Allergies not recorded"),
22
+ meds.length ? `Active meds: ${named(meds, "Unknown medication")}` : recorded.medications && "No active meds",
23
+ diagnoses.length ? `Diagnoses: ${named(diagnoses, "Unknown diagnosis")}` : recorded.diagnoses && "No diagnoses",
24
+ benefits.length
25
+ ? `Insurance: ${benefits.map((b) => `BIN ${b.bin}`).join(", ")}`
26
+ : recorded.benefits && "No insurance",
27
+ ].filter(Boolean);
28
+ return (_jsx(Text, { tone: "secondary", children: facts.map((fact, i) => (_jsxs(Fragment, { children: [i > 0 && " · ", _jsx("span", { children: fact })] }, i))) }));
29
+ }
30
+ //# sourceMappingURL=CollapsedSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsedSummary.js","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/CollapsedSummary.tsx"],"names":[],"mappings":";AAAA,sHAAsH;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8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from "@photonhealth/client";
2
+ /** The part of an UpdatePatient that PatientDetailsForm sends. */
3
+ export type PatientDetailsInput = Pick<PatientInput, "demographic" | "contact">;
4
+ export declare function PatientDetailsForm({ patient, addressRequest, onSave, }: {
5
+ patient: PatientRecord;
6
+ addressRequest: string | null;
7
+ /** Called by Save once every field is valid, with every field to send. */
8
+ onSave: (input: PatientDetailsInput) => void | Promise<void>;
9
+ }): import("react").JSX.Element;
10
+ //# sourceMappingURL=PatientDetailsForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientDetailsForm.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/PatientDetailsForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQ7E,kEAAkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC;AAEhF,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,cAAc,EACd,MAAM,GACP,EAAE;IACD,OAAO,EAAE,aAAa,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,MAAM,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D,+BAuQA"}
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useComponents } from "../../../primitives/index.js";
3
+ import {} from "@photonhealth/client";
4
+ import { zodResolver } from "@hookform/resolvers/zod";
5
+ import { Controller, useForm } from "react-hook-form";
6
+ import { formatPhone } from "../../format.js";
7
+ import { noAutofill, SEX_OPTIONS } from "../fields.js";
8
+ import { TrackedField, useFieldInteractions } from "../../../analytics/fieldInteraction.js";
9
+ import { PatientDetailsSchema } from "./PatientDetailsSchema.js";
10
+ export function PatientDetailsForm({ patient, addressRequest, onSave, }) {
11
+ const { Alert, Button, Grid, Input, Row, Select, Stack } = useComponents();
12
+ const phone = patient.contact?.phone ?? null;
13
+ const { control, handleSubmit, formState: { isSubmitting }, } = useForm({
14
+ resolver: zodResolver(PatientDetailsSchema),
15
+ defaultValues: formValuesFrom(patient),
16
+ mode: "onTouched",
17
+ });
18
+ const fieldInteraction = useFieldInteractions("update_patient_form");
19
+ return (_jsxs(_Fragment, { children: [_jsxs(Grid, { min: "200px", gap: "3", children: [_jsx(TrackedField, { formName: "update_patient_form", fieldName: "firstName", isOptional: false, children: _jsx(Controller, { control: control, name: "firstName", render: ({ field, fieldState }) => (_jsx(Input, { label: "First name", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "lastName", isOptional: false, children: _jsx(Controller, { control: control, name: "lastName", render: ({ field, fieldState }) => (_jsx(Input, { label: "Last name", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "dateOfBirth", isOptional: false, children: _jsx(Controller, { control: control, name: "dateOfBirth", render: ({ field, fieldState }) => (_jsx(Input, { label: "Date of birth", type: "date", ...noAutofill, name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message })) }) }), _jsx(Controller, { control: control, name: "sex", render: ({ field, fieldState }) => {
20
+ const sexInteractions = fieldInteraction("sex", { isOptional: false, hasValue: Boolean(field.value) });
21
+ return (_jsx("div", { style: { display: "contents" }, onFocus: sexInteractions.onFocus, onBlur: sexInteractions.onBlur, children: _jsx(Select, { label: "Sex", placeholder: "Select\u2026", options: SEX_OPTIONS, value: field.value, onChange: (sex) => {
22
+ sexInteractions.onChange(true);
23
+ field.onChange(sex);
24
+ }, invalid: fieldState.invalid, errorMessage: fieldState.error?.message }) }));
25
+ } })] }), _jsxs(Stack, { gap: "2", children: [addressRequest && _jsx(Alert, { tone: "warning", title: phone ? "Address needed to send" : "Phone needed to send" }), _jsxs(Grid, { min: "120px", gap: "3", children: [_jsx(TrackedField, { formName: "update_patient_form", fieldName: "phone", isOptional: true, children: _jsx(Controller, { control: control, name: "phone", render: ({ field, fieldState }) => (_jsx(Input, { label: "Phone", type: "tel", inputMode: "tel", name: field.name, value: field.value, onChange: field.onChange,
26
+ // Leaving the field shows the number formatted, e.g. "+1 (415) 555-0172".
27
+ onBlur: () => {
28
+ field.onChange(formatPhone(field.value));
29
+ field.onBlur();
30
+ }, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "email", isOptional: true, children: _jsx(Controller, { control: control, name: "email", render: ({ field, fieldState }) => (_jsx(Input, { label: "Email", type: "email", inputMode: "email", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) })] }), _jsxs(Stack, { gap: "3", children: [_jsxs(Grid, { min: "120px", gap: "3", children: [_jsx(TrackedField, { formName: "update_patient_form", fieldName: "address_street1", isOptional: true, children: _jsx(Controller, { control: control, name: "address.street1", render: ({ field, fieldState }) => (_jsx(Input, { label: "Street", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "address_street2", isOptional: true, children: _jsx(Controller, { control: control, name: "address.street2", render: ({ field, fieldState }) => (_jsx(Input, { label: "Apt / suite", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) })] }), _jsxs(Grid, { min: "120px", gap: "3", children: [_jsx(TrackedField, { formName: "update_patient_form", fieldName: "address_city", isOptional: true, children: _jsx(Controller, { control: control, name: "address.city", render: ({ field, fieldState }) => (_jsx(Input, { label: "City", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "address_state", isOptional: true, children: _jsx(Controller, { control: control, name: "address.state", render: ({ field, fieldState }) => (_jsx(Input, { label: "State", maxLength: 2, name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) }), _jsx(TrackedField, { formName: "update_patient_form", fieldName: "address_zip", isOptional: true, children: _jsx(Controller, { control: control, name: "address.postalCode", render: ({ field, fieldState }) => (_jsx(Input, { label: "ZIP", inputMode: "numeric", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, invalid: fieldState.invalid, errorMessage: fieldState.error?.message, ...noAutofill })) }) })] })] })] }), _jsx(Row, { justify: "end", children: _jsx(Button, { variant: "secondary", loading: isSubmitting, onClick: handleSubmit((details) => onSave(toPatientInput(details))), children: "Save" }) })] }));
31
+ }
32
+ function formValuesFrom(patient) {
33
+ const demographic = patient.demographic;
34
+ const address = patient.contact?.address;
35
+ return {
36
+ firstName: demographic?.name.first ?? "",
37
+ lastName: demographic?.name.last ?? "",
38
+ dateOfBirth: demographic?.dateOfBirth ?? "",
39
+ sex: demographic?.sex ?? null,
40
+ phone: formatPhone(patient.contact?.phone),
41
+ email: patient.contact?.email ?? "",
42
+ address: {
43
+ street1: address?.street1 ?? "",
44
+ street2: address?.street2 ?? "",
45
+ city: address?.city ?? "",
46
+ state: address?.state ?? "",
47
+ postalCode: address?.postalCode ?? "",
48
+ },
49
+ };
50
+ }
51
+ function toPatientInput(details) {
52
+ return {
53
+ demographic: {
54
+ name: { first: details.firstName, last: details.lastName },
55
+ dateOfBirth: details.dateOfBirth,
56
+ sex: details.sex,
57
+ },
58
+ contact: {
59
+ phone: details.phone,
60
+ email: details.email,
61
+ ...(details.address && { address: details.address }),
62
+ },
63
+ };
64
+ }
65
+ //# sourceMappingURL=PatientDetailsForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientDetailsForm.js","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/PatientDetailsForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAyC,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAe,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAyC,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAsD,MAAM,2BAA2B,CAAC;AAKrH,MAAM,UAAU,kBAAkB,CAAC,EACjC,OAAO,EACP,cAAc,EACd,MAAM,GAMP;IACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,CAAC;IAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC;IAE7C,MAAM,EACJ,OAAO,EACP,YAAY,EACZ,SAAS,EAAE,EAAE,YAAY,EAAE,GAC5B,GAAG,OAAO,CAAoD;QAC7D,QAAQ,EAAE,WAAW,CAAC,oBAAoB,CAIzC;QACD,aAAa,EAAE,cAAc,CAAC,OAAO,CAAC;QACtC,IAAI,EAAE,WAAW;KAClB,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,qBAAqB,CAA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AAE,IAAI,CAAC,KAAK,IAAI,EAAE;QACxC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACtC,WAAW,EAAE,WAAW,EAAE,WAAW,IAAI,EAAE;QAC3C,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,IAAI;QAC7B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;QAC1C,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;YAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;YAC/B,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE;YACzB,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;YAC3B,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,EAAE;SACtC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAAuB;IAC7C,OAAO;QACL,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE;YAC1D,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,GAAG,EAAE,OAAO,CAAC,GAAG;SACjB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;SACrD;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import { type Sex } from "@photonhealth/client";
3
+ export declare const PatientDetailsSchema: z.ZodObject<{
4
+ firstName: z.ZodString;
5
+ lastName: z.ZodString;
6
+ dateOfBirth: z.ZodString;
7
+ sex: z.ZodEnum<{
8
+ FEMALE: "FEMALE";
9
+ MALE: "MALE";
10
+ UNKNOWN: "UNKNOWN";
11
+ }>;
12
+ phone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
13
+ email: z.ZodString;
14
+ address: z.ZodPipe<z.ZodObject<{
15
+ street1: z.ZodString;
16
+ street2: z.ZodString;
17
+ city: z.ZodString;
18
+ state: z.ZodString;
19
+ postalCode: z.ZodString;
20
+ }, z.core.$strip>, z.ZodTransform<{
21
+ street1: string;
22
+ street2: string | undefined;
23
+ city: string;
24
+ state: string;
25
+ postalCode: string;
26
+ country: string;
27
+ } | undefined, {
28
+ street1: string;
29
+ street2: string;
30
+ city: string;
31
+ state: string;
32
+ postalCode: string;
33
+ }>>;
34
+ }, z.core.$strip>;
35
+ /** The values to send, once every field is valid. */
36
+ export type PatientDetails = z.output<typeof PatientDetailsSchema>;
37
+ /** What the form holds while the prescriber edits it*/
38
+ export type PatientDetailsFormValues = {
39
+ firstName: string;
40
+ lastName: string;
41
+ dateOfBirth: string;
42
+ sex: Sex | null;
43
+ phone: string;
44
+ email: string;
45
+ address: {
46
+ street1: string;
47
+ street2: string;
48
+ city: string;
49
+ state: string;
50
+ postalCode: string;
51
+ };
52
+ };
53
+ //# sourceMappingURL=PatientDetailsSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientDetailsSchema.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/PatientDetailsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAKhD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsD/B,CAAC;AAEH,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,uDAAuD;AACvD,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAChG,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { z } from "zod";
2
+ import {} from "@photonhealth/client";
3
+ import { PHONE_PATTERN, toE164 } from "../../format.js";
4
+ const sexes = ["MALE", "FEMALE", "UNKNOWN"];
5
+ export const PatientDetailsSchema = z.object({
6
+ firstName: z.string().trim().min(1, "Required"),
7
+ lastName: z.string().trim().min(1, "Required"),
8
+ dateOfBirth: z
9
+ .string()
10
+ .trim()
11
+ .min(1, "Required")
12
+ .refine(isIsoDate, "Enter a valid date")
13
+ .refine((value) => value <= today(), "Date of birth can't be in the future"),
14
+ sex: z.enum(sexes, { error: "Required" }),
15
+ // network-api clears a phone or email sent as an empty string, so a blank phone or email parses as ""
16
+ phone: z
17
+ .string()
18
+ .trim()
19
+ .refine((value) => !value || isUsPhone(value), "Enter a valid phone number")
20
+ .transform((value) => toE164(value) ?? ""),
21
+ email: z
22
+ .string()
23
+ .trim()
24
+ .refine((value) => !value || z.email().safeParse(value).success, "Enter a valid email"),
25
+ address: z
26
+ .object({
27
+ street1: z.string().trim(),
28
+ street2: z.string().trim(),
29
+ city: z.string().trim(),
30
+ state: z.string().trim(),
31
+ postalCode: z.string().trim(),
32
+ })
33
+ .transform((value) => Object.values(value).some(Boolean)
34
+ ? {
35
+ street1: value.street1,
36
+ street2: value.street2 || undefined,
37
+ city: value.city,
38
+ state: value.state.toUpperCase(),
39
+ postalCode: value.postalCode,
40
+ // network-api's schema marks country optional, but its patient planner refuses an address without one.
41
+ // The form only takes US addresses (a 2-letter state, a 5-digit ZIP), so it always sends "US".
42
+ country: "US",
43
+ }
44
+ : undefined)
45
+ .superRefine((value, ctx) => {
46
+ if (!value)
47
+ return;
48
+ for (const key of ["street1", "city", "state", "postalCode"]) {
49
+ if (!value[key])
50
+ ctx.addIssue({ code: "custom", path: [key], message: "Required" });
51
+ }
52
+ if (value.state && !/^[A-Z]{2}$/.test(value.state)) {
53
+ ctx.addIssue({ code: "custom", path: ["state"], message: "Enter a 2-letter state" });
54
+ }
55
+ if (value.postalCode && !/^\d{5}(-\d{4})?$/.test(value.postalCode)) {
56
+ ctx.addIssue({ code: "custom", path: ["postalCode"], message: "Enter a 5-digit ZIP" });
57
+ }
58
+ }),
59
+ });
60
+ function isUsPhone(value) {
61
+ return new RegExp(`^(?:${PHONE_PATTERN})$`).test(value);
62
+ }
63
+ /** A real calendar date written as YYYY-MM-DD: "2023-02-30" is refused. */
64
+ function isIsoDate(value) {
65
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
66
+ if (!match)
67
+ return false;
68
+ const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
69
+ const date = new Date(Date.UTC(year, month - 1, day));
70
+ return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
71
+ }
72
+ /** Today's date in the prescriber's time zone, as YYYY-MM-DD, so it compares with a date of birth as text. */
73
+ function today() {
74
+ const now = new Date();
75
+ const pad = (n) => String(n).padStart(2, "0");
76
+ return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
77
+ }
78
+ //# sourceMappingURL=PatientDetailsSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientDetailsSchema.js","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/PatientDetailsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAA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EAAE,KAAK,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,CAAC;AACzG,CAAC;AAED,8GAA8G;AAC9G,SAAS,KAAK;IACZ,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AACjF,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { type ChangeOption, type ClassifiedChanges, type MedicationStatus, type PatientRecord, type PhotonError } from "@photonhealth/client";
2
+ import { type BenefitInput } from "./BenefitsInputForm.tsx";
3
+ import { type DiagnosisInput } from "./ClinicalInputForm.tsx";
4
+ import { type PatientDetailsInput } from "./PatientDetailsForm.tsx";
5
+ export declare function PatientSummary({ patient, saving, changes, error, onChoose, onAddAllergy, onConfirmNone, onRemoveAllergy, onRemoveMedication, onAddMedication, onAddDiagnosis, onRemoveDiagnosis, onAddBenefit, onRemoveBenefit, onConfirmNoBenefits, onSaveDetails, addressRequest, onChangePatient, readOnly, }: {
6
+ patient: PatientRecord;
7
+ saving: boolean;
8
+ /**
9
+ * The server's changes. Each clinical list shows its own choices (AMBIGUOUS changes) and problems (e.g. a name
10
+ * nothing matches) under its field; the rest show at the bottom of the card.
11
+ */
12
+ changes: ClassifiedChanges;
13
+ /** The last save's failure, if any. */
14
+ error: PhotonError | null;
15
+ onChoose: (option: ChangeOption) => void;
16
+ onAddAllergy: (name: string) => void;
17
+ /** Record "none" for a clinical list (NKDA, no medications, no diagnoses). */
18
+ onConfirmNone: (list: "allergies" | "medications" | "diagnoses") => void;
19
+ onRemoveAllergy: (allergy: {
20
+ id: string;
21
+ }) => void;
22
+ onRemoveMedication: (medication: {
23
+ id: string;
24
+ status: MedicationStatus;
25
+ }) => void;
26
+ onAddMedication: (name: string) => void;
27
+ onAddDiagnosis: (diagnosis: DiagnosisInput) => void;
28
+ onRemoveDiagnosis: (diagnosis: {
29
+ id: string;
30
+ }) => void;
31
+ onAddBenefit: (benefit: BenefitInput) => void;
32
+ onRemoveBenefit: (benefit: {
33
+ id: string;
34
+ }) => void;
35
+ onConfirmNoBenefits: () => void;
36
+ /**
37
+ * Send what PatientDetailsForm saved, as one UpdatePatient. Resolves to true once network-api has saved it, or
38
+ * false when the update failed.
39
+ */
40
+ onSaveDetails: (input: PatientDetailsInput) => Promise<boolean>;
41
+ addressRequest: string | null;
42
+ onChangePatient?: () => void;
43
+ /** Read-only (e.g. on a sent order): the summary alone — no editors, no pencil. */
44
+ readOnly?: boolean;
45
+ }): import("react").JSX.Element;
46
+ //# sourceMappingURL=PatientSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/patient/PatientSummary/PatientSummary.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAIxF,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf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