@ampath/esm-dha-workflow-app 4.0.0-next.15 → 4.0.0-next.151

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 (379) hide show
  1. package/dist/1197.js +1 -0
  2. package/dist/1277.js +1 -0
  3. package/dist/1277.js.map +1 -0
  4. package/dist/1558.js +2 -0
  5. package/dist/1558.js.map +1 -0
  6. package/dist/1729.js +1 -0
  7. package/dist/1729.js.map +1 -0
  8. package/dist/182.js +1 -0
  9. package/dist/182.js.map +1 -0
  10. package/dist/1826.js +1 -0
  11. package/dist/1826.js.map +1 -0
  12. package/dist/1833.js +1 -0
  13. package/dist/1833.js.map +1 -0
  14. package/dist/1856.js +1 -0
  15. package/dist/1856.js.map +1 -0
  16. package/dist/1925.js +1 -0
  17. package/dist/1925.js.map +1 -0
  18. package/dist/2021.js +1 -0
  19. package/dist/2021.js.map +1 -0
  20. package/dist/2054.js +1 -0
  21. package/dist/2054.js.map +1 -0
  22. package/dist/2177.js +2 -0
  23. package/dist/2177.js.map +1 -0
  24. package/dist/2333.js +1 -0
  25. package/dist/2333.js.map +1 -0
  26. package/dist/2364.js +2 -0
  27. package/dist/{388.js.LICENSE.txt → 2364.js.LICENSE.txt} +15 -0
  28. package/dist/2364.js.map +1 -0
  29. package/dist/2801.js +1 -0
  30. package/dist/2801.js.map +1 -0
  31. package/dist/3041.js +1 -0
  32. package/dist/3041.js.map +1 -0
  33. package/dist/3099.js +1 -0
  34. package/dist/3184.js +2 -0
  35. package/dist/3184.js.map +1 -0
  36. package/dist/3654.js +1 -0
  37. package/dist/3654.js.map +1 -0
  38. package/dist/4055.js +1 -0
  39. package/dist/4205.js +1 -0
  40. package/dist/4205.js.map +1 -0
  41. package/dist/4225.js +1 -0
  42. package/dist/4225.js.map +1 -0
  43. package/dist/4300.js +1 -0
  44. package/dist/4335.js +1 -0
  45. package/dist/4353.js +1 -0
  46. package/dist/4353.js.map +1 -0
  47. package/dist/4517.js +1 -0
  48. package/dist/4517.js.map +1 -0
  49. package/dist/4652.js +1 -0
  50. package/dist/4674.js +1 -0
  51. package/dist/4674.js.map +1 -0
  52. package/dist/4947.js +1 -0
  53. package/dist/4947.js.map +1 -0
  54. package/dist/5015.js +1 -0
  55. package/dist/5015.js.map +1 -0
  56. package/dist/5422.js +1 -0
  57. package/dist/5422.js.map +1 -0
  58. package/dist/5428.js +1 -0
  59. package/dist/5428.js.map +1 -0
  60. package/dist/5752.js +1 -0
  61. package/dist/5752.js.map +1 -0
  62. package/dist/5851.js +1 -0
  63. package/dist/5851.js.map +1 -0
  64. package/dist/6260.js +1 -0
  65. package/dist/6260.js.map +1 -0
  66. package/dist/6264.js +1 -0
  67. package/dist/6264.js.map +1 -0
  68. package/dist/6540.js +2 -0
  69. package/dist/6540.js.map +1 -0
  70. package/dist/6606.js +1 -0
  71. package/dist/6606.js.map +1 -0
  72. package/dist/{709.js → 693.js} +1 -1
  73. package/dist/693.js.map +1 -0
  74. package/dist/6991.js +1 -0
  75. package/dist/6991.js.map +1 -0
  76. package/dist/7199.js +1 -0
  77. package/dist/7199.js.map +1 -0
  78. package/dist/7255.js +1 -0
  79. package/dist/7255.js.map +1 -0
  80. package/dist/7258.js +1 -0
  81. package/dist/7258.js.map +1 -0
  82. package/dist/7420.js +1 -0
  83. package/dist/7420.js.map +1 -0
  84. package/dist/8114.js +1 -0
  85. package/dist/8114.js.map +1 -0
  86. package/dist/8235.js +1 -0
  87. package/dist/8235.js.map +1 -0
  88. package/dist/8339.js +1 -0
  89. package/dist/8339.js.map +1 -0
  90. package/dist/8558.js +1 -0
  91. package/dist/8558.js.map +1 -0
  92. package/dist/8865.js +1 -0
  93. package/dist/8865.js.map +1 -0
  94. package/dist/8895.js +1 -0
  95. package/dist/8895.js.map +1 -0
  96. package/dist/9037.js +1 -0
  97. package/dist/9037.js.map +1 -0
  98. package/dist/9091.js +1 -0
  99. package/dist/9091.js.map +1 -0
  100. package/dist/9093.js +1 -0
  101. package/dist/9093.js.map +1 -0
  102. package/dist/9117.js +1 -0
  103. package/dist/9117.js.map +1 -0
  104. package/dist/9721.js +1 -0
  105. package/dist/9721.js.map +1 -0
  106. package/dist/esm-dha-workflow-app.js +1 -1
  107. package/dist/esm-dha-workflow-app.js.buildmanifest.json +990 -215
  108. package/dist/esm-dha-workflow-app.js.map +1 -1
  109. package/dist/main.js +1 -1
  110. package/dist/main.js.map +1 -1
  111. package/dist/routes.json +1 -1
  112. package/package.json +10 -3
  113. package/src/accounting/accounting.component.tsx +13 -0
  114. package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
  115. package/src/admissions/admission-request-list/admission-request-list.tsx +134 -0
  116. package/src/admissions/admissions-dashboard.component.scss +15 -0
  117. package/src/admissions/admissions-dashboard.component.tsx +160 -0
  118. package/src/admissions/admissions.resource.ts +101 -0
  119. package/src/admissions/admitted-list/admitted-patients-list.tsx +141 -0
  120. package/src/admissions/constants/index.ts +33 -0
  121. package/src/admissions/discharged-list/discharged-list.scss +0 -0
  122. package/src/admissions/discharged-list/discharged-list.tsx +58 -0
  123. package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
  124. package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
  125. package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
  126. package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
  127. package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
  128. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
  129. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
  130. package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
  131. package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +109 -0
  132. package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
  133. package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
  134. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
  135. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
  136. package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
  137. package/src/admissions/modal/discharge/discharge-patient.modal.tsx +84 -0
  138. package/src/admissions/types/index.ts +192 -0
  139. package/src/appointments/appointments.component.tsx +13 -0
  140. package/src/billing/api/billing.api.ts +107 -0
  141. package/src/billing/billing-root.tsx +20 -0
  142. package/src/billing/dashboard/billingDashboard.component.scss +0 -0
  143. package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
  144. package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
  145. package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +508 -0
  146. package/src/billing/invoice/bill.resource.ts +47 -0
  147. package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
  148. package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
  149. package/src/billing/invoice/invoice.scss +113 -0
  150. package/src/billing/invoice/invoice.tsx +1441 -0
  151. package/src/billing/invoice/line-items/line-items.scss +0 -0
  152. package/src/billing/invoice/line-items/line-items.tsx +120 -0
  153. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
  154. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
  155. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
  156. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
  157. package/src/billing/invoice/payment-details/payment-details.scss +0 -0
  158. package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
  159. package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
  160. package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
  161. package/src/billing/types/index.ts +84 -0
  162. package/src/billing/utils/index.ts +17 -0
  163. package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
  164. package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
  165. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +103 -0
  166. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
  167. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +349 -0
  168. package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +11 -0
  169. package/src/bookings/bookings.component.scss +7 -0
  170. package/src/bookings/bookings.component.tsx +31 -0
  171. package/src/bookings/daily/daily-bookings.component.scss +38 -0
  172. package/src/bookings/daily/daily-bookings.component.tsx +138 -0
  173. package/src/bookings/daily/daily-bookings.resource.ts +28 -0
  174. package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
  175. package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
  176. package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
  177. package/src/bookings/types/index.ts +68 -0
  178. package/src/config-schema.ts +91 -1
  179. package/src/createDashboardLink.tsx +9 -0
  180. package/src/dashboard/charts/chart.component.scss +13 -0
  181. package/src/dashboard/charts/chart.component.tsx +56 -0
  182. package/src/dashboard/dashboard.component.scss +7 -0
  183. package/src/dashboard/dashboard.component.tsx +51 -0
  184. package/src/dashboard/overview/overview.component.scss +150 -0
  185. package/src/dashboard/overview/overview.component.tsx +134 -0
  186. package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
  187. package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
  188. package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
  189. package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
  190. package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
  191. package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
  192. package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
  193. package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
  194. package/src/dashboard-meta/maternity-dashboard.meta.ts +6 -0
  195. package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
  196. package/src/dashboard-meta/pharmacy-dashboard.meta.ts +6 -0
  197. package/src/dashboard-meta/queue-dashboard.meta.ts +6 -0
  198. package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
  199. package/src/dashboard-meta/registry-dashboard.meta.ts +6 -0
  200. package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
  201. package/src/dashboard-meta/triage-dashboard.meta.ts +6 -0
  202. package/src/hooks/useActions.ts +19 -2
  203. package/src/index.ts +110 -15
  204. package/src/laboratory/laboratory.component.tsx +13 -0
  205. package/src/mnch/maternity/maternity-queues.component.scss +7 -0
  206. package/src/mnch/maternity/maternity-queues.component.tsx +28 -0
  207. package/src/mnch/maternity/queues/triage/maternity-triage.tsx +15 -0
  208. package/src/mnch/mch/mch-queues.component.scss +7 -0
  209. package/src/mnch/mch/mch-queues.component.tsx +32 -0
  210. package/src/mnch/mch/queues/consultation/mch-consultation.tsx +18 -0
  211. package/src/mnch/mch/queues/triage/mch-triage.tsx +15 -0
  212. package/src/mnch/mnch-root.tsx +17 -0
  213. package/src/mortuary/mortuary.component.tsx +13 -0
  214. package/src/pharmacy/pharmacy.component.tsx +13 -0
  215. package/src/registers/registers.component.tsx +8 -0
  216. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +6 -0
  217. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +137 -0
  218. package/src/registry/eligibility/modal/eligibility-details.modal.scss +38 -0
  219. package/src/registry/eligibility/modal/eligibility-details.modal.tsx +131 -0
  220. package/src/registry/modal/client-details-modal/client-details-modal.tsx +9 -26
  221. package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +31 -1
  222. package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +139 -54
  223. package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +9 -1
  224. package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +665 -45
  225. package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
  226. package/src/registry/payment-details/payment-options/payment-options.tsx +61 -14
  227. package/src/registry/registry.component.scss +6 -0
  228. package/src/registry/registry.component.tsx +94 -27
  229. package/src/registry/registry.resource.ts +10 -6
  230. package/src/registry/types/index.ts +120 -0
  231. package/src/registry/utils/hie-client-adapter.ts +3 -0
  232. package/src/registry/utils/mask-data.ts +11 -0
  233. package/src/resources/dashboard.resource.ts +20 -0
  234. package/src/resources/identifier-types.ts +2 -0
  235. package/src/resources/patient-resource.ts +3 -1
  236. package/src/resources/queue.resource.ts +24 -1
  237. package/src/resources/superset.resource.ts +21 -0
  238. package/src/resources/visit.resource.ts +19 -1
  239. package/src/root.component.tsx +27 -6
  240. package/src/routes.json +222 -15
  241. package/src/{consultation → service-queues}/action-button.component.tsx +2 -2
  242. package/src/{consultation → service-queues}/action-overflow-menu-item.component.tsx +2 -2
  243. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
  244. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +143 -0
  245. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
  246. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +154 -0
  247. package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
  248. package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
  249. package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
  250. package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
  251. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
  252. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
  253. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
  254. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
  255. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
  256. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
  257. package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
  258. package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +34 -0
  259. package/src/service-queues/consultation/consultation.component.scss +7 -0
  260. package/src/service-queues/consultation/consultation.component.tsx +15 -0
  261. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
  262. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
  263. package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
  264. package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
  265. package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
  266. package/src/{metrics → service-queues/metrics}/metrics.resource.ts +0 -36
  267. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
  268. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +108 -0
  269. package/src/service-queues/modals/move/move-patient.component.scss +35 -0
  270. package/src/service-queues/modals/move/move-patient.component.tsx +152 -0
  271. package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
  272. package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
  273. package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
  274. package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
  275. package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
  276. package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
  277. package/src/service-queues/queue-list/check-in.service.ts +26 -0
  278. package/src/service-queues/queue-list/queue-list.component.scss +50 -0
  279. package/src/service-queues/queue-list/queue-list.component.tsx +302 -0
  280. package/src/service-queues/queue-room.component.tsx +39 -0
  281. package/src/service-queues/room/room.component.tsx +58 -0
  282. package/src/service-queues/service-queue/service-queue.component.scss +14 -0
  283. package/src/service-queues/service-queue/service-queue.component.tsx +399 -0
  284. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +12 -0
  285. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +63 -0
  286. package/src/service-queues/service-queue.scss +27 -0
  287. package/src/service-queues/service-queue.tsx +37 -0
  288. package/src/service-queues/service-queues.resource.ts +303 -4
  289. package/src/service-queues/service.resource.ts +28 -0
  290. package/src/shared/constants/concepts.ts +18 -0
  291. package/src/shared/constants/index.ts +1 -2
  292. package/src/shared/constants/patient-category.ts +6 -0
  293. package/src/shared/constants/patient-type.ts +10 -0
  294. package/src/shared/constants/visit-types.ts +7 -0
  295. package/src/shared/services/billing.resource.ts +38 -0
  296. package/src/shared/services/client-payment-mode.resource.ts +27 -0
  297. package/src/shared/services/client-payment.resource.ts +17 -0
  298. package/src/shared/services/eligibility.resource.ts +19 -0
  299. package/src/shared/services/encounters.resource.ts +27 -0
  300. package/src/shared/services/location.resource.ts +9 -0
  301. package/src/shared/types/index.ts +152 -0
  302. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
  303. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
  304. package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
  305. package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
  306. package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
  307. package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
  308. package/src/shared/ui/stat-card/stat-card.component.scss +10 -0
  309. package/src/shared/ui/stat-card/stat-card.component.tsx +26 -0
  310. package/src/shared/ui/timer/timer.component.scss +5 -0
  311. package/src/shared/ui/timer/timer.component.tsx +40 -0
  312. package/src/shared/utils/get-base-url.ts +27 -0
  313. package/src/shared/utils/get-tag-type.ts +66 -0
  314. package/src/side-nav-menu/mnch-nav-link-config.ts +16 -0
  315. package/src/side-nav-menu/mnch-nav-links.tsx +42 -0
  316. package/src/side-nav-menu/nav-link-config.ts +6 -4
  317. package/src/triage/metrics/attended-patients.extension.tsx +42 -0
  318. package/src/triage/metrics/metrics.scss +36 -0
  319. package/src/triage/metrics/triage-metrics.component.tsx +21 -0
  320. package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
  321. package/src/triage/room/room.scss +29 -0
  322. package/src/triage/triage.component.tsx +15 -0
  323. package/src/triage/triage.resource.ts +19 -0
  324. package/src/triage/types.ts +16 -0
  325. package/src/types/types.ts +82 -2
  326. package/dist/104.js +0 -2
  327. package/dist/104.js.map +0 -1
  328. package/dist/184.js +0 -2
  329. package/dist/184.js.map +0 -1
  330. package/dist/197.js +0 -1
  331. package/dist/255.js +0 -1
  332. package/dist/255.js.map +0 -1
  333. package/dist/300.js +0 -1
  334. package/dist/306.js +0 -1
  335. package/dist/306.js.map +0 -1
  336. package/dist/335.js +0 -1
  337. package/dist/353.js +0 -1
  338. package/dist/353.js.map +0 -1
  339. package/dist/388.js +0 -2
  340. package/dist/388.js.map +0 -1
  341. package/dist/420.js +0 -1
  342. package/dist/420.js.map +0 -1
  343. package/dist/460.js +0 -1
  344. package/dist/460.js.map +0 -1
  345. package/dist/540.js +0 -2
  346. package/dist/540.js.map +0 -1
  347. package/dist/55.js +0 -1
  348. package/dist/560.js +0 -1
  349. package/dist/560.js.map +0 -1
  350. package/dist/635.js +0 -1
  351. package/dist/635.js.map +0 -1
  352. package/dist/652.js +0 -1
  353. package/dist/695.js +0 -1
  354. package/dist/695.js.map +0 -1
  355. package/dist/709.js.map +0 -1
  356. package/dist/710.js +0 -2
  357. package/dist/710.js.map +0 -1
  358. package/dist/91.js +0 -1
  359. package/dist/91.js.map +0 -1
  360. package/dist/93.js +0 -1
  361. package/dist/93.js.map +0 -1
  362. package/dist/978.js +0 -1
  363. package/dist/978.js.map +0 -1
  364. package/dist/99.js +0 -1
  365. package/src/consultation/consultation-room.component.tsx +0 -60
  366. package/src/consultation/consultation.scss +0 -5
  367. package/src/consultation/consultation.tsx +0 -14
  368. package/src/hooks/useQueueEntries.ts +0 -35
  369. package/src/metrics/metrics-cards/attended-patients.extension.tsx +0 -18
  370. package/src/metrics/metrics-cards/waiting-patients.extension.tsx +0 -18
  371. package/src/metrics/metrics-container.component.tsx +0 -16
  372. package/src/registry/mock-client.ts +0 -627
  373. /package/dist/{710.js.LICENSE.txt → 1558.js.LICENSE.txt} +0 -0
  374. /package/dist/{104.js.LICENSE.txt → 2177.js.LICENSE.txt} +0 -0
  375. /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
  376. /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
  377. /package/src/{metrics → service-queues/metrics}/metrics-cards/metrics-card.component.tsx +0 -0
  378. /package/src/{metrics → service-queues/metrics}/metrics-cards/metrics-card.scss +0 -0
  379. /package/src/{metrics → service-queues/metrics}/metrics-container.scss +0 -0
