@ampath/esm-dha-workflow-app 4.0.0-claim-workflows.159

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 (405) hide show
  1. package/.editorconfig +12 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +57 -0
  4. package/.husky/pre-commit +7 -0
  5. package/.husky/pre-push +6 -0
  6. package/.prettierignore +14 -0
  7. package/.turbo.json +18 -0
  8. package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
  9. package/LICENSE +401 -0
  10. package/README.md +37 -0
  11. package/__mocks__/react-i18next.js +50 -0
  12. package/dist/1197.js +1 -0
  13. package/dist/1277.js +1 -0
  14. package/dist/1277.js.map +1 -0
  15. package/dist/1558.js +2 -0
  16. package/dist/1558.js.LICENSE.txt +14 -0
  17. package/dist/1558.js.map +1 -0
  18. package/dist/1729.js +1 -0
  19. package/dist/1729.js.map +1 -0
  20. package/dist/182.js +1 -0
  21. package/dist/182.js.map +1 -0
  22. package/dist/1826.js +1 -0
  23. package/dist/1826.js.map +1 -0
  24. package/dist/1833.js +1 -0
  25. package/dist/1833.js.map +1 -0
  26. package/dist/1856.js +1 -0
  27. package/dist/1856.js.map +1 -0
  28. package/dist/1925.js +1 -0
  29. package/dist/1925.js.map +1 -0
  30. package/dist/2021.js +1 -0
  31. package/dist/2021.js.map +1 -0
  32. package/dist/2054.js +1 -0
  33. package/dist/2054.js.map +1 -0
  34. package/dist/2177.js +2 -0
  35. package/dist/2177.js.LICENSE.txt +9 -0
  36. package/dist/2177.js.map +1 -0
  37. package/dist/2333.js +1 -0
  38. package/dist/2333.js.map +1 -0
  39. package/dist/2801.js +1 -0
  40. package/dist/2801.js.map +1 -0
  41. package/dist/282.js +2 -0
  42. package/dist/282.js.LICENSE.txt +32 -0
  43. package/dist/282.js.map +1 -0
  44. package/dist/3041.js +1 -0
  45. package/dist/3041.js.map +1 -0
  46. package/dist/3099.js +1 -0
  47. package/dist/3184.js +2 -0
  48. package/dist/3184.js.LICENSE.txt +14 -0
  49. package/dist/3184.js.map +1 -0
  50. package/dist/3654.js +1 -0
  51. package/dist/3654.js.map +1 -0
  52. package/dist/4055.js +1 -0
  53. package/dist/4205.js +1 -0
  54. package/dist/4205.js.map +1 -0
  55. package/dist/4225.js +1 -0
  56. package/dist/4225.js.map +1 -0
  57. package/dist/4300.js +1 -0
  58. package/dist/4335.js +1 -0
  59. package/dist/4353.js +1 -0
  60. package/dist/4353.js.map +1 -0
  61. package/dist/4517.js +1 -0
  62. package/dist/4517.js.map +1 -0
  63. package/dist/4652.js +1 -0
  64. package/dist/4674.js +1 -0
  65. package/dist/4674.js.map +1 -0
  66. package/dist/4947.js +1 -0
  67. package/dist/4947.js.map +1 -0
  68. package/dist/5015.js +1 -0
  69. package/dist/5015.js.map +1 -0
  70. package/dist/5422.js +1 -0
  71. package/dist/5422.js.map +1 -0
  72. package/dist/5428.js +1 -0
  73. package/dist/5428.js.map +1 -0
  74. package/dist/5752.js +1 -0
  75. package/dist/5752.js.map +1 -0
  76. package/dist/5851.js +1 -0
  77. package/dist/5851.js.map +1 -0
  78. package/dist/6260.js +1 -0
  79. package/dist/6260.js.map +1 -0
  80. package/dist/6264.js +1 -0
  81. package/dist/6264.js.map +1 -0
  82. package/dist/6540.js +2 -0
  83. package/dist/6540.js.LICENSE.txt +9 -0
  84. package/dist/6540.js.map +1 -0
  85. package/dist/6606.js +1 -0
  86. package/dist/6606.js.map +1 -0
  87. package/dist/693.js +1 -0
  88. package/dist/693.js.map +1 -0
  89. package/dist/6991.js +1 -0
  90. package/dist/6991.js.map +1 -0
  91. package/dist/7199.js +1 -0
  92. package/dist/7199.js.map +1 -0
  93. package/dist/7255.js +1 -0
  94. package/dist/7255.js.map +1 -0
  95. package/dist/7258.js +1 -0
  96. package/dist/7258.js.map +1 -0
  97. package/dist/7420.js +1 -0
  98. package/dist/7420.js.map +1 -0
  99. package/dist/8114.js +1 -0
  100. package/dist/8114.js.map +1 -0
  101. package/dist/8321.js +1 -0
  102. package/dist/8321.js.map +1 -0
  103. package/dist/8339.js +1 -0
  104. package/dist/8339.js.map +1 -0
  105. package/dist/8558.js +1 -0
  106. package/dist/8558.js.map +1 -0
  107. package/dist/8778.js +1 -0
  108. package/dist/8778.js.map +1 -0
  109. package/dist/8803.js +2 -0
  110. package/dist/8803.js.LICENSE.txt +54 -0
  111. package/dist/8803.js.map +1 -0
  112. package/dist/8865.js +1 -0
  113. package/dist/8865.js.map +1 -0
  114. package/dist/8895.js +1 -0
  115. package/dist/8895.js.map +1 -0
  116. package/dist/9037.js +1 -0
  117. package/dist/9037.js.map +1 -0
  118. package/dist/9091.js +1 -0
  119. package/dist/9091.js.map +1 -0
  120. package/dist/9093.js +1 -0
  121. package/dist/9093.js.map +1 -0
  122. package/dist/9117.js +1 -0
  123. package/dist/9117.js.map +1 -0
  124. package/dist/961.js +2 -0
  125. package/dist/961.js.LICENSE.txt +19 -0
  126. package/dist/961.js.map +1 -0
  127. package/dist/9721.js +1 -0
  128. package/dist/9721.js.map +1 -0
  129. package/dist/esm-dha-workflow-app.js +1 -0
  130. package/dist/esm-dha-workflow-app.js.buildmanifest.json +1594 -0
  131. package/dist/esm-dha-workflow-app.js.map +1 -0
  132. package/dist/main.js +1 -0
  133. package/dist/main.js.map +1 -0
  134. package/dist/routes.json +1 -0
  135. package/e2e/README.md +115 -0
  136. package/e2e/core/global-setup.ts +32 -0
  137. package/e2e/core/index.ts +1 -0
  138. package/e2e/core/test.ts +20 -0
  139. package/e2e/fixtures/api.ts +26 -0
  140. package/e2e/fixtures/index.ts +1 -0
  141. package/e2e/pages/index.ts +1 -0
  142. package/e2e/pages/root-page.ts +32 -0
  143. package/e2e/specs/template-app.spec.ts +23 -0
  144. package/e2e/support/github/Dockerfile +34 -0
  145. package/e2e/support/github/docker-compose.yml +24 -0
  146. package/e2e/support/github/run-e2e-docker-env.sh +37 -0
  147. package/example.env +6 -0
  148. package/jest.config.js +33 -0
  149. package/package.json +117 -0
  150. package/playwright.config.ts +32 -0
  151. package/prettier.config.js +8 -0
  152. package/src/accounting/accounting.component.tsx +13 -0
  153. package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
  154. package/src/admissions/admission-request-list/admission-request-list.tsx +134 -0
  155. package/src/admissions/admissions-dashboard.component.scss +15 -0
  156. package/src/admissions/admissions-dashboard.component.tsx +160 -0
  157. package/src/admissions/admissions.resource.ts +101 -0
  158. package/src/admissions/admitted-list/admitted-patients-list.tsx +141 -0
  159. package/src/admissions/constants/index.ts +33 -0
  160. package/src/admissions/discharged-list/discharged-list.scss +0 -0
  161. package/src/admissions/discharged-list/discharged-list.tsx +58 -0
  162. package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
  163. package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
  164. package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
  165. package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
  166. package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
  167. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
  168. package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
  169. package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
  170. package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +109 -0
  171. package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
  172. package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
  173. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
  174. package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
  175. package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
  176. package/src/admissions/modal/discharge/discharge-patient.modal.tsx +84 -0
  177. package/src/admissions/types/index.ts +192 -0
  178. package/src/appointments/appointments.component.tsx +13 -0
  179. package/src/billing/api/billing.api.ts +107 -0
  180. package/src/billing/billing-root.tsx +20 -0
  181. package/src/billing/dashboard/billingDashboard.component.scss +0 -0
  182. package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
  183. package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
  184. package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +508 -0
  185. package/src/billing/invoice/bill.resource.ts +47 -0
  186. package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
  187. package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
  188. package/src/billing/invoice/invoice.scss +113 -0
  189. package/src/billing/invoice/invoice.tsx +1441 -0
  190. package/src/billing/invoice/line-items/line-items.scss +0 -0
  191. package/src/billing/invoice/line-items/line-items.tsx +120 -0
  192. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
  193. package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
  194. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
  195. package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
  196. package/src/billing/invoice/payment-details/payment-details.scss +0 -0
  197. package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
  198. package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
  199. package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
  200. package/src/billing/types/index.ts +84 -0
  201. package/src/billing/utils/index.ts +17 -0
  202. package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
  203. package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
  204. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +103 -0
  205. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
  206. package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +357 -0
  207. package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +11 -0
  208. package/src/bookings/bookings.component.scss +7 -0
  209. package/src/bookings/bookings.component.tsx +31 -0
  210. package/src/bookings/daily/daily-bookings.component.scss +38 -0
  211. package/src/bookings/daily/daily-bookings.component.tsx +138 -0
  212. package/src/bookings/daily/daily-bookings.resource.ts +28 -0
  213. package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
  214. package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
  215. package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
  216. package/src/bookings/types/index.ts +68 -0
  217. package/src/claims/claims.component.tsx +142 -0
  218. package/src/claims/claims.resource.ts +168 -0
  219. package/src/claims/index.ts +206 -0
  220. package/src/claims/interventions.resource.ts +49 -0
  221. package/src/claims/utils.ts +59 -0
  222. package/src/config-schema.ts +215 -0
  223. package/src/createDashboardLink.tsx +9 -0
  224. package/src/dashboard/charts/chart.component.scss +13 -0
  225. package/src/dashboard/charts/chart.component.tsx +56 -0
  226. package/src/dashboard/dashboard.component.scss +7 -0
  227. package/src/dashboard/dashboard.component.tsx +51 -0
  228. package/src/dashboard/overview/overview.component.scss +150 -0
  229. package/src/dashboard/overview/overview.component.tsx +134 -0
  230. package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
  231. package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
  232. package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
  233. package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
  234. package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
  235. package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
  236. package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
  237. package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
  238. package/src/dashboard-meta/maternity-dashboard.meta.ts +6 -0
  239. package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
  240. package/src/dashboard-meta/pharmacy-dashboard.meta.ts +6 -0
  241. package/src/dashboard-meta/queue-dashboard.meta.ts +6 -0
  242. package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
  243. package/src/dashboard-meta/registry-dashboard.meta.ts +6 -0
  244. package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
  245. package/src/dashboard-meta/triage-dashboard.meta.ts +6 -0
  246. package/src/declarations.d.ts +5 -0
  247. package/src/hooks/useActions.ts +165 -0
  248. package/src/index.ts +161 -0
  249. package/src/laboratory/laboratory.component.tsx +13 -0
  250. package/src/left-panel/left-panel.component.tsx +20 -0
  251. package/src/left-panel/left-panel.scss +42 -0
  252. package/src/mnch/maternity/maternity-queues.component.scss +7 -0
  253. package/src/mnch/maternity/maternity-queues.component.tsx +28 -0
  254. package/src/mnch/maternity/queues/triage/maternity-triage.tsx +15 -0
  255. package/src/mnch/mch/mch-queues.component.scss +7 -0
  256. package/src/mnch/mch/mch-queues.component.tsx +32 -0
  257. package/src/mnch/mch/queues/consultation/mch-consultation.tsx +18 -0
  258. package/src/mnch/mch/queues/triage/mch-triage.tsx +15 -0
  259. package/src/mnch/mnch-root.tsx +17 -0
  260. package/src/modals/sign-off-modal.scss +7 -0
  261. package/src/modals/sign-off-modal.tsx +52 -0
  262. package/src/mortuary/mortuary.component.tsx +13 -0
  263. package/src/pharmacy/pharmacy.component.tsx +13 -0
  264. package/src/registers/registers.component.tsx +8 -0
  265. package/src/registry/client-details/client-details.tsx +40 -0
  266. package/src/registry/eligibility/eligibility-details/eligibility-details.scss +38 -0
  267. package/src/registry/eligibility/eligibility-details/eligibility-details.tsx +101 -0
  268. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +6 -0
  269. package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +120 -0
  270. package/src/registry/eligibility/modal/eligibility-details.modal.scss +0 -0
  271. package/src/registry/eligibility/modal/eligibility-details.modal.tsx +45 -0
  272. package/src/registry/modal/client-details-modal/client-details-modal.scss +28 -0
  273. package/src/registry/modal/client-details-modal/client-details-modal.tsx +119 -0
  274. package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +43 -0
  275. package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +280 -0
  276. package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +39 -0
  277. package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +921 -0
  278. package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
  279. package/src/registry/payment-details/payment-options/payment-options.tsx +68 -0
  280. package/src/registry/registry.component.scss +89 -0
  281. package/src/registry/registry.component.tsx +490 -0
  282. package/src/registry/registry.resource.ts +62 -0
  283. package/src/registry/types/index.ts +401 -0
  284. package/src/registry/utils/error-handler.ts +37 -0
  285. package/src/registry/utils/format-dependant-display-data.ts +8 -0
  286. package/src/registry/utils/hie-adapter.ts +56 -0
  287. package/src/registry/utils/hie-client-adapter.ts +312 -0
  288. package/src/registry/utils/mask-data.ts +32 -0
  289. package/src/registry/utils/phone-number-formatter.ts +11 -0
  290. package/src/resources/dashboard.resource.ts +20 -0
  291. package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
  292. package/src/resources/identifier-types.ts +29 -0
  293. package/src/resources/patient-resource.ts +62 -0
  294. package/src/resources/patient-search.resource.ts +22 -0
  295. package/src/resources/queue.resource.ts +60 -0
  296. package/src/resources/superset.resource.ts +21 -0
  297. package/src/resources/visit.resource.ts +38 -0
  298. package/src/root.component.tsx +48 -0
  299. package/src/root.scss +11 -0
  300. package/src/root.test.tsx +51 -0
  301. package/src/routes.json +292 -0
  302. package/src/service-queues/action-button.component.tsx +34 -0
  303. package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
  304. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
  305. package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +143 -0
  306. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
  307. package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +154 -0
  308. package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
  309. package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
  310. package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
  311. package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
  312. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
  313. package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
  314. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
  315. package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
  316. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
  317. package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
  318. package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
  319. package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +34 -0
  320. package/src/service-queues/consultation/consultation.component.scss +7 -0
  321. package/src/service-queues/consultation/consultation.component.tsx +15 -0
  322. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
  323. package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
  324. package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
  325. package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
  326. package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
  327. package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
  328. package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
  329. package/src/service-queues/metrics/metrics-container.scss +36 -0
  330. package/src/service-queues/metrics/metrics.resource.ts +65 -0
  331. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
  332. package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +110 -0
  333. package/src/service-queues/modals/move/move-patient.component.scss +35 -0
  334. package/src/service-queues/modals/move/move-patient.component.tsx +152 -0
  335. package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
  336. package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
  337. package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
  338. package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
  339. package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
  340. package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
  341. package/src/service-queues/queue-list/check-in.service.ts +26 -0
  342. package/src/service-queues/queue-list/queue-list.component.scss +56 -0
  343. package/src/service-queues/queue-list/queue-list.component.tsx +311 -0
  344. package/src/service-queues/queue-room.component.tsx +39 -0
  345. package/src/service-queues/room/room.component.tsx +58 -0
  346. package/src/service-queues/service-queue/service-queue.component.scss +14 -0
  347. package/src/service-queues/service-queue/service-queue.component.tsx +387 -0
  348. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +12 -0
  349. package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +63 -0
  350. package/src/service-queues/service-queue.scss +27 -0
  351. package/src/service-queues/service-queue.tsx +37 -0
  352. package/src/service-queues/service-queues.resource.ts +361 -0
  353. package/src/service-queues/service.resource.ts +28 -0
  354. package/src/shared/constants/civil-status.ts +29 -0
  355. package/src/shared/constants/concepts.ts +35 -0
  356. package/src/shared/constants/index.ts +1 -0
  357. package/src/shared/constants/patient-category.ts +6 -0
  358. package/src/shared/constants/patient-type.ts +10 -0
  359. package/src/shared/constants/person-attributes.ts +33 -0
  360. package/src/shared/constants/visit-types.ts +7 -0
  361. package/src/shared/services/billing.resource.ts +38 -0
  362. package/src/shared/services/client-payment-mode.resource.ts +27 -0
  363. package/src/shared/services/client-payment.resource.ts +17 -0
  364. package/src/shared/services/eligibility.resource.ts +20 -0
  365. package/src/shared/services/encounters.resource.ts +27 -0
  366. package/src/shared/services/location.resource.ts +9 -0
  367. package/src/shared/types/index.ts +153 -0
  368. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
  369. package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
  370. package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
  371. package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
  372. package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
  373. package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
  374. package/src/shared/ui/stat-card/stat-card.component.scss +10 -0
  375. package/src/shared/ui/stat-card/stat-card.component.tsx +26 -0
  376. package/src/shared/ui/timer/timer.component.scss +5 -0
  377. package/src/shared/ui/timer/timer.component.tsx +40 -0
  378. package/src/shared/utils/get-base-url.ts +27 -0
  379. package/src/shared/utils/get-tag-type.ts +66 -0
  380. package/src/side-nav/side-menu.scss +38 -0
  381. package/src/side-nav-menu/mnch-nav-link-config.ts +16 -0
  382. package/src/side-nav-menu/mnch-nav-links.tsx +42 -0
  383. package/src/side-nav-menu/nav-link-config.ts +78 -0
  384. package/src/side-nav-menu/nav-links.tsx +42 -0
  385. package/src/triage/metrics/attended-patients.extension.tsx +42 -0
  386. package/src/triage/metrics/metrics.scss +36 -0
  387. package/src/triage/metrics/triage-metrics.component.tsx +21 -0
  388. package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
  389. package/src/triage/room/room.scss +29 -0
  390. package/src/triage/triage.component.tsx +15 -0
  391. package/src/triage/triage.resource.ts +19 -0
  392. package/src/triage/types.ts +16 -0
  393. package/src/types/types.ts +180 -0
  394. package/src/widgets/workflow-registry-link.extension.tsx +12 -0
  395. package/tools/i18next-parser.config.js +89 -0
  396. package/tools/setup-tests.ts +1 -0
  397. package/tools/update-openmrs-deps.mjs +43 -0
  398. package/translations/am.json +24 -0
  399. package/translations/en.json +24 -0
  400. package/translations/es.json +24 -0
  401. package/translations/fr.json +24 -0
  402. package/translations/he.json +24 -0
  403. package/translations/km.json +24 -0
  404. package/tsconfig.json +24 -0
  405. package/webpack.config.js +1 -0
