@ampath/esm-dha-workflow-app 4.0.0-next.44 → 4.0.0-next.445

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 (941) hide show
  1. package/README.md +47 -0
  2. package/dist/1100.js +1 -0
  3. package/dist/1100.js.map +1 -0
  4. package/dist/{197.js → 1197.js} +1 -1
  5. package/dist/1371.js +2 -0
  6. package/dist/1371.js.LICENSE.txt +282 -0
  7. package/dist/1371.js.map +1 -0
  8. package/dist/1435.js +1 -0
  9. package/dist/1435.js.map +1 -0
  10. package/dist/1673.js +1 -0
  11. package/dist/1673.js.map +1 -0
  12. package/dist/1843.js +1 -0
  13. package/dist/1843.js.map +1 -0
  14. package/dist/1931.js +1 -0
  15. package/dist/1931.js.map +1 -0
  16. package/dist/2272.js +2 -0
  17. package/dist/2272.js.map +1 -0
  18. package/dist/2383.js +1 -0
  19. package/dist/2383.js.map +1 -0
  20. package/dist/2439.js +1 -0
  21. package/dist/2439.js.map +1 -0
  22. package/dist/2535.js +1 -0
  23. package/dist/2535.js.map +1 -0
  24. package/dist/2592.js +1 -0
  25. package/dist/2592.js.map +1 -0
  26. package/dist/2632.js +1 -0
  27. package/dist/2632.js.map +1 -0
  28. package/dist/2635.js +1 -0
  29. package/dist/2635.js.map +1 -0
  30. package/dist/2663.js +1 -0
  31. package/dist/2663.js.map +1 -0
  32. package/dist/2687.js +1 -0
  33. package/dist/2687.js.map +1 -0
  34. package/dist/2802.js +1 -0
  35. package/dist/2802.js.map +1 -0
  36. package/dist/2808.js +1 -0
  37. package/dist/2808.js.map +1 -0
  38. package/dist/282.js +1 -1
  39. package/dist/282.js.LICENSE.txt +3 -3
  40. package/dist/282.js.map +1 -1
  41. package/dist/2848.js +1 -0
  42. package/dist/2848.js.map +1 -0
  43. package/dist/3.js +1 -0
  44. package/dist/3.js.map +1 -0
  45. package/dist/3016.js +1 -0
  46. package/dist/3016.js.map +1 -0
  47. package/dist/3041.js +1 -0
  48. package/dist/3041.js.map +1 -0
  49. package/dist/3099.js +1 -0
  50. package/dist/3182.js +1 -0
  51. package/dist/3182.js.map +1 -0
  52. package/dist/3184.js +2 -0
  53. package/dist/3184.js.map +1 -0
  54. package/dist/3196.js +1 -0
  55. package/dist/3196.js.map +1 -0
  56. package/dist/3242.js +1 -0
  57. package/dist/3242.js.map +1 -0
  58. package/dist/3270.js +1 -0
  59. package/dist/3270.js.map +1 -0
  60. package/dist/3288.js +1 -0
  61. package/dist/3288.js.map +1 -0
  62. package/dist/3311.js +2 -0
  63. package/dist/3311.js.LICENSE.txt +9 -0
  64. package/dist/3311.js.map +1 -0
  65. package/dist/3558.js +1 -0
  66. package/dist/3558.js.map +1 -0
  67. package/dist/3612.js +1 -0
  68. package/dist/3612.js.map +1 -0
  69. package/dist/3636.js +1 -0
  70. package/dist/3636.js.map +1 -0
  71. package/dist/3654.js +1 -0
  72. package/dist/3654.js.map +1 -0
  73. package/dist/3794.js +1 -0
  74. package/dist/3794.js.map +1 -0
  75. package/dist/3816.js +1 -0
  76. package/dist/3816.js.map +1 -0
  77. package/dist/3897.js +1 -0
  78. package/dist/3897.js.map +1 -0
  79. package/dist/3949.js +1 -0
  80. package/dist/3949.js.map +1 -0
  81. package/dist/4055.js +1 -0
  82. package/dist/408.js +1 -0
  83. package/dist/408.js.map +1 -0
  84. package/dist/409.js +1 -0
  85. package/dist/409.js.map +1 -0
  86. package/dist/411.js +1 -0
  87. package/dist/411.js.map +1 -0
  88. package/dist/4225.js +1 -0
  89. package/dist/4225.js.map +1 -0
  90. package/dist/4300.js +1 -0
  91. package/dist/{335.js → 4335.js} +1 -1
  92. package/dist/4353.js +1 -0
  93. package/dist/4353.js.map +1 -0
  94. package/dist/4399.js +1 -0
  95. package/dist/4399.js.map +1 -0
  96. package/dist/4569.js +1 -0
  97. package/dist/4569.js.map +1 -0
  98. package/dist/{652.js → 4652.js} +1 -1
  99. package/dist/474.js +1 -0
  100. package/dist/474.js.map +1 -0
  101. package/dist/4993.js +1 -0
  102. package/dist/4993.js.map +1 -0
  103. package/dist/5006.js +1 -0
  104. package/dist/5006.js.map +1 -0
  105. package/dist/5119.js +1 -0
  106. package/dist/5119.js.map +1 -0
  107. package/dist/5138.js +1 -0
  108. package/dist/5138.js.map +1 -0
  109. package/dist/5179.js +1 -0
  110. package/dist/5179.js.map +1 -0
  111. package/dist/5244.js +1 -0
  112. package/dist/5244.js.map +1 -0
  113. package/dist/5353.js +1 -0
  114. package/dist/5353.js.map +1 -0
  115. package/dist/5377.js +1 -0
  116. package/dist/5377.js.map +1 -0
  117. package/dist/5413.js +1 -0
  118. package/dist/5413.js.map +1 -0
  119. package/dist/5422.js +1 -0
  120. package/dist/5422.js.map +1 -0
  121. package/dist/5500.js +1 -0
  122. package/dist/5500.js.map +1 -0
  123. package/dist/5754.js +1 -0
  124. package/dist/5754.js.map +1 -0
  125. package/dist/5805.js +1 -0
  126. package/dist/5805.js.map +1 -0
  127. package/dist/6048.js +1 -0
  128. package/dist/6048.js.map +1 -0
  129. package/dist/6055.js +1 -0
  130. package/dist/6055.js.map +1 -0
  131. package/dist/6206.js +1 -0
  132. package/dist/6206.js.map +1 -0
  133. package/dist/6279.js +1 -0
  134. package/dist/6279.js.map +1 -0
  135. package/dist/6399.js +1 -0
  136. package/dist/6399.js.map +1 -0
  137. package/dist/6540.js +2 -0
  138. package/dist/6540.js.map +1 -0
  139. package/dist/6606.js +1 -0
  140. package/dist/6606.js.map +1 -0
  141. package/dist/6682.js +1 -0
  142. package/dist/6682.js.map +1 -0
  143. package/dist/6802.js +1 -0
  144. package/dist/6802.js.map +1 -0
  145. package/dist/7024.js +1 -0
  146. package/dist/7024.js.map +1 -0
  147. package/dist/72.js +1 -0
  148. package/dist/72.js.map +1 -0
  149. package/dist/7269.js +1 -0
  150. package/dist/7269.js.map +1 -0
  151. package/dist/7332.js +1 -0
  152. package/dist/7332.js.map +1 -0
  153. package/dist/7369.js +1 -0
  154. package/dist/7369.js.map +1 -0
  155. package/dist/7593.js +1 -0
  156. package/dist/7593.js.map +1 -0
  157. package/dist/7694.js +1 -0
  158. package/dist/7694.js.map +1 -0
  159. package/dist/7698.js +1 -0
  160. package/dist/7698.js.map +1 -0
  161. package/dist/7734.js +1 -0
  162. package/dist/7734.js.map +1 -0
  163. package/dist/774.js +1 -0
  164. package/dist/774.js.map +1 -0
  165. package/dist/7852.js +1 -0
  166. package/dist/7852.js.map +1 -0
  167. package/dist/7949.js +2 -0
  168. package/dist/{246.js.LICENSE.txt → 7949.js.LICENSE.txt} +1 -10
  169. package/dist/7949.js.map +1 -0
  170. package/dist/7958.js +1 -0
  171. package/dist/7958.js.map +1 -0
  172. package/dist/8137.js +1 -0
  173. package/dist/8137.js.map +1 -0
  174. package/dist/8167.js +1 -0
  175. package/dist/8167.js.map +1 -0
  176. package/dist/818.js +1 -0
  177. package/dist/818.js.map +1 -0
  178. package/dist/8250.js +1 -0
  179. package/dist/8250.js.map +1 -0
  180. package/dist/8308.js +1 -0
  181. package/dist/8308.js.map +1 -0
  182. package/dist/8735.js +1 -0
  183. package/dist/8735.js.map +1 -0
  184. package/dist/8947.js +1 -0
  185. package/dist/8947.js.map +1 -0
  186. package/dist/8961.js +1 -0
  187. package/dist/8961.js.map +1 -0
  188. package/dist/902.js +1 -0
  189. package/dist/902.js.map +1 -0
  190. package/dist/9062.js +1 -0
  191. package/dist/9062.js.map +1 -0
  192. package/dist/9134.js +1 -0
  193. package/dist/9134.js.map +1 -0
  194. package/dist/9249.js +1 -0
  195. package/dist/9249.js.map +1 -0
  196. package/dist/9418.js +2 -0
  197. package/dist/9418.js.LICENSE.txt +1 -0
  198. package/dist/9418.js.map +1 -0
  199. package/dist/9429.js +1 -0
  200. package/dist/9429.js.map +1 -0
  201. package/dist/9442.js +1 -0
  202. package/dist/9442.js.map +1 -0
  203. package/dist/961.js +1 -1
  204. package/dist/961.js.map +1 -1
  205. package/dist/968.js +1 -0
  206. package/dist/968.js.map +1 -0
  207. package/dist/9709.js +1 -0
  208. package/dist/9709.js.map +1 -0
  209. package/dist/9768.js +1 -0
  210. package/dist/9768.js.map +1 -0
  211. package/dist/9770.js +1 -0
  212. package/dist/9770.js.map +1 -0
  213. package/dist/9879.js +1 -0
  214. package/dist/9879.js.map +1 -0
  215. package/dist/9974.js +1 -0
  216. package/dist/9974.js.map +1 -0
  217. package/dist/esm-dha-workflow-app.js +1 -1
  218. package/dist/esm-dha-workflow-app.js.buildmanifest.json +2249 -224
  219. package/dist/esm-dha-workflow-app.js.map +1 -1
  220. package/dist/main.js +1 -1
  221. package/dist/main.js.map +1 -1
  222. package/dist/routes.json +1 -1
  223. package/jest.config.js +4 -0
  224. package/local-config.json +9 -0
  225. package/package.json +29 -11
  226. package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
  227. package/src/admissions/admission-request-list/admission-request-list.tsx +263 -0
  228. package/src/admissions/admissions-dashboard.component.scss +15 -0
  229. package/src/admissions/admissions-dashboard.component.tsx +277 -0
  230. package/src/admissions/admissions.resource.ts +233 -0
  231. package/src/admissions/admitted-list/admitted-patients-list.tsx +268 -0
  232. package/src/admissions/awaiting-discharge-list/awaiting-discharge-list.tsx +197 -0
  233. package/src/admissions/bed-assigment-request/bed-assignment-request-list.tsx +134 -0
  234. package/src/admissions/constants/index.ts +33 -0
  235. package/src/admissions/discharged-list/discharged-list.scss +0 -0
  236. package/src/admissions/discharged-list/discharged-list.tsx +67 -0
  237. package/src/admissions/form-entry-workspace/form-entry-workspace.tsx +62 -0
  238. package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
  239. package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
  240. package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
  241. package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
  242. package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
  243. package/src/admissions/modal/add-bill-items/add-bill-items.modal.scss +17 -0
  244. package/src/admissions/modal/add-bill-items/add-bill-items.modal.tsx +220 -0
  245. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
  246. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
  247. package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
  248. package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +111 -0
  249. package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
  250. package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
  251. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
  252. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
  253. package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
  254. package/src/admissions/modal/discharge/discharge-patient.modal.tsx +86 -0
  255. package/src/admissions/types/index.ts +263 -0
  256. package/src/appointments/appointments.component.scss +6 -0
  257. package/src/appointments/appointments.component.tsx +8 -1
  258. package/src/billing/admin/claims/claims-list.component.scss +13 -0
  259. package/src/billing/admin/claims/claims-list.component.tsx +163 -0
  260. package/src/billing/admin/claims-admin-dashboard.component.scss +0 -0
  261. package/src/billing/admin/claims-admin-dashboard.component.tsx +32 -0
  262. package/src/billing/api/billing.api.ts +139 -0
  263. package/src/billing/billing-claims.resource.ts +1112 -0
  264. package/src/billing/billing-dashboard-link.component.tsx +31 -0
  265. package/src/billing/billing-dashboard-reset.ts +27 -0
  266. package/src/billing/billing-root.tsx +37 -0
  267. package/src/billing/dashboard/billingDashboard.component.scss +0 -0
  268. package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
  269. package/src/billing/dashboard/v2/active-visits/active-visits.component.tsx +257 -0
  270. package/src/billing/dashboard/v2/active-visits/active-visits.resource.ts +85 -0
  271. package/src/billing/dashboard/v2/active-visits/active-visits.scss +15 -0
  272. package/src/billing/dashboard/v2/active-visits.component.tsx +102 -0
  273. package/src/billing/dashboard/v2/admissions/admission-requests-tab.component.tsx +79 -0
  274. package/src/billing/dashboard/v2/billing-and-claims-patient-chart.component.tsx +52 -0
  275. package/src/billing/dashboard/v2/billing-claims-dashboard.component.scss +221 -0
  276. package/src/billing/dashboard/v2/billing-claims-dashboard.component.tsx +342 -0
  277. package/src/billing/dashboard/v2/cash-checklist/bill-document.component.scss +90 -0
  278. package/src/billing/dashboard/v2/cash-checklist/bill-document.component.tsx +101 -0
  279. package/src/billing/dashboard/v2/cash-checklist/cash-checklist.component.scss +199 -0
  280. package/src/billing/dashboard/v2/cash-checklist/cash-checklist.component.tsx +361 -0
  281. package/src/billing/dashboard/v2/cash-checklist/cash-checklist.resource.ts +239 -0
  282. package/src/billing/dashboard/v2/cash-checklist/payment-drawer.component.scss +246 -0
  283. package/src/billing/dashboard/v2/cash-checklist/payment-drawer.component.tsx +182 -0
  284. package/src/billing/dashboard/v2/claim-statuses.ts +143 -0
  285. package/src/billing/dashboard/v2/claim-visits/claim-diagnosis-details/claim-diagnosis-details.component.scss +0 -0
  286. package/src/billing/dashboard/v2/claim-visits/claim-diagnosis-details/claim-diagnosis-details.component.tsx +35 -0
  287. package/src/billing/dashboard/v2/claim-visits/claim-diagnosis-details/claim-diagnosis-panel.component.scss +67 -0
  288. package/src/billing/dashboard/v2/claim-visits/claim-diagnosis-details/claim-diagnosis-panel.component.tsx +90 -0
  289. package/src/billing/dashboard/v2/claim-visits/claim-doctors/claim-doctors.scss +28 -0
  290. package/src/billing/dashboard/v2/claim-visits/claim-doctors/claim-doctors.tsx +36 -0
  291. package/src/billing/dashboard/v2/claim-visits/claim-history/claim-history.component.scss +119 -0
  292. package/src/billing/dashboard/v2/claim-visits/claim-history/claim-history.component.tsx +198 -0
  293. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/claim-intervention-details.component.scss +5 -0
  294. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/claim-intervention-details.component.tsx +160 -0
  295. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/claim-intervention-panel.component.scss +105 -0
  296. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/claim-intervention-panel.component.tsx +184 -0
  297. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/intervention-attachments.component.scss +161 -0
  298. package/src/billing/dashboard/v2/claim-visits/claim-intervention-details/intervention-attachments.component.tsx +328 -0
  299. package/src/billing/dashboard/v2/claim-visits/claim-invoice-details/claim-invoice-details.component.tsx +96 -0
  300. package/src/billing/dashboard/v2/claim-visits/claim-invoice-details/claim-invoice-document.component.tsx +236 -0
  301. package/src/billing/dashboard/v2/claim-visits/claim-invoice-details/claim-invoice-panel.component.scss +98 -0
  302. package/src/billing/dashboard/v2/claim-visits/claim-invoice-details/claim-invoice-panel.component.tsx +293 -0
  303. package/src/billing/dashboard/v2/claim-visits/claim-invoice-line-details/claim-invoice-line-details.component.scss +133 -0
  304. package/src/billing/dashboard/v2/claim-visits/claim-invoice-line-details/claim-invoice-line-details.component.tsx +217 -0
  305. package/src/billing/dashboard/v2/claim-visits/claim-list/claim-visits.component.scss +28 -0
  306. package/src/billing/dashboard/v2/claim-visits/claim-list/claim-visits.component.tsx +315 -0
  307. package/src/billing/dashboard/v2/claim-visits/claim-visit-details/claim-details-by-token.component.tsx +150 -0
  308. package/src/billing/dashboard/v2/claim-visits/claim-visit-details/claim-details-page.component.scss +13 -0
  309. package/src/billing/dashboard/v2/claim-visits/claim-visit-details/claim-details-page.component.tsx +116 -0
  310. package/src/billing/dashboard/v2/claim-visits/claim-visit-details/claim-visit-details.component.scss +338 -0
  311. package/src/billing/dashboard/v2/claim-visits/claim-visit-details/claim-visit-details.component.tsx +616 -0
  312. package/src/billing/dashboard/v2/claim-visits/modal/claim-doctors/add-claim-doctor/add-claim-doctor.modal.scss +5 -0
  313. package/src/billing/dashboard/v2/claim-visits/modal/claim-doctors/add-claim-doctor/add-claim-doctor.modal.tsx +49 -0
  314. package/src/billing/dashboard/v2/claim-visits/modal/claim-visit-details/claim-visit-details.modal.scss +17 -0
  315. package/src/billing/dashboard/v2/claim-visits/modal/claim-visit-details/claim-visit-details.modal.tsx +56 -0
  316. package/src/billing/dashboard/v2/claim-visits/modal/close-claim/close-claim.modal.scss +0 -0
  317. package/src/billing/dashboard/v2/claim-visits/modal/close-claim/close-claim.modal.tsx +129 -0
  318. package/src/billing/dashboard/v2/claim-visits/modal/submit-claim/submit-claim.modal.tsx +280 -0
  319. package/src/billing/dashboard/v2/claim-visits/shared/_empty-state.scss +28 -0
  320. package/src/billing/dashboard/v2/claim-visits/shared/record-cards.component.scss +298 -0
  321. package/src/billing/dashboard/v2/claim-visits/shared/record-cards.component.tsx +252 -0
  322. package/src/billing/dashboard/v2/claim-visits/shared/record-details.workspace.scss +42 -0
  323. package/src/billing/dashboard/v2/claim-visits/shared/record-details.workspace.tsx +67 -0
  324. package/src/billing/dashboard/v2/claim-visits/shared/record-table.component.scss +61 -0
  325. package/src/billing/dashboard/v2/claim-visits/shared/record-table.component.tsx +150 -0
  326. package/src/billing/dashboard/v2/claim-visits/switch-intervention/switch-intervention.resource.ts +51 -0
  327. package/src/billing/dashboard/v2/claim-visits/switch-intervention/switch-intervention.workspace.scss +191 -0
  328. package/src/billing/dashboard/v2/claim-visits/switch-intervention/switch-intervention.workspace.tsx +660 -0
  329. package/src/billing/dashboard/v2/claim-workspace/claim-workspace.component.scss +595 -0
  330. package/src/billing/dashboard/v2/claim-workspace/claim-workspace.component.tsx +810 -0
  331. package/src/billing/dashboard/v2/claim-workspace/claim-workspace.resource.ts +282 -0
  332. package/src/billing/dashboard/v2/claims-accounting/bill-utils.ts +134 -0
  333. package/src/billing/dashboard/v2/claims-accounting/claim-detail.component.tsx +346 -0
  334. package/src/billing/dashboard/v2/claims-accounting/claims-accounting.component.scss +546 -0
  335. package/src/billing/dashboard/v2/claims-accounting/claims-accounting.component.tsx +206 -0
  336. package/src/billing/dashboard/v2/claims-accounting/claims-accounting.resource.ts +337 -0
  337. package/src/billing/dashboard/v2/claims-accounting/invoice-document.component.scss +90 -0
  338. package/src/billing/dashboard/v2/claims-accounting/invoice-document.component.tsx +90 -0
  339. package/src/billing/dashboard/v2/claims-accounting/remittances.component.tsx +169 -0
  340. package/src/billing/dashboard/v2/claims-accounting/remittances.resource.ts +46 -0
  341. package/src/billing/dashboard/v2/claims-accounting/status-meta.ts +25 -0
  342. package/src/billing/dashboard/v2/clearance/cash-patients.scss +18 -0
  343. package/src/billing/dashboard/v2/clearance/cash.component.tsx +145 -0
  344. package/src/billing/dashboard/v2/clearance/clearance.component.scss +84 -0
  345. package/src/billing/dashboard/v2/clearance/clearance.component.tsx +225 -0
  346. package/src/billing/dashboard/v2/clearance/pay-cash.component.tsx +199 -0
  347. package/src/billing/dashboard/v2/clearance/pay-cash.scss +28 -0
  348. package/src/billing/dashboard/v2/clearance/prepaid-services.component.tsx +112 -0
  349. package/src/billing/dashboard/v2/facility-bills/claim-status.ts +249 -0
  350. package/src/billing/dashboard/v2/facility-bills/facility-bills.component.scss +140 -0
  351. package/src/billing/dashboard/v2/facility-bills/facility-bills.component.tsx +688 -0
  352. package/src/billing/dashboard/v2/facility-bills/preauths-datatables/pending-preauths.component.tsx +132 -0
  353. package/src/billing/dashboard/v2/facility-bills/preauths-datatables/preauth-preview-table.component.tsx +267 -0
  354. package/src/billing/dashboard/v2/facility-bills/preauths.component.tsx +130 -0
  355. package/src/billing/dashboard/v2/inpatient-requests/inpatient-requests.component.scss +22 -0
  356. package/src/billing/dashboard/v2/inpatient-requests/inpatient-requests.component.tsx +382 -0
  357. package/src/billing/dashboard/v2/inpatient-requests/modal/start-inpatient-claim/start-inpatient-claim.component.scss +0 -0
  358. package/src/billing/dashboard/v2/inpatient-requests/modal/start-inpatient-claim/start-inpatient-claim.component.tsx +0 -0
  359. package/src/billing/dashboard/v2/new-facility-bills/bills-table.component.tsx +78 -0
  360. package/src/billing/dashboard/v2/new-facility-bills/bills-table.scss +18 -0
  361. package/src/billing/dashboard/v2/new-facility-bills/new-facility-bills.component.tsx +64 -0
  362. package/src/billing/dashboard/v2/new-facility-bills/new-facility-bills.scss +146 -0
  363. package/src/billing/dashboard/v2/patient-bill-details/attachments/add-attachments.component.tsx +234 -0
  364. package/src/billing/dashboard/v2/patient-bill-details/attachments/attachment.component.tsx +157 -0
  365. package/src/billing/dashboard/v2/patient-bill-details/attachments/attachments.scss +92 -0
  366. package/src/billing/dashboard/v2/patient-bill-details/attachments/case-summary/case-summary.scss +295 -0
  367. package/src/billing/dashboard/v2/patient-bill-details/attachments/case-summary/case-summary.tsx +326 -0
  368. package/src/billing/dashboard/v2/patient-bill-details/attachments/death-notification.component.tsx +162 -0
  369. package/src/billing/dashboard/v2/patient-bill-details/attachments/death-notification.resource.ts +112 -0
  370. package/src/billing/dashboard/v2/patient-bill-details/attachments/death-notification.scss +88 -0
  371. package/src/billing/dashboard/v2/patient-bill-details/attachments/dialysis/dialysis-chart.scss +238 -0
  372. package/src/billing/dashboard/v2/patient-bill-details/attachments/dialysis/dialysis-chart.tsx +269 -0
  373. package/src/billing/dashboard/v2/patient-bill-details/attachments/discharge-summary/discharge-summary.scss +96 -0
  374. package/src/billing/dashboard/v2/patient-bill-details/attachments/discharge-summary/discharge-summary.tsx +124 -0
  375. package/src/billing/dashboard/v2/patient-bill-details/attachments/final-bill.component.tsx +152 -0
  376. package/src/billing/dashboard/v2/patient-bill-details/attachments/final-bill.scss +225 -0
  377. package/src/billing/dashboard/v2/patient-bill-details/attachments/general-discharge-summary/general-discharge-summary.scss +182 -0
  378. package/src/billing/dashboard/v2/patient-bill-details/attachments/general-discharge-summary/general-discharge-summary.tsx +173 -0
  379. package/src/billing/dashboard/v2/patient-bill-details/attachments/generate-attachments.component.tsx +450 -0
  380. package/src/billing/dashboard/v2/patient-bill-details/attachments/invoice.component.tsx +151 -0
  381. package/src/billing/dashboard/v2/patient-bill-details/attachments/invoice.scss +225 -0
  382. package/src/billing/dashboard/v2/patient-bill-details/attachments/type.ts +44 -0
  383. package/src/billing/dashboard/v2/patient-bill-details/bill-details/bill-details.scss +107 -0
  384. package/src/billing/dashboard/v2/patient-bill-details/bill-details/bill-details.tsx +508 -0
  385. package/src/billing/dashboard/v2/patient-bill-details/bill-details-page.component.scss +30 -0
  386. package/src/billing/dashboard/v2/patient-bill-details/bill-details-page.component.tsx +94 -0
  387. package/src/billing/dashboard/v2/patient-bill-details/claim-details/claim-details-skeleton.component.scss +89 -0
  388. package/src/billing/dashboard/v2/patient-bill-details/claim-details/claim-details-skeleton.component.tsx +53 -0
  389. package/src/billing/dashboard/v2/patient-bill-details/claim-details/patient-claim-details.component.scss +32 -0
  390. package/src/billing/dashboard/v2/patient-bill-details/claim-details/patient-claim-details.component.tsx +215 -0
  391. package/src/billing/dashboard/v2/patient-bill-details/modals/add-claim-diagnosis/add-claim-diagnosis.modal.scss +0 -0
  392. package/src/billing/dashboard/v2/patient-bill-details/modals/add-claim-diagnosis/add-claim-diagnosis.modal.tsx +99 -0
  393. package/src/billing/dashboard/v2/patient-bill-details/modals/add-claim-line/add-claim-line.modal.tsx +187 -0
  394. package/src/billing/dashboard/v2/patient-bill-details/patient-bill-details.scss +153 -0
  395. package/src/billing/dashboard/v2/patient-bill-details/patient-bill-details.tsx +458 -0
  396. package/src/billing/dashboard/v2/patient-bill-details/payment-mode.ts +124 -0
  397. package/src/billing/dashboard/v2/patient-bill-details/workspaces/add-claim-line/add-claim-line.workspace.scss +27 -0
  398. package/src/billing/dashboard/v2/patient-bill-details/workspaces/add-claim-line/add-claim-line.workspace.tsx +234 -0
  399. package/src/billing/dashboard/v2/patient-bill-details/workspaces/bill-item-payment/bill-item-payment.workspace.scss +27 -0
  400. package/src/billing/dashboard/v2/patient-bill-details/workspaces/bill-item-payment/bill-item-payment.workspace.tsx +123 -0
  401. package/src/billing/dashboard/v2/preauth/preauth-attachments.component.tsx +389 -0
  402. package/src/billing/dashboard/v2/preauth/preauth-list.component.scss +38 -0
  403. package/src/billing/dashboard/v2/preauth/preauth-list.component.tsx +241 -0
  404. package/src/billing/dashboard/v2/preauth/preauth-status-tag.component.tsx +75 -0
  405. package/src/billing/dashboard/v2/preauth/preauth-typed-fields.md +125 -0
  406. package/src/billing/dashboard/v2/preauth/preauth.resource.ts +1032 -0
  407. package/src/billing/dashboard/v2/preauth/preauth.workspace.scss +91 -0
  408. package/src/billing/dashboard/v2/preauth/preauth.workspace.tsx +1802 -0
  409. package/src/billing/dashboard/v2/preauth/preauthorizations-tab.component.tsx +53 -0
  410. package/src/billing/dashboard/v2/sha-claims/sha-claims-table.component.tsx +36 -0
  411. package/src/billing/dashboard/v2/sha-claims/sha-claims.component.tsx +60 -0
  412. package/src/billing/dashboard/v2/sha-claims/sha-claims.scss +8 -0
  413. package/src/billing/dashboard/v2/shared/dash-board-card/dash-board-card.component.scss +17 -0
  414. package/src/billing/dashboard/v2/shared/dash-board-card/dash-board-card.component.tsx +15 -0
  415. package/src/billing/dashboard/v2/shared/empty-state.component.scss +24 -0
  416. package/src/billing/dashboard/v2/shared/empty-state.component.tsx +13 -0
  417. package/src/billing/dashboard/v2/shared/scroll-to-top.component.scss +54 -0
  418. package/src/billing/dashboard/v2/shared/scroll-to-top.component.tsx +54 -0
  419. package/src/billing/dashboard/v2/shared/table-toolbar.component.scss +77 -0
  420. package/src/billing/dashboard/v2/shared/table-toolbar.component.tsx +48 -0
  421. package/src/billing/dashboard/v2/types/index.ts +534 -0
  422. package/src/billing/dashboard/v3/active-visits/active-visits.component.tsx +256 -0
  423. package/src/billing/dashboard/v3/active-visits/active-visits.resource.ts +57 -0
  424. package/src/billing/dashboard/v3/active-visits/active-visits.scss +15 -0
  425. package/src/billing/dashboard/v3/cash-checklist/bill-document.component.scss +90 -0
  426. package/src/billing/dashboard/v3/cash-checklist/bill-document.component.tsx +101 -0
  427. package/src/billing/dashboard/v3/cash-checklist/cash-checklist.component.scss +199 -0
  428. package/src/billing/dashboard/v3/cash-checklist/cash-checklist.component.tsx +361 -0
  429. package/src/billing/dashboard/v3/cash-checklist/cash-checklist.resource.ts +240 -0
  430. package/src/billing/dashboard/v3/cash-checklist/payment-drawer.component.scss +246 -0
  431. package/src/billing/dashboard/v3/cash-checklist/payment-drawer.component.tsx +182 -0
  432. package/src/billing/dashboard/v3/claim-visits/claim-diagnosis-details/claim-diagnosis-details.component.scss +0 -0
  433. package/src/billing/dashboard/v3/claim-visits/claim-diagnosis-details/claim-diagnosis-details.component.tsx +44 -0
  434. package/src/billing/dashboard/v3/claim-visits/claim-doctors/claim-doctors.scss +5 -0
  435. package/src/billing/dashboard/v3/claim-visits/claim-doctors/claim-doctors.tsx +40 -0
  436. package/src/billing/dashboard/v3/claim-visits/claim-documents/claim-documents.scss +10 -0
  437. package/src/billing/dashboard/v3/claim-visits/claim-documents/claim-documents.tsx +25 -0
  438. package/src/billing/dashboard/v3/claim-visits/claim-intervention-details/claim-intervention-details.component.tsx +268 -0
  439. package/src/billing/dashboard/v3/claim-visits/claim-invoice-details/claim-invoice-details.component.scss +6 -0
  440. package/src/billing/dashboard/v3/claim-visits/claim-invoice-details/claim-invoice-details.component.tsx +85 -0
  441. package/src/billing/dashboard/v3/claim-visits/claim-invoice-line-details/claim-invoice-line-details.component.scss +0 -0
  442. package/src/billing/dashboard/v3/claim-visits/claim-invoice-line-details/claim-invoice-line-details.component.tsx +109 -0
  443. package/src/billing/dashboard/v3/claim-visits/claim-visit-details/claim-visit-details.component.scss +103 -0
  444. package/src/billing/dashboard/v3/claim-visits/claim-visit-details/claim-visit-details.component.tsx +519 -0
  445. package/src/billing/dashboard/v3/claim-visits/claim-visits.component.scss +5 -0
  446. package/src/billing/dashboard/v3/claim-visits/claim-visits.component.tsx +139 -0
  447. package/src/billing/dashboard/v3/claim-visits/modal/claim-doctors/add-claim-doctor/add-claim-doctor.modal.scss +5 -0
  448. package/src/billing/dashboard/v3/claim-visits/modal/claim-doctors/add-claim-doctor/add-claim-doctor.modal.tsx +49 -0
  449. package/src/billing/dashboard/v3/claim-visits/modal/claim-invoice-lines/claim-invoice-lines.modal.scss +7 -0
  450. package/src/billing/dashboard/v3/claim-visits/modal/claim-invoice-lines/claim-invoice-lines.modal.tsx +35 -0
  451. package/src/billing/dashboard/v3/claim-visits/modal/claim-visit-details/claim-visit-details.modal.scss +6 -0
  452. package/src/billing/dashboard/v3/claim-visits/modal/claim-visit-details/claim-visit-details.modal.tsx +33 -0
  453. package/src/billing/dashboard/v3/claim-visits/modal/close-claim/close-claim.modal.scss +0 -0
  454. package/src/billing/dashboard/v3/claim-visits/modal/close-claim/close-claim.modal.tsx +129 -0
  455. package/src/billing/dashboard/v3/claim-visits/modal/identify-emergency-unknown-patient/identify-emergencu-unknown-patient.scss +407 -0
  456. package/src/billing/dashboard/v3/claim-visits/modal/identify-emergency-unknown-patient/identify-emergency-unknown-patient.component.tsx +523 -0
  457. package/src/billing/dashboard/v3/claim-visits/modal/identify-emergency-unknown-patient/identify-patient-helper.ts +77 -0
  458. package/src/billing/dashboard/v3/claim-visits/modal/submit-claim/submit-claim.modal.tsx +280 -0
  459. package/src/billing/dashboard/v3/claim-visits/modal/submit-emergency-claim/submit-emergency-claim.component.tsx +91 -0
  460. package/src/billing/dashboard/v3/claim-visits/modal/submit-emergency-claim/submit-emergency.scss +14 -0
  461. package/src/billing/dashboard/v3/claim-visits/payer-preview/index.scss +140 -0
  462. package/src/billing/dashboard/v3/claim-visits/payer-preview/payer-preview-tile.component.tsx +55 -0
  463. package/src/billing/dashboard/v3/claim-visits/payer-preview/payer-preview-workspace.component.tsx +171 -0
  464. package/src/billing/dashboard/v3/claim-visits/payer-preview/tables/payer-claim-doctors.component.tsx +54 -0
  465. package/src/billing/dashboard/v3/claim-visits/payer-preview/tables/payer-claim-lines.component.tsx +48 -0
  466. package/src/billing/dashboard/v3/claim-visits/payer-preview/tables/payer-claim-notes.component.tsx +47 -0
  467. package/src/billing/dashboard/v3/claim-visits/payer-preview/tables/payer-diagnoses.component.tsx +44 -0
  468. package/src/billing/dashboard/v3/claim-visits/payer-preview/tables/payer-interventions.component.tsx +44 -0
  469. package/src/billing/dashboard/v3/claim-visits/switch-intervention/switch-intervention.resource.ts +51 -0
  470. package/src/billing/dashboard/v3/claim-visits/switch-intervention/switch-intervention.workspace.scss +191 -0
  471. package/src/billing/dashboard/v3/claim-visits/switch-intervention/switch-intervention.workspace.tsx +644 -0
  472. package/src/billing/dashboard/v3/claim-workspace/claim-workspace.component.scss +595 -0
  473. package/src/billing/dashboard/v3/claim-workspace/claim-workspace.component.tsx +810 -0
  474. package/src/billing/dashboard/v3/claim-workspace/claim-workspace.resource.ts +282 -0
  475. package/src/billing/dashboard/v3/claims-accounting/bill-utils.ts +134 -0
  476. package/src/billing/dashboard/v3/claims-accounting/claim-detail.component.tsx +346 -0
  477. package/src/billing/dashboard/v3/claims-accounting/claims-accounting.component.scss +546 -0
  478. package/src/billing/dashboard/v3/claims-accounting/claims-accounting.component.tsx +206 -0
  479. package/src/billing/dashboard/v3/claims-accounting/claims-accounting.resource.ts +337 -0
  480. package/src/billing/dashboard/v3/claims-accounting/invoice-document.component.scss +90 -0
  481. package/src/billing/dashboard/v3/claims-accounting/invoice-document.component.tsx +90 -0
  482. package/src/billing/dashboard/v3/claims-accounting/remittances.component.tsx +169 -0
  483. package/src/billing/dashboard/v3/claims-accounting/remittances.resource.ts +46 -0
  484. package/src/billing/dashboard/v3/claims-accounting/status-meta.ts +25 -0
  485. package/src/billing/dashboard/v3/claims-stats-dashboard/claim-stat/claim-stat.component.scss +27 -0
  486. package/src/billing/dashboard/v3/claims-stats-dashboard/claim-stat/claim-stat.component.tsx +41 -0
  487. package/src/billing/dashboard/v3/claims-stats-dashboard/claims-stats-dashboard.component.scss +16 -0
  488. package/src/billing/dashboard/v3/claims-stats-dashboard/claims-stats-dashboard.component.tsx +184 -0
  489. package/src/billing/dashboard/v3/claims-stats-dashboard/modal/claim-stats-list/claim-stats-list.modal.scss +0 -0
  490. package/src/billing/dashboard/v3/claims-stats-dashboard/modal/claim-stats-list/claim-stats-list.modal.tsx +27 -0
  491. package/src/billing/dashboard/v3/clearance/clearance.component.scss +100 -0
  492. package/src/billing/dashboard/v3/clearance/clearance.component.tsx +0 -0
  493. package/src/billing/dashboard/v3/clearance/prepaid-services.component.tsx +112 -0
  494. package/src/billing/dashboard/v3/facility-bills/claim-status.ts +243 -0
  495. package/src/billing/dashboard/v3/facility-bills/facility-bills.component.scss +92 -0
  496. package/src/billing/dashboard/v3/facility-bills/facility-bills.component.tsx +306 -0
  497. package/src/billing/dashboard/v3/facility-bills/preauths-datatables/pending-preauths.component.tsx +132 -0
  498. package/src/billing/dashboard/v3/facility-bills/preauths-datatables/preauth-preview-table.component.tsx +232 -0
  499. package/src/billing/dashboard/v3/facility-bills/preauths.component.tsx +127 -0
  500. package/src/billing/dashboard/v3/patient-bill-details/attachments/add-attachments.component.tsx +228 -0
  501. package/src/billing/dashboard/v3/patient-bill-details/attachments/attachment.component.tsx +157 -0
  502. package/src/billing/dashboard/v3/patient-bill-details/attachments/attachments.scss +92 -0
  503. package/src/billing/dashboard/v3/patient-bill-details/attachments/case-summary/case-summary-helper.ts +58 -0
  504. package/src/billing/dashboard/v3/patient-bill-details/attachments/case-summary/case-summary.scss +295 -0
  505. package/src/billing/dashboard/v3/patient-bill-details/attachments/case-summary/case-summary.tsx +287 -0
  506. package/src/billing/dashboard/v3/patient-bill-details/attachments/dialysis/dialysis-chart.scss +238 -0
  507. package/src/billing/dashboard/v3/patient-bill-details/attachments/dialysis/dialysis-chart.tsx +352 -0
  508. package/src/billing/dashboard/v3/patient-bill-details/attachments/dialysis/dialysis-helper.ts +117 -0
  509. package/src/billing/dashboard/v3/patient-bill-details/attachments/discharge-summary/discharge-summary.scss +96 -0
  510. package/src/billing/dashboard/v3/patient-bill-details/attachments/discharge-summary/discharge-summary.tsx +126 -0
  511. package/src/billing/dashboard/v3/patient-bill-details/attachments/final-bill.component.tsx +75 -0
  512. package/src/billing/dashboard/v3/patient-bill-details/attachments/general-discharge-summary/general-discharge-summary.scss +182 -0
  513. package/src/billing/dashboard/v3/patient-bill-details/attachments/general-discharge-summary/general-discharge-summary.tsx +253 -0
  514. package/src/billing/dashboard/v3/patient-bill-details/attachments/generate-attachments.component.tsx +450 -0
  515. package/src/billing/dashboard/v3/patient-bill-details/attachments/invoice.component.tsx +151 -0
  516. package/src/billing/dashboard/v3/patient-bill-details/attachments/invoice.scss +225 -0
  517. package/src/billing/dashboard/v3/patient-bill-details/attachments/lab-results/lab-orders.component.tsx +198 -0
  518. package/src/billing/dashboard/v3/patient-bill-details/attachments/lab-results/lab-orders.scss +227 -0
  519. package/src/billing/dashboard/v3/patient-bill-details/attachments/medical-report/medical-report.component.tsx +346 -0
  520. package/src/billing/dashboard/v3/patient-bill-details/attachments/medical-report/medical-report.scss +265 -0
  521. package/src/billing/dashboard/v3/patient-bill-details/attachments/proforma-invoice/proforma-invoice.component.tsx +347 -0
  522. package/src/billing/dashboard/v3/patient-bill-details/attachments/proforma-invoice/proforma-invoice.scss +285 -0
  523. package/src/billing/dashboard/v3/patient-bill-details/attachments/type.ts +280 -0
  524. package/src/billing/dashboard/v3/patient-bill-details/attachments/ultrasound-report/ultrasound-report.scss +273 -0
  525. package/src/billing/dashboard/v3/patient-bill-details/attachments/ultrasound-report/utlrasound-report.component.tsx +435 -0
  526. package/src/billing/dashboard/v3/patient-bill-details/bill-details/bill-details.scss +17 -0
  527. package/src/billing/dashboard/v3/patient-bill-details/bill-details/bill-details.tsx +377 -0
  528. package/src/billing/dashboard/v3/patient-bill-details/claim-details/patient-claim-details.component.scss +0 -0
  529. package/src/billing/dashboard/v3/patient-bill-details/claim-details/patient-claim-details.component.tsx +71 -0
  530. package/src/billing/dashboard/v3/patient-bill-details/modals/add-claim-diagnosis/add-claim-diagnosis.modal.scss +0 -0
  531. package/src/billing/dashboard/v3/patient-bill-details/modals/add-claim-diagnosis/add-claim-diagnosis.modal.tsx +99 -0
  532. package/src/billing/dashboard/v3/patient-bill-details/modals/add-claim-line/add-claim-line.modal.scss +14 -0
  533. package/src/billing/dashboard/v3/patient-bill-details/modals/add-claim-line/add-claim-line.modal.tsx +156 -0
  534. package/src/billing/dashboard/v3/patient-bill-details/modals/bill-item-payment/bill-item-payment.modal.scss +6 -0
  535. package/src/billing/dashboard/v3/patient-bill-details/modals/bill-item-payment/bill-item-payment.modal.tsx +137 -0
  536. package/src/billing/dashboard/v3/patient-bill-details/modals/claim-details/claim-details.modal.scss +28 -0
  537. package/src/billing/dashboard/v3/patient-bill-details/modals/claim-details/claim-details.modal.tsx +170 -0
  538. package/src/billing/dashboard/v3/patient-bill-details/modals/pomsf/pomsf-scheme-balance.util.test.ts +56 -0
  539. package/src/billing/dashboard/v3/patient-bill-details/modals/pomsf/pomsf-scheme-balance.util.ts +27 -0
  540. package/src/billing/dashboard/v3/patient-bill-details/modals/pomsf/set-effective-pomsf-coverage.component.tsx +128 -0
  541. package/src/billing/dashboard/v3/patient-bill-details/modals/pomsf/set-effective-pomsf-coverage.scss +27 -0
  542. package/src/billing/dashboard/v3/patient-bill-details/patient-bill-details.scss +85 -0
  543. package/src/billing/dashboard/v3/patient-bill-details/patient-bill-details.tsx +363 -0
  544. package/src/billing/dashboard/v3/patient-bill-details/patient-visit-details.tsx +256 -0
  545. package/src/billing/dashboard/v3/patient-bill-details/patient-visit.scss +9 -0
  546. package/src/billing/dashboard/v3/patient-bill-details/visit-diagnosis-details/visit-diagnosis-details.component.scss +0 -0
  547. package/src/billing/dashboard/v3/patient-bill-details/visit-diagnosis-details/visit-diagnosis-details.component.tsx +102 -0
  548. package/src/billing/dashboard/v3/preauth/elective/elective-authorize.resource.ts +284 -0
  549. package/src/billing/dashboard/v3/preauth/elective/elective-preauth-request.workspace.scss +125 -0
  550. package/src/billing/dashboard/v3/preauth/elective/elective-preauth-request.workspace.tsx +1184 -0
  551. package/src/billing/dashboard/v3/preauth/elective/elective-preauth.component.scss +15 -0
  552. package/src/billing/dashboard/v3/preauth/elective/elective-preauth.component.tsx +377 -0
  553. package/src/billing/dashboard/v3/preauth/elective/elective-preauth.resource.ts +1378 -0
  554. package/src/billing/dashboard/v3/preauth/elective/elective-requests-list.component.tsx +357 -0
  555. package/src/billing/dashboard/v3/preauth/preauth-attachments.component.tsx +388 -0
  556. package/src/billing/dashboard/v3/preauth/preauth-list.component.scss +34 -0
  557. package/src/billing/dashboard/v3/preauth/preauth-list.component.tsx +300 -0
  558. package/src/billing/dashboard/v3/preauth/preauth-status-tag.component.tsx +75 -0
  559. package/src/billing/dashboard/v3/preauth/preauth-typed-fields.md +125 -0
  560. package/src/billing/dashboard/v3/preauth/preauth.resource.ts +1549 -0
  561. package/src/billing/dashboard/v3/preauth/preauth.workspace.scss +176 -0
  562. package/src/billing/dashboard/v3/preauth/preauth.workspace.tsx +2458 -0
  563. package/src/billing/dashboard/v3/preauth/preauthorizations-tab.component.tsx +55 -0
  564. package/src/billing/dashboard/v3/shared/empty-state.component.scss +25 -0
  565. package/src/billing/dashboard/v3/shared/empty-state.component.tsx +13 -0
  566. package/src/billing/dashboard/v3/shared/table-toolbar.component.scss +64 -0
  567. package/src/billing/dashboard/v3/shared/table-toolbar.component.tsx +48 -0
  568. package/src/billing/dashboard/v3/types/index.ts +450 -0
  569. package/src/billing/extensions/generate-order-bill-button/generate-order-bill-button.extension.tsx +55 -0
  570. package/src/billing/extensions/generate-order-bill-button/generate-order-bill-button.scss +16 -0
  571. package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
  572. package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +514 -0
  573. package/src/billing/invoice/bill.resource.ts +47 -0
  574. package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
  575. package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
  576. package/src/billing/invoice/invoice.scss +113 -0
  577. package/src/billing/invoice/invoice.tsx +1441 -0
  578. package/src/billing/invoice/line-items/line-items.scss +0 -0
  579. package/src/billing/invoice/line-items/line-items.tsx +120 -0
  580. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
  581. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
  582. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
  583. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
  584. package/src/billing/invoice/payment-details/payment-details.scss +0 -0
  585. package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
  586. package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
  587. package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
  588. package/src/billing/maternity-discharge.resource.ts +21 -0
  589. package/src/billing/reports/billing-and-claims-reports-dashboard.scss +40 -0
  590. package/src/billing/reports/billing-and-claims-reports-dashboard.tsx +32 -0
  591. package/src/billing/reports/claims/claims-report-dashboard.scss +55 -0
  592. package/src/billing/reports/claims/claims-report-dashboard.tsx +136 -0
  593. package/src/billing/reports/claims/summary-data/summary-data.scss +24 -0
  594. package/src/billing/reports/claims/summary-data/summary-data.tsx +184 -0
  595. package/src/billing/types/index.ts +411 -0
  596. package/src/billing/utils/index.ts +17 -0
  597. package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
  598. package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
  599. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +223 -0
  600. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
  601. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +874 -0
  602. package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +20 -0
  603. package/src/billing/workspaces/create-order-bill-form-workspace/types.ts +49 -0
  604. package/src/bookings/bookings.component.scss +7 -0
  605. package/src/bookings/bookings.component.tsx +35 -0
  606. package/src/bookings/daily/daily-bookings.resource.ts +2 -1
  607. package/src/case-summary/case-summary.extension.scss +13 -0
  608. package/src/case-summary/case-summary.extension.tsx +40 -0
  609. package/src/case-summary/case-summary.resource.test.ts +69 -0
  610. package/src/case-summary/case-summary.resource.ts +52 -0
  611. package/src/case-summary/components/case-summary-printable.component.scss +174 -0
  612. package/src/case-summary/components/case-summary-printable.component.tsx +288 -0
  613. package/src/case-summary/components/case-summary-printable.utils.ts +51 -0
  614. package/src/case-summary/types/case-summary.types.ts +152 -0
  615. package/src/claims/claims.component.scss +70 -0
  616. package/src/claims/claims.component.tsx +743 -0
  617. package/src/claims/claims.resource.ts +1855 -0
  618. package/src/claims/index.ts +365 -0
  619. package/src/claims/interventions.resource.ts +131 -0
  620. package/src/claims/utils.ts +64 -0
  621. package/src/config-schema.ts +264 -0
  622. package/src/context/patient-context.tsx +27 -0
  623. package/src/critical-care-unit/critical-care-root.tsx +23 -0
  624. package/src/critical-care-unit/hdu/hdu-queues.component.scss +7 -0
  625. package/src/critical-care-unit/hdu/hdu-queues.component.tsx +31 -0
  626. package/src/critical-care-unit/hdu/queues/consultation/hdu-consultation.tsx +18 -0
  627. package/src/critical-care-unit/icu/icu-queues.component.scss +7 -0
  628. package/src/critical-care-unit/icu/icu-queues.component.tsx +31 -0
  629. package/src/critical-care-unit/icu/queues/consultation/icu-consultation.tsx +17 -0
  630. package/src/critical-care-unit/icu-burns/icu-burns-queues.component.scss +7 -0
  631. package/src/critical-care-unit/icu-burns/icu-burns-queues.component.tsx +30 -0
  632. package/src/critical-care-unit/icu-burns/queues/consultation/icu-burns-consultation.tsx +17 -0
  633. package/src/critical-care-unit/nicu/nicu-queues.component.scss +7 -0
  634. package/src/critical-care-unit/nicu/nicu-queues.component.tsx +31 -0
  635. package/src/critical-care-unit/nicu/queues/consultation/nicu-consultation.tsx +17 -0
  636. package/src/critical-care-unit/picu/picu-queues.component.scss +7 -0
  637. package/src/critical-care-unit/picu/picu-queues.component.tsx +31 -0
  638. package/src/critical-care-unit/picu/queues/consultation/picu-consultation.tsx +17 -0
  639. package/src/dashboard/charts/chart.component.scss +24 -0
  640. package/src/dashboard/charts/chart.component.tsx +56 -0
  641. package/src/dashboard/dashboard.component.scss +48 -3
  642. package/src/dashboard/dashboard.component.tsx +29 -38
  643. package/src/dashboard/overview/overview.component.scss +40 -59
  644. package/src/dashboard/overview/overview.component.tsx +55 -41
  645. package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
  646. package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
  647. package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
  648. package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
  649. package/src/dashboard-meta/case-summary.meta.ts +6 -0
  650. package/src/dashboard-meta/claims-admin.meta.ts +6 -0
  651. package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
  652. package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
  653. package/src/dashboard-meta/elective-preauth.meta.ts +6 -0
  654. package/src/dashboard-meta/emt-dashboard.meta.ts +6 -0
  655. package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
  656. package/src/dashboard-meta/maternity-dashboard.meta.ts +6 -0
  657. package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
  658. package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
  659. package/src/{registry-dashboard.meta.ts → dashboard-meta/registry-dashboard.meta.ts} +2 -2
  660. package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
  661. package/src/dashboard-meta/shr-dashboard.meta.ts +19 -0
  662. package/src/dashboard-meta/specialized-clinics-dashboard.meta.ts +6 -0
  663. package/src/dashboard-meta/telemedicine-dashboard.meta.ts +6 -0
  664. package/src/dashboard-meta/telemedicine-patient-chart.meta.ts +6 -0
  665. package/src/death-reporting/death-reporting-form-button.component.tsx +50 -0
  666. package/src/death-reporting/death-reporting-form-button.resource.ts +64 -0
  667. package/src/emt/cr-lookup.resource.test.ts +88 -0
  668. package/src/emt/cr-lookup.resource.ts +42 -0
  669. package/src/emt/emt-queue.component.test.tsx +353 -0
  670. package/src/emt/emt-queue.component.tsx +463 -0
  671. package/src/emt/emt-queue.scss +85 -0
  672. package/src/emt/emt.resource.test.ts +247 -0
  673. package/src/emt/emt.resource.ts +150 -0
  674. package/src/emt/handover-modal/handover-modal.component.test.tsx +273 -0
  675. package/src/emt/handover-modal/handover-modal.component.tsx +538 -0
  676. package/src/emt/handover-modal/handover-modal.scss +113 -0
  677. package/src/emt/types/emt.types.ts +137 -0
  678. package/src/index.ts +232 -11
  679. package/src/mnch/maternity/maternity-queues.component.scss +7 -0
  680. package/src/mnch/maternity/maternity-queues.component.tsx +32 -0
  681. package/src/mnch/maternity/queues/triage/maternity-triage.tsx +15 -0
  682. package/src/mnch/mch/mch-queues.component.scss +10 -0
  683. package/src/mnch/mch/mch-queues.component.tsx +36 -0
  684. package/src/{mch → mnch/mch}/queues/consultation/mch-consultation.tsx +2 -2
  685. package/src/{mch → mnch/mch}/queues/triage/mch-triage.tsx +2 -2
  686. package/src/mnch/mnch-root.tsx +17 -0
  687. package/src/mortuary/mortuary.component.tsx +2 -2
  688. package/src/pharmacy/pharmacy.component.scss +16 -0
  689. package/src/pharmacy/pharmacy.component.tsx +11 -6
  690. package/src/registers/registers.component.tsx +8 -0
  691. package/src/registry/drawer/emr-compare.component.scss +263 -0
  692. package/src/registry/drawer/emr-compare.component.tsx +302 -0
  693. package/src/registry/drawer/emr-compare.resource.ts +181 -0
  694. package/src/registry/drawer/emr-create-preview.component.tsx +123 -0
  695. package/src/registry/drawer/otp-verification-step.component.tsx +398 -0
  696. package/src/registry/drawer/pomsf-balance.util.test.ts +177 -0
  697. package/src/registry/drawer/pomsf-balance.util.ts +116 -0
  698. package/src/registry/drawer/verification.resource.ts +60 -0
  699. package/src/registry/drawer/workflow-drawer.component.scss +1242 -0
  700. package/src/registry/drawer/workflow-drawer.component.tsx +1542 -0
  701. package/src/registry/eligibility/eligibility-details/eligibility-details.scss +38 -0
  702. package/src/registry/eligibility/eligibility-details/eligibility-details.tsx +101 -0
  703. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +16 -0
  704. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +120 -0
  705. package/src/registry/eligibility/modal/eligibility-details.modal.scss +0 -0
  706. package/src/registry/eligibility/modal/eligibility-details.modal.tsx +45 -0
  707. package/src/registry/emergency/emergency-extension.component.tsx +599 -0
  708. package/src/registry/emergency/emergency-helper.ts +47 -0
  709. package/src/registry/emergency/emergency.resource.ts +291 -0
  710. package/src/registry/emergency/emergency.scss +123 -0
  711. package/src/registry/emergency/otp-component.tsx +289 -0
  712. package/src/registry/emergency/type/index.ts +77 -0
  713. package/src/registry/emergency/unidentified/unidentified-registration.component.tsx +154 -0
  714. package/src/registry/emergency/unidentified/unidentified-registration.scss +0 -0
  715. package/src/registry/emergency/unidentified/unidentified.component.tsx +376 -0
  716. package/src/registry/emergency/unidentified/unidentified.scss +0 -0
  717. package/src/registry/hie.resource.ts +481 -0
  718. package/src/registry/hie.types.ts +63 -0
  719. package/src/registry/modal/biometrics-verification-modal/biometrics-verification-modal.scss +277 -0
  720. package/src/registry/modal/biometrics-verification-modal/biometrics-verification-modal.tsx +218 -0
  721. package/src/registry/modal/biometrics-verification-modal/type.ts +39 -0
  722. package/src/registry/modal/client-details-modal/client-details-modal.tsx +65 -29
  723. package/src/registry/modal/otp-modal/otp-whitlisting-modal.component.tsx +809 -0
  724. package/src/registry/modal/otp-modal/otp-whitlisting-modal.scss +354 -0
  725. package/src/registry/modal/otp-modal/otp-whitlisting.scss +0 -0
  726. package/src/registry/modal/otp-verification-modal/claims-consent.scss +72 -0
  727. package/src/registry/modal/otp-verification-modal/claims-consent.tsx +135 -0
  728. package/src/registry/modal/otp-verification-modal/extension/claims-consent.extension.tsx +130 -0
  729. package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +15 -3
  730. package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +136 -44
  731. package/src/registry/modal/send-to-triage/payment-details.tsx +120 -0
  732. package/src/registry/modal/send-to-triage/payment-method.component.tsx +54 -0
  733. package/src/registry/modal/send-to-triage/send-to-queue.modal.tsx +991 -0
  734. package/src/registry/modal/send-to-triage/send-to-queue.workspace.tsx +24 -0
  735. package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +156 -3
  736. package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +1086 -130
  737. package/src/registry/modal/start-patient-visit/start-patient-visit.modal.scss +34 -0
  738. package/src/registry/modal/start-patient-visit/start-patient-visit.modal.tsx +231 -0
  739. package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
  740. package/src/registry/payment-details/payment-options/payment-options.tsx +61 -14
  741. package/src/registry/registration-list/registration-list.component.scss +32 -0
  742. package/src/registry/registration-list/registration-list.component.tsx +103 -0
  743. package/src/registry/registry-entry.tsx +11 -0
  744. package/src/registry/registry.component.scss +402 -78
  745. package/src/registry/registry.component.tsx +732 -220
  746. package/src/registry/registry.resource.ts +22 -3
  747. package/src/registry/types/index.ts +126 -9
  748. package/src/registry/utils/error-handler.ts +54 -0
  749. package/src/registry/utils/format-dependant-display-data.ts +1 -1
  750. package/src/registry/utils/hie-client-adapter.ts +7 -4
  751. package/src/registry/utils/mask-data.ts +40 -0
  752. package/src/registry/utils/phone-number-formatter.ts +11 -0
  753. package/src/resources/dashboard.resource.ts +20 -0
  754. package/src/resources/identifier-types.ts +2 -0
  755. package/src/resources/patient-resource.ts +7 -2
  756. package/src/resources/queue.resource.ts +3 -3
  757. package/src/resources/superset.resource.ts +41 -0
  758. package/src/resources/visit.resource.ts +19 -1
  759. package/src/root.component.tsx +9 -7
  760. package/src/routes.json +651 -40
  761. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
  762. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +193 -0
  763. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
  764. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +201 -0
  765. package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
  766. package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
  767. package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
  768. package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
  769. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
  770. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
  771. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
  772. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
  773. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
  774. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
  775. package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
  776. package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +35 -0
  777. package/src/service-queues/consultation/consultation.component.tsx +9 -0
  778. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
  779. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
  780. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
  781. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +110 -0
  782. package/src/service-queues/modals/move/move-patient.component.scss +1 -1
  783. package/src/service-queues/modals/move/move-patient.component.tsx +31 -17
  784. package/src/service-queues/queue-list/check-in.service.ts +26 -0
  785. package/src/service-queues/queue-list/queue-list.component.scss +37 -0
  786. package/src/service-queues/queue-list/queue-list.component.tsx +296 -60
  787. package/src/service-queues/service-queue/service-queue.component.tsx +151 -8
  788. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +5 -0
  789. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +36 -7
  790. package/src/service-queues/service-queue.tsx +22 -16
  791. package/src/service-queues/service-queues.resource.ts +293 -2
  792. package/src/service-queues/service.resource.ts +1 -1
  793. package/src/shared/constants/concepts.ts +70 -0
  794. package/src/shared/constants/patient-category.ts +6 -0
  795. package/src/shared/constants/patient-type.ts +10 -0
  796. package/src/shared/constants/visit-types.ts +9 -0
  797. package/src/shared/services/billable-service.resource.ts +121 -0
  798. package/src/shared/services/billing.resource.ts +112 -0
  799. package/src/shared/services/claims.resource.ts +47 -0
  800. package/src/shared/services/client-payment-mode.resource.ts +27 -0
  801. package/src/shared/services/client-payment.resource.ts +17 -0
  802. package/src/shared/services/consultation-clearance.resource.ts +210 -0
  803. package/src/shared/services/eligibility.resource.ts +20 -0
  804. package/src/shared/services/encounters.resource.ts +33 -0
  805. package/src/shared/types/index.ts +156 -0
  806. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
  807. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
  808. package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
  809. package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
  810. package/src/shared/ui/facility-worker-slot/facility-worker.component-slot.component.scss +39 -0
  811. package/src/shared/ui/facility-worker-slot/facility-worker.component-slot.component.tsx +19 -0
  812. package/src/shared/ui/otp-input/otp-input.component.scss +12 -12
  813. package/src/shared/ui/otp-input/otp-input.component.tsx +13 -6
  814. package/src/{service-queues/service-queue/stats → shared/ui}/stat-card/stat-card.component.tsx +6 -3
  815. package/src/shared/utils/format-title-case.ts +8 -0
  816. package/src/shared/utils/get-base-url.ts +15 -0
  817. package/src/shared/utils/get-tag-type.ts +75 -0
  818. package/src/shr/shr-close-visit-form.component.tsx +102 -0
  819. package/src/shr/shr-code-systems.json +363 -0
  820. package/src/shr/shr-terminology.resource.test.ts +66 -0
  821. package/src/shr/shr-terminology.resource.ts +64 -0
  822. package/src/shr/shr-viewer/shr-categories.test.ts +241 -0
  823. package/src/shr/shr-viewer/shr-categories.ts +209 -0
  824. package/src/shr/shr-viewer/shr-presentation.test.ts +511 -0
  825. package/src/shr/shr-viewer/shr-presentation.ts +883 -0
  826. package/src/shr/shr-viewer/shr-viewer.component.test.tsx +176 -0
  827. package/src/shr/shr-viewer/shr-viewer.component.tsx +432 -0
  828. package/src/shr/shr-viewer/shr-viewer.scss +239 -0
  829. package/src/shr/shr-visit-sync.test.ts +88 -0
  830. package/src/shr/shr-visit-sync.ts +62 -0
  831. package/src/shr/shr.component.tsx +730 -0
  832. package/src/shr/shr.resource.test.ts +737 -0
  833. package/src/shr/shr.resource.ts +463 -0
  834. package/src/shr/shr.scss +114 -0
  835. package/src/shr/shr.types.ts +682 -0
  836. package/src/shr/workspaces/shr-consent-workspace/schema.ts +53 -0
  837. package/src/shr/workspaces/shr-consent-workspace/shr-consent.scss +71 -0
  838. package/src/shr/workspaces/shr-consent-workspace/shr-consent.workspace.tsx +686 -0
  839. package/src/side-nav-menu/accounting-nav-link-config.ts +16 -0
  840. package/src/side-nav-menu/accounting-nav-links.tsx +42 -0
  841. package/src/side-nav-menu/critical-care-nav-links.tsx +42 -0
  842. package/src/side-nav-menu/critical-care-unit-nav-link-config.ts +28 -0
  843. package/src/side-nav-menu/mnch-nav-link-config.ts +16 -0
  844. package/src/side-nav-menu/mnch-nav-links.tsx +42 -0
  845. package/src/side-nav-menu/nav-link-config.ts +5 -5
  846. package/src/side-nav-menu/specialized-clinics-nav-link-config.ts +32 -0
  847. package/src/side-nav-menu/specialized-clinics-nav-links.tsx +42 -0
  848. package/src/specialized-clinics/dental/dental-queues.component.scss +7 -0
  849. package/src/specialized-clinics/dental/dental-queues.component.tsx +36 -0
  850. package/src/specialized-clinics/dental/queues/consultation/dental-consultation.tsx +15 -0
  851. package/src/specialized-clinics/dental/queues/triage/dental-triage.tsx +15 -0
  852. package/src/specialized-clinics/diagnostic-and-imaging/diagnostic-and-imaging.component.scss +7 -0
  853. package/src/specialized-clinics/diagnostic-and-imaging/diagnostic-and-imaging.component.tsx +36 -0
  854. package/src/specialized-clinics/diagnostic-and-imaging/queues/consultation/diagnosis-and-imaging-consultation.tsx +15 -0
  855. package/src/specialized-clinics/diagnostic-and-imaging/queues/triage/diagnosis-and-imaging-triage.tsx +15 -0
  856. package/src/specialized-clinics/oncology/oncology-queues.component.scss +7 -0
  857. package/src/specialized-clinics/oncology/oncology-queues.component.tsx +36 -0
  858. package/src/specialized-clinics/oncology/queues/consultation/oncology-consultation.tsx +15 -0
  859. package/src/specialized-clinics/oncology/queues/triage/oncology-triage.tsx +15 -0
  860. package/src/specialized-clinics/ophthalmology/ophthalmology-queues.component.scss +7 -0
  861. package/src/specialized-clinics/ophthalmology/ophthalmology-queues.component.tsx +36 -0
  862. package/src/specialized-clinics/ophthalmology/queues/consultation/ophthalmology-consultation.tsx +15 -0
  863. package/src/specialized-clinics/ophthalmology/queues/triage/ophthalmology-triage.tsx +15 -0
  864. package/src/specialized-clinics/psychiatry/psychiatry-queues.component.scss +7 -0
  865. package/src/specialized-clinics/psychiatry/psychiatry-queues.component.tsx +36 -0
  866. package/src/specialized-clinics/psychiatry/queues/consultation/psychiatry-consultation.tsx +15 -0
  867. package/src/specialized-clinics/psychiatry/queues/triage/psychiatry-triage.tsx +15 -0
  868. package/src/specialized-clinics/renal/queues/consultation/dialysis-consultation.tsx +15 -0
  869. package/src/specialized-clinics/renal/queues/triage/renal-triage.tsx +15 -0
  870. package/src/specialized-clinics/renal/renal-queues.component.scss +7 -0
  871. package/src/specialized-clinics/renal/renal-queues.component.tsx +36 -0
  872. package/src/specialized-clinics/specialized-clinics-root.tsx +25 -0
  873. package/src/telemedicine/telemedicine-patient-chart.component.test.tsx +123 -0
  874. package/src/telemedicine/telemedicine-patient-chart.component.tsx +131 -0
  875. package/src/telemedicine/telemedicine.component.test.tsx +113 -0
  876. package/src/telemedicine/telemedicine.component.tsx +310 -0
  877. package/src/telemedicine/telemedicine.resource.test.ts +171 -0
  878. package/src/telemedicine/telemedicine.resource.ts +125 -0
  879. package/src/telemedicine/telemedicine.scss +91 -0
  880. package/src/triage/triage.component.scss +6 -0
  881. package/src/triage/triage.component.tsx +4 -0
  882. package/src/types/types.ts +56 -1
  883. package/tools/fetch-shr-code-systems.mjs +135 -0
  884. package/tools/strip-openmrs-declaration-maps.mjs +44 -0
  885. package/tools/update-openmrs-deps.mjs +36 -5
  886. package/translations/en.json +135 -0
  887. package/tsconfig.json +7 -4
  888. package/webpack.config.js +74 -1
  889. package/dist/104.js +0 -2
  890. package/dist/104.js.map +0 -1
  891. package/dist/145.js +0 -1
  892. package/dist/145.js.map +0 -1
  893. package/dist/15.js +0 -1
  894. package/dist/15.js.map +0 -1
  895. package/dist/184.js +0 -2
  896. package/dist/184.js.map +0 -1
  897. package/dist/246.js +0 -2
  898. package/dist/246.js.map +0 -1
  899. package/dist/255.js +0 -1
  900. package/dist/255.js.map +0 -1
  901. package/dist/28.js +0 -1
  902. package/dist/28.js.map +0 -1
  903. package/dist/300.js +0 -1
  904. package/dist/321.js +0 -1
  905. package/dist/321.js.map +0 -1
  906. package/dist/327.js +0 -1
  907. package/dist/327.js.map +0 -1
  908. package/dist/339.js +0 -1
  909. package/dist/339.js.map +0 -1
  910. package/dist/353.js +0 -1
  911. package/dist/353.js.map +0 -1
  912. package/dist/420.js +0 -1
  913. package/dist/420.js.map +0 -1
  914. package/dist/540.js +0 -2
  915. package/dist/540.js.map +0 -1
  916. package/dist/55.js +0 -1
  917. package/dist/709.js +0 -1
  918. package/dist/709.js.map +0 -1
  919. package/dist/710.js +0 -2
  920. package/dist/710.js.LICENSE.txt +0 -14
  921. package/dist/710.js.map +0 -1
  922. package/dist/717.js +0 -1
  923. package/dist/717.js.map +0 -1
  924. package/dist/729.js +0 -1
  925. package/dist/729.js.map +0 -1
  926. package/dist/752.js +0 -1
  927. package/dist/752.js.map +0 -1
  928. package/dist/833.js +0 -1
  929. package/dist/833.js.map +0 -1
  930. package/dist/93.js +0 -1
  931. package/dist/93.js.map +0 -1
  932. package/dist/964.js +0 -1
  933. package/dist/964.js.map +0 -1
  934. package/dist/99.js +0 -1
  935. /package/dist/{104.js.LICENSE.txt → 2272.js.LICENSE.txt} +0 -0
  936. /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
  937. /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
  938. /package/src/{pharmacy-dashboard.meta.ts → dashboard-meta/pharmacy-dashboard.meta.ts} +0 -0
  939. /package/src/{queue-dashboard.meta.ts → dashboard-meta/queue-dashboard.meta.ts} +0 -0
  940. /package/src/{triage-dashboard.meta.ts → dashboard-meta/triage-dashboard.meta.ts} +0 -0
  941. /package/src/{service-queues/service-queue/stats → shared/ui}/stat-card/stat-card.component.scss +0 -0
