@kenyaemr/esm-express-workflow-app 5.4.4-pre.299 → 5.4.4-pre.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/dist/126.js +1 -0
  3. package/dist/126.js.map +1 -0
  4. package/dist/2024.js +1 -1
  5. package/dist/2024.js.map +1 -1
  6. package/dist/2225.js +1 -1
  7. package/dist/2225.js.map +1 -1
  8. package/dist/2386.js +1 -0
  9. package/dist/2386.js.map +1 -0
  10. package/dist/2438.js +1 -1
  11. package/dist/2438.js.map +1 -1
  12. package/dist/4504.js +1 -0
  13. package/dist/4504.js.map +1 -0
  14. package/dist/4670.js +1 -0
  15. package/dist/4670.js.map +1 -0
  16. package/dist/4682.js +1 -1
  17. package/dist/4682.js.map +1 -1
  18. package/dist/5047.js +1 -0
  19. package/dist/5047.js.map +1 -0
  20. package/dist/586.js.map +1 -1
  21. package/dist/5986.js +1 -1
  22. package/dist/5986.js.map +1 -1
  23. package/dist/6075.js +1 -0
  24. package/dist/6075.js.map +1 -0
  25. package/dist/6328.js +1 -1
  26. package/dist/6328.js.map +1 -1
  27. package/dist/64.js +1 -0
  28. package/dist/64.js.map +1 -0
  29. package/dist/6456.js +1 -1
  30. package/dist/6720.js +1 -0
  31. package/dist/6720.js.map +1 -0
  32. package/dist/7607.js +1 -1
  33. package/dist/8566.js +1 -0
  34. package/dist/8566.js.map +1 -0
  35. package/dist/8727.js +1 -1
  36. package/dist/8799.js +1 -0
  37. package/dist/8799.js.map +1 -0
  38. package/dist/8911.js +1 -1
  39. package/dist/8911.js.map +1 -1
  40. package/dist/9157.js +1 -1
  41. package/dist/9157.js.map +1 -1
  42. package/dist/9161.js +1 -0
  43. package/dist/9161.js.map +1 -0
  44. package/dist/9182.js +1 -1
  45. package/dist/9343.js +1 -0
  46. package/dist/9343.js.map +1 -0
  47. package/dist/9535.js +1 -1
  48. package/dist/9535.js.map +1 -1
  49. package/dist/9834.js +1 -0
  50. package/dist/{4432.js.map → 9834.js.map} +1 -1
  51. package/dist/kenyaemr-esm-express-workflow-app.js +2 -2
  52. package/dist/kenyaemr-esm-express-workflow-app.js.buildmanifest.json +294 -151
  53. package/dist/kenyaemr-esm-express-workflow-app.js.map +1 -1
  54. package/dist/main.js +2 -2
  55. package/dist/main.js.map +1 -1
  56. package/dist/routes.json +1 -1
  57. package/package.json +1 -1
  58. package/src/components/admissions/index.tsx +0 -1
  59. package/src/components/anaesthetic/anaesthetic.component.tsx +10 -4
  60. package/src/components/anaesthetic/forms/interoperative-record-drug-given-form.component.tsx +2 -26
  61. package/src/components/anaesthetic/graphs/interoperative-record-drug-given-graph-wrapper.component.tsx +66 -25
  62. package/src/components/anaesthetic/resources/anaesthetic.resource.ts +2 -2
  63. package/src/components/consultation/clinical-encounter/clinical-encounter.component.tsx +4 -20
  64. package/src/components/consultation/index.ts +1 -1
  65. package/src/components/consultation/tabs/index.ts +67 -0
  66. package/src/components/facility-dashboard/components/header/home-header.component.tsx +8 -13
  67. package/src/components/laboratory/index.ts +11 -0
  68. package/src/components/laboratory/lab-table.component.tsx +25 -12
  69. package/src/components/laboratory/laboratory-tabs.component.tsx +3 -17
  70. package/src/components/pharmacy/index.ts +1 -1
  71. package/src/components/pharmacy/pharmacy-tabs.component.tsx +4 -20
  72. package/src/components/pharmacy/tabs/index.ts +21 -0
  73. package/src/components/procedures/index.ts +16 -0
  74. package/src/components/procedures/procedures-table.component.tsx +33 -15
  75. package/src/components/procedures/procedures-tabs.component.tsx +3 -22
  76. package/src/components/radiology-and-imaging/index.ts +11 -0
  77. package/src/components/radiology-and-imaging/radiology-and-imaging-table.component.tsx +35 -15
  78. package/src/components/radiology-and-imaging/radiology-and-imaging.component.tsx +3 -19
  79. package/src/components/registration/card/Local-card/local-card.component.tsx +3 -3
  80. package/src/components/registration/dependants/dependants.component.tsx +6 -1
  81. package/src/components/registration/end-visit-modal/end-visit-dialog.modal.tsx +320 -0
  82. package/src/components/registration/end-visit-modal/end-visit-dialog.scss +12 -0
  83. package/src/components/registration/end-visit-modal/end-visit.resource.tsx +59 -0
  84. package/src/components/registration/end-visit-modal/sha-end-visit.resource.ts +285 -0
  85. package/src/components/registration/start-visit-form/overflow-menu-extension/custom-end-active-visit.extension.tsx +44 -0
  86. package/src/components/registration/start-visit-form/start-visit-workspace/exported-visit-form.workspace.tsx +16 -11
  87. package/src/components/registration/type/index.ts +101 -0
  88. package/src/config-schema.ts +23 -1
  89. package/src/index.ts +36 -17
  90. package/src/routes.json +205 -12
  91. package/src/shared/otp-verification/index.ts +3 -0
  92. package/src/shared/otp-verification/otp-verification.modal.tsx +51 -17
  93. package/src/shared/patient-chart/patient-summary-dashboard/patient-summary-dashboard.component.tsx +5 -73
  94. package/src/shared/tabs/create-tab-extension.tsx +33 -0
  95. package/src/shared/tabs/extension-tabs.component.tsx +51 -33
  96. package/src/shared/utils/index.ts +6 -6
  97. package/translations/am.json +32 -24
  98. package/translations/en.json +23 -16
  99. package/translations/fr.json +23 -16
  100. package/translations/sw.json +23 -21
  101. package/Failed to delete encounter/am.json +0 -4
  102. package/Failed to delete encounter/en.json +0 -4
  103. package/Failed to delete encounter/fr.json +0 -4
  104. package/Failed to delete encounter/sw.json +0 -4
  105. package/dist/2332.js +0 -1
  106. package/dist/2332.js.map +0 -1
  107. package/dist/4432.js +0 -1
  108. package/dist/4666.js +0 -1
  109. package/dist/4666.js.map +0 -1
  110. package/dist/5733.js +0 -1
  111. package/dist/5733.js.map +0 -1
  112. package/dist/644.js +0 -1
  113. package/dist/644.js.map +0 -1
  114. package/dist/655.js +0 -1
  115. package/dist/655.js.map +0 -1
  116. package/dist/70.js +0 -1
  117. package/dist/70.js.map +0 -1
  118. package/dist/9387.js +0 -1
  119. package/dist/9387.js.map +0 -1
  120. package/src/components/admissions/admission-medication-summary.tsx +0 -302
  121. package/src/components/admissions/admissions-dashboard.utils.test.ts +0 -48
  122. package/src/components/admissions/admissions-dashboard.utils.tsx +0 -63
  123. package/src/shared/orders/OrdersTabs.tsx +0 -76
  124. /package/src/shared/{patient-chart/patient-summary-dashboard → tabs}/patient-summary-dashboard.scss +0 -0
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.24.0"},"pages":[{"component":"root","route":"express-workflow"},{"component":"queuesAdminHome","route":"queues-admin"}],"extensions":[{"component":"appointmentsDashboardLink","name":"appointments-dashboard-link","slot":"appointments-left-panel-slot","meta":{"name":"appointments","slot":"appointments-dashboard-slot","title":"Appointments"}},{"name":"ewf-preauth-dashboard-link","component":"preauthDashboardLink","slot":"patient-chart-dashboard-slot","order":10,"meta":{"name":"ewf-preauth","title":"Preauthorization","path":"preauthorization","slot":"ewf-preauth-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-preauth-dashboard","component":"preauthDashboard","slot":"ewf-patient-chart-preauth-dashboard-slot","online":true,"offline":false},{"component":"admissionsLeftPanelLink","name":"admissions-dashboard-link","slot":"express-workflow-left-panel-slot","order":9,"meta":{"name":"admissions","slot":"admissions-dashboard-slot","title":"Admissions"}},{"component":"admissionsDashboard","name":"admissions-dashboard","slot":"admissions-dashboard-slot"},{"component":"consultationLeftPanelLink","name":"consultation-dashboard-link","slot":"homepage-dashboard-slot","order":3,"meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"}},{"component":"consultationDashboard","name":"consultation-dashboard","slot":"consultation-dashboard-slot"},{"component":"facilityLeftPanelLink","name":"facility-dashboard-link","slot":"homepage-dashboard-slot","order":0,"meta":{"name":"dashboard","slot":"facility-dashboard-slot","title":"Dashboard"}},{"component":"facilityDashboard","name":"facility-dashboard","slot":"facility-dashboard-slot"},{"component":"mchLeftPanelLink","name":"mch-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"mch","slot":"mch-dashboard-slot","title":"MCH"}},{"component":"mchDashboard","name":"mch-dashboard","slot":"mch-dashboard-slot"},{"component":"registrationLeftPanelLink","name":"registration-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"registration","slot":"registration-dashboard-slot","title":"Registration"}},{"component":"registrationDashboard","name":"registration-dashboard","slot":"registration-dashboard-slot"},{"component":"triageLeftPanelLink","name":"triage-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-dashboard-slot","title":"Triage"}},{"component":"triageDashboard","name":"triage-dashboard","slot":"triage-dashboard-slot"},{"name":"custom-visit-form-queue-fields","component":"checkinFormExtraExtension","slot":"visit-form-bottom-slot","order":0},{"component":"reportsDashboardLink","name":"reports-homepage-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"reports","slot":"reports-homepage-dashboard-slot","title":"Reports"}},{"component":"reportsDashboard","name":"reports-dashboard","slot":"reports-homepage-dashboard-slot"},{"name":"pharmacy-homepage-dashboard-link","component":"pharmacyLink","slot":"homepage-dashboard-slot","meta":{"name":"pharmacy","title":"Pharmacy","path":"pharmacy","slot":"pharmacy-homepage-dashboard-slot"}},{"name":"pharmacy-homepage-dashboard","component":"pharmacy","slot":"pharmacy-homepage-dashboard-slot","online":true,"offline":false},{"name":"ewf-pharmacy-orders-dashboard","component":"pharmacyOrders","slot":"ewf-orders-slot","online":true,"offline":false},{"name":"patient-summary-dashboard","component":"patientSummaryDashboard","slot":"patient-chart-summary-dashboard-slot"},{"name":"ewf-clinical-encounter-link","component":"clinicalEncounterLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-clinical-encounter","title":"Clinical Encounter","slot":"ewf-patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-clinical-encounter-dashboard","component":"clinicalEncounter","slot":"ewf-patient-chart-clinical-encounter-slot","online":true,"offline":false},{"name":"ewf-laboratory-dashboard-link","component":"laboratoryLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-laboratory","title":"Lab Orders","path":"laboratory","slot":"ewf-patient-chart-laboratory-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-laboratory-dashboard","component":"laboratoryDashboard","slot":"ewf-patient-chart-laboratory-dashboard-slot","online":true,"offline":false},{"name":"ewf-radiology-and-imaging-dashboard-link","component":"radiologyAndImagingLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-radiology-and-imaging","title":"Radiology and Imaging","path":"radiology-and-imaging","slot":"ewf-patient-chart-radiology-and-imaging-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-radiology-and-imaging-dashboard","component":"radiologyAndImagingDashboard","slot":"ewf-patient-chart-radiology-and-imaging-dashboard-slot","online":true,"offline":false},{"name":"ewf-procedures-dashboard-link","component":"proceduresLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-procedures","title":"Procedures","path":"procedures","slot":"ewf-patient-chart-procedures-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-procedures-dashboard","component":"proceduresDashboard","slot":"ewf-patient-chart-procedures-dashboard-slot","online":true,"offline":false},{"name":"ewf-pharmacy-dashboard-link","component":"pharmacyPatientChartDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-pharmacy","title":"Prescription","path":"pharmacy","slot":"ewf-patient-chart-pharmacy-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-pharmacy-dashboard","component":"pharmacyTabs","slot":"ewf-patient-chart-pharmacy-dashboard-slot","online":true,"offline":false},{"name":"ewf-admissions-dashboard-link","component":"admissionsDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-admissions","title":"In-patient","path":"admissions","slot":"ewf-patient-chart-admissions-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-admissions-dashboard","component":"admissionsDashboard","slot":"ewf-patient-chart-admissions-dashboard-slot","online":true,"offline":false},{"name":"ewf-homepage-dashboard-link","component":"homepageDashboardLink","slot":"patient-chart-dashboard-slot","order":0},{"name":"ewf-encounter-details-dashboard","component":"encounterDetails","slot":"ewf-clinical-encounter-slot","online":true,"offline":false},{"name":"custom-start-visit-overflow-menu-item","slot":"patient-actions-slot","component":"customStartVisitOverflowMenuItem","online":true,"offline":true},{"name":"procedure-queues","component":"procedureQueues","online":true,"offline":false,"featureFlag":"procedureQueues","slot":"procedure-orders-dashboard-slot"},{"name":"procedure-form-extras","component":"procedureFormExtras","slot":"procedure-order-form-extras-slot","online":true,"offline":false,"featureFlag":"procedureQueues"},{"name":"admission-medication-summary","component":"admissionsMedicationSummary","slot":"inpatient-dashboard-tabs-slot","online":true,"offline":false,"meta":{"title":"medicationSummary"}}],"workspaces2":[{"name":"custom-start-visit-workspace-form","component":"visitFormWorkspace","window":"ewf-start-visit"},{"name":"anaesthetic-record-workspace-form","component":"anaestheticFormWorkspace","window":"ewf-anaesthetic-record"},{"name":"interoperative-drug-given-workspace-form","component":"interoperativeDrugGivenFormWorkspace","window":"ewf-anaesthetic-record"}],"workspaceWindows2":[{"name":"ewf-start-visit","group":"ewf-patient-chart","width":"wider"},{"name":"ewf-anaesthetic-record","group":"ewf-patient-chart","width":"wider"}],"workspaceGroups2":[{"name":"ewf-patient-chart","scopePattern":"/patient/([^/]+)/chart"}],"modals":[{"component":"otpVerificationModal","name":"otp-verification-modal"},{"component":"facilityDashboardAuthorizationModal","name":"facility-dashboard-authorization-form-modal"}],"version":"5.4.4-pre.299"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.24.0"},"pages":[{"component":"root","route":"express-workflow"},{"component":"queuesAdminHome","route":"queues-admin"}],"extensions":[{"component":"appointmentsDashboardLink","name":"appointments-dashboard-link","slot":"appointments-left-panel-slot","meta":{"name":"appointments","slot":"appointments-dashboard-slot","title":"Appointments"}},{"name":"ewf-preauth-dashboard-link","component":"preauthDashboardLink","slot":"patient-chart-dashboard-slot","order":10,"meta":{"name":"ewf-preauth","title":"Preauthorization","path":"preauthorization","slot":"ewf-preauth-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-preauth-dashboard","component":"preauthDashboard","slot":"ewf-patient-chart-preauth-dashboard-slot","online":true,"offline":false},{"component":"admissionsLeftPanelLink","name":"admissions-dashboard-link","slot":"express-workflow-left-panel-slot","order":9,"meta":{"name":"admissions","slot":"admissions-dashboard-slot","title":"Admissions"}},{"component":"admissionsDashboard","name":"admissions-dashboard","slot":"admissions-dashboard-slot"},{"component":"consultationLeftPanelLink","name":"consultation-dashboard-link","slot":"homepage-dashboard-slot","order":3,"meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"}},{"component":"consultationDashboard","name":"consultation-dashboard","slot":"consultation-dashboard-slot"},{"component":"facilityLeftPanelLink","name":"facility-dashboard-link","slot":"homepage-dashboard-slot","order":0,"meta":{"name":"dashboard","slot":"facility-dashboard-slot","title":"Dashboard"}},{"component":"facilityDashboard","name":"facility-dashboard","slot":"facility-dashboard-slot"},{"component":"mchLeftPanelLink","name":"mch-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"mch","slot":"mch-dashboard-slot","title":"MCH"}},{"component":"mchDashboard","name":"mch-dashboard","slot":"mch-dashboard-slot"},{"component":"registrationLeftPanelLink","name":"registration-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"registration","slot":"registration-dashboard-slot","title":"Registration"}},{"component":"registrationDashboard","name":"registration-dashboard","slot":"registration-dashboard-slot"},{"component":"triageLeftPanelLink","name":"triage-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-dashboard-slot","title":"Triage"}},{"component":"triageDashboard","name":"triage-dashboard","slot":"triage-dashboard-slot"},{"name":"custom-visit-form-queue-fields","component":"checkinFormExtraExtension","slot":"visit-form-bottom-slot","order":0},{"component":"reportsDashboardLink","name":"reports-homepage-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"reports","slot":"reports-homepage-dashboard-slot","title":"Reports"}},{"component":"reportsDashboard","name":"reports-dashboard","slot":"reports-homepage-dashboard-slot"},{"name":"pharmacy-homepage-dashboard-link","component":"pharmacyLink","slot":"homepage-dashboard-slot","meta":{"name":"pharmacy","title":"Pharmacy","path":"pharmacy","slot":"pharmacy-homepage-dashboard-slot"}},{"name":"pharmacy-homepage-dashboard","component":"pharmacy","slot":"pharmacy-homepage-dashboard-slot","online":true,"offline":false},{"name":"ewf-pharmacy-orders-dashboard","component":"pharmacyOrders","slot":"ewf-orders-slot","online":true,"offline":false},{"name":"patient-summary-dashboard","component":"patientSummaryDashboard","slot":"patient-chart-summary-dashboard-slot"},{"name":"ewf-clinical-encounter-link","component":"clinicalEncounterLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-clinical-encounter","title":"Clinical Encounter","slot":"ewf-patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-clinical-encounter-dashboard","component":"clinicalEncounter","slot":"ewf-patient-chart-clinical-encounter-slot","online":true,"offline":false},{"name":"ewf-laboratory-dashboard-link","component":"laboratoryLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-laboratory","title":"Lab Orders","path":"laboratory","slot":"ewf-patient-chart-laboratory-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-laboratory-dashboard","component":"laboratoryDashboard","slot":"ewf-patient-chart-laboratory-dashboard-slot","online":true,"offline":false},{"name":"ewf-radiology-and-imaging-dashboard-link","component":"radiologyAndImagingLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-radiology-and-imaging","title":"Radiology and Imaging","path":"radiology-and-imaging","slot":"ewf-patient-chart-radiology-and-imaging-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-radiology-and-imaging-dashboard","component":"radiologyAndImagingDashboard","slot":"ewf-patient-chart-radiology-and-imaging-dashboard-slot","online":true,"offline":false},{"name":"ewf-procedures-dashboard-link","component":"proceduresLeftPanelLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-procedures","title":"Procedures","path":"procedures","slot":"ewf-patient-chart-procedures-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-procedures-dashboard","component":"proceduresDashboard","slot":"ewf-patient-chart-procedures-dashboard-slot","online":true,"offline":false},{"name":"ewf-pharmacy-dashboard-link","component":"pharmacyPatientChartDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-pharmacy","title":"Prescription","path":"pharmacy","slot":"ewf-patient-chart-pharmacy-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-pharmacy-dashboard","component":"pharmacyTabs","slot":"ewf-patient-chart-pharmacy-dashboard-slot","online":true,"offline":false},{"name":"ewf-admissions-dashboard-link","component":"admissionsDashboardLink","slot":"patient-chart-dashboard-slot","meta":{"name":"ewf-admissions","title":"In-patient","path":"admissions","slot":"ewf-patient-chart-admissions-dashboard-slot","layoutMode":"anchored","hideDashboardTitle":true}},{"name":"ewf-admissions-dashboard","component":"admissionsDashboard","slot":"ewf-patient-chart-admissions-dashboard-slot","online":true,"offline":false},{"name":"ewf-homepage-dashboard-link","component":"homepageDashboardLink","slot":"patient-chart-dashboard-slot","order":0},{"name":"ewf-encounter-details-dashboard","component":"encounterDetails","slot":"ewf-clinical-encounter-slot","online":true,"offline":false},{"name":"custom-start-visit-overflow-menu-item","slot":"patient-actions-slot","component":"customStartVisitOverflowMenuItem","online":true,"offline":true},{"name":"custom-stop-visit-overflow-menu-item","component":"customStopVisitOverflowMenuItem","online":true,"offline":true},{"name":"procedure-queues","component":"procedureQueues","online":true,"offline":false,"featureFlag":"procedureQueues","slot":"procedure-orders-dashboard-slot"},{"name":"procedure-form-extras","component":"procedureFormExtras","slot":"procedure-order-form-extras-slot","online":true,"offline":false,"featureFlag":"procedureQueues"},{"name":"ewf-patient-summary-tab","component":"patientSummary","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"patientSummaryTab","slot":"ewf-patient-summary-slot"}},{"name":"ewf-patient-vitals-tab","component":"patientVitals","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"vitalsAndAnthropometric","slot":"ewf-vitals-slot"}},{"name":"ewf-patient-care-panel-tab","component":"carePanel","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"carePanel","slot":"ewf-care-panel-slot"}},{"name":"ewf-patient-immunization-tab","component":"immunization","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"immunizations","slot":"ewf-immunizations-slot"}},{"name":"ewf-patient-relationships-tab","component":"relationships","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"relationships","slot":"ewf-relationships-slot"}},{"name":"ewf-patient-appointments-tab","component":"appointments","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"appointments","slot":"ewf-appointments-slot"}},{"name":"ewf-patient-attachments-tab","component":"attachments","slot":"ewf-patient-chart-patient-summary-tabs-extension-slot","meta":{"title":"attachments","slot":"ewf-attachments-slot"}},{"name":"ewf-patient-clinical-encounter-tab","component":"patientClinicalEncounter","slot":"clinical-encounter-tabs-slot","meta":{"title":"clinicalEncounterTab","slot":"ewf-clinical-encounter-slot"}},{"name":"ewf-patient-visits-tab","component":"patientVisits","slot":"clinical-encounter-tabs-slot","meta":{"title":"visits","slot":"ewf-visits-slot"}},{"name":"ewf-patient-special-clinics-tab","component":"specialClinics","slot":"clinical-encounter-tabs-slot","meta":{"title":"specialClinics","slot":"ewf-special-clinics-slot"}},{"name":"ewf-clinical-notes-tab","component":"clinicalNotes","meta":{"title":"clinicalNotes","slot":"ewf-clinical-notes-slot"}},{"name":"ewf-procedures-and-orders-tab","component":"proceduresAndOrders","meta":{"title":"proceduresAndOrders","slot":"ewf-procedures-and-orders-slot"}},{"name":"ewf-pharmacy-orders-tab","component":"pharmacyOrdersTab","slot":"pharmacy-tabs-slot","meta":{"title":"orders","slot":"ewf-orders-slot"}},{"name":"ewf-pharmacy-active-medication-tab","component":"pharmacyActiveMedicationsTab","slot":"pharmacy-tabs-slot","meta":{"title":"activeMedications","slot":"ewf-active-medications-slot"}},{"name":"ewf-pharmacy-past-medication-tab","component":"pharmacyPastMedicationsTab","slot":"pharmacy-tabs-slot","meta":{"title":"pastMedications","slot":"ewf-past-medications-slot"}},{"name":"ewf-patient-lab-orders-tab","component":"patientLaboratoryOrdersTab","slot":"patient-laboratory-tabs-slot","meta":{"title":"orders"}},{"name":"ewf-patient-lab-order-results-tab","component":"patientLaboratoryOrdersResults","slot":"patient-laboratory-tabs-slot","meta":{"title":"results","slot":"ewf-laboratory-results-slot","basePath":"laboratory"}},{"name":"ewf-patient-procedure-orders-tab","component":"patientProcedureOrdersTab","slot":"patient-procedure-tabs-slot","meta":{"title":"orders"}},{"name":"ewf-patient-procedure-order-results-tab","component":"patientProcedureOrdersResults","slot":"patient-procedure-tabs-slot","meta":{"title":"results","slot":"ewf-procedures-results-slot","basePath":"procedures"}},{"name":"ewf-patient-procedure-anaesthetic-tab","component":"patientProcedureAnaestheticTab","slot":"patient-procedure-tabs-slot","meta":{"title":"anaesthetic"}},{"name":"ewf-patient-imaging-orders-tab","component":"patientImagingOrdersTab","slot":"patient-imaging-tabs-slot","meta":{"title":"orders"}},{"name":"ewf-patient-imaging-order-results-tab","component":"patientImagingOrdersResults","slot":"patient-imaging-tabs-slot","meta":{"title":"results","slot":"ewf-radiology-and-imaging-results-slot","basePath":"radiology-and-imaging"}}],"workspaces2":[{"name":"custom-start-visit-workspace-form","component":"visitFormWorkspace","window":"ewf-start-visit"},{"name":"anaesthetic-record-workspace-form","component":"anaestheticFormWorkspace","window":"ewf-anaesthetic-record"},{"name":"interoperative-drug-given-workspace-form","component":"interoperativeDrugGivenFormWorkspace","window":"ewf-anaesthetic-record"}],"workspaceWindows2":[{"name":"ewf-start-visit","group":"patient-chart","width":"wider"},{"name":"ewf-anaesthetic-record","group":"ewf-patient-chart","width":"wider"}],"workspaceGroups2":[{"name":"ewf-patient-chart","scopePattern":"/patient/([^/]+)/chart"}],"modals":[{"component":"otpVerificationModal","name":"otp-verification-modal"},{"component":"facilityDashboardAuthorizationModal","name":"facility-dashboard-authorization-form-modal"},{"name":"custom-end-visit-dialog","component":"customEndVisitModal"}],"version":"5.4.4-pre.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-express-workflow-app",
3
- "version": "5.4.4-pre.299",
3
+ "version": "5.4.4-pre.3",
4
4
  "description": "Express workflow app for OpenMRS 3",
