@ampath/esm-dha-workflow-app 4.0.0-next.13 → 4.0.0-next.130

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 (364) 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/{198.js.LICENSE.txt → 1558.js.LICENSE.txt} +0 -10
  6. package/dist/1558.js.map +1 -0
  7. package/dist/1729.js +1 -0
  8. package/dist/1729.js.map +1 -0
  9. package/dist/182.js +1 -0
  10. package/dist/182.js.map +1 -0
  11. package/dist/1826.js +1 -0
  12. package/dist/1826.js.map +1 -0
  13. package/dist/1833.js +1 -0
  14. package/dist/1833.js.map +1 -0
  15. package/dist/1856.js +1 -0
  16. package/dist/1856.js.map +1 -0
  17. package/dist/1925.js +1 -0
  18. package/dist/1925.js.map +1 -0
  19. package/dist/2021.js +1 -0
  20. package/dist/2021.js.map +1 -0
  21. package/dist/2054.js +1 -0
  22. package/dist/2054.js.map +1 -0
  23. package/dist/2177.js +2 -0
  24. package/dist/2177.js.LICENSE.txt +9 -0
  25. package/dist/2177.js.map +1 -0
  26. package/dist/2364.js +2 -0
  27. package/dist/{200.js.LICENSE.txt → 2364.js.LICENSE.txt} +15 -0
  28. package/dist/2364.js.map +1 -0
  29. package/dist/2566.js +1 -0
  30. package/dist/2566.js.map +1 -0
  31. package/dist/2801.js +1 -0
  32. package/dist/2801.js.map +1 -0
  33. package/dist/2975.js +1 -0
  34. package/dist/2975.js.map +1 -0
  35. package/dist/3041.js +1 -0
  36. package/dist/3041.js.map +1 -0
  37. package/dist/3099.js +1 -0
  38. package/dist/3184.js +2 -0
  39. package/dist/3184.js.map +1 -0
  40. package/dist/3654.js +1 -0
  41. package/dist/3654.js.map +1 -0
  42. package/dist/4055.js +1 -0
  43. package/dist/4205.js +1 -0
  44. package/dist/4205.js.map +1 -0
  45. package/dist/4225.js +1 -0
  46. package/dist/4225.js.map +1 -0
  47. package/dist/4300.js +1 -0
  48. package/dist/4335.js +1 -0
  49. package/dist/4353.js +1 -0
  50. package/dist/4353.js.map +1 -0
  51. package/dist/4517.js +1 -0
  52. package/dist/4517.js.map +1 -0
  53. package/dist/4652.js +1 -0
  54. package/dist/4674.js +1 -0
  55. package/dist/4674.js.map +1 -0
  56. package/dist/4947.js +1 -0
  57. package/dist/4947.js.map +1 -0
  58. package/dist/5015.js +1 -0
  59. package/dist/5015.js.map +1 -0
  60. package/dist/5422.js +1 -0
  61. package/dist/5422.js.map +1 -0
  62. package/dist/5428.js +1 -0
  63. package/dist/5428.js.map +1 -0
  64. package/dist/5752.js +1 -0
  65. package/dist/5752.js.map +1 -0
  66. package/dist/5851.js +1 -0
  67. package/dist/5851.js.map +1 -0
  68. package/dist/6264.js +1 -0
  69. package/dist/6264.js.map +1 -0
  70. package/dist/6540.js +2 -0
  71. package/dist/6540.js.map +1 -0
  72. package/dist/6606.js +1 -0
  73. package/dist/6606.js.map +1 -0
  74. package/dist/693.js +1 -0
  75. package/dist/693.js.map +1 -0
  76. package/dist/6991.js +1 -0
  77. package/dist/6991.js.map +1 -0
  78. package/dist/7076.js +1 -0
  79. package/dist/7076.js.map +1 -0
  80. package/dist/7199.js +1 -0
  81. package/dist/7199.js.map +1 -0
  82. package/dist/7255.js +1 -0
  83. package/dist/7255.js.map +1 -0
  84. package/dist/7258.js +1 -0
  85. package/dist/7258.js.map +1 -0
  86. package/dist/7420.js +1 -0
  87. package/dist/7420.js.map +1 -0
  88. package/dist/7523.js +1 -0
  89. package/dist/7523.js.map +1 -0
  90. package/dist/8114.js +1 -0
  91. package/dist/8114.js.map +1 -0
  92. package/dist/8339.js +1 -0
  93. package/dist/8339.js.map +1 -0
  94. package/dist/8865.js +1 -0
  95. package/dist/8865.js.map +1 -0
  96. package/dist/8895.js +1 -0
  97. package/dist/8895.js.map +1 -0
  98. package/dist/9037.js +1 -0
  99. package/dist/9037.js.map +1 -0
  100. package/dist/9091.js +1 -0
  101. package/dist/9091.js.map +1 -0
  102. package/dist/9093.js +1 -0
  103. package/dist/9093.js.map +1 -0
  104. package/dist/9117.js +1 -0
  105. package/dist/9117.js.map +1 -0
  106. package/dist/9721.js +1 -0
  107. package/dist/9721.js.map +1 -0
  108. package/dist/esm-dha-workflow-app.js +1 -0
  109. package/dist/esm-dha-workflow-app.js.buildmanifest.json +1570 -0
  110. package/dist/esm-dha-workflow-app.js.map +1 -0
  111. package/dist/main.js +1 -1
  112. package/dist/main.js.map +1 -1
  113. package/dist/routes.json +1 -1
  114. package/package.json +11 -4
  115. package/src/accounting/accounting.component.tsx +13 -0
  116. package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
  117. package/src/admissions/admission-request-list/admission-request-list.tsx +134 -0
  118. package/src/admissions/admissions-dashboard.component.scss +15 -0
  119. package/src/admissions/admissions-dashboard.component.tsx +160 -0
  120. package/src/admissions/admissions.resource.ts +101 -0
  121. package/src/admissions/admitted-list/admitted-patients-list.tsx +141 -0
  122. package/src/admissions/constants/index.ts +33 -0
  123. package/src/admissions/discharged-list/discharged-list.scss +0 -0
  124. package/src/admissions/discharged-list/discharged-list.tsx +58 -0
  125. package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
  126. package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
  127. package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
  128. package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
  129. package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
  130. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
  131. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
  132. package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
  133. package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +109 -0
  134. package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
  135. package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
  136. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
  137. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
  138. package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
  139. package/src/admissions/modal/discharge/discharge-patient.modal.tsx +84 -0
  140. package/src/admissions/types/index.ts +192 -0
  141. package/src/appointments/appointments.component.tsx +13 -0
  142. package/src/billing/api/billing.api.ts +95 -0
  143. package/src/billing/billing-root.tsx +20 -0
  144. package/src/billing/dashboard/billingDashboard.component.scss +0 -0
  145. package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
  146. package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
  147. package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +409 -0
  148. package/src/billing/invoice/bill.resource.ts +47 -0
  149. package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
  150. package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
  151. package/src/billing/invoice/invoice.scss +113 -0
  152. package/src/billing/invoice/invoice.tsx +1371 -0
  153. package/src/billing/invoice/line-items/line-items.scss +0 -0
  154. package/src/billing/invoice/line-items/line-items.tsx +120 -0
  155. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
  156. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
  157. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
  158. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
  159. package/src/billing/invoice/payment-details/payment-details.scss +0 -0
  160. package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
  161. package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
  162. package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
  163. package/src/billing/types/index.ts +84 -0
  164. package/src/billing/utils/index.ts +17 -0
  165. package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
  166. package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
  167. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +85 -0
  168. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
  169. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +330 -0
  170. package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +11 -0
  171. package/src/bookings/bookings.component.scss +7 -0
  172. package/src/bookings/bookings.component.tsx +31 -0
  173. package/src/bookings/daily/daily-bookings.component.scss +38 -0
  174. package/src/bookings/daily/daily-bookings.component.tsx +138 -0
  175. package/src/bookings/daily/daily-bookings.resource.ts +28 -0
  176. package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
  177. package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
  178. package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
  179. package/src/bookings/types/index.ts +68 -0
  180. package/src/config-schema.ts +186 -32
  181. package/src/createDashboardLink.tsx +9 -0
  182. package/src/dashboard/charts/chart.component.scss +13 -0
  183. package/src/dashboard/charts/chart.component.tsx +54 -0
  184. package/src/dashboard/dashboard.component.scss +7 -0
  185. package/src/dashboard/dashboard.component.tsx +51 -0
  186. package/src/dashboard/overview/overview.component.scss +147 -0
  187. package/src/dashboard/overview/overview.component.tsx +115 -0
  188. package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
  189. package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
  190. package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
  191. package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
  192. package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
  193. package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
  194. package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
  195. package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
  196. package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
  197. package/src/dashboard-meta/pharmacy-dashboard.meta.ts +6 -0
  198. package/src/dashboard-meta/queue-dashboard.meta.ts +6 -0
  199. package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
  200. package/src/dashboard-meta/registry-dashboard.meta.ts +6 -0
  201. package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
  202. package/src/dashboard-meta/triage-dashboard.meta.ts +6 -0
  203. package/src/hooks/useActions.ts +165 -0
  204. package/src/index.ts +118 -1
  205. package/src/laboratory/laboratory.component.tsx +13 -0
  206. package/src/left-panel/left-panel.component.tsx +0 -2
  207. package/src/mch/mch-queues.component.scss +7 -0
  208. package/src/mch/mch-queues.component.tsx +32 -0
  209. package/src/mch/queues/consultation/mch-consultation.tsx +18 -0
  210. package/src/mch/queues/triage/mch-triage.tsx +15 -0
  211. package/src/modals/sign-off-modal.scss +7 -0
  212. package/src/modals/sign-off-modal.tsx +52 -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 +145 -58
  223. package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +16 -1
  224. package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +681 -97
  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 +18 -1
  228. package/src/registry/registry.component.tsx +242 -111
  229. package/src/registry/registry.resource.ts +8 -5
  230. package/src/registry/types/index.ts +179 -1
  231. package/src/registry/utils/error-handler.ts +33 -0
  232. package/src/registry/utils/format-dependant-display-data.ts +8 -0
  233. package/src/registry/utils/hie-client-adapter.ts +312 -0
  234. package/src/registry/utils/mask-data.ts +11 -0
  235. package/src/resources/dashboard.resource.ts +20 -0
  236. package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
  237. package/src/resources/identifier-types.ts +29 -0
  238. package/src/resources/patient-resource.ts +62 -0
  239. package/src/resources/queue.resource.ts +23 -0
  240. package/src/resources/superset.resource.ts +20 -0
  241. package/src/resources/visit.resource.ts +19 -1
  242. package/src/root.component.tsx +32 -6
  243. package/src/routes.json +232 -7
  244. package/src/service-queues/action-button.component.tsx +34 -0
  245. package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
  246. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
  247. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +142 -0
  248. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
  249. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +150 -0
  250. package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
  251. package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
  252. package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
  253. package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
  254. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
  255. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
  256. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
  257. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
  258. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
  259. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
  260. package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
  261. package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +34 -0
  262. package/src/service-queues/consultation/consultation.component.scss +7 -0
  263. package/src/service-queues/consultation/consultation.component.tsx +15 -0
  264. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
  265. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
  266. package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
  267. package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
  268. package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
  269. package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
  270. package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
  271. package/src/service-queues/metrics/metrics-container.scss +36 -0
  272. package/src/service-queues/metrics/metrics.resource.ts +65 -0
  273. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
  274. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +108 -0
  275. package/src/service-queues/modals/move/move-patient.component.scss +35 -0
  276. package/src/service-queues/modals/move/move-patient.component.tsx +152 -0
  277. package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
  278. package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
  279. package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
  280. package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
  281. package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
  282. package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
  283. package/src/service-queues/queue-list/check-in.service.ts +26 -0
  284. package/src/service-queues/queue-list/queue-list.component.scss +36 -0
  285. package/src/service-queues/queue-list/queue-list.component.tsx +249 -0
  286. package/src/service-queues/queue-room.component.tsx +39 -0
  287. package/src/service-queues/room/room.component.tsx +58 -0
  288. package/src/service-queues/service-queue/service-queue.component.scss +14 -0
  289. package/src/service-queues/service-queue/service-queue.component.tsx +399 -0
  290. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +12 -0
  291. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +63 -0
  292. package/src/service-queues/service-queue.scss +27 -0
  293. package/src/service-queues/service-queue.tsx +37 -0
  294. package/src/service-queues/service-queues.resource.ts +361 -0
  295. package/src/service-queues/service.resource.ts +28 -0
  296. package/src/shared/constants/civil-status.ts +29 -0
  297. package/src/shared/constants/concepts.ts +15 -0
  298. package/src/shared/constants/index.ts +1 -2
  299. package/src/shared/constants/patient-category.ts +6 -0
  300. package/src/shared/constants/person-attributes.ts +33 -0
  301. package/src/shared/constants/visit-types.ts +7 -0
  302. package/src/shared/services/billing.resource.ts +38 -0
  303. package/src/shared/services/client-payment-mode.resource.ts +27 -0
  304. package/src/shared/services/client-payment.resource.ts +17 -0
  305. package/src/shared/services/eligibility.resource.ts +19 -0
  306. package/src/shared/services/encounters.resource.ts +27 -0
  307. package/src/shared/services/location.resource.ts +9 -0
  308. package/src/shared/types/index.ts +152 -0
  309. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
  310. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
  311. package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
  312. package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
  313. package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
  314. package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
  315. package/src/shared/ui/stat-card/stat-card.component.scss +10 -0
  316. package/src/shared/ui/stat-card/stat-card.component.tsx +26 -0
  317. package/src/shared/ui/timer/timer.component.scss +5 -0
  318. package/src/shared/ui/timer/timer.component.tsx +40 -0
  319. package/src/shared/utils/get-base-url.ts +27 -0
  320. package/src/shared/utils/get-tag-type.ts +66 -0
  321. package/src/side-nav-menu/nav-link-config.ts +6 -0
  322. package/src/triage/metrics/attended-patients.extension.tsx +42 -0
  323. package/src/triage/metrics/metrics.scss +36 -0
  324. package/src/triage/metrics/triage-metrics.component.tsx +21 -0
  325. package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
  326. package/src/triage/room/room.scss +29 -0
  327. package/src/triage/triage.component.tsx +15 -0
  328. package/src/triage/triage.resource.ts +19 -0
  329. package/src/triage/types.ts +16 -0
  330. package/src/types/types.ts +180 -0
  331. package/dist/16.js +0 -1
  332. package/dist/16.js.map +0 -1
  333. package/dist/184.js +0 -2
  334. package/dist/184.js.map +0 -1
  335. package/dist/197.js +0 -1
  336. package/dist/198.js +0 -2
  337. package/dist/198.js.map +0 -1
  338. package/dist/200.js +0 -2
  339. package/dist/200.js.map +0 -1
  340. package/dist/255.js +0 -1
  341. package/dist/255.js.map +0 -1
  342. package/dist/300.js +0 -1
  343. package/dist/335.js +0 -1
  344. package/dist/353.js +0 -1
  345. package/dist/353.js.map +0 -1
  346. package/dist/420.js +0 -1
  347. package/dist/420.js.map +0 -1
  348. package/dist/540.js +0 -2
  349. package/dist/540.js.map +0 -1
  350. package/dist/55.js +0 -1
  351. package/dist/652.js +0 -1
  352. package/dist/860.js +0 -1
  353. package/dist/860.js.map +0 -1
  354. package/dist/91.js +0 -1
  355. package/dist/91.js.map +0 -1
  356. package/dist/93.js +0 -1
  357. package/dist/93.js.map +0 -1
  358. package/dist/99.js +0 -1
  359. package/dist/openmrs-esm-home-app.js +0 -1
  360. package/dist/openmrs-esm-home-app.js.buildmanifest.json +0 -626
  361. package/dist/openmrs-esm-home-app.js.map +0 -1
  362. package/src/consultation/consultation.tsx +0 -7
  363. /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
  364. /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