@@ -0,0 +1,103 @@
1
+ import { openmrsFetch, OpenmrsResource, restBaseUrl } from "@openmrs/esm-framework";
2
+ import { useState } from "react";
3
+ import useSWR from 'swr';
4
+ import { getHieBaseUrl } from "../../../shared/utils/get-base-url";
5
+ import { postJson } from "../../../registry/registry.resource";
6
+ import dayjs from "dayjs";
7
+
8
+ export const useBillableItems = (serviceTypeUuid: string = "") => {
9
+ const url = `${restBaseUrl}/billing/billableService?v=custom:(uuid,name,shortName,serviceStatus,serviceType:(uuid,display),servicePrices:(uuid,name,price,paymentMode),concept:(uuid))`;
10
+ const { data, isLoading, error } = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch);
11
+ const [searchTerm, setSearchTerm] = useState('');
12
+ let filteredItems =
13
+ data?.data?.results?.filter((item) => item.name.toLowerCase().includes(searchTerm.toLowerCase())) ?? [];
14
+
15
+ if (serviceTypeUuid) {
16
+ filteredItems = filteredItems?.filter(item => item?.serviceType?.uuid === serviceTypeUuid);
17
+ }
18
+
19
+ return {
20
+ lineItems: filteredItems,
21
+ isLoading,
22
+ error,
23
+ searchTerm,
24
+ setSearchTerm,
25
+ };
26
+ };
27
+
28
+ export const usePatientBills = (patientUuid: string, billStatus: string = 'PENDING') => {
29
+ const url = `${restBaseUrl}/billing/bill?patientUuid=${patientUuid}&status=${billStatus}&v=custom:(uuid,lineItems,dateCreated)`;
30
+
31
+ const {
32
+ data,
33
+ error,
34
+ isLoading,
35
+ isValidating,
36
+ mutate: mutated,
37
+ } = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch, {
38
+ errorRetryCount: 2,
39
+ });
40
+
41
+ const results = data?.data?.results ?? [];
42
+
43
+ const today = dayjs().startOf('day');
44
+
45
+ const currentDayBills = results.filter((bill) => {
46
+ const billDate = dayjs(bill?.dateCreated).startOf('day');
47
+ return billDate.isSame(today);
48
+ });
49
+
50
+ return {
51
+ currentDayBills,
52
+ error,
53
+ isLoading,
54
+ isValidating,
55
+ mutated,
56
+ };
57
+ };
58
+
59
+ export const useCashPoint = () => {
60
+ const url = `/ws/rest/v1/billing/cashPoint`;
61
+ const { data, isLoading, error } = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch);
62
+
63
+ return { isLoading, error, cashPoints: data?.data?.results ?? [] };
64
+ };
65
+
66
+ export const createPatientBill = (payload) => {
67
+ const postUrl = `${restBaseUrl}/billing/bill`;
68
+ return openmrsFetch<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }>(postUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: payload });
69
+ };
70
+
71
+ export const updatePatientBill = (billUuid: string, payload) => {
72
+ const postUrl = `${restBaseUrl}/billing/bill/${billUuid}`;
73
+ return openmrsFetch<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }>(postUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: payload });
74
+ };
75
+
76
+ export const removePatientBill = (uuid) => {
77
+ const purgeUrl = `${restBaseUrl}/billing/bill/${uuid}?purge=true`;
78
+ return openmrsFetch<{ uuid: string }>(purgeUrl, { method: 'DELETE' });
79
+ };
80
+
81
+ export const createOrderBillInHie = async (payload) => {
82
+ const hieBaseUrl = await getHieBaseUrl();
83
+ const url = `${hieBaseUrl}/bill-order`;
84
+ return postJson<{ bill_uuid: string }>(url, payload);
85
+ }
86
+
87
+ export const usePatientIdentifiers = (patientUuid: string) => {
88
+ const customRepresentation = `custom:(identifiers:(identifier,identifierType:(uuid,display)))`;
89
+ const url = `/ws/rest/v1/patient/${patientUuid}?v=${customRepresentation}`;
90
+ const { data, isLoading, error } = useSWR<{
91
+ data: {
92
+ identifiers: Array<{
93
+ identifier: string,
94
+ identifierType: {
95
+ uuid: string,
96
+ display: string
97
+ }
98
+ }>
99
+ }
100
+ }>(url, openmrsFetch);
101
+
102
+ return { isLoading, error, identifiers: data?.data?.identifiers };
103
+ };
@@ -0,0 +1,58 @@
1
+ @use '@carbon/colors';
2
+ @use '@carbon/layout';
3
+ @use '@carbon/type';
4
+ @use '@openmrs/esm-styleguide/src/vars' as *;
5
+
6
+ .form {
7
+ display: flex;
8
+ flex-direction: column;
9
+ justify-content: space-between;
10
+ height: 100%;
11
+ }
12
+
13
+ .formContainer {
14
+ margin: layout.$spacing-05;
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: layout.$spacing-05;
18
+ }
19
+
20
+ .tablet {
21
+ padding: layout.$spacing-06 layout.$spacing-05;
22
+ background-color: colors.$white;
23
+ }
24
+
25
+ .desktop {
26
+ padding: layout.$spacing-01 layout.$spacing-05;
27
+ }
28
+
29
+ .buttonContainer {
30
+ max-width: 50%;
31
+ }
32
+
33
+ .inlineLoading {
34
+ display: flex;
35
+ align-items: center;
36
+ gap: layout.$spacing-03;
37
+ }
38
+
39
+ .service {
40
+ padding: layout.$spacing-05 layout.$spacing-04;
41
+ }
42
+
43
+ .conceptsList {
44
+ background-color: $ui-02;
45
+ max-height: 14rem;
46
+ overflow-y: auto;
47
+ border: 1px solid $ui-03;
48
+
49
+ li:hover {
50
+ background-color: $ui-03;
51
+ }
52
+ }
53
+
54
+ .errorMessage {
55
+ @include type.type-style('label-02');
56
+ color: $danger;
57
+ margin-bottom: layout.$spacing-05;
58
+ }
@@ -0,0 +1,349 @@
1
+ import { Order } from "@openmrs/esm-patient-common-lib";
2
+ import { useMemo, useRef, useState } from "react";
3
+ import { zodResolver } from "@hookform/resolvers/zod";
4
+ import { Controller, useForm, useWatch } from "react-hook-form";
5
+ import { validationSchema, type CreateOrderBillFormSchema } from "./schema";
6
+ import { FetchResponse, OpenmrsResource, ResponsiveWrapper, showSnackbar, useConfig, useDebounce, useLayoutType } from "@openmrs/esm-framework";
7
+ import { useTranslation } from "react-i18next";
8
+ import { Column, FilterableMultiSelect, Select, SelectItem, Form, FormGroup, Stack, TextInput, InlineNotification, ButtonSet, Button, InlineLoading, Search, Layer, Tile, FormLabel } from "@carbon/react";
9
+ import styles from './create-order-bill-form.scss';
10
+ import React from "react";
11
+ import classNames from 'classnames';
12
+ import { createOrderBillInHie, createPatientBill, removePatientBill, updatePatientBill, useBillableItems, useCashPoint, usePatientBills, usePatientIdentifiers } from "./create-order-bill-form.resource";
13
+ import { generateUpdateBillLineItems } from "../../utils";
14
+ import { IdentifierTypesUuids } from "../../../resources/identifier-types";
15
+ import { type ConfigObject } from "../../../config-schema";
16
+
17
+ interface CreateOrderBillFormProps {
18
+ closeWorkspace: () => void;
19
+ quantity: number;
20
+ order: Order,
21
+ mutated: () => void;
22
+ serviceTypeUuid: string;
23
+ }
24
+
25
+ const CreateOrderBillForm: React.FC<CreateOrderBillFormProps> = ({
26
+ closeWorkspace, quantity, order, mutated, serviceTypeUuid
27
+ }) => {
28
+ const { t } = useTranslation();
29
+ const isTablet = useLayoutType() === 'tablet';
30
+ const { lineItems, isLoading: isLoadingLineItems } = useBillableItems(); //useBillableItems(serviceTypeUuid);
31
+ const { currentDayBills } = usePatientBills(order?.patient?.uuid);
32
+ const { identifiers } = usePatientIdentifiers(order?.patient?.uuid);
33
+ const { cashPoints } = useCashPoint();
34
+ const cashPointUuid = cashPoints?.[0]?.uuid ?? '';
35
+ const conceptUuid = order?.concept?.uuid;
36
+ const { nonSHAPaymentModes, consultationBillableServiceNames } = useConfig<ConfigObject>();
37
+ const [searchTerm, setSearchTerm] = useState('');
38
+ const debouncedSearchTerm = useDebounce(searchTerm.trim());
39
+ const searchInputRef = useRef(null);
40
+ const searchResults = useMemo(() => {
41
+ if (debouncedSearchTerm) {
42
+ const filteredItems = lineItems.filter(item => item?.name.toLowerCase()?.includes(debouncedSearchTerm.toLowerCase()));
43
+ return filteredItems;
44
+ }
45
+ return [];
46
+ }, [debouncedSearchTerm])
47
+
48
+ const {
49
+ control,
50
+ watch,
51
+ handleSubmit,
52
+ setValue,
53
+ formState: { errors, isDirty, isSubmitting },
54
+ } = useForm<CreateOrderBillFormSchema>({
55
+ resolver: zodResolver(validationSchema),
56
+ defaultValues: {
57
+ quantity: quantity ?? 1
58
+ }
59
+ });
60
+
61
+ const initialPriceName = useMemo(() => {
62
+ let priceName = "";
63
+ if (currentDayBills && currentDayBills.length) {
64
+ const bill = currentDayBills[0];
65
+ priceName = bill?.lineItems?.find(i => consultationBillableServiceNames.includes(i?.billableService?.toUpperCase()))?.priceName;
66
+ }
67
+ return priceName;
68
+ }, [currentDayBills]);
69
+
70
+ const selectedBillableItem = useWatch({ control, name: 'billableItem' });
71
+ const billableItem = useMemo(() => {
72
+ if (selectedBillableItem) {
73
+ let filteredItems = lineItems.filter(item => item?.uuid === selectedBillableItem);
74
+ return filteredItems;
75
+ }
76
+ return [];
77
+ }, [selectedBillableItem, initialPriceName]);
78
+
79
+ const isSHAEligible = useMemo(() => {
80
+ if (identifiers) {
81
+ return identifiers?.some(v => v.identifierType.uuid === IdentifierTypesUuids.CLIENT_REGISTRY_NO_UUID);
82
+ }
83
+ return false;
84
+ }, [identifiers]);
85
+
86
+ const servicePrices = useMemo(() => {
87
+ if (billableItem && billableItem.length && identifiers) {
88
+ let sPs = billableItem[0]?.servicePrices ?? [];
89
+ // add the non-sha payments
90
+ sPs = sPs && sPs.length && !isSHAEligible ? sPs.filter(v => nonSHAPaymentModes.includes(v?.paymentMode?.uuid)) : sPs;
91
+ return sPs;
92
+ }
93
+ return [];
94
+ }, [billableItem, identifiers]);
95
+
96
+ const initialUnitPriceUuid = useMemo(() => {
97
+ if (billableItem && billableItem.length && initialPriceName) {
98
+ const serviceUuid = billableItem[0]?.uuid ?? "";
99
+
100
+ const initialServicePriceUuid = servicePrices?.find(sP => sP?.paymentMode?.name?.toUpperCase() === initialPriceName.toUpperCase())?.uuid;
101
+ const value = serviceUuid + "#" + initialServicePriceUuid;
102
+ setValue("unitPrice", value);
103
+ return value;
104
+ }
105
+ return null;
106
+ }, [billableItem, initialPriceName]);
107
+
108
+ const onSubmit = async (data) => {
109
+ try {
110
+ if (isSubmitting) {
111
+ return;
112
+ }
113
+
114
+ const unitPriceTxt = data?.unitPrice;
115
+ const serviceUuid = unitPriceTxt?.split("#")[0];
116
+ const servicePriceUuid = unitPriceTxt?.split("#")[1];
117
+ const lineItemOrder = order?.orderNumber?.split("-")[1] ?? null;
118
+
119
+ const billableItems = lineItems
120
+ .filter((item) => item.uuid === serviceUuid)
121
+ .map((item, index) => {
122
+ const price = item.servicePrices?.find(service => service.uuid === servicePriceUuid)?.price || 0;
123
+ const paymentStatus = price == 0 ? "PAID" : "PENDING";
124
+ return {
125
+ billableService: item.uuid,
126
+ quantity: data.quantity,
127
+ item: conceptUuid,
128
+ price: price,
129
+ priceName: item.servicePrices?.find(service => service.uuid === servicePriceUuid)?.name || 'Default',
130
+ priceUuid: servicePriceUuid || '',
131
+ lineItemOrder: Number(lineItemOrder) ?? index,
132
+ paymentStatus: paymentStatus,
133
+ }
134
+ });
135
+ let billPayload = {};
136
+
137
+ let response: FetchResponse<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }> | undefined;
138
+
139
+ if (currentDayBills && currentDayBills.length) {
140
+ const bill = currentDayBills[0];
141
+ const billUuid = bill?.uuid;
142
+ const initialLineItems = generateUpdateBillLineItems(bill, lineItems);
143
+ const lineItemsPayload = [...initialLineItems, ...billableItems];
144
+ billPayload = {
145
+ lineItems: lineItemsPayload
146
+ }
147
+ response = await updatePatientBill(billUuid, billPayload);
148
+ } else {
149
+ billPayload = {
150
+ lineItems: billableItems,
151
+ cashPoint: cashPointUuid,
152
+ patient: order?.patient?.uuid,
153
+ status: 'PENDING',
154
+ payments: []
155
+ };
156
+ response = await createPatientBill(billPayload);
157
+ }
158
+
159
+ const billUuidResp = response?.data?.uuid;
160
+ const lineItemUuid = response?.data?.lineItems?.find(v => v?.lineItemOrder === Number(lineItemOrder))?.uuid;
161
+
162
+ if (billUuidResp) {
163
+ const hiePayload = {
164
+ bill_uuid: billUuidResp,
165
+ order_no: order?.orderNumber,
166
+ line_item_uuid: lineItemUuid
167
+ };
168
+
169
+ try {
170
+ await createOrderBillInHie(hiePayload);
171
+ } catch (error) {
172
+ await removePatientBill(billUuidResp);
173
+ throw error;
174
+ }
175
+ } else {
176
+ throw new Error("Bill uuid not found!");
177
+ }
178
+
179
+ showSnackbar({
180
+ title: t('billSuccess', 'Bill created'),
181
+ subtitle: t('billSuccessMessage', "Patient's bill has been created successfully"),
182
+ kind: 'success',
183
+ });
184
+
185
+ mutated();
186
+ closeWorkspace();
187
+ } catch (error) {
188
+ showSnackbar({
189
+ title: t('error', 'Error'),
190
+ subtitle: error?.message || t('unknownError', 'An unknown error occurred'),
191
+ kind: 'error',
192
+ });
193
+ }
194
+ }
195
+
196
+ return (
197
+ <Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
198
+ <div className={styles.formContainer}>
199
+ <Stack gap={3}>
200
+ <InlineNotification
201
+ kind="info"
202
+ title={`${order?.orderNumber} - ${order?.display}`}
203
+ lowContrast
204
+ />
205
+
206
+ <ResponsiveWrapper>
207
+ <FormGroup legendText="">
208
+ <Column>
209
+ <Controller
210
+ name="quantity"
211
+ control={control}
212
+ render={({ field }) => (
213
+ <TextInput
214
+ {...field}
215
+ id="quantity"
216
+ labelText={t('quantity', 'Quantity *')}
217
+ placeholder={t('enterQuantity', 'Enter quantity')}
218
+ invalid={!!errors.quantity}
219
+ invalidText={errors.quantity?.message}
220
+ />
221
+ )}
222
+ />
223
+ </Column>
224
+ </FormGroup>
225
+ </ResponsiveWrapper>
226
+
227
+ <ResponsiveWrapper>
228
+ <Controller
229
+ name="billableItem"
230
+ control={control}
231
+ render={({ field }) => (
232
+ <>
233
+ <FormLabel className={styles.conceptLabel}>{t('billableItem', 'Billable item')}</FormLabel>
234
+ <Search
235
+ id="billableItemSearch"
236
+ labelText={t('billableItem', 'Billable item')}
237
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearchTerm(e.target.value)}
238
+ onClear={() => {
239
+ setSearchTerm('');
240
+ field.onChange('');
241
+ }}
242
+ placeholder={t('searchBillableItem', 'Search billable item')}
243
+ ref={searchInputRef}
244
+ value={lineItems.find(v => v.uuid === selectedBillableItem)?.name || searchTerm}
245
+ />
246
+
247
+ {(() => {
248
+ if (!debouncedSearchTerm || selectedBillableItem) {
249
+ return null;
250
+ }
251
+ if (searchResults && searchResults.length) {
252
+
253
+ return (
254
+ <ul className={styles.conceptsList}>
255
+ {searchResults?.map((item) => (
256
+ <li
257
+ className={styles.service}
258
+ key={item?.uuid}
259
+ onClick={() => {
260
+ field.onChange(item?.uuid);
261
+ setSearchTerm('');
262
+ }}
263
+ role="menuitem">
264
+ {item?.name}
265
+ </li>
266
+ ))}
267
+ </ul>
268
+ );
269
+ }
270
+ return (
271
+ <Layer>
272
+ <Tile className={styles.emptyResults}>
273
+ <span>
274
+ {t('noResultsFor', 'No results for {{searchTerm}}', { searchTerm: debouncedSearchTerm })}
275
+ </span>
276
+ </Tile>
277
+ </Layer>
278
+ );
279
+ })()}
280
+ </>
281
+ )}
282
+ />
283
+ </ResponsiveWrapper>
284
+
285
+ <Column>
286
+ <Controller
287
+ control={control}
288
+ name="unitPrice"
289
+ render={({ field }) => {
290
+ const serviceUuid = billableItem[0]?.uuid ?? "";
291
+
292
+ return (
293
+ <>
294
+ {billableItem && billableItem.length ?
295
+ (servicePrices.length > 0 ? (
296
+ <Select id="unitPrice" labelText={t('selectServicePrice', 'Select service price *')} invalid={!!errors.unitPrice}
297
+ invalidText={errors.unitPrice?.message}
298
+ onChange={(e) => {
299
+ field.onChange(e.target.value);
300
+ }}
301
+ defaultValue={initialUnitPriceUuid ?? null}
302
+ >
303
+ <SelectItem value="" text="Select service price" />
304
+ {
305
+ servicePrices.map((service) => {
306
+ const value = serviceUuid + "#" + service?.uuid;
307
+ const text = `${service?.name} - ${service?.price}`;
308
+ return (
309
+ <SelectItem value={value} text={text} />
310
+ )
311
+ })
312
+ }
313
+ </Select>
314
+ ) : (
315
+ <InlineNotification
316
+ kind="warning"
317
+ title={t(
318
+ 'noServicesAvailable',
319
+ 'No service price has been configured for this order.',
320
+ )}
321
+ lowContrast
322
+ />
323
+ )) : null
324
+ }
325
+ </>
326
+ );
327
+ }}
328
+ />
329
+ </Column>
330
+ </Stack>
331
+ </div>
332
+
333
+ <ButtonSet className={classNames(styles.buttonSet, { [styles.tablet]: isTablet })}>
334
+ <Button kind="secondary" onClick={closeWorkspace}>
335
+ {t('cancel', 'Cancel')}
336
+ </Button>
337
+ <Button kind="primary" type="submit" disabled={isSubmitting || !isDirty}>
338
+ {isSubmitting ? (
339
+ <InlineLoading description={t('submitting', 'Submitting...')} />
340
+ ) : (
341
+ t('saveAndClose', 'Save & close')
342
+ )}
343
+ </Button>
344
+ </ButtonSet>
345
+ </Form>
346
+ )
347
+ }
348
+
349
+ export default CreateOrderBillForm;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ const validationSchema = z.object({
4
+ unitPrice: z.string({ required_error: "Unit price is required" }),
5
+ quantity: z.number({ required_error: "Quantity is required" }),
6
+ billableItem: z.string().optional()
7
+ });
8
+
9
+ export { validationSchema };
10
+
11
+ export type CreateOrderBillFormSchema = z.infer<typeof validationSchema>;
@@ -0,0 +1,7 @@
1
+ .bookingsLayout{
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ row-gap: 10px;
6
+ padding: 2% 2%;
7
+ }
@@ -0,0 +1,31 @@
1
+ import { Checkbox, Layer, Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
2
+ import React from 'react';
3
+ import DailyBookings from './daily/daily-bookings.component';
4
+ import styles from './bookings.component.scss';
5
+ const Bookings: React.FC = () => {
6
+ return (
7
+ <>
8
+ <div className={styles.bookingsLayout}>
9
+ <div className={styles.bookingsHeader}>
10
+ <h4>Bookings</h4>
11
+ </div>
12
+ <div className={styles.bookingsContent}>
13
+ <Tabs>
14
+ <TabList contained>
15
+ <Tab>Daily</Tab>
16
+ <Tab>Monthly</Tab>
17
+ </TabList>
18
+ <TabPanels>
19
+ <TabPanel>
20
+ <DailyBookings />
21
+ </TabPanel>
22
+ <TabPanel></TabPanel>
23
+ </TabPanels>
24
+ </Tabs>
25
+ </div>
26
+ </div>
27
+ </>
28
+ );
29
+ };
30
+
31
+ export default Bookings;
@@ -0,0 +1,38 @@
1
+ .bookingsLayout{
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 15px 15px;
5
+ row-gap: 5px;
6
+ }
7
+ .bookingsHeader{
8
+ display: flex;
9
+ flex-direction: row;
10
+ column-gap: 5px;
11
+ width: 100%;
12
+ }
13
+ .bookingsFilters{
14
+ display: flex;
15
+ flex-direction: column;
16
+ width: 100%;
17
+ border: 1px double lightgray;
18
+ padding-top: 10px;
19
+ padding-bottom: 10px;
20
+ padding-left: 15px;
21
+ padding-right: 15px;
22
+ margin-left: 5px;
23
+ margin-right: 5px;
24
+ margin-bottom: 10px;
25
+ }
26
+ .bookingsContent{
27
+ display: flex;
28
+ flex-direction: column;
29
+ width: 100%;
30
+ row-gap: 15px;
31
+ }
32
+ .contentActions{
33
+ display: flex;
34
+ flex-direction: row;
35
+ width: 100%;
36
+ justify-content: flex-end;
37
+ column-gap: 5px;
38
+ }