5
5
  "keywords": [
6
6
  "openmrs",
@@ -8,7 +8,6 @@ const options = {
8
8
  };
9
9
 
10
10
  export const admissionsDashboard = getAsyncLifecycle(() => import('./admissions-dashboard.component'), options);
11
- export const admissionsMedicationSummary = getAsyncLifecycle(() => import('./admission-medication-summary'), options);
12
11
  // t('inPatient', 'In-Patient')
13
12
  export const admissionsDashboardLink = getAsyncLifecycle(
14
13
  () =>
@@ -268,8 +268,11 @@ const Partograph: React.FC<PartographyProps> = ({ patientUuid }) => {
268
268
  const getInteroperativeRecordDrugGivenTableData = () => {
269
269
  const MAINTENANCE_OF_ANAESTHESIA_UUID = '164254AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
270
270
  const HALOTHANE_UUID = '77343AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
271
- const EVOFLURANE_UUID = '83872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
271
+ const SEVOFLURANE_UUID = '83872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
272
272
  const ISOFLURANE_UUID = '78258AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
273
+ const PROPOFOL_UUID = '82726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
274
+ const KETAMINE_UUID = '78467AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
275
+ const DEXMEDETOMIDINE_UUID = '74640AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
273
276
  const CONCENTRATION_RATE_UUID = '160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
274
277
  const MEDICATION_GIVEN_UUID = '164231AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
275
278
  const IV_FLUIDS_UUID = '161911AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
@@ -277,8 +280,11 @@ const Partograph: React.FC<PartographyProps> = ({ patientUuid }) => {
277
280
 
278
281
  const maintenanceLabels: Record<string, string> = {
279
282
  [HALOTHANE_UUID]: 'Halothane',
280
- [EVOFLURANE_UUID]: 'Evoflurane',
283
+ [SEVOFLURANE_UUID]: 'Sevoflurane',
281
284
  [ISOFLURANE_UUID]: 'Isoflurane',
285
+ [PROPOFOL_UUID]: 'Propofol',
286
+ [KETAMINE_UUID]: 'Ketamine',
287
+ [DEXMEDETOMIDINE_UUID]: 'Dexmedetomidine',
282
288
  };
283
289
 
284
290
  const resolveMaintenanceLabel = (value: string) => {
@@ -290,7 +296,7 @@ const Partograph: React.FC<PartographyProps> = ({ patientUuid }) => {
290
296
  }
291
297
  const normalized = value.toLowerCase();
292
298
  if (normalized === 'sevoflurane') {
293
- return 'Evoflurane';
299
+ return 'Sevoflurane';
294
300
  }
295
301
  const matched = Object.values(maintenanceLabels).find((label) => label.toLowerCase() === normalized);
296
302
  return matched || value;
@@ -330,7 +336,7 @@ const Partograph: React.FC<PartographyProps> = ({ patientUuid }) => {
330
336
  }
331
337
  return String(o.value).trim();
332
338
  })
333
- .find((value) => /^(?:\d+(?:\.\d+)?|\.\d+)%?$/.test(value));
339
+ .find((value) => value.length > 0);
334
340
 
335
341
  const medicationValues = obs
336
342
  .filter((o) => o.concept.uuid === MEDICATION_GIVEN_UUID || o.concept.uuid === DRUG_NAME_UUID)
@@ -26,8 +26,6 @@ export type InteroperativeRecordDrugGivenWorkspaceProps = {
26
26
  };
27
27
 
28
28
  // ── Zod schema ────────────────────────────────────────────────────────────────
29
- const concentrationRatePattern = /^(?:\d+(?:\.\d+)?|\.\d+)%?$/;
30
-
31
29
  const schema = z
32
30
  .object({
33
31
  maintenanceAgent: z.string(),
@@ -37,7 +35,6 @@ const schema = z
37
35
  })
38
36
  .superRefine((val, ctx) => {
39
37
  const hasMaintenance = Boolean(val.maintenanceAgent);
40
- const concentrationRate = val.concentrationRate.trim();
41
38
  const hasMedication = Boolean(val.medicationGiven.trim());
42
39
  const hasFluids = Boolean(val.fluidsGiven.trim());
43
40
 
@@ -48,22 +45,6 @@ const schema = z
48
45
  message: 'Enter a maintenance agent, medication given, or fluids given before saving',
49
46
  });
50
47
  }
51
-
52
- if (hasMaintenance && !concentrationRate) {
53
- ctx.addIssue({
54
- code: z.ZodIssueCode.custom,
55
- path: ['concentrationRate'],
56
- message: 'Concentration rate is required when a maintenance agent is selected',
57
- });
58
- }
59
-
60
- if (concentrationRate && !concentrationRatePattern.test(concentrationRate)) {
61
- ctx.addIssue({
62
- code: z.ZodIssueCode.custom,
63
- path: ['concentrationRate'],
64
- message: 'Use 1, 2.3, 3%, or 4.5% only',
65
- });
66
- }
67
48
  });
68
49
 
69
50
  type FormData = z.infer<typeof schema>;
@@ -186,14 +167,9 @@ const InteroperativeRecordDrugGivenForm: React.FC<
186
167
  <TextInput
187
168
  id="concentration-rate-input"
188
169
  labelText={t('concentrationRate', 'Concentration rate')}
189
- placeholder={t('enterConcentrationRate', 'Enter 1, 2.3, 3%, 4.5%')}
170
+ placeholder={t('enterConcentrationRate', 'Enter concentration rate')}
190
171
  value={field.value}
191
- onChange={(e) => {
192
- const nextValue = e.target.value;
193
- if (nextValue === '' || /^(?:\d+(?:\.\d*)?|\.\d*)%?$/.test(nextValue)) {
194
- field.onChange(nextValue);
195
- }
196
- }}
172
+ onChange={field.onChange}
197
173
  invalid={!!fieldState.error}
198
174
  invalidText={fieldState.error?.message}
199
175
  />
@@ -1,8 +1,9 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { Button } from '@carbon/react';
3
+ import { Button, Pagination } from '@carbon/react';
4
4
  import { Add, ChartColumn, Table as TableIcon } from '@carbon/react/icons';
5
5
  import { launchWorkspace2 } from '@openmrs/esm-framework';
6
+ import { usePaginationInfo } from '@openmrs/esm-patient-common-lib';
6
7
  import InteroperativeRecordDrugGivenGraph, {
7
8
  InteroperativeRecordDrugGivenData,
8
9
  } from './interoperative-record-drug-given-graph.component';
@@ -48,15 +49,39 @@ const InteroperativeRecordDrugGivenGraphWrapper: React.FC<InteroperativeRecordDr
48
49
  data = [],
49
50
  tableData = [],
50
51
  viewMode = 'graph',
52
+ currentPage = 1,
53
+ pageSize = 5,
54
+ totalItems = 0,
51
55
  controlSize = 'sm',
52
56
  onAddData,
53
57
  onViewModeChange,
58
+ onPageChange,
59
+ onPageSizeChange,
54
60
  isAddButtonDisabled = false,
55
61
  patient,
56
62
  onInteroperativeRecordDrugGivenSubmit,
57
63
  onDataSaved,
58
64
  }) => {
59
65
  const { t } = useTranslation();
66
+ const [internalPage, setInternalPage] = useState(currentPage);
67
+ const [internalPageSize, setInternalPageSize] = useState(pageSize);
68
+
69
+ React.useEffect(() => {
70
+ setInternalPage(currentPage);
71
+ }, [currentPage]);
72
+
73
+ React.useEffect(() => {
74
+ setInternalPageSize(pageSize);
75
+ }, [pageSize]);
76
+
77
+ const { pageSizes: calculatedPageSizes, itemsDisplayed } = usePaginationInfo(
78
+ internalPageSize,
79
+ Math.ceil((totalItems || 0) / internalPageSize),
80
+ internalPage,
81
+ totalItems || 0,
82
+ );
83
+
84
+ const paginatedTableData = tableData.slice((internalPage - 1) * internalPageSize, internalPage * internalPageSize);
60
85
 
61
86
  const handleAddData = () => {
62
87
  onAddData?.();
@@ -117,30 +142,46 @@ const InteroperativeRecordDrugGivenGraphWrapper: React.FC<InteroperativeRecordDr
117
142
  ) : (
118
143
  <div className={styles.tableContainer}>
119
144
  {tableData && tableData.length > 0 ? (
120
- <div className={styles.drugsIVFluidsTable}>
121
- <table className={styles.dataTable}>
122
- <thead>
123
- <tr>
124
- <th>{t('date', 'Date')}</th>
125
- <th>{t('maintenanceOfAnaesthesia', 'Maintenance of Anaesthesia')}</th>
126
- <th>{t('concentrationRate', 'Concentration rate')}</th>
127
- <th>{t('medicationsGiven', 'Medications given')}</th>
128
- <th>{t('fluidsGiven', 'Fluids given')}</th>
129
- </tr>
130
- </thead>
131
- <tbody>
132
- {tableData.map((item, index) => (
133
- <tr key={index}>
134
- <td>{item.date}</td>
135
- <td>{item.maintenanceAgent || '-'}</td>
136
- <td>{item.concentrationRate || '-'}</td>
137
- <td>{item.medicationGiven || '-'}</td>
138
- <td>{item.fluidsGiven || '-'}</td>
145
+ <>
146
+ <div className={styles.drugsIVFluidsTable}>
147
+ <table className={styles.dataTable}>
148
+ <thead>
149
+ <tr>
150
+ <th>{t('date', 'Date')}</th>
151
+ <th>{t('maintenanceOfAnaesthesia', 'Maintenance of Anaesthesia')}</th>
152
+ <th>{t('concentrationRate', 'Concentration rate')}</th>
153
+ <th>{t('medicationsGiven', 'Medications given')}</th>
154
+ <th>{t('fluidsGiven', 'Fluids given')}</th>
139
155
  </tr>
140
- ))}
141
- </tbody>
142
- </table>
143
- </div>
156
+ </thead>
157
+ <tbody>
158
+ {paginatedTableData.map((item, index) => (
159
+ <tr key={index}>
160
+ <td>{item.date}</td>
161
+ <td>{item.maintenanceAgent || '-'}</td>
162
+ <td>{item.concentrationRate || '-'}</td>
163
+ <td>{item.medicationGiven || '-'}</td>
164
+ <td>{item.fluidsGiven || '-'}</td>
165
+ </tr>
166
+ ))}
167
+ </tbody>
168
+ </table>
169
+ </div>
170
+ <Pagination
171
+ page={internalPage}
172
+ pageSize={internalPageSize}
173
+ pageSizes={calculatedPageSizes}
174
+ totalItems={totalItems || tableData.length}
175
+ onChange={({ page, pageSize }) => {
176
+ setInternalPage(page);
177
+ setInternalPageSize(pageSize);
178
+ onPageChange?.(page);
179
+ onPageSizeChange?.(pageSize);
180
+ }}
181
+ className={styles.pagination}
182
+ />
183
+ {(totalItems || tableData.length) > 0 && <div className={styles.paginationInfo}>{itemsDisplayed}</div>}
184
+ </>
144
185
  ) : (
145
186
  <div className={styles.emptyTable}>
146
187
  <p>{t('noInteroperativeRecordDrugGivenData', 'No interoperative record data available')}</p>
@@ -358,7 +358,7 @@ export async function deleteCervixEncounter(encounterUuid: string): Promise<Save
358
358
  if (!response.ok) {
359
359
  return {
360
360
  success: false,
361
- message: t('Failed to delete encounter: {{status}} {{statusText}}', {
361
+ message: t('failedToDeleteEncounter', '{{status}} {{statusText}}', {
362
362
  status: response.status,
363
363
  statusText: response.statusText,
364
364
  }),
@@ -369,7 +369,7 @@ export async function deleteCervixEncounter(encounterUuid: string): Promise<Save
369
369
  } catch (error) {
370
370
  return {
371
371
  success: false,
372
- message: t('Failed to delete encounter: {{message}}', {
372
+ message: t('failedToDeleteEncounter', 'Failed to delete encounter: {{message}}', {
373
373
  message: error instanceof Error ? error.message : t('Unknown error'),
374
374
  }),
375
375
  error: 'EXCEPTION',
@@ -1,28 +1,12 @@
1
- import React, { useMemo } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import { Layer } from '@carbon/react';
4
- import { IbmWatsonDiscovery, Account, Stethoscope } from '@carbon/react/icons';
5
- import ExtensionTabs, { ExtensionTabItem } from '../../../shared/tabs/extension-tabs.component';
1
+ import React from 'react';
2
+ import ExtensionTabs from '../../../shared/tabs/extension-tabs.component';
6
3
 
7
4
  type ClinicalEncounterProps = {
8
5
  patientUuid: string;
9
- patient: fhir.Patient;
10
6
  };
11
7
 
12
- const ClinicalEncounter: React.FC<ClinicalEncounterProps> = ({ patientUuid, patient }) => {
13
- const { t } = useTranslation();
14
- const state = useMemo(() => ({ patientUuid, patient }), [patientUuid, patient]);
15
- const items: Array<ExtensionTabItem> = [
16
- { label: t('clinicalEncounter', 'Clinical Encounter'), icon: Stethoscope, slotName: 'ewf-clinical-encounter-slot' },
17
- { label: t('visits', 'Visits'), icon: Account, slotName: 'ewf-visits-slot' },
18
- { label: t('specialClinics', 'Special Clinics'), icon: IbmWatsonDiscovery, slotName: 'ewf-special-clinics-slot' },
19
- ];
20
-
21
- return (
22
- <Layer>
23
- <ExtensionTabs items={items} state={state} />
24
- </Layer>
25
- );
8
+ const ClinicalEncounter: React.FC<ClinicalEncounterProps> = ({ patientUuid }) => {
9
+ return <ExtensionTabs extensionSlotName="clinical-encounter-tabs-slot" patientUuid={patientUuid} />;
26
10
  };
27
11
 
28
12
  export default ClinicalEncounter;
@@ -1,5 +1,5 @@
1
1
  import { getAsyncLifecycle } from '@openmrs/esm-framework';
2
-
2
+ export * from './tabs';
3
3
  import { moduleName } from '../../constants';
4
4
 
5
5
  const options = {
@@ -0,0 +1,67 @@
1
+ import { getAsyncLifecycle } from '@openmrs/esm-framework';
2
+
3
+ const options = {
4
+ featureName: 'express-workflow',
5
+ moduleName: '@kenyaemr/esm-express-workflow-app',
6
+ };
7
+
8
+ // t('patientSummaryTab', 'Patient Summary')
9
+ export const patientSummary = getAsyncLifecycle(
10
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
11
+ options,
12
+ );
13
+ // t('vitalsAndAnthropometric', 'Vitals & Anthropometric')
14
+ export const patientVitals = getAsyncLifecycle(
15
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
16
+ options,
17
+ );
18
+ // t('carePanel', 'Care Panel')
19
+ export const carePanel = getAsyncLifecycle(
20
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
21
+ options,
22
+ );
23
+ // t('immunizations', 'Immunizations')
24
+ export const immunization = getAsyncLifecycle(
25
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
26
+ options,
27
+ );
28
+ // t('relationships', 'Relationships')
29
+ export const relationships = getAsyncLifecycle(
30
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
31
+ options,
32
+ );
33
+ // t('appointments', 'Appointments')
34
+ export const appointments = getAsyncLifecycle(
35
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
36
+ options,
37
+ );
38
+ // t("attachments", "Attachments")
39
+ export const attachments = getAsyncLifecycle(
40
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
41
+ options,
42
+ );
43
+ // t('clinicalEncounterTab', 'Clinical Encounter')
44
+ export const patientClinicalEncounter = getAsyncLifecycle(
45
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
46
+ options,
47
+ );
48
+ // t('visits', 'Visits')
49
+ export const patientVisits = getAsyncLifecycle(
50
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
51
+ options,
52
+ );
53
+ // t('specialClinics', 'Special Clinics')
54
+ export const specialClinics = getAsyncLifecycle(
55
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
56
+ options,
57
+ );
58
+ // t('clinicalNotes', 'Clinical Notes')
59
+ export const clinicalNotes = getAsyncLifecycle(
60
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
61
+ options,
62
+ );
63
+ // t('proceduresAndOrders', 'Investigation & Orders')
64
+ export const proceduresAndOrders = getAsyncLifecycle(
65
+ () => import('../../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
66
+ options,
67
+ );
@@ -1,7 +1,6 @@
1
- import React, { useCallback, useMemo } from 'react';
1
+ import React from 'react';
2
2
  import dayjs from 'dayjs';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { MultiSelect } from '@carbon/react';
5
4
  import {
6
5
  PageHeader,
7
6
  PageHeaderContent,
@@ -18,17 +17,17 @@ interface HomeHeaderProps {
18
17
 
19
18
  const HomeHeader: React.FC<HomeHeaderProps> = ({ title, onDateChange }) => {
20
19
  const { t } = useTranslation();
21
- const today = new Date().toISOString().split('T')[0];
20
+ const today = dayjs().toDate();
22
21
  const [startDate, setStartDate] = React.useState(today);
23
22
  const [endDate, setEndDate] = React.useState(today);
24
23
 
25
24
  const handleDateChange = (type: 'start' | 'end', date: string) => {
26
25
  if (type === 'start') {
27
- setStartDate(date);
28
- onDateChange?.(date, endDate);
26
+ setStartDate(dayjs(date).startOf('day').toDate());
27
+ onDateChange?.(dayjs(date).startOf('day').toISOString(), dayjs(endDate).endOf('day').toISOString());
29
28
  } else {
30
- setEndDate(date);
31
- onDateChange?.(startDate, date);
29
+ setEndDate(dayjs(date).endOf('day').toDate());
30
+ onDateChange?.(dayjs(startDate).startOf('day').toISOString(), dayjs(date).endOf('day').toISOString());
32
31
  }
33
32
  };
34
33
 
@@ -44,9 +43,7 @@ const HomeHeader: React.FC<HomeHeaderProps> = ({ title, onDateChange }) => {
44
43
  id="start-date"
45
44
  labelText="Start Date"
46
45
  value={startDate}
47
- onChange={(date) =>
48
- handleDateChange('start', typeof date === 'string' ? date : date.toISOString().split('T')[0])
49
- }
46
+ onChange={(date) => handleDateChange('start', typeof date === 'string' ? date : date.toISOString())}
50
47
  />
51
48
  </div>
52
49
  <div className={styles.dateInput}>
@@ -54,9 +51,7 @@ const HomeHeader: React.FC<HomeHeaderProps> = ({ title, onDateChange }) => {
54
51
  id="end-date"
55
52
  labelText="End Date"
56
53
  value={endDate}
57
- onChange={(date) =>
58
- handleDateChange('end', typeof date === 'string' ? date : date.toISOString().split('T')[0])
59
- }
54
+ onChange={(date) => handleDateChange('end', typeof date === 'string' ? date : date.toISOString())}
60
55
  />
61
56
  </div>
62
57
  </div>
@@ -20,3 +20,14 @@ export const laboratoryLeftPanelLink = getAsyncLifecycle(
20
20
  })),
21
21
  options,
22
22
  );
23
+
24
+ // t("results", "Results")
25
+ export const patientLaboratoryOrdersResults = getAsyncLifecycle(
26
+ () => import('./../../shared/tabs/create-tab-extension').then((mod) => ({ default: mod.createTabExtension() })),
27
+ options,
28
+ );
29
+ // t("order", "Orders")
30
+ export const patientLaboratoryOrdersTab = getAsyncLifecycle(
31
+ () => import('../../components/laboratory/lab-table.component'),
32
+ options,
33
+ );
@@ -1,35 +1,48 @@
1
1
  import React, { useMemo } from 'react';
2
- import { Order } from '../../types/order/order';
3
- import { Layer } from '@carbon/react';
2
+ import { DataTableSkeleton, Layer } from '@carbon/react';
4
3
  import { useTranslation } from 'react-i18next';
5
- import { useConfig } from '@openmrs/esm-framework';
4
+ import { ErrorState, useConfig } from '@openmrs/esm-framework';
6
5
  import styles from './laboratory-tabs.scss';
7
6
  import { EmptyState, useLaunchWorkspaceRequiringVisit, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
8
7
  import { ExpressWorkflowConfig } from '../../config-schema';
9
8
  import OrderTable from '../../shared/orders/OrderTable';
9
+ import { usePatientOrders } from '../../hooks/useOrders';
10
10
 
11
11
  type LabTableProps = {
12
- orders: Array<Order>;
13
12
  patientUuid: string;
14
- mutateOrders: () => void;
15
13
  };
16
14
 
17
- const LabTable: React.FC<LabTableProps> = ({ orders, patientUuid, mutateOrders }) => {
15
+ const LabTable: React.FC<LabTableProps> = ({ patientUuid }) => {
16
+ const { labOrderTypeUuid, orderableConceptSets } = useConfig<ExpressWorkflowConfig>();
17
+ const {
18
+ data: orders,
19
+ isLoading,
20
+ error,
21
+ mutate: mutateOrders,
22
+ } = usePatientOrders(patientUuid, 'any', labOrderTypeUuid, undefined, undefined);
23
+
18
24
  const { t } = useTranslation();
19
25
  const { patient } = usePatientChartStore(patientUuid);
20
- const windowProps = useMemo(() => ({ encounterUuid: orders[0]?.encounter?.uuid }), [orders[0]?.encounter?.uuid]);
26
+ const windowProps = useMemo(() => ({ encounterUuid: orders?.[0]?.encounter?.uuid }), [orders]);
21
27
  const groupProps = useMemo(
22
28
  () => ({
23
29
  patient,
24
30
  patientUuid: patient?.id,
25
- visitContext: orders[0]?.encounter?.visit,
31
+ visitContext: orders?.[0]?.encounter?.visit,
26
32
  mutateVisitContext: mutateOrders,
27
33
  }),
28
- [patient, orders[0]?.encounter?.visit, mutateOrders],
34
+ [patient, orders, mutateOrders],
29
35
  );
30
- const { labOrderTypeUuid, orderableConceptSets } = useConfig<ExpressWorkflowConfig>();
31
36
  const launchAddLabOrder = useLaunchWorkspaceRequiringVisit(patientUuid, 'order-basket');
32
37
 
38
+ if (isLoading) {
39
+ return <DataTableSkeleton />;
40
+ }
41
+
42
+ if (error) {
43
+ return <ErrorState headerTitle={t('laboratoryOrders', 'Laboratory Orders')} error={error} />;
44
+ }
45
+
33
46
  if (orders?.length === 0) {
34
47
  return (
35
48
  <Layer>
@@ -47,8 +60,8 @@ const LabTable: React.FC<LabTableProps> = ({ orders, patientUuid, mutateOrders }
47
60
  return (
48
61
  <OrderTable
49
62
  title={t('laboratoryOrders', 'Laboratory Orders')}
50
- orders={orders}
51
- onAdd={() => launchAddLabOrder(null, { encounterUuid: '' }, groupProps)}
63
+ orders={orders ?? []}
64
+ onAdd={() => launchAddLabOrder(undefined, { encounterUuid: '' }, groupProps)}
52
65
  containerClassName={styles.labTableContainer}
53
66
  tableCellClassName={styles.tableCell}
54
67
  priorityPillClassName={styles.priorityPill}
@@ -1,29 +1,15 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import OrdersTabs from '../../shared/orders/OrdersTabs';
4
- import LabTable from './lab-table.component';
3
+ import ExtensionTabs from '../../shared/tabs/extension-tabs.component';
5
4
 
6
5
  type LaboratoryTabsProps = {
7
6
  patientUuid: string;
8
- patient: fhir.Patient;
9
7
  };
10
8
 
11
- const LaboratoryTabs: React.FC<LaboratoryTabsProps> = ({ patientUuid, patient }) => {
9
+ const LaboratoryTabs: React.FC<LaboratoryTabsProps> = ({ patientUuid }) => {
12
10
  const { t } = useTranslation();
13
- const testOrderTypeUuid = '52a447d3-a64a-11e3-9aeb-50e549534c5e';
14
11
 
15
- return (
16
- <OrdersTabs
17
- patientUuid={patientUuid}
18
- patient={patient}
19
- basePath="laboratory"
20
- resultsSlotName="ewf-laboratory-results-slot"
21
- orderTypeUuid={testOrderTypeUuid}
22
- Table={({ orders, mutateOrders }) => {
23
- return <LabTable orders={orders} patientUuid={patientUuid} mutateOrders={mutateOrders} />;
24
- }}
25
- />
26
- );
12
+ return <ExtensionTabs extensionSlotName="patient-laboratory-tabs-slot" patientUuid={patientUuid} />;
27
13
  };
28
14
 
29
15
  export default LaboratoryTabs;
@@ -1,7 +1,7 @@
1
1
  import { getAsyncLifecycle } from '@openmrs/esm-framework';
2
2
 
3
3
  import { moduleName } from '../../constants';
4
-
4
+ export * from './tabs';
5
5
  const options = {
6
6
  featureName: 'express-workflow',
7
7
  moduleName,