@@ -3,9 +3,10 @@ import {
3
3
  Button,
4
4
  Checkbox,
5
5
  ComboBox,
6
- InlineLoading,
7
6
  Modal,
8
7
  ModalBody,
8
+ ProgressIndicator,
9
+ ProgressStep,
9
10
  Select,
10
11
  SelectItem,
11
12
  Table,
@@ -14,13 +15,70 @@ import {
14
15
  TableHead,
15
16
  TableHeader,
16
17
  TableRow,
18
+ TextInput,
17
19
  } from '@carbon/react';
18
20
  import styles from './send-to-triage.modal.scss';
19
- import { type Patient, useVisitTypes, useSession, showSnackbar, type VisitType } from '@openmrs/esm-framework';
20
- import { type HieClient, type CreateVisitDto, type QueueEntryDto, type ServiceQueue } from '../../types';
21
+ import {
22
+ type Patient,
23
+ useSession,
24
+ showSnackbar,
25
+ type Visit,
26
+ useConfig,
27
+ ExtensionSlot,
28
+ Encounter,
29
+ useVisit,
30
+ } from '@openmrs/esm-framework';
31
+ import {
32
+ type HieClient,
33
+ type CreateVisitDto,
34
+ type QueueEntryDto,
35
+ type ServiceQueue,
36
+ PaymentDetail,
37
+ type VisitAttribute,
38
+ RequestCustomOtpDto,
39
+ } from '../../types';
21
40
  import { createQueueEntry, getFacilityServiceQueues } from '../../../resources/queue.resource';
22
41
  import { QUEUE_PRIORITIES_UUIDS, QUEUE_STATUS_UUIDS } from '../../../shared/constants/concepts';
23
42
  import { createVisit } from '../../../resources/visit.resource';
43
+ import {
44
+ createBill,
45
+ createOrderBillInHie,
46
+ fetchBillableServices,
47
+ fetchCashPoints,
48
+ fetchPaymentModes,
49
+ } from '../../../shared/services/billing.resource';
50
+ import {
51
+ type PayableBillableService,
52
+ type ServicePrice,
53
+ type BillableService,
54
+ type PaymentMode,
55
+ type CreateBillDto,
56
+ type CashPoint,
57
+ type CreateOrderEncounterDto,
58
+ } from '../../../shared/types';
59
+ import { PatientCategories } from '../../../shared/constants/patient-category';
60
+ import { VisitTypeUuids } from '../../../shared/constants/visit-types';
61
+ import { type Bill } from '../../../billing/types';
62
+ import { fetchPatientBills } from '../../../billing/invoice/bill.resource';
63
+ import { type QueueEntry } from '../../../types/types';
64
+ import { getActiveQueueEntryByPatientUuid } from '../../../service-queues/service-queues.resource';
65
+ import { createOrderEncounter, getOrder } from '../../../shared/services/encounters.resource';
66
+ import { type ConfigObject } from '../../../config-schema';
67
+ import { PatientTypes } from '../../../shared/constants/patient-type';
68
+ import ClaimsConsentModal from '../otp-verification-modal/claims-consent';
69
+ import { OtpFormData, type OTPWhitelistRequest } from '../../hie.types';
70
+ import { cancelAllPendingAuthorizations, createOTPWhitelisting, sendClaimsOTP } from '../../hie.resource';
71
+ import { usePatient } from '../../../context/patient-context';
72
+ import { type ClaimResult, type Intervention, type VisitType } from '../../../claims';
73
+ import { Order } from '@openmrs/esm-patient-common-lib';
74
+ import { getServiceType } from '../../../shared/services/claims.resource';
75
+ import PaymentDetailsSection from './payment-details';
76
+ import PaymentMethodComponent from './payment-method.component';
77
+ import { searchPatientByCrNumber } from '../../../resources/patient-search.resource';
78
+ import { IdentifierTypesUuids } from '../../../resources/identifier-types';
79
+ import { formatPhoneNumberForOTP } from '../../utils/phone-number-formatter';
80
+ import OtpVerificationModal from '../otp-verification-modal/otp-verification-modal';
81
+ import ClientDetailsModal from '../client-details-modal/client-details-modal';
24
82
 
25
83
  interface SendToTriageModalProps {
26
84
  patients: Patient[];
@@ -43,45 +101,365 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
43
101
  }) => {
44
102
  const [selectedPatient, setSelectedPatient] = useState<Patient>();
45
103
  const [selectedVisitType, setSelectedVisitType] = useState<string>();
104
+ const [selectedPatientType, setSelectedPatientType] = useState<string>();
46
105
  const [serviceQueues, setServiceQueues] = useState<ServiceQueue[]>();
47
106
  const [selectedServiceQueue, setSelectedServiceQueue] = useState<string>();
107
+ const [paymentModes, setPaymentModes] = useState<PaymentMode[]>([]);
108
+ const [cashPoints, setCashPoints] = useState<CashPoint[]>([]);
109
+ const [selectedCashPoint, setSelectedCashPoint] = useState<CashPoint>(null);
110
+ const [selectedPaymentMode, setSelectedPaymentMode] = useState<PaymentMode>(null);
48
111
  const [selectedPriority, setSelectedPriority] = useState<string>('');
112
+ const [selectedPaymentDetail, setSelectedPaymentDetail] = useState<string>();
113
+ const [billableServices, setBillableServices] = useState<BillableService[]>([]);
114
+ const [servicePrices, setServicePrices] = useState<ServicePrice[]>([]);
115
+ const [filteredBillableServices, setFilteredBillableServices] = useState<ServicePrice[]>(null);
116
+ const [selectedBillableService, setSelectedBillableService] = useState<ServicePrice | null>(null);
117
+ const [selectedInsuranceScheme, setSelectedInsuranceScheme] = useState<string>('');
118
+ const [selectedInsurancePolicy, setSelectedInsurancePolicy] = useState<string>('');
119
+ const [selectedPatientCategory, setSelectedPatientCategory] = useState<string>('');
120
+ const [currentQueueEntry, setCurrentQueueEntry] = useState<QueueEntry>();
121
+ const [patientBills, setPatientBills] = useState<Bill[]>([]);
122
+ const [billCreated, setBillCreated] = useState<boolean>(false);
123
+ const [disableSubmission, setDisableSubmission] = useState<boolean>(false);
49
124
  const [loading, setLoading] = useState<boolean>(false);
50
- const visitTypes = useVisitTypes();
125
+ const [claimResult, setClaimResult] = useState<ClaimResult>();
126
+ const [intervention, setIntervention] = useState<Intervention>();
127
+ const [triggerCreateVisit, setTriggerCreateVisit] = useState<boolean>(false);
128
+ const [showConsent, setShowSoncent] = useState<boolean>(false);
51
129
  const session = useSession();
52
- const locationUuid = session.sessionLocation.uuid;
53
- const visitTypeOptions = useMemo(() => generateVisitTypeOptions(), [visitTypes]);
130
+ const locationUuid = session?.sessionLocation?.uuid;
131
+ const [submitting, setSubmitting] = useState(false);
132
+ const [otpSent, setOtpSent] = useState(false);
133
+ const [whitelistRequest, setWhitelistRequest] = useState(null);
134
+ const [otpVerified, setOtpVerified] = useState(false);
135
+ const [otp, setOtp] = useState<string | null>(null);
136
+ const [step, setStep] = useState(0);
137
+ const [displayOtpModal, setDisplayOtpModal] = useState<boolean>(false);
138
+ const [requestCustomOtpDto, setRequestCustomOtpDto] = useState<RequestCustomOtpDto>();
139
+ const [displayClientDetailsModal, setDisplayClientDetailsModal] = useState<boolean>(false);
140
+ const [principal, setPrincipal] = useState<HieClient>();
141
+ const [selecteddPatient, setSelecteddPatient] = useState<string>('principal');
142
+ const [selectedDependant, setSelectedDependant] = useState<HieClient>();
143
+ const [generatedOtp, setGeneratedOtp] = useState<string | null>(null);
144
+ const [scanStatus, setScanStatus] = useState<string>();
145
+ const { activeVisit } = useVisit(selectedPatient?.uuid);
146
+
147
+ const next = () => setStep((s) => s + 1);
148
+ const previous = () => setStep((s) => s - 1);
149
+ const {
150
+ registrationBillableServices,
151
+ cashConsulationConceptUuid,
152
+ shaConsulationConceptUuid,
153
+ outPatientCareSettingUuid,
154
+ orderEncounterTypeUuid,
155
+ registrationServicequeues,
156
+ } = useConfig<ConfigObject>();
157
+
158
+ const { patient } = usePatient();
159
+
160
+ const facilityCashPoints = useMemo(() => getfacilityCashpoints(), [cashPoints, locationUuid]);
161
+ const selectedServicePrice = useMemo(
162
+ () =>
163
+ servicePrices.find(
164
+ (servicePrice) =>
165
+ servicePrice.billableService.uuid === selectedBillableService?.billableService.uuid &&
166
+ servicePrice.paymentMode?.uuid === selectedPaymentMode?.uuid,
167
+ ),
168
+ [servicePrices, selectedBillableService, selectedPaymentMode],
169
+ );
170
+
171
+ const visitTypeOptions = useMemo(
172
+ () => [
173
+ {
174
+ text: 'OPD',
175
+ id: VisitTypeUuids.OPD_VISIT_TYPE_UUID,
176
+ },
177
+ {
178
+ text: 'Inpatient',
179
+ id: VisitTypeUuids.INPATIENT_VISIT_TYPE_UUID,
180
+ },
181
+ ],
182
+ [client],
183
+ );
184
+
185
+ const visitType: VisitType = useMemo(() => {
186
+ if (selectedVisitType) {
187
+ if (selectedVisitType === VisitTypeUuids.OPD_VISIT_TYPE_UUID) {
188
+ return 'OUTPATIENT';
189
+ }
190
+ if (selectedVisitType === VisitTypeUuids.INPATIENT_VISIT_TYPE_UUID) {
191
+ return 'INPATIENT';
192
+ }
193
+ }
194
+ }, [selectedVisitType, VisitTypeUuids]);
195
+
196
+ const patientTypeOptions = useMemo(
197
+ () => [
198
+ {
199
+ text: 'Walk-In',
200
+ id: PatientTypes.WALK_IN_UUID,
201
+ },
202
+ {
203
+ text: 'Self-Referral',
204
+ id: PatientTypes.SELF_RERERRAL_UUID,
205
+ },
206
+ {
207
+ text: 'Referral from another Facility',
208
+ id: PatientTypes.REFERRAL_FROM_ANOTHER_FACILITY_UUID,
209
+ },
210
+ {
211
+ text: 'Referral from Community',
212
+ id: PatientTypes.REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID,
213
+ },
214
+ ],
215
+ [client],
216
+ );
217
+
218
+ const patientIdentifiers = useMemo(() => {
219
+ if (selectedPatient) {
220
+ const identifiers = selectedPatient.identifiers;
221
+ return {
222
+ crIdentifierId: identifiers?.find((i) => i.identifierType.uuid == 'e88dc246-3614-4ee3-8141-1f2a83054e72')
223
+ .identifier,
224
+ };
225
+ }
226
+ }, [selectedPatient]);
227
+
228
+ const paymentDetails = Object.values(PaymentDetail).map((value) => {
229
+ return {
230
+ id: value,
231
+ label: value,
232
+ };
233
+ });
54
234
  useEffect(() => {
55
235
  getServiceQueues();
236
+ getPaymentMethods();
237
+ getBillableServices();
238
+ getCashPoints();
239
+ getPatientBills();
240
+ getPatientActiveQueue();
56
241
  }, [patients]);
57
242
  if (!patients) {
58
243
  return <>No Client data</>;
59
244
  }
60
- const registerOnAfyaYangu = () => {
61
- window.open('https://afyayangu.go.ke/', '_blank');
245
+
246
+ function onClaimsVisitStart(payload: ClaimResult, selectedIntervention: Intervention) {
247
+ setClaimResult(payload);
248
+ setIntervention(selectedIntervention);
249
+ }
250
+
251
+ function onInterventionChange(selectedIntervention: Intervention) {
252
+ setIntervention(selectedIntervention);
253
+ }
254
+
255
+ async function getPatientActiveQueue() {
256
+ if (patients && patients.length > 0) {
257
+ const activePatient = patients[0];
258
+ try {
259
+ const resp = await getActiveQueueEntryByPatientUuid(activePatient.uuid);
260
+ setCurrentQueueEntry(resp.length > 0 ? resp[0] : null);
261
+ } catch (error) {
262
+ showAlert('error', 'Error getting patient active queue', '');
263
+ }
264
+ }
265
+ }
266
+
267
+ async function getPatientBills() {
268
+ if (patients) {
269
+ let bills: Bill[] = [];
270
+ setPatientBills([]);
271
+ for (let i = 0; i < patients.length; i++) {
272
+ const resp = await fetchPatientBills(patients[i].uuid);
273
+ const todaysBills = getTodaysBills(resp);
274
+ setPatientBills(todaysBills);
275
+ }
276
+ }
277
+ }
278
+ function getTodaysBills(bills: Bill[]) {
279
+ const today = new Date();
280
+ return bills.filter((b) => {
281
+ const billDate = new Date(b.dateCreated);
282
+ return (
283
+ billDate.getFullYear() === today.getFullYear() &&
284
+ billDate.getMonth() === today.getMonth() &&
285
+ billDate.getDate() === today.getDate()
286
+ );
287
+ });
288
+ }
289
+ const handleSendToTriage = async () => {
290
+ if (step === 1) {
291
+ handleOtpVerification();
292
+ return;
293
+ }
294
+ setLoading(true);
295
+ if (hasSelectedPaymentMode('SHA')) {
296
+ if (claimResult) {
297
+ await sendToTriage();
298
+ } else {
299
+ setTriggerCreateVisit(true);
300
+ }
301
+ return;
302
+ }
62
303
  };
304
+
305
+ const generateCustomSmsPayload = (): RequestCustomOtpDto => {
306
+ return {
307
+ identificationNumber: patient!.identification_number,
308
+ identificationType: patient!.identification_type,
309
+ locationUuid: locationUuid,
310
+ phoneNumber: patient?.phone ? formatPhoneNumberForOTP(patient.phone ?? '') : '',
311
+ };
312
+ };
313
+
314
+ const isValidCustomSmsPayload = (payload: RequestCustomOtpDto): boolean => {
315
+ if (!payload.identificationNumber) {
316
+ showAlert('error', 'Please enter a valid identification number', '');
317
+ return false;
318
+ }
319
+ if (!payload.identificationType) {
320
+ showAlert('error', 'Please enter a valid identification type', '');
321
+ return false;
322
+ }
323
+ if (!payload.locationUuid) {
324
+ showAlert('error', 'No default location selected', '');
325
+ return false;
326
+ }
327
+ if (!payload.phoneNumber) {
328
+ showAlert('error', 'No phone number selected', '');
329
+ return false;
330
+ }
331
+ return true;
332
+ };
333
+
334
+ const handleOtpVerification = () => {
335
+ const smsPayload = generateCustomSmsPayload();
336
+ if (isValidCustomSmsPayload(smsPayload)) {
337
+ setRequestCustomOtpDto(smsPayload);
338
+ setDisplayOtpModal(true);
339
+ }
340
+ };
341
+
342
+ useEffect(() => {
343
+ if (triggerCreateVisit && claimResult) {
344
+ const fn = async () => {
345
+ await sendToTriage();
346
+ setTriggerCreateVisit(false);
347
+ };
348
+ void fn();
349
+ }
350
+ }, [triggerCreateVisit, claimResult]);
351
+
63
352
  const sendToTriage = async () => {
353
+ if (disableSubmission) {
354
+ showAlert(
355
+ 'error',
356
+ 'Form already Submitted',
357
+ 'Form has already been submitted, please wait for the visit,queue and bill to be created',
358
+ );
359
+ return;
360
+ }
361
+ setDisableSubmission(true);
362
+ if (!validateVisitQueueBill()) {
363
+ setDisableSubmission(false);
364
+ return;
365
+ }
64
366
  setLoading(true);
65
367
  try {
66
- const newVisit = await createPatientVisit();
368
+ const newVisit: Visit = await createPatientVisit();
67
369
  if (newVisit) {
68
- const addToTriageQueueDto: QueueEntryDto = generateAddToTriageDto(newVisit.uuid);
370
+ const addToTriageQueueDto: QueueEntryDto = generateAddToTriageDto(newVisit);
69
371
  const queueEntryResp = await createQueueEntry(addToTriageQueueDto);
372
+
70
373
  if (queueEntryResp) {
71
374
  showAlert('success', 'Patient has succesfully been moved to the Triage queue', '');
375
+ }
376
+
377
+ // add bill if it was a paying client
378
+ let createBillResp = null;
379
+ if (selectedPaymentDetail === PaymentDetail.Paying) {
380
+ const createBillDto = generateCreateBillDto();
381
+ if (isValidCreateBillDto(createBillDto) && !billCreated) {
382
+ createBillResp = await createBill(createBillDto);
383
+ if (createBillResp) {
384
+ setBillCreated(true);
385
+ showAlert('success', 'Bill succesfully created', '');
386
+ }
387
+ // create consulation order
388
+ const encounter = await createOrder(selectedPatient.uuid, newVisit.uuid);
389
+ // Add to bill order
390
+ const billOrderDto = await generateBillOrderDto(encounter, createBillResp);
391
+ await createOrderBillInHie(billOrderDto);
392
+ } else {
393
+ return false;
394
+ }
395
+ }
396
+
397
+ if (
398
+ (queueEntryResp && PaymentDetail.Paying && (createBillResp || billCreated)) ||
399
+ (queueEntryResp && PaymentDetail.NonPaying)
400
+ ) {
72
401
  onModalClose({ success: true });
73
402
  }
74
403
  }
75
404
  } catch (error) {
76
- showAlert('error', 'Error creating visit', '');
405
+ setDisableSubmission(false);
406
+ showAlert('error', error.message ?? 'Error creating visit', '');
77
407
  } finally {
78
408
  setLoading(false);
79
409
  }
80
410
  };
81
- const generateAddToTriageDto = (newVisitUuid: string): QueueEntryDto => {
411
+ function validateVisitQueueBill(): boolean {
412
+ if (!selectedPatient) {
413
+ showAlert('error', 'Please select a patient', '');
414
+ return false;
415
+ }
416
+ if (!selectedPaymentDetail) {
417
+ showAlert('error', 'Please select a paying or non paying option', '');
418
+ return false;
419
+ }
420
+
421
+ if (!isValidServiceQueueSelected()) {
422
+ return false;
423
+ }
424
+
425
+ if (selectedPaymentDetail === PaymentDetail.Paying) {
426
+ if (!selectedPaymentMode) {
427
+ showAlert('error', 'Please select a payment method', '');
428
+ return false;
429
+ }
430
+ if (!selectedBillableService) {
431
+ showAlert('error', 'Please select a billable service', '');
432
+ return false;
433
+ }
434
+ if (!selectedCashPoint) {
435
+ showAlert('error', 'Please select a cashpoint', '');
436
+ return false;
437
+ }
438
+ }
439
+ if (selectedPaymentDetail === PaymentDetail.NonPaying) {
440
+ if (!selectedPatientCategory) {
441
+ showAlert('error', 'Please select a patient category', '');
442
+ return false;
443
+ }
444
+ }
445
+ if (!selectedVisitType) {
446
+ showAlert('error', 'Please select a visit type', '');
447
+ return false;
448
+ }
449
+ if (!selectedServiceQueue) {
450
+ showAlert('error', 'Please select a service queue', '');
451
+ return false;
452
+ }
453
+ if (!selectedPriority) {
454
+ showAlert('error', 'Please select a service queue priority', '');
455
+ return false;
456
+ }
457
+ return true;
458
+ }
459
+ const generateAddToTriageDto = (newVisit: Visit): QueueEntryDto => {
82
460
  const payload: QueueEntryDto = {
83
461
  visit: {
84
- uuid: newVisitUuid,
462
+ uuid: newVisit.uuid,
85
463
  },
86
464
  queueEntry: {
87
465
  status: {
@@ -96,7 +474,7 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
96
474
  patient: {
97
475
  uuid: selectedPatient.uuid,
98
476
  },
99
- startedAt: new Date().toISOString(),
477
+ startedAt: newVisit.startDatetime,
100
478
  sortWeight: 0,
101
479
  },
102
480
  };
@@ -108,14 +486,102 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
108
486
  const visitTypeChangeHandler = (selectedVisitType: { selectedItem: { id: string; text: string } }) => {
109
487
  const vt = selectedVisitType.selectedItem.id;
110
488
  setSelectedVisitType(vt);
489
+ setShowSoncent(true);
490
+ };
491
+ const isValidServiceQueueSelected = () => {
492
+ if (!currentQueueEntry) {
493
+ return true;
494
+ }
495
+ if (currentQueueEntry.queue.uuid) {
496
+ showAlert(
497
+ 'error',
498
+ 'Patient already in queue',
499
+ `Patient is already in the ${currentQueueEntry.queue.display} queue, remove them first or contact support`,
500
+ );
501
+ return false;
502
+ }
503
+ return true;
111
504
  };
112
505
  const serviceChangeHandler = ($event: any) => {
113
- const sq = $event.target.value as unknown as string;
114
- setSelectedServiceQueue(sq);
506
+ if (isValidServiceQueueSelected()) {
507
+ const sq = $event.target.value as unknown as string;
508
+ setSelectedServiceQueue(sq);
509
+ }
115
510
  };
116
511
  const priorityChangeHandler = (priorityUuid: string) => {
117
512
  setSelectedPriority(priorityUuid);
118
513
  };
514
+ const paymentDetailsHandler = (paymentDetailSelected: string) => {
515
+ setSelectedPaymentDetail(paymentDetailSelected);
516
+ };
517
+ const paymentMethodHandler = (selectedPaymentModeUuid: string) => {
518
+ const selectedPaymentMode = paymentModes.find((pm) => {
519
+ return pm.uuid === selectedPaymentModeUuid;
520
+ });
521
+ setSelectedPaymentMode(selectedPaymentMode);
522
+ const paymentModeBillableServices = getBillableServiceByPaymentMode(selectedPaymentMode);
523
+ setFilteredBillableServices(paymentModeBillableServices);
524
+ setSelectedInsuranceScheme('');
525
+ setSelectedInsurancePolicy('');
526
+ setSelectedPriority('');
527
+ };
528
+ const getBillableServiceByPaymentMode = (paymentMode: PaymentMode): PayableBillableService[] => {
529
+ const paymentBillableServices: ServicePrice[] = [];
530
+ servicePrices.forEach((sp) => {
531
+ if (sp.paymentMode) {
532
+ if (
533
+ sp.paymentMode.uuid === paymentMode.uuid &&
534
+ registrationBillableServices.includes(sp.billableService.uuid)
535
+ ) {
536
+ paymentBillableServices.push(sp);
537
+ }
538
+ }
539
+ });
540
+ return paymentBillableServices;
541
+ };
542
+ const billableServicesHandler = (selectedBillableServiceUuid: string) => {
543
+ const selectedBillableService = servicePrices.find((sp) => {
544
+ return sp.uuid === selectedBillableServiceUuid;
545
+ });
546
+ if (isValidBillableService(selectedBillableService)) {
547
+ setSelectedBillableService(selectedBillableService);
548
+ } else {
549
+ setSelectedBillableService(null);
550
+ showAlert('error', 'Existing bill', 'Patient has a similar bill');
551
+ }
552
+ };
553
+ const isValidBillableService = (selectedService: ServicePrice) => {
554
+ // check if patient has been billed for similar service
555
+ let isValid = true;
556
+ patientBills.forEach((b) => {
557
+ const lineItems = b.lineItems;
558
+ lineItems.forEach((l) => {
559
+ if (l.billableService === selectedService.billableService.display) {
560
+ isValid = false;
561
+ }
562
+ });
563
+ });
564
+ return isValid;
565
+ };
566
+ const cashPointsHandler = (selectedCashPointUuid: string) => {
567
+ const selectedCashPoint = cashPoints.find((cp) => {
568
+ return cp.uuid === selectedCashPointUuid;
569
+ });
570
+ setSelectedCashPoint(selectedCashPoint);
571
+ };
572
+ const patientTypeHandler = (selectedPatientType: { selectedItem: { id: string; text: string } }) => {
573
+ const pt = selectedPatientType.selectedItem.id;
574
+ setSelectedPatientType(pt);
575
+ };
576
+ const insuranceSchemeHandler = (selectedInsuranceScheme: string) => {
577
+ setSelectedInsuranceScheme(selectedInsuranceScheme);
578
+ };
579
+ const insurancePolicyHandler = (selectedInsurancePolicy: string) => {
580
+ setSelectedInsurancePolicy(selectedInsurancePolicy);
581
+ };
582
+ const patientCategoryHandler = (categoryUuid: string) => {
583
+ setSelectedPatientCategory(categoryUuid);
584
+ };
119
585
  const createPatientVisit = async () => {
120
586
  const visitDto = getCreateVisitDto();
121
587
  if (!isValidCreateVisitDto(visitDto)) {
@@ -145,16 +611,25 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
145
611
  showAlert('error', 'Please select a visit', '');
146
612
  return false;
147
613
  }
614
+ if (!selectedPatientType) {
615
+ showAlert('error', 'Please select a patient type', '');
616
+ return false;
617
+ }
148
618
  return true;
149
619
  };
150
620
  const getCreateVisitDto = (): CreateVisitDto => {
151
- return {
621
+ const visitAttributes = getVisitAttributes();
622
+ const visitDto: CreateVisitDto = {
152
623
  visitType: selectedVisitType,
153
624
  location: locationUuid,
154
625
  startDatetime: null,
155
626
  stopDatetime: null,
156
- patient: selectedPatient?.uuid ?? '',
627
+ patient: selectedPatient?.uuid,
157
628
  };
629
+ if (visitAttributes.length > 0) {
630
+ visitDto['attributes'] = visitAttributes;
631
+ }
632
+ return visitDto;
158
633
  };
159
634
  const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
160
635
  showSnackbar({
@@ -164,19 +639,54 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
164
639
  });
165
640
  };
166
641
 
167
- function generateVisitTypeOptions() {
168
- return visitTypes.map((vt: VisitType) => {
169
- return {
170
- id: vt.uuid,
171
- text: vt.display,
172
- };
173
- });
642
+ function getVisitAttributes(): VisitAttribute[] {
643
+ const attributes: VisitAttribute[] = [];
644
+ if (selectedInsuranceScheme) {
645
+ attributes.push({
646
+ attributeType: '3a988e33-a6c0-4b76-b924-01abb998944b',
647
+ value: selectedInsuranceScheme,
648
+ });
649
+ }
650
+ if (selectedInsurancePolicy) {
651
+ attributes.push({
652
+ attributeType: 'aac48226-d143-4274-80e0-264db4e368ee',
653
+ value: selectedInsurancePolicy,
654
+ });
655
+ }
656
+ if (selectedPaymentMode) {
657
+ attributes.push({
658
+ attributeType: '8553afa0-bdb9-4d3c-8a98-05fa9350aa85',
659
+ value: selectedPaymentMode.uuid,
660
+ });
661
+ }
662
+ if (selectedPatientType) {
663
+ attributes.push({
664
+ attributeType: 'fbc0702d-b4c9-4968-be63-af8ad3ad6239',
665
+ value: selectedPatientType,
666
+ });
667
+ }
668
+ if (selectedPaymentDetail === PaymentDetail.NonPaying) {
669
+ attributes.push({
670
+ attributeType: 'df0362f9-782e-4d92-8bb2-3112e9e9eb3c',
671
+ value: 'true',
672
+ });
673
+ }
674
+
675
+ // Claims
676
+ if (claimResult) {
677
+ attributes.push({
678
+ attributeType: '4962a633-c4f8-474c-857c-5c68c72fbbe3',
679
+ value: claimResult.authorization_code,
680
+ });
681
+ }
682
+ return attributes;
174
683
  }
175
684
  async function getServiceQueues() {
176
685
  try {
177
686
  const sqs = await getFacilityServiceQueues(locationUuid);
178
- if (sqs.length > 0) {
179
- setServiceQueues(sqs);
687
+ if (sqs && sqs.length > 0) {
688
+ const triageServiceQueues = getTriageServiceQueues(sqs);
689
+ setServiceQueues(triageServiceQueues);
180
690
  }
181
691
  } catch (e) {
182
692
  showSnackbar({
@@ -186,115 +696,561 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
186
696
  });
187
697
  }
188
698
  }
699
+ function getTriageServiceQueues(serviceQueues: ServiceQueue[]) {
700
+ return serviceQueues.filter((sq) => {
701
+ return registrationServicequeues.includes(sq.uuid ?? '');
702
+ });
703
+ }
704
+
705
+ async function getPaymentMethods() {
706
+ const methods = await fetchPaymentModes();
707
+ setPaymentModes(methods);
708
+ }
709
+
710
+ async function getBillableServices() {
711
+ const billableServices = await fetchBillableServices();
712
+ setBillableServices(billableServices);
713
+ generateServiceTypesList(billableServices);
714
+ }
715
+
716
+ async function getCashPoints() {
717
+ const cp = await fetchCashPoints();
718
+ setCashPoints(cp);
719
+ }
720
+
721
+ function getfacilityCashpoints() {
722
+ return cashPoints.filter((cp) => {
723
+ return cp && cp.location?.uuid === locationUuid;
724
+ });
725
+ }
726
+
727
+ function generateServiceTypesList(billableServices: BillableService[]) {
728
+ const sp: ServicePrice[] = [];
729
+ for (let bs of billableServices) {
730
+ if (bs.servicePrices) {
731
+ const servicePrices = bs.servicePrices;
732
+ for (let servicePrice of servicePrices) {
733
+ sp.push(servicePrice);
734
+ }
735
+ }
736
+ }
737
+ setServicePrices(sp);
738
+ }
739
+
740
+ function generateCreateBillDto(): CreateBillDto {
741
+ const payload: CreateBillDto = {
742
+ lineItems: [
743
+ {
744
+ quantity: 1,
745
+ priceUuid: selectedServicePrice.uuid,
746
+ status: selectedServicePrice.price === 0 ? 'PAID' : 'PENDING',
747
+ },
748
+ ],
749
+ cashPoint: selectedCashPoint.uuid,
750
+ patient: selectedPatient.uuid,
751
+ visit: activeVisit?.uuid ?? '',
752
+ status: 'PENDING',
753
+ payments: [],
754
+ };
755
+ return payload;
756
+ }
757
+ function isValidCreateBillDto(createBillDto: CreateBillDto): boolean {
758
+ if (!createBillDto.patient) {
759
+ showAlert('error', 'Please select a patient', '');
760
+ return false;
761
+ }
762
+ if (!createBillDto.status) {
763
+ showAlert('error', 'Bill does not have a status', '');
764
+ return false;
765
+ }
766
+ if (!createBillDto.cashPoint) {
767
+ showAlert('error', 'Please select a valid cashpoint', '');
768
+ return false;
769
+ }
770
+ if (!createBillDto.lineItems || createBillDto.lineItems.length === 0) {
771
+ showAlert('error', 'Please select a valid billable service', '');
772
+ return false;
773
+ }
774
+ return true;
775
+ }
776
+
777
+ function hasSelectedPaymentMode(paymentMode: string): boolean {
778
+ if (!selectedPaymentMode) {
779
+ return false;
780
+ }
781
+ // eslint-disable-next-line no-console
782
+ console.log('CHECKING selectedPaymentMode:', selectedPaymentMode);
783
+ // eslint-disable-next-line no-console
784
+ console.log(
785
+ 'SELECTED PAYMENT MODE:',
786
+ selectedPaymentMode.name.trim().toLowerCase().includes(paymentMode.trim().toLowerCase()),
787
+ );
788
+ return selectedPaymentMode.name.trim().toLowerCase().includes(paymentMode.trim().toLowerCase());
789
+ }
790
+
791
+ function generateOrderEncounterPayload(patientUuid: string, visitUuid: string): CreateOrderEncounterDto {
792
+ return {
793
+ patient: patientUuid,
794
+ location: locationUuid,
795
+ encounterType: orderEncounterTypeUuid,
796
+ visit: visitUuid,
797
+ obs: [],
798
+ orders: [
799
+ {
800
+ action: 'NEW',
801
+ type: 'order',
802
+ patient: patientUuid,
803
+ careSetting: outPatientCareSettingUuid,
804
+ orderer: session.currentProvider.uuid ?? 'pd25871c-1359-11df-a1f1-0026b9348838',
805
+ encounter: null,
806
+ concept: getOrderConcept(selectedPaymentMode),
807
+ accessionNumber: null,
808
+ urgency: 'ROUTINE',
809
+ scheduledDate: null,
810
+ },
811
+ ],
812
+ };
813
+ }
814
+ function getOrderConcept(paymentMode: PaymentMode) {
815
+ const paymentModeName = paymentMode.name.toLowerCase().trim();
816
+ if (paymentModeName.includes('cash') || paymentModeName.includes('mpesa')) {
817
+ return cashConsulationConceptUuid;
818
+ }
819
+ return shaConsulationConceptUuid;
820
+ }
821
+ async function createOrder(patientUuid: string, visitUuid: string) {
822
+ const createOrderPayload = generateOrderEncounterPayload(patientUuid, visitUuid);
823
+ try {
824
+ const resp = await createOrderEncounter(createOrderPayload);
825
+ if (resp) {
826
+ showAlert('success', 'Consultation order created', 'Consultation order has been succesfully created');
827
+ }
828
+ return resp;
829
+ } catch (error) {
830
+ showAlert(
831
+ 'error',
832
+ 'Error creating consulation order',
833
+ 'An error occurred while generating the consultation order. Please contact support',
834
+ );
835
+ }
836
+ }
837
+
838
+ async function generateBillOrderDto(encounter: Encounter, createdBillResp: any) {
839
+ try {
840
+ const orders = encounter?.orders;
841
+
842
+ if (orders && orders.length && createdBillResp) {
843
+ let order1 = orders[0];
844
+ let order = await getOrder(order1?.uuid);
845
+ const orderNumber = order?.orderNumber;
846
+ const billUuid = createdBillResp?.uuid;
847
+ const lineItemUuid = (() => {
848
+ if (createdBillResp?.lineItems && createdBillResp?.lineItems?.length) {
849
+ const lineItem = createdBillResp?.lineItems?.[0];
850
+
851
+ return lineItem?.uuid as string;
852
+ }
853
+ return '';
854
+ })();
855
+
856
+ let payload = {
857
+ bill_uuid: billUuid,
858
+ order_no: orderNumber,
859
+ line_item_uuid: lineItemUuid,
860
+ };
861
+
862
+ if (claimResult && intervention) {
863
+ const interventionResult = intervention;
864
+ const requiresPreauth = Boolean(interventionResult.needsPreauth);
865
+ const isElective = Boolean(interventionResult.needsManualPreauthApproval);
866
+ const requiredPreauthDocumentTypes = interventionResult.requiredPreauthDocumentTypes;
867
+ const applicableDocumentTypes = interventionResult.applicableDocumentTypes;
868
+
869
+ let interventionPayload = {
870
+ intervention_code: interventionResult.code,
871
+ consent_token: claimResult.authorization_code,
872
+ service_type: getServiceType(interventionResult, visitType),
873
+ requires_preauth: requiresPreauth,
874
+ normal_preauth: requiresPreauth && !isElective,
875
+ elective_preauth: isElective,
876
+ };
877
+
878
+ if (applicableDocumentTypes && applicableDocumentTypes.length) {
879
+ interventionPayload['applicable_document_types'] = applicableDocumentTypes.join(',');
880
+ }
881
+
882
+ if (requiredPreauthDocumentTypes && requiredPreauthDocumentTypes.length) {
883
+ interventionPayload['required_preauth_document_types'] = requiredPreauthDocumentTypes.join(',');
884
+ }
885
+
886
+ payload = {
887
+ ...payload,
888
+ ...interventionPayload,
889
+ };
890
+ }
891
+
892
+ return payload;
893
+ }
894
+ } catch (error) {}
895
+ }
896
+
897
+ const handleWhitelistSubmit = async (payload: OTPWhitelistRequest) => {
898
+ return await createOTPWhitelisting(payload);
899
+ };
900
+
901
+ const handleSendClaimsOtp = async () => {
902
+ try {
903
+ setSubmitting(true);
904
+
905
+ await cancelAllPendingAuthorizations(locationUuid!, patient!.id);
906
+
907
+ const response = await sendClaimsOTP(patient!.id, locationUuid!, intervention?.code);
908
+
909
+ if (response?.message?.includes('OTP')) {
910
+ const otp = response.message.match(/\d{6}/)?.[0];
911
+ setGeneratedOtp(otp);
912
+ setOtpSent(true);
913
+
914
+ showSnackbar({
915
+ kind: 'success',
916
+ title: 'OTP Sent',
917
+ });
918
+ }
919
+ } finally {
920
+ setSubmitting(false);
921
+ }
922
+ };
923
+
924
+ const handleVerifyOtp = async (otp: string) => {
925
+ try {
926
+ setSubmitting(true);
927
+ if (otp !== generatedOtp) {
928
+ showSnackbar({
929
+ kind: 'error',
930
+ title: 'Invalid OTP',
931
+ subtitle: 'The OTP you entered is incorrect.',
932
+ });
933
+
934
+ setOtpVerified(false);
935
+ return;
936
+ }
937
+
938
+ setOtpVerified(true);
939
+ setOtp(otp);
940
+ showSnackbar({
941
+ kind: 'success',
942
+ title: 'OTP Verified',
943
+ });
944
+ } finally {
945
+ setSubmitting(false);
946
+ }
947
+ };
948
+
949
+ const onRequestSubmit = () => {
950
+ if (step === 0) {
951
+ setStep(1);
952
+ } else if (step === 1) {
953
+ setStep(2);
954
+ } else if (step === 2) {
955
+ setStep(3);
956
+ } else {
957
+ sendToTriage();
958
+ }
959
+ };
960
+
961
+ const lastStep =
962
+ selectedPaymentDetail === PaymentDetail.Paying &&
963
+ !hasSelectedPaymentMode('CASH') &&
964
+ !hasSelectedPaymentMode('MPESA')
965
+ ? 2
966
+ : 1;
967
+
968
+ const handleSecondaryAction = () => {
969
+ if (step === 0) {
970
+ onModalClose({ success: false });
971
+ } else {
972
+ setStep((prev) => prev - 1);
973
+ }
974
+ };
975
+
976
+ const handleprimaryAction = async () => {
977
+ if (step < lastStep) {
978
+ setStep(step + 1);
979
+ return;
980
+ }
981
+
982
+ await handleSendToTriage();
983
+ };
984
+
985
+ const handleOtpSuccessfullVerification = () => {
986
+ setDisplayOtpModal(false);
987
+ setDisplayClientDetailsModal(true);
988
+ };
989
+
990
+ const handleModelClose = () => {
991
+ setDisplayOtpModal(false);
992
+ };
993
+
994
+ const onClientDetailsModalClose = () => {
995
+ setDisplayClientDetailsModal(false);
996
+ };
997
+
998
+ const handleSendClientToTriage = async () => {
999
+ if (hasSelectedPaymentMode('SHA')) {
1000
+ if (claimResult) {
1001
+ await sendToTriage();
1002
+ } else {
1003
+ setTriggerCreateVisit(true);
1004
+ }
1005
+ return;
1006
+ }
1007
+ await sendToTriage();
1008
+ };
1009
+
1010
+ const getPatient = (): HieClient => {
1011
+ if (selecteddPatient === 'principal') {
1012
+ return principal;
1013
+ } else if (selecteddPatient === 'dependants') {
1014
+ return selectedDependant;
1015
+ } else {
1016
+ return principal;
1017
+ }
1018
+ };
1019
+
1020
+ const handleClientDetailsSubmit = async () => {
1021
+ onClientDetailsModalClose();
1022
+ if (hasSelectedPaymentMode('SHA')) {
1023
+ if (claimResult) {
1024
+ await sendToTriage();
1025
+ } else {
1026
+ setTriggerCreateVisit(true);
1027
+ }
1028
+ return;
1029
+ }
1030
+ await sendToTriage();
1031
+ };
1032
+ const showWizard = !displayClientDetailsModal && !displayOtpModal;
189
1033
 
190
1034
  return (
191
1035
  <>
192
- <Modal
193
- open={open}
194
- size="md"
195
- onSecondarySubmit={() => onModalClose({ success: false })}
196
- onRequestClose={() => onModalClose({ success: false })}
197
- onRequestSubmit={registerOnAfyaYangu}
198
- primaryButtonText="Register on Afya Yangu"
199
- secondaryButtonText="Cancel"
200
- >
201
- <ModalBody>
202
- <div className={styles.clientDetailsLayout}>
203
- <div className={styles.sectionHeader}>
204
- <h4 className={styles.sectionTitle}>Send To Triage</h4>
205
- </div>
206
- {patients.length > 0 ? (
207
- <div className={styles.sectionContent}>
208
- <div className={styles.patientSelect}>
209
- <Table>
210
- <TableHead>
211
- <TableRow>
212
- <TableHeader>No</TableHeader>
213
- <TableHeader>Name</TableHeader>
214
- <TableHeader>Gender</TableHeader>
215
- <TableHeader>Select Patient</TableHeader>
216
- </TableRow>
217
- </TableHead>
218
- <TableBody>
219
- {patients.map((p, index) => (
220
- <TableRow key={p.uuid}>
221
- <TableCell>{index + 1}</TableCell>
222
- <TableCell>{p.person.preferredName.display}</TableCell>
223
- <TableCell>{p.person.gender}</TableCell>
224
- <TableCell>
225
- <Checkbox id={p.uuid} labelText="" onChange={() => onPatientSelect(p)} />
226
- </TableCell>
227
- </TableRow>
228
- ))}
229
- </TableBody>
230
- </Table>
1036
+ {showWizard && (
1037
+ <>
1038
+ <ProgressIndicator currentIndex={step}></ProgressIndicator>
1039
+ {step === 0 && <h1 />}
1040
+
1041
+ {step === 1 && <h2 />}
1042
+
1043
+ {step === 2 && <h1 />}
1044
+ <Modal
1045
+ open={open}
1046
+ size="md"
1047
+ onSecondarySubmit={handleSecondaryAction}
1048
+ onRequestClose={() => onModalClose({ success: false })}
1049
+ onRequestSubmit={handleprimaryAction}
1050
+ primaryButtonText={step === lastStep ? (loading ? 'Sending...please wait' : 'Send to Triage') : 'Next'}
1051
+ secondaryButtonText={step === 0 ? 'Cancel' : 'Back'}
1052
+ primaryButtonDisabled={
1053
+ step === lastStep && selectedPaymentMode?.name === 'SHA' && (loading || !otpVerified)
1054
+ }
1055
+ >
1056
+ <ModalBody>
1057
+ <ProgressIndicator currentIndex={step}>
1058
+ <ProgressStep label="Payment Details" />
1059
+ <ProgressStep label="Visit Details" />
1060
+ <ProgressStep label="Consent" />
1061
+ </ProgressIndicator>
1062
+
1063
+ <div className={styles.clientDetailsLayout}>
1064
+ <div className={styles.sectionHeader}>
1065
+ <h4 className={styles.sectionTitle}>Send To Triage</h4>
231
1066
  </div>
232
- <div className={styles.formSection}>
233
- <div className={styles.formRow}>
234
- <div className={styles.formControl}>
235
- <ComboBox
236
- onChange={visitTypeChangeHandler}
237
- id="visit-type-combobox"
238
- items={visitTypeOptions}
239
- itemToString={(item) => (item ? item.text : '')}
240
- titleText="Select a Visit Type"
241
- />
242
- </div>
243
- <div className={styles.formControl}>
244
- <Select id="service" labelText="Select a Service" onChange={serviceChangeHandler}>
245
- <SelectItem value="" text="Select" />;
246
- {serviceQueues &&
247
- serviceQueues.map((sq) => {
248
- return <SelectItem value={sq.uuid} text={`${sq.display} (${sq.location.display ?? ''})`} />;
249
- })}
250
- </Select>
251
- </div>
252
- </div>
253
- <div className={styles.formRow}>
254
- <div className={styles.formControl}>
255
- <Select
256
- id="priority"
257
- labelText="Select Priority"
258
- onChange={($event) => priorityChangeHandler($event.target.value)}
259
- >
260
- <SelectItem value="" text="Select" />;
261
- <SelectItem value={QUEUE_PRIORITIES_UUIDS.NORMAL_PRIORITY_UUID} text="NORMAL" />;
262
- <SelectItem value={QUEUE_PRIORITIES_UUIDS.EMERGENCY_PRIORITY_UUID} text="EMERGENCY" />;
263
- </Select>
264
- </div>
1067
+
1068
+ {patients.length > 0 && (
1069
+ <div className={styles.sectionContent}>
1070
+ {/* ================= STEP 0 ================= */}
1071
+ {step === 0 && (
1072
+ <>
1073
+ <PaymentDetailsSection
1074
+ patients={patients}
1075
+ onPatientSelect={onPatientSelect}
1076
+ patientTypeHandler={patientTypeHandler}
1077
+ paymentDetailsHandler={paymentDetailsHandler}
1078
+ />
1079
+
1080
+ {selectedPaymentDetail === PaymentDetail.Paying && (
1081
+ <PaymentMethodComponent
1082
+ paymentMethodHandler={paymentMethodHandler}
1083
+ paymentModes={paymentModes}
1084
+ billableServicesHandler={billableServicesHandler}
1085
+ filteredBillableServices={filteredBillableServices}
1086
+ />
1087
+ )}
1088
+ </>
1089
+ )}
1090
+
1091
+ {/* ================= STEP 1 ================= */}
1092
+ {step === 1 && (
1093
+ <>
1094
+ {selectedPaymentDetail === PaymentDetail.Paying && (
1095
+ <>
1096
+ {hasSelectedPaymentMode('insurance') && (
1097
+ <div className={styles.formRow}>
1098
+ <div className={styles.formControl}>
1099
+ <TextInput
1100
+ id="insurance-scheme"
1101
+ labelText="Insurance scheme"
1102
+ onChange={(e) => insuranceSchemeHandler(e.target.value)}
1103
+ />
1104
+ </div>
1105
+
1106
+ <div className={styles.formControl}>
1107
+ <TextInput
1108
+ id="policy-number"
1109
+ labelText="Policy number"
1110
+ onChange={(e) => insurancePolicyHandler(e.target.value)}
1111
+ />
1112
+ </div>
1113
+ </div>
1114
+ )}
1115
+
1116
+ <div className={styles.formRow}>
1117
+ <div className={styles.formControl}>
1118
+ <Select
1119
+ id="cash-point"
1120
+ labelText="Cash Point"
1121
+ onChange={(e) => cashPointsHandler(e.target.value)}
1122
+ >
1123
+ <SelectItem value="" text="Select" />
1124
+ {facilityCashPoints?.map((cp) => (
1125
+ <SelectItem key={cp.uuid} value={cp.uuid} text={cp.name} />
1126
+ ))}
1127
+ </Select>
1128
+ </div>
1129
+ </div>
1130
+ </>
1131
+ )}
1132
+
1133
+ {selectedPaymentDetail === PaymentDetail.NonPaying && (
1134
+ <div className={styles.formRow}>
1135
+ <div className={styles.formControl}>
1136
+ <Select
1137
+ id="patient-category"
1138
+ labelText="Patient Category"
1139
+ onChange={(e) => patientCategoryHandler(e.target.value)}
1140
+ >
1141
+ <SelectItem value="" text="Select" />
1142
+ <SelectItem value={PatientCategories.CCC_PATIENT_UUID} text="CCC" />
1143
+ <SelectItem value={PatientCategories.MCH_PATIENT_UUID} text="MCH" />
1144
+ </Select>
1145
+ </div>
1146
+ </div>
1147
+ )}
1148
+
1149
+ <div className={styles.formSection}>
1150
+ <div className={styles.formRow}>
1151
+ <div className={styles.formControl}>
1152
+ <ComboBox
1153
+ onChange={visitTypeChangeHandler}
1154
+ id="visit-type-combobox"
1155
+ items={visitTypeOptions}
1156
+ itemToString={(item) => (item ? item.text : '')}
1157
+ titleText="Visit Type"
1158
+ />
1159
+ </div>
1160
+
1161
+ <div className={styles.formControl}>
1162
+ <Select id="service" labelText="Select a Queue Service" onChange={serviceChangeHandler}>
1163
+ <SelectItem value="" text="Select" />
1164
+ {serviceQueues?.map((sq) => (
1165
+ <SelectItem key={sq.uuid} value={sq.uuid} text={sq.display} />
1166
+ ))}
1167
+ </Select>
1168
+ </div>
1169
+ </div>
1170
+
1171
+ <div className={styles.formRow}>
1172
+ <div className={styles.formControl}>
1173
+ <Select
1174
+ id="priority"
1175
+ labelText="Select Priority"
1176
+ onChange={(e) => priorityChangeHandler(e.target.value)}
1177
+ >
1178
+ <SelectItem value="" text="Select" />
1179
+ <SelectItem value={QUEUE_PRIORITIES_UUIDS.NORMAL_PRIORITY_UUID} text="PRIORITY" />
1180
+ <SelectItem value={QUEUE_PRIORITIES_UUIDS.NOT_URGENT_PRIORITY_UUID} text="NON URGENT" />
1181
+ <SelectItem value={QUEUE_PRIORITIES_UUIDS.EMERGENCY_PRIORITY_UUID} text="EMERGENCY" />
1182
+ </Select>
1183
+ </div>
1184
+ </div>
1185
+ </div>
1186
+ </>
1187
+ )}
1188
+
1189
+ {/* ================= STEP 2 ================= */}
1190
+ {step === 2 && showConsent && selectedPaymentDetail === PaymentDetail.Paying && (
1191
+ <>
1192
+ {hasSelectedPaymentMode('SHA') && (
1193
+ <ExtensionSlot
1194
+ name="billing-claims-slot"
1195
+ state={{
1196
+ clientRegistryId: patientIdentifiers?.crIdentifierId,
1197
+ patientUuid: selectedPatient?.uuid,
1198
+ triggerCreateVisit,
1199
+ otp,
1200
+ visitType,
1201
+ onSelectChange: () => {},
1202
+ onClaimsVisitStart,
1203
+ onInterventionChange,
1204
+ }}
1205
+ />
1206
+ )}
1207
+ {intervention && (
1208
+ <ClaimsConsentModal
1209
+ submitting={submitting}
1210
+ otpSent={otpSent}
1211
+ whitelistRequest={whitelistRequest}
1212
+ onWhitelistSubmit={handleWhitelistSubmit}
1213
+ onSendClaimsOtp={handleSendClaimsOtp}
1214
+ onOtpVerified={handleVerifyOtp}
1215
+ onOtpVerificationStatusChange={setOtpVerified}
1216
+ serviceType={getServiceType(intervention, visitType)}
1217
+ interventionCode={intervention?.code ?? ''}
1218
+ crId={patient!.id}
1219
+ onScanStatusChange={setScanStatus}
1220
+ />
1221
+ )}
1222
+ </>
1223
+ )}
265
1224
  </div>
266
- </div>
1225
+ )}
267
1226
  </div>
268
- ) : (
269
- <></>
270
- )}
271
- <div className={styles.actionSection}>
272
- {patients.length > 0 ? (
273
- <div className={styles.btnContainer}>
274
- <Button className={styles.greenBtn} onClick={sendToTriage}>
275
- {loading ? <InlineLoading description="Sending To Triage..." /> : 'Send To Triage'}
276
- </Button>
277
- </div>
278
- ) : (
279
- <>
280
- <div className={styles.patientAction}>
281
- <div className={styles.btnContainer}>
282
- <Button kind="primary" onClick={() => onCreateAmrsPatient(client)}>
283
- Automatically Register in AMRS
284
- </Button>
285
- </div>
286
- <div className={styles.btnContainer}>
287
- <Button kind="secondary" onClick={onManualRegistration}>
288
- Manually Register
289
- </Button>
290
- </div>
291
- </div>
292
- </>
293
- )}
294
- </div>
295
- </div>
296
- </ModalBody>
297
- </Modal>
1227
+ </ModalBody>
1228
+ </Modal>
1229
+ </>
1230
+ )}
1231
+ {displayOtpModal && requestCustomOtpDto ? (
1232
+ <OtpVerificationModal
1233
+ requestCustomOtpDto={requestCustomOtpDto}
1234
+ phoneNumber={formatPhoneNumberForOTP(patient!.phone)}
1235
+ open={displayOtpModal}
1236
+ onModalClose={handleModelClose}
1237
+ onOtpSuccessfullVerification={handleOtpSuccessfullVerification}
1238
+ />
1239
+ ) : (
1240
+ <></>
1241
+ )}
1242
+ {displayClientDetailsModal ? (
1243
+ <>
1244
+ <ClientDetailsModal
1245
+ client={patient!}
1246
+ open={displayClientDetailsModal}
1247
+ onModalClose={onClientDetailsModalClose}
1248
+ onSubmit={handleClientDetailsSubmit}
1249
+ />{' '}
1250
+ </>
1251
+ ) : (
1252
+ <></>
1253
+ )}
298
1254
  </>
299
1255
  );
300
1256
  };