@@ -0,0 +1,62 @@
1
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import { type HieClient, type CreatePatientDto, HieIdentificationType } from '../registry/types';
3
+ import { IdentifierTypesUuids } from './identifier-types';
4
+ import { getAmrsIdentifierTypeUuid } from '../registry/utils/hie-client-adapter';
5
+ import { getSubDomainUrl } from '../shared/utils/get-base-url';
6
+
7
+ export async function createPatient(payload: CreatePatientDto) {
8
+ return await openmrsFetch(`${restBaseUrl}/patient`, {
9
+ method: 'POST',
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ },
13
+ body: payload,
14
+ });
15
+ }
16
+
17
+ export const generatePatientIdentifiers = async (identifierLocation: string, client: HieClient) => {
18
+ const amrsUniverSalId = await generateAmrsUniversalIdentifier();
19
+ const identifiers = generateAmrsCreatePatientIdentifiersPayload(client, identifierLocation);
20
+ identifiers.push({
21
+ identifierType: IdentifierTypesUuids.AMRS_UNIVERSAL_ID_UUID,
22
+ identifier: amrsUniverSalId,
23
+ location: identifierLocation,
24
+ preferred: true,
25
+ });
26
+ return identifiers;
27
+ };
28
+
29
+ export function generateAmrsCreatePatientIdentifiersPayload(hieClient: HieClient, identifierLocation: string) {
30
+ const identifiers = [];
31
+ // add CR number
32
+ identifiers.push({
33
+ identifierType: getAmrsIdentifierTypeUuid(HieIdentificationType.Cr),
34
+ identifier: hieClient.id,
35
+ location: identifierLocation,
36
+ });
37
+
38
+ // add main identifier
39
+ identifiers.push({
40
+ identifierType: getAmrsIdentifierTypeUuid(hieClient.identification_type),
41
+ identifier: hieClient.identification_number,
42
+ location: identifierLocation,
43
+ });
44
+ return identifiers;
45
+ }
46
+
47
+ export async function generateAmrsUniversalIdentifier() {
48
+ const subDomainUrl = await getSubDomainUrl();
49
+ const abortController = new AbortController();
50
+ const resp = await openmrsFetch(`${subDomainUrl}/amrs-id-generator/generateidentifier`, {
51
+ headers: {
52
+ 'Content-Type': 'application/json',
53
+ },
54
+ method: 'POST',
55
+ body: {
56
+ user: 1,
57
+ },
58
+ signal: abortController.signal,
59
+ });
60
+ const data = await resp.json();
61
+ return data['identifier'] ?? '';
62
+ }
@@ -1,5 +1,6 @@
1
1
  import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