@@ -0,0 +1,107 @@
1
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
+ import { getClaimsUrl, getClaimsKey } from '../../shared/utils/get-base-url';
3
+
4
+ async function claimsFetch(path: string, method: string = 'GET', body?: any) {
5
+ try {
6
+ const [baseUrl, claimsKey] = await Promise.all([getClaimsUrl(), getClaimsKey()]);
7
+
8
+ const res = await openmrsFetch(`${baseUrl}${path}`, {
9
+ method,
10
+ headers: {
11
+ 'AMPATH-CLAIMS-KEY': claimsKey,
12
+ 'Content-Type': 'application/json',
13
+ },
14
+ body: body ? JSON.stringify(body) : undefined,
15
+ });
16
+
17
+ return res?.data;
18
+ } catch (error: any) {
19
+ return {
20
+ success: false,
21
+ data: null,
22
+ message: error?.response?.data?.message || error?.message || 'Claims API request failed',
23
+ };
24
+ }
25
+ }
26
+
27
+ export async function raiseSHAClaim(billId: string) {
28
+ if (!billId) {
29
+ return {
30
+ success: false,
31
+ data: null,
32
+ message: 'Bill ID is required to raise a SHA claim',
33
+ };
34
+ }
35
+
36
+ return claimsFetch(`/claims/${billId}`, 'POST');
37
+ }
38
+
39
+ export async function UpdateBillItemStatus(payload: any) {
40
+ return claimsFetch(`/bill-item/status`, 'POST', payload);
41
+ }
42
+
43
+ export async function fetchBillsByDate(billDate: string) {
44
+ if (!billDate) {
45
+ return {
46
+ success: false,
47
+ data: null,
48
+ message: 'Bill date is required',
49
+ };
50
+ }
51
+
52
+ return claimsFetch(`/daily-bills?locationUuId=090089ea-1352-11df-a1f1-0026b9348838&billDate=${billDate}`);
53
+ }
54
+
55
+ export async function checkClaimStatus(billUuid: string) {
56
+ if (!billUuid) {
57
+ return {
58
+ success: false,
59
+ data: null,
60
+ message: 'Bill UUID is required',
61
+ };
62
+ }
63
+
64
+ return claimsFetch(`/claims/${billUuid}/status`);
65
+ }
66
+
67
+ export async function updateBillStatus(billUuid: string) {
68
+ if (!billUuid) {
69
+ return {
70
+ success: false,
71
+ data: null,
72
+ message: 'Bill UUID is required',
73
+ };
74
+ }
75
+
76
+ return claimsFetch(`/bills/${billUuid}/status`);
77
+ }
78
+
79
+ export async function fetchBillById(billId: string) {
80
+ const res = await openmrsFetch(`${restBaseUrl}/billing/bill/${billId}`);
81
+ return res.data;
82
+ }
83
+
84
+ export async function fetchPaymentModes() {
85
+ const res = await openmrsFetch(`${restBaseUrl}/billing/paymentMode`);
86
+ return res.data;
87
+ }
88
+
89
+ export async function finalizeBill(billUuid: string) {
90
+ if (!billUuid) {
91
+ return {
92
+ success: false,
93
+ data: null,
94
+ message: 'Bill UUID is required',
95
+ };
96
+ }
97
+
98
+ return claimsFetch(`/bills/${billUuid}/status`, 'POST');
99
+ }
100
+
101
+ export async function processPayment(billId: string, payload: any) {
102
+ return openmrsFetch(`${restBaseUrl}/billing/bill/${billId}/payment`, {
103
+ method: 'POST',
104
+ headers: { 'Content-Type': 'application/json' },
105
+ body: payload,
106
+ });
107
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import styles from './root.scss';
3
+ import { useLeftNav } from '@openmrs/esm-framework';
4
+ import { BrowserRouter, Route, Routes } from 'react-router-dom';
5
+ import BillingDashboard from './dashboard/billingDashboard.component';
6
+ import Invoice from './invoice/invoice';
7
+
8
+ const BillingRoot: React.FC = () => {
9
+ const spaBasePath = window.spaBase;
10
+ return (
11
+ <BrowserRouter basename={`${window.spaBase}/home/billing`}>
12
+ <Routes>
13
+ <Route path="" element={<BillingDashboard />} />
14
+ <Route path="/patient/:patientUuid/:billUuid" element={<Invoice />} />
15
+ </Routes>
16
+ </BrowserRouter>
17
+ );
18
+ };
19
+
20
+ export default BillingRoot;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { Grid, Column } from '@carbon/react';
3
+ import BillingTotalsRow from '../../billing/widgets/billingTotalsRow.component';
4
+
5
+ import { spacing07 } from '@carbon/themes';
6
+
7
+ const BillingDashboard: React.FC = () => {
8
+ return (
9
+ <Grid fullWidth>
10
+ <Column lg={16} md={8} sm={4}>
11
+ <div
12
+ style={{
13
+ position: 'relative',
14
+ marginLeft: `-${spacing07}`,
15
+ marginRight: `-${spacing07}`,
16
+ }}
17
+ >
18
+ <BillingTotalsRow />
19
+ </div>
20
+ </Column>
21
+ </Grid>
22
+ );
23
+ };
24
+
25
+ export default BillingDashboard;
@@ -0,0 +1,508 @@
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
+ import styles from './visit-billing.extension.scss';
3
+ import { ComboBox, Select, SelectItem, TextInput } from '@carbon/react';
4
+ import {
5
+ createBill,
6
+ fetchBillableServices,
7
+ fetchCashPoints,
8
+ fetchPaymentModes,
9
+ } from '../../../shared/services/billing.resource';
10
+ import {
11
+ type ServicePrice,
12
+ type PaymentMode,
13
+ type PayableBillableService,
14
+ type CashPoint,
15
+ type BillableService,
16
+ type CreateBillDto,
17
+ } from '../../../shared/types';
18
+ import { PaymentDetail, VisitAttribute, type QueueEntryDto, type ServiceQueue } from '../../../registry/types';
19
+ import { PatientCategories } from '../../../shared/constants/patient-category';
20
+ import { QUEUE_PRIORITIES_UUIDS, QUEUE_STATUS_UUIDS } from '../../../shared/constants/concepts';
21
+ import { showSnackbar, useConfig, usePatient, useSession, useVisit, type Visit } from '@openmrs/esm-framework';
22
+ import { PatientTypes } from '../../../shared/constants/patient-type';
23
+
24
+ interface VisitBillingFormProps {
25
+ patientUuid: string;
26
+ setExtraVisitInfo: (state) => void;
27
+ }
28
+ const VisitBillingForm: React.FC<VisitBillingFormProps> = ({ patientUuid, setExtraVisitInfo }) => {
29
+ const { isLoading, error, patient } = usePatient(patientUuid);
30
+ const [paymentModes, setPaymentModes] = useState<PaymentMode[]>([]);
31
+ const [selectedPatientType, setSelectedPatientType] = useState<string>();
32
+ const [selectedPaymentDetail, setSelectedPaymentDetail] = useState<string>();
33
+ const [selectedBillableService, setSelectedBillableService] = useState<ServicePrice>(null);
34
+ const [filteredBillableServices, setFilteredBillableServices] = useState<ServicePrice[]>(null);
35
+ const [selectedPaymentMode, setSelectedPaymentMode] = useState<PaymentMode>(null);
36
+ const [selectedInsuranceScheme, setSelectedInsuranceScheme] = useState<string>('');
37
+ const [selectedInsurancePolicy, setSelectedInsurancePolicy] = useState<string>('');
38
+ const [servicePrices, setServicePrices] = useState<ServicePrice[]>([]);
39
+ const [selectedCashPoint, setSelectedCashPoint] = useState<CashPoint>(null);
40
+ const [selectedPriority, setSelectedPriority] = useState<string>('');
41
+ const [selectedPatientCategory, setSelectedPatientCategory] = useState<string>('');
42
+ const [selectedServiceQueue, setSelectedServiceQueue] = useState<string>();
43
+ const [serviceQueues, setServiceQueues] = useState<ServiceQueue[]>();
44
+ const [cashPoints, setCashPoints] = useState<CashPoint[]>([]);
45
+ const [billableServices, setBillableServices] = useState<BillableService[]>([]);
46
+ const { currentVisit } = useVisit(patientUuid);
47
+ const session = useSession();
48
+ const locationUuid = session.sessionLocation.uuid;
49
+ const facilityCashPoints = useMemo(() => getfacilityCashpoints(), [cashPoints, locationUuid]);
50
+ const { registrationBillableServices, nonSHAPaymentModes } = useConfig();
51
+ const hasCrNo = useMemo(()=>patientHasCrNo(),[patient])
52
+ const patientTypeOptions = useMemo(
53
+ () => [
54
+ {
55
+ text: 'Walk-in',
56
+ id: PatientTypes.WALK_IN_UUID,
57
+ },
58
+ {
59
+ text: 'Self-referral',
60
+ id: PatientTypes.SELF_RERERRAL_UUID,
61
+ },
62
+ {
63
+ text: 'Referral from other Facility',
64
+ id: PatientTypes.REFERRAL_FROM_ANOTHER_FACILITY_UUID,
65
+ },
66
+ {
67
+ text: 'Referral from Community',
68
+ id: PatientTypes.REFERRED_BY_COMMUNITY_HEALTH_WORKER_UUID,
69
+ },
70
+ ],
71
+ [patient],
72
+ );
73
+
74
+ useEffect(() => {
75
+ getPaymentMethods();
76
+ getBillableServices();
77
+ getCashPoints();
78
+ }, []);
79
+
80
+ useEffect(() => {
81
+ if (selectedBillableService && selectedCashPoint) {
82
+ setExtraVisitInfo({
83
+ handleCreateExtraVisitInfo: createPatientBill,
84
+ attributes: getVisitAttributes(),
85
+ });
86
+ }
87
+ }, [selectedBillableService, selectedCashPoint,selectedPatientType,selectedPaymentMode,selectedInsurancePolicy]);
88
+
89
+ if(isLoading || error){
90
+ return <></>
91
+ }
92
+
93
+ async function getCashPoints() {
94
+ const cp = await fetchCashPoints();
95
+ setCashPoints(cp);
96
+ }
97
+
98
+ async function getBillableServices() {
99
+ const billableServices = await fetchBillableServices();
100
+ setBillableServices(billableServices);
101
+ generateServiceTypesList(billableServices);
102
+ }
103
+
104
+ function generateServiceTypesList(billableServices: BillableService[]) {
105
+ const sp: ServicePrice[] = [];
106
+ for (let bs of billableServices) {
107
+ if (bs.servicePrices) {
108
+ const servicePrices = bs.servicePrices;
109
+ for (let servicePrice of servicePrices) {
110
+ sp.push(servicePrice);
111
+ }
112
+ }
113
+ }
114
+ setServicePrices(sp);
115
+ }
116
+
117
+ async function getPaymentMethods() {
118
+ const methods = await fetchPaymentModes();
119
+ let allowedPaymentMethods = [];
120
+ if(!hasCrNo){
121
+ allowedPaymentMethods = methods.filter((p)=>{
122
+ return nonSHAPaymentModes.includes(p.uuid);
123
+ });
124
+ }else{
125
+ allowedPaymentMethods = methods;
126
+ }
127
+ setPaymentModes(allowedPaymentMethods);
128
+ }
129
+ function patientHasCrNo(){
130
+ let identifiers = [];
131
+ if(patient && patient.identifier){
132
+ identifiers = patient.identifier ?? [];
133
+ }
134
+ const hasCrNo = identifiers.some((id)=>{
135
+ if(!id || !id.type){
136
+ return false;
137
+ }
138
+ return id.type.text === 'CR';
139
+ });
140
+ return hasCrNo;
141
+ }
142
+ const paymentMethodHandler = (selectedPaymentModeUuid: string) => {
143
+ const selectedPaymentMode = paymentModes.find((pm) => {
144
+ return pm.uuid === selectedPaymentModeUuid;
145
+ });
146
+ setSelectedPaymentMode(selectedPaymentMode);
147
+ const paymentModeBillableServices = getBillableServiceByPaymentMode(selectedPaymentMode);
148
+ setFilteredBillableServices(paymentModeBillableServices);
149
+ setSelectedInsuranceScheme('');
150
+ setSelectedInsurancePolicy('');
151
+ setSelectedPriority('');
152
+ };
153
+
154
+ const getBillableServiceByPaymentMode = (paymentMode: PaymentMode): PayableBillableService[] => {
155
+ const paymentBillableServices: ServicePrice[] = [];
156
+ servicePrices.forEach((sp) => {
157
+ if (sp.paymentMode) {
158
+ if (
159
+ sp.paymentMode.uuid === paymentMode.uuid &&
160
+ registrationBillableServices.includes(sp.billableService.uuid)
161
+ ) {
162
+ paymentBillableServices.push(sp);
163
+ }
164
+ }
165
+ });
166
+ return paymentBillableServices;
167
+ };
168
+
169
+ const paymentDetailsHandler = (paymentDetailSelected: string) => {
170
+ setSelectedPaymentDetail(paymentDetailSelected);
171
+ };
172
+ const paymentDetails = Object.values(PaymentDetail).map((value) => {
173
+ return {
174
+ id: value,
175
+ label: value,
176
+ };
177
+ });
178
+
179
+ const billableServicesHandler = (selectedBillableServiceUuid: string) => {
180
+ const selectedBillableService = servicePrices.find((sp) => {
181
+ return sp.uuid === selectedBillableServiceUuid;
182
+ });
183
+ setSelectedBillableService(selectedBillableService);
184
+ };
185
+
186
+ function hasSelectedPaymentMode(paymentMode: string): boolean {
187
+ if (!selectedPaymentMode) {
188
+ return false;
189
+ }
190
+ return selectedPaymentMode.name.trim().toLowerCase().includes(paymentMode.trim().toLowerCase());
191
+ }
192
+ const insuranceSchemeHandler = (selectedInsuranceScheme: string) => {
193
+ setSelectedInsuranceScheme(selectedInsuranceScheme);
194
+ };
195
+
196
+ const insurancePolicyHandler = (selectedInsurancePolicy: string) => {
197
+ setSelectedInsurancePolicy(selectedInsurancePolicy);
198
+ };
199
+
200
+ const cashPointsHandler = (selectedCashPointUuid: string) => {
201
+ const selectedCashPoint = cashPoints.find((cp) => {
202
+ return cp.uuid === selectedCashPointUuid;
203
+ });
204
+ setSelectedCashPoint(selectedCashPoint);
205
+ };
206
+
207
+ function getfacilityCashpoints() {
208
+ return cashPoints.filter((cp) => {
209
+ return cp && cp.location?.uuid === locationUuid;
210
+ });
211
+ }
212
+
213
+ const patientCategoryHandler = (categoryUuid: string) => {
214
+ setSelectedPatientCategory(categoryUuid);
215
+ };
216
+
217
+ function validateVisitQueueBill(): boolean {
218
+ if (!selectedPaymentDetail) {
219
+ showAlert('error', 'Please select a paying or non paying option', '');
220
+ return false;
221
+ }
222
+
223
+ if (selectedPaymentDetail === PaymentDetail.Paying) {
224
+ if (!selectedPaymentMode) {
225
+ showAlert('error', 'Please select a payment method', '');
226
+ return false;
227
+ }
228
+ if (!selectedBillableService) {
229
+ showAlert('error', 'Please select a billable service', '');
230
+ return false;
231
+ }
232
+ if (!selectedCashPoint) {
233
+ showAlert('error', 'Please select a cashpoint', '');
234
+ return false;
235
+ }
236
+ }
237
+ if (selectedPaymentDetail === PaymentDetail.NonPaying) {
238
+ if (!selectedPatientCategory) {
239
+ showAlert('error', 'Please select a patient category', '');
240
+ return false;
241
+ }
242
+ }
243
+ return true;
244
+ }
245
+
246
+ const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
247
+ showSnackbar({
248
+ kind: alertType,
249
+ title: title,
250
+ subtitle: subtitle,
251
+ });
252
+ };
253
+
254
+ function isValidCreateBillDto(createBillDto: CreateBillDto): boolean {
255
+ if (!createBillDto.patient) {
256
+ showAlert('error', 'Please select a patient', '');
257
+ return false;
258
+ }
259
+ if (!createBillDto.status) {
260
+ showAlert('error', 'Bill does not have a status', '');
261
+ return false;
262
+ }
263
+ if (!createBillDto.cashPoint) {
264
+ showAlert('error', 'Please select a valid cashpoint', '');
265
+ return false;
266
+ }
267
+ if (!createBillDto.lineItems || createBillDto.lineItems.length === 0) {
268
+ showAlert('error', 'Please select a valid billable service', '');
269
+ return false;
270
+ }
271
+ return true;
272
+ }
273
+
274
+ async function createPatientBill() {
275
+ if (!validateVisitQueueBill()) return;
276
+ try {
277
+ // add bill if it was a paying client
278
+ let createBillResp = null;
279
+ if (selectedPaymentDetail === PaymentDetail.Paying) {
280
+ const createBillDto = generateCreateBillDto();
281
+ if (isValidCreateBillDto(createBillDto)) {
282
+ createBillResp = await createBill(createBillDto);
283
+ if (createBillResp) {
284
+ showAlert('success', 'Bill succesfully created', '');
285
+ }
286
+ } else {
287
+ return false;
288
+ }
289
+ }
290
+ } catch (error) {
291
+ console.log({ error });
292
+ }
293
+ }
294
+
295
+ const generateAddToTriageDto = (newVisit: Visit): QueueEntryDto => {
296
+ const payload: QueueEntryDto = {
297
+ visit: {
298
+ uuid: newVisit.uuid,
299
+ },
300
+ queueEntry: {
301
+ status: {
302
+ uuid: QUEUE_STATUS_UUIDS.WAITING_UUID,
303
+ },
304
+ priority: {
305
+ uuid: selectedPriority ?? QUEUE_PRIORITIES_UUIDS.NORMAL_PRIORITY_UUID,
306
+ },
307
+ queue: {
308
+ uuid: selectedServiceQueue,
309
+ },
310
+ patient: {
311
+ uuid: patientUuid,
312
+ },
313
+ startedAt: newVisit.startDatetime,
314
+ sortWeight: 0,
315
+ },
316
+ };
317
+ return payload;
318
+ };
319
+
320
+ function generateCreateBillDto(): CreateBillDto {
321
+ const payload: CreateBillDto = {
322
+ lineItems: [
323
+ {
324
+ billableService: selectedBillableService.billableService.uuid,
325
+ quantity: 1,
326
+ price: selectedBillableService.price,
327
+ priceName: selectedBillableService.name,
328
+ priceUuid: selectedBillableService.uuid,
329
+ lineItemOrder: 0,
330
+ paymentStatus: 'PENDING',
331
+ },
332
+ ],
333
+ cashPoint: selectedCashPoint.uuid,
334
+ patient: patientUuid,
335
+ status: 'PENDING',
336
+ payments: [],
337
+ };
338
+ return payload;
339
+ }
340
+
341
+ const patientTypeHandler = (selectedPatientType: { selectedItem: { id: string; text: string } }) => {
342
+ const pt = selectedPatientType.selectedItem.id;
343
+ setSelectedPatientType(pt);
344
+ };
345
+
346
+ function getVisitAttributes(): VisitAttribute[] {
347
+ const attributes: VisitAttribute[] = [];
348
+ if (selectedInsuranceScheme) {
349
+ attributes.push({
350
+ attributeType: '3a988e33-a6c0-4b76-b924-01abb998944b',
351
+ value: selectedInsuranceScheme,
352
+ });
353
+ }
354
+ if (selectedInsurancePolicy) {
355
+ attributes.push({
356
+ attributeType: 'aac48226-d143-4274-80e0-264db4e368ee',
357
+ value: selectedInsurancePolicy,
358
+ });
359
+ }
360
+ if (selectedPaymentMode) {
361
+ attributes.push({
362
+ attributeType: '8553afa0-bdb9-4d3c-8a98-05fa9350aa85',
363
+ value: selectedPaymentMode.uuid,
364
+ });
365
+ }
366
+ if(selectedPatientType) {
367
+ attributes.push({
368
+ attributeType: 'fbc0702d-b4c9-4968-be63-af8ad3ad6239',
369
+ value: selectedPatientType,
370
+ });
371
+ }
372
+ if(selectedPaymentDetail === PaymentDetail.NonPaying){
373
+ attributes.push({
374
+ attributeType: 'df0362f9-782e-4d92-8bb2-3112e9e9eb3c',
375
+ value: 'true',
376
+ });
377
+ }
378
+ return attributes;
379
+ }
380
+
381
+ return (
382
+ <>
383
+ <div className={styles.visitLayout}>
384
+ <div className={styles.formSection}>
385
+ <div className={styles.formRow}>
386
+ <div className={styles.formControl}>
387
+ <ComboBox
388
+ onChange={patientTypeHandler}
389
+ id="patient-type-combobox"
390
+ items={patientTypeOptions}
391
+ itemToString={(item) => (item ? item.text : '')}
392
+ titleText="Patient Type"
393
+ />
394
+ </div>
395
+ <div className={styles.formControl}>
396
+ <Select
397
+ id="payment-details"
398
+ labelText="Payment Details"
399
+ onChange={($event) => paymentDetailsHandler($event.target.value)}
400
+ >
401
+ <SelectItem value="" text="Select" />;
402
+ {paymentDetails.map((pd) => {
403
+ return <SelectItem value={pd.id} text={pd.label} />;
404
+ })}
405
+ </Select>
406
+ </div>
407
+ </div>
408
+ </div>
409
+ <div className={styles.formSection}>
410
+ {selectedPaymentDetail === PaymentDetail.Paying ? (
411
+ <>
412
+ <div className={styles.formRow}>
413
+ <div className={styles.formControl}>
414
+ <Select
415
+ id="payment-method"
416
+ labelText="Payment Method"
417
+ onChange={($event) => paymentMethodHandler($event.target.value)}
418
+ >
419
+ <SelectItem value="" text="Select" />;
420
+ {paymentModes &&
421
+ paymentModes.map((pm) => {
422
+ return <SelectItem value={pm.uuid} text={pm.name} />;
423
+ })}
424
+ </Select>
425
+ </div>
426
+ <div className={styles.formControl}>
427
+ <Select
428
+ id="billable-service"
429
+ labelText="Billable Services"
430
+ onChange={($event) => billableServicesHandler($event.target.value)}
431
+ >
432
+ <SelectItem value="" text="Select" />;
433
+ {filteredBillableServices &&
434
+ filteredBillableServices.map((sp) => {
435
+ return (
436
+ <SelectItem value={sp.uuid} text={`${sp.billableService.display}(${sp.name}:${sp.price})`} />
437
+ );
438
+ })}
439
+ </Select>
440
+ </div>
441
+ </div>
442
+ {hasSelectedPaymentMode('insurance') ? (
443
+ <>
444
+ <div className={styles.formRow}>
445
+ <div className={styles.formControl}>
446
+ <TextInput
447
+ id="insurance-scheme"
448
+ labelText="Insurance scheme"
449
+ onChange={(e) => insuranceSchemeHandler(e.target.value)}
450
+ />
451
+ </div>
452
+ <div className={styles.formControl}>
453
+ <TextInput
454
+ id="policy-number"
455
+ labelText="Policy number"
456
+ onChange={(e) => insurancePolicyHandler(e.target.value)}
457
+ />
458
+ </div>
459
+ </div>
460
+ </>
461
+ ) : (
462
+ <></>
463
+ )}
464
+ <div className={styles.formRow}>
465
+ <div className={styles.formControl}>
466
+ <Select
467
+ id="cash-point"
468
+ labelText="Cash Point"
469
+ onChange={($event) => cashPointsHandler($event.target.value)}
470
+ >
471
+ <SelectItem value="" text="Select" />;
472
+ {facilityCashPoints &&
473
+ facilityCashPoints.map((cp) => {
474
+ return <SelectItem value={cp.uuid} text={cp.name} />;
475
+ })}
476
+ </Select>
477
+ </div>
478
+ </div>
479
+ </>
480
+ ) : (
481
+ <></>
482
+ )}
483
+
484
+ {selectedPaymentDetail === PaymentDetail.NonPaying ? (
485
+ <>
486
+ <div className={styles.formRow}>
487
+ <div className={styles.formControl}>
488
+ <Select
489
+ id="patient-category"
490
+ labelText="Patient Category"
491
+ onChange={($event) => patientCategoryHandler($event.target.value)}
492
+ >
493
+ <SelectItem value="" text="Select" />;
494
+ <SelectItem value={PatientCategories.CCC_PATIENT_UUID} text="CCC" />;
495
+ <SelectItem value={PatientCategories.MCH_PATIENT_UUID} text="MCH" />;
496
+ </Select>
497
+ </div>
498
+ </div>
499
+ </>
500
+ ) : (
501
+ <></>
502
+ )}
503
+ </div>
504
+ </div>
505
+ </>
506
+ );
507
+ };
508
+ export default VisitBillingForm;