2
  import { type QueueEntryDto, type ServiceQueueApiResponse } from '../registry/types';
3
+ import { getLocationByUuid } from '../shared/services/location.resource';
3
4
 
4
5
  export async function fetchServiceQueuesByLocationUuid<T>(locationUuid: string): Promise<ServiceQueueApiResponse> {
5
6
  const url = `${restBaseUrl}/queue`;
@@ -35,3 +36,25 @@ export async function createQueueEntry(createQueueEntryDto: QueueEntryDto) {
35
36
 
36
37
  return response.json();
37
38
  }
39
+
40
+ export async function getFacilityServiceQueues(locationUuid: string) {
41
+ const currentLocation = await getLocationByUuid(locationUuid);
42
+ if (!currentLocation) return;
43
+ const parentLocation = currentLocation.parentLocation;
44
+ //get child locations
45
+ if (!parentLocation) return;
46
+ const parentLocationDetail = await getLocationByUuid(parentLocation.uuid);
47
+ const childLocations = parentLocationDetail.childLocations ?? [];
48
+ const childLocationUuids =
49
+ childLocations.map((c) => {
50
+ return c.uuid;
51
+ }) ?? [];
52
+ let sqs = [];
53
+ if (childLocationUuids.length > 0) {
54
+ for (let i = 0; i < childLocationUuids.length; i++) {
55
+ const s = await fetchServiceQueuesByLocationUuid(childLocationUuids[i]);
56
+ sqs = [...sqs, ...s.results];
57
+ }
58
+ }
59
+ return sqs;
60
+ }
@@ -0,0 +1,20 @@
1
+ import { openmrsFetch } from '@openmrs/esm-framework';
2
+ import { getEtlBaseUrl } from '../shared/utils/get-base-url';
3
+
4
+ export async function fetchGuestToken(locationUuid: string): Promise<string> {
5
+ const etlBaseUrl = await getEtlBaseUrl();
6
+ const supersetTokenUrl = `${etlBaseUrl}/superset-token`;
7
+ const params = {
8
+ locationUuid: locationUuid,
9
+ };
10
+ const queryString = new URLSearchParams(params).toString();
11
+ const response = await openmrsFetch(`${supersetTokenUrl}?${queryString}`);
12
+
13
+ if (!response.ok) {
14
+ const errorText = await response.text();
15
+ throw new Error(`Failed to fetch guest token: ${response.status} - ${errorText}`);
16
+ }
17
+
18
+ const data = await response.json();
19
+ return data.access_token;
20
+ }
@@ -1,5 +1,5 @@
1
1
  import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
- import { type CreateVisitDto } from '../registry/types';
2
+ import { type EndVisitDto, type CreateVisitDto } from '../registry/types';
3
3
 
4
4
  export async function createVisit(createVisitDto: CreateVisitDto) {
5
5
  const url = `${restBaseUrl}/visit`;
@@ -18,3 +18,21 @@ export async function createVisit(createVisitDto: CreateVisitDto) {
18
18
 
19
19
  return response.json();
20
20
  }
21
+
22
+ export async function endVisit(visitUuid: string, endVisitDto: EndVisitDto) {
23
+ const url = `${restBaseUrl}/visit/${visitUuid}`;
24
+ const response = await openmrsFetch(url, {
25
+ method: 'POST',
26
+ headers: {
27
+ 'content-type': 'application/json',
28
+ },
29
+ body: JSON.stringify(endVisitDto),
30
+ });
31
+
32
+ if (!response.ok) {
33
+ const errorText = await response.text();
34
+ throw new Error(`Request failed with ${response.status}: ${errorText}`);
35
+ }
36
+
37
+ return response.json();
38
+ }
@@ -1,22 +1,48 @@
1
1
  import React from 'react';
2
2
  import styles from './root.scss';
3
- import { WorkspaceContainer } from '@openmrs/esm-framework';
3
+ import { useLeftNav, WorkspaceContainer } from '@openmrs/esm-framework';
4
4
  import { BrowserRouter, Route, Routes } from 'react-router-dom';
5
5
  import RegistryComponent from './registry/registry.component';
6
6
  import LeftPanel from './left-panel/left-panel.component';
7
- import Consultation from './consultation/consultation';
7
+ import Triage from './triage/triage.component';
8
+ import LaboratoryComponent from './laboratory/laboratory.component';
9
+ import AppointmentsComponent from './appointments/appointments.component';
10
+ import PharmacyComponent from './pharmacy/pharmacy.component';
11
+ import Consultation from './service-queues/consultation/consultation.component';
12
+ import Dashboard from './dashboard/dashboard.component';
13
+ import AccountingComponent from './accounting/accounting.component';
14
+ import DailyBookings from './bookings/daily/daily-bookings.component';
15
+ import MchTriage from './mch/queues/triage/mch-triage';
16
+ import MchConsultation from './mch/queues/consultation/mch-consultation';
17
+ import Mortuary from './mortuary/mortuary.component';
18
+ import ServiceQueueAdminDashboard from './service-queues/admin/service-queue-admin-dashboard.component';
19
+ import AdmissionsDashboard from './admissions/admissions-dashboard.component';
8
20
 
9
21
  const Root: React.FC = () => {
22
+ const spaBasePath = window.spaBase;
23
+ useLeftNav({
24
+ name: 'dha-workflow-slot',
25
+ basePath: spaBasePath,
26
+ mode: 'normal',
27
+ });
10
28
  return (
11
- <BrowserRouter basename={`${window.spaBase}/home`}>
29
+ <BrowserRouter basename={`${window.spaBase}/dha-workflow`}>
12
30
  <LeftPanel />
13
31
  <main className={styles.container}>
14
32
  <Routes>
15
- <Route path="" element={<RegistryComponent />} />
33
+ <Route path="dashboard" element={<Dashboard />} />
16
34
  <Route path="registry" element={<RegistryComponent />} />
17
- <Route path="triage" element={<Consultation />} />
18
35
  <Route path="consultation" element={<Consultation />} />
19
- <Route path="*" element={<RegistryComponent />} />
36
+ <Route path="triage" element={<Triage />} />
37
+ <Route path="laboratory" element={<LaboratoryComponent />} />
38
+ <Route path="pharmacy" element={<PharmacyComponent />} />
39
+ <Route path="appointments" element={<AppointmentsComponent />} />
40
+ <Route path="bookings/daily" element={<DailyBookings />} />
41
+ <Route path="mch/triage" element={<MchTriage />} />
42
+ <Route path="mch/consultation" element={<MchConsultation />} />
43
+ <Route path="mortuary" element={<Mortuary />} />
44
+ <Route path="service-queue-admin" element={<ServiceQueueAdminDashboard />} />
45
+ <Route path="admissions-dashboard" element={<AdmissionsDashboard />} />
20
46
  </Routes>
21
47
  </main>
22
48
  <WorkspaceContainer contextKey="home" />
package/src/routes.json CHANGED
@@ -4,25 +4,250 @@
4
4
  "pages": [
5
5
  {
6
6
  "component": "root",
7
- "route": "home",
7
+ "route": "dha-workflow",
8
8
  "online": true,
9
9
  "offline": true
10
10
  }
11
11
  ],
12
12
  "extensions": [
13
13
  {
14
- "component": "workflowRegistryLink",
15
- "name": "workflow-registry-link",
14
+ "component": "navLinks",
15
+ "name": "side-nav-workflow-links",
16
+ "slot": "dha-workflow-slot",
17
+ "online": true,
18
+ "offline": true
19
+ },
20
+ {
21
+ "name": "dha-workflow-dashboard-link",
22
+ "component": "dhaWorkflowDashboardLink",
23
+ "slot": "homepage-dashboard-slot",
24
+ "meta": {
25
+ "name": "dashboard",
26
+ "slot": "dha-workflow-dashboard-slot",
27
+ "title": "Dashboard"
28
+ },
29
+ "online": true,
30
+ "offline": true,
31
+ "order": 0
32
+ },
33
+ {
34
+ "component": "dhaWorkflowDashboard",
35
+ "name": "dashboardExt",
36
+ "slot": "dha-workflow-dashboard-slot"
37
+ },
38
+ {
39
+ "name": "registry-dashboard-link",
40
+ "component": "registryDashboardLink",
41
+ "slot": "homepage-dashboard-slot",
42
+ "meta": {
43
+ "name": "registry",
44
+ "slot": "client-registry-dashboard-slot",
45
+ "title": "Registry"
46
+ },
47
+ "online": true,
48
+ "offline": true,
49
+ "order": 1
50
+ },
51
+ {
52
+ "component": "registryExtension",
53
+ "name": "registry",
54
+ "slot": "client-registry-dashboard-slot"
55
+ },
56
+ {
57
+ "name": "triage-dashboard-link",
58
+ "component": "triageDashboardLink",
59
+ "slot": "homepage-dashboard-slot",
60
+ "meta": {
61
+ "name": "triage",
62
+ "slot": "triage-queue-dashboard-slot",
63
+ "title": "Triage"
64
+ },
65
+ "online": true,
66
+ "offline": false
67
+ },
68
+ {
69
+ "component": "triageQueueExtension",
70
+ "name": "triage",
71
+ "slot": "triage-queue-dashboard-slot"
72
+ },
73
+ {
74
+ "name": "consultation-dashboard-link",
75
+ "component": "consultationDashboardLink",
76
+ "slot": "homepage-dashboard-slot",
77
+ "meta": {
78
+ "name": "consultation",
79
+ "slot": "consultation-dashboard-slot",
80
+ "title": "Consultation"
81
+ },
82
+ "online": true,
83
+ "offline": false
84
+ },
85
+ {
86
+ "component": "consultationQueue",
87
+ "name": "consultation",
88
+ "slot": "consultation-dashboard-slot"
89
+ },
90
+ {
91
+ "name": "mnch-dashboard-link",
92
+ "component": "mnchQueueDashboardLink",
93
+ "slot": "homepage-dashboard-slot",
94
+ "meta": {
95
+ "name": "mnch",
96
+ "slot": "mnch-dashboard-slot",
97
+ "title": "MNCH"
98
+ },
99
+ "online": true,
100
+ "offline": true
101
+ },
102
+ {
103
+ "component": "mnchQueueDashboard",
104
+ "name": "mnch",
105
+ "slot": "mnch-dashboard-slot"
106
+ },
107
+ {
108
+ "name": "pharmacy-dashboard-link",
109
+ "component": "pharmacyDashboardLink",
110
+ "slot": "homepage-dashboard-slot",
111
+ "meta": {
112
+ "name": "dispensing",
113
+ "slot": "dispensing-dashboard-slot",
114
+ "title": "Pharmacy"
115
+ },
116
+ "online": true,
117
+ "offline": true
118
+ },
119
+ {
120
+ "name": "registers-dashboard-link",
121
+ "component": "registersDashboardLink",
122
+ "slot": "homepage-dashboard-slot",
123
+ "meta": {
124
+ "name": "registers",
125
+ "slot": "registers-dashboard-slot",
126
+ "title": "Registers"
127
+ },
128
+ "online": true,
129
+ "offline": false
130
+ },
131
+ {
132
+ "component": "registers",
133
+ "name": "registers",
134
+ "slot": "registers-dashboard-slot"
135
+ },
136
+ {
137
+ "name": "bookings-dashboard-link",
138
+ "component": "bookingsDashboardLink",
139
+ "slot": "homepage-dashboard-slot",
140
+ "meta": {
141
+ "name": "bookings",
142
+ "slot": "bookings-dashboard-slot",
143
+ "title": "Bookings"
144
+ },
145
+ "online": true,
146
+ "offline": true
147
+ },
148
+ {
149
+ "component": "bookings",
150
+ "name": "bookings",
151
+ "slot": "bookings-dashboard-slot"
152
+ },
153
+ {
154
+ "name": "service-queue-admin-dashboard-link",
155
+ "component": "serviceQueuesAdminLink",
16
156
  "slot": "app-menu-slot",
157
+ "meta": {
158
+ "name": "service-queue-admin",
159
+ "slot": "service-queue-admin-dashboard-slot",
160
+ "title": "Service Queue Admin"
161
+ },
17
162
  "online": true,
18
163
  "offline": true
19
164
  },
20
165
  {
21
- "component": "navLinks",
22
- "name": "side-nav-workflow-links",
23
- "slot": "dha-workflow-slot",
166
+ "component": "serviceQueueAdmin",
167
+ "name": "service-queue-admin",
168
+ "slot": "service-queue-admin-dashboard-slot"
169
+ },
170
+ {
171
+ "name": "admissions-dashboard-link",
172
+ "component": "admissionsDashboardLink",
173
+ "slot": "homepage-dashboard-slot",
174
+ "meta": {
175
+ "name": "admissions-dashboard",
176
+ "slot": "admissions-dashboard-slot",
177
+ "title": "Admissions Dashboard"
178
+ },
24
179
  "online": true,
25
180
  "offline": true
181
+ },
182
+ {
183
+ "component": "admissionsDashboard",
184
+ "name": "admissions-dashboard",
185
+ "slot": "admissions-dashboard-slot"
186
+ },
187
+ {
188
+ "component": "serviceQueueBannerComponent",
189
+ "name": "service-queue-banne",
190
+ "slot": "patient-banner-tags-slot"
191
+ },
192
+ {
193
+ "name": "admissions-summary-dashboard",
194
+ "slot": "patient-chart-dashboard-slot",
195
+ "component": "patientChartAdmissionsLink",
196
+ "meta": {
197
+ "slot": "patient-chart-admissions-summary-dashboard-slot",
198
+ "path": "Admissions",
199
+ "layoutMode": "anchored"
200
+ },
201
+ "online": true,
202
+ "offline": true
203
+ },
204
+ {
205
+ "name": "admission-details",
206
+ "slot": "patient-chart-admissions-summary-dashboard-slot",
207
+ "component": "patientAdmissionSummary",
208
+ "order": 1,
209
+ "meta": {
210
+ "title": "Admissions",
211
+ "view": "admissions"
212
+ },
213
+ "online": true,
214
+ "offline": true
215
+ },
216
+ {
217
+ "name": "ampath-billing-dashboard-link",
218
+ "component": "billingDashboardLink",
219
+ "slot": "homepage-dashboard-slot",
220
+ "meta": {
221
+ "name": "billing",
222
+ "slot": "ampath-billing-dashboard-slot",
223
+ "title": "Accounting"
224
+ },
225
+ "online": true,
226
+ "offline": true
227
+ },
228
+ {
229
+ "component": "billingRoot",
230
+ "name": "billing",
231
+ "slot": "ampath-billing-dashboard-slot"
232
+ },
233
+ {
234
+ "name": "ampath-billing-checkin-form",
235
+ "slot": "extra-visit-attribute-slot",
236
+ "component": "visitBillingForm"
237
+ }
238
+ ],
239
+ "workspaces": [
240
+ {
241
+ "name": "create-order-bill-form-workspace",
242
+ "component": "createOrderBillFormWorkspace",
243
+ "title": "Create order Bill",
244
+ "type": "other-form"
245
+ }
246
+ ],
247
+ "modals": [
248
+ {
249
+ "name": "sign-off-queue-entry-modal",
250
+ "component": "signOffModal"
26
251
  }
27
252
  ]
28
- }
253
+ }
@@ -0,0 +1,34 @@
1
+ import { Button } from "@carbon/react";
2
+ import { useLayoutType, isDesktop } from "@openmrs/esm-framework";
3
+ import { useTranslation } from "react-i18next";
4
+ import React from "react";
5
+ import { useActionPropsByKey } from "../hooks/useActions";
6
+ import { type QueueEntryAction } from "../config-schema";
7
+ import { type QueueEntry } from "../types/types";
8
+
9
+ export function ActionButton({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
10
+ const { t } = useTranslation();
11
+ const layout = useLayoutType();
12
+ const actionPropsByKey = useActionPropsByKey();
13
+
14
+ const actionProps = actionPropsByKey[actionKey];
15
+ if (!actionProps) {
16
+ console.error(`Service queue table configuration uses unknown action in 'action.buttons': ${actionKey}`);
17
+ return null;
18
+ }
19
+
20
+ if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
21
+ return null;
22
+ }
23
+
24
+ return (
25
+ <Button
26
+ key={actionKey}
27
+ kind="ghost"
28
+ aria-label={t(actionProps.label, actionProps.text)}
29
+ onClick={() => actionProps.onClick(queueEntry)}
30
+ size={isDesktop(layout) ? 'sm' : 'lg'}>
31
+ {t(actionProps.label, actionProps.text)}
32
+ </Button>
33
+ );
34
+ }
@@ -0,0 +1,34 @@
1
+ import { OverflowMenuItem } from "@carbon/react";
2
+ import { useTranslation } from "react-i18next";
3
+ import React from "react";
4
+ import { type QueueEntryAction } from "../config-schema";
5
+ import { useActionPropsByKey } from "../hooks/useActions";
6
+ import { type QueueEntry } from "../types/types";
7
+ import styles from './service-queue.scss';
8
+
9
+ export function ActionOverflowMenuItem({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
10
+ const { t } = useTranslation();
11
+ const actionPropsByKey = useActionPropsByKey();
12
+
13
+ const actionProps = actionPropsByKey[actionKey];
14
+ if (!actionProps) {
15
+ console.error(`Service queue table configuration uses unknown action in 'action.overflowMenu': ${actionKey}`);
16
+ return null;
17
+ }
18
+
19
+ if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
20
+ return null;
21
+ }
22
+
23
+ return (
24
+ <OverflowMenuItem
25
+ key={actionKey}
26
+ className={styles.menuItem}
27
+ aria-label={t(actionProps.label, actionProps.text)}
28
+ hasDivider
29
+ isDelete={actionProps.isDelete}
30
+ onClick={() => actionProps.onClick(queueEntry)}
31
+ itemText={t(actionProps.label, actionProps.text)}
32
+ />
33
+ );
34
+ }
@@ -0,0 +1,31 @@
1
+ .createQueueModalLayout{
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ row-gap: 10px;
6
+ padding: 15px 15px;
7
+ .sectionHeader{
8
+ display: flex;
9
+ flex-direction: column;
10
+ row-gap: 15px;
11
+ width: 100%;
12
+ padding-bottom: 15px;
13
+ }
14
+ .createQueueModalContentSection{
15
+ display: flex;
16
+ flex-direction: column;
17
+ width: 100%;
18
+ row-gap: 10px;
19
+ }
20
+ .createQueueModalFormRow{
21
+ display: flex;
22
+ flex-direction: row;
23
+ width: 100%;
24
+ column-gap: 10px;
25
+ }
26
+ .createQueueModalFormControl{
27
+ display: flex;
28
+ flex-direction: column;
29
+ width: 100%;
30
+ }
31
+ }