@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2202 → 5.4.2-pre.2223
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.
- package/.turbo/turbo-build.log +26 -489
- package/dist/144.js +2 -0
- package/dist/144.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/317.js +1 -0
- package/dist/317.js.map +1 -0
- package/dist/{807.js → 335.js} +1 -1
- package/dist/349.js +2 -0
- package/dist/349.js.map +1 -0
- package/dist/359.js +2 -0
- package/dist/359.js.LICENSE.txt +29 -0
- package/dist/359.js.map +1 -0
- package/dist/41.js +2 -0
- package/dist/41.js.map +1 -0
- package/dist/474.js +2 -0
- package/dist/474.js.map +1 -0
- package/dist/479.js +2 -0
- package/dist/479.js.LICENSE.txt +9 -0
- package/dist/479.js.map +1 -0
- package/dist/537.js +1 -0
- package/dist/537.js.map +1 -0
- package/dist/{319.js → 55.js} +1 -1
- package/dist/60.js +1 -0
- package/dist/60.js.map +1 -0
- package/dist/746.js +2 -0
- package/dist/{164.js.LICENSE.txt → 746.js.LICENSE.txt} +0 -10
- package/dist/746.js.map +1 -0
- package/dist/907.js +1 -0
- package/dist/907.js.map +1 -0
- package/dist/913.js +2 -0
- package/dist/{591.js.map → 913.js.map} +1 -1
- package/dist/{757.js → 99.js} +1 -1
- package/dist/kenyaemr-esm-patient-clinical-view-app.js +1 -1
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.buildmanifest.json +219 -117
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +4 -1
- package/src/autosuggest/autosuggest.component.tsx +3 -3
- package/src/autosuggest/autosuggest.scss +1 -1
- package/src/autosuggest/patient-search-info.component.tsx +1 -1
- package/src/case-management/encounters/case-encounter-header.scss +1 -1
- package/src/case-management/encounters/case-encounter-overview.component.tsx +11 -8
- package/src/case-management/header/case-management-header.scss +1 -1
- package/src/case-management/metrics/case-management-header.scss +1 -1
- package/src/case-management/table/case-management-list.scss +1 -1
- package/src/case-management/tabs/case-management-tabs.component.tsx +2 -2
- package/src/case-management/tabs/case-management-tabs.scss +1 -1
- package/src/case-management/workspace/case-management.scss +1 -1
- package/src/case-management/workspace/patient-info.scss +1 -1
- package/src/clinical-encounter/clinical-enc.component.tsx +4 -4
- package/src/clinical-encounter/dashboard/in-patient.scss +1 -1
- package/src/clinical-encounter/summary/in-patient-medical-summary/in-patient-medical-summary.component.tsx +1 -1
- package/src/clinical-encounter/summary/maternal-summary/maternal-summary.component.tsx +4 -4
- package/src/clinical-encounter/summary/neonatal summary/neonatal-summary.component.tsx +4 -4
- package/src/clinical-encounter/summary/out-patient-summary/out-patient-summary.scss +1 -1
- package/src/clinical-encounter/summary/out-patient-summary/patient-medical-history.component.tsx +2 -2
- package/src/clinical-encounter/summary/out-patient-summary/patient-social-history.component.tsx +5 -5
- package/src/clinical-encounter/summary/surgical summary/surgical-summary.component.tsx +4 -5
- package/src/contact-list/contact-actions.component.tsx +4 -5
- package/src/contact-list/contact-list-concept-map.ts +1 -0
- package/src/contact-list/contact-list.component.tsx +2 -2
- package/src/contact-list/contact-list.scss +1 -1
- package/src/contact-list/contact-list.workspace.tsx +28 -13
- package/src/contact-list/contact-tracing-history.component.tsx +3 -3
- package/src/contact-list/forms/contact-list-update.workspace.tsx +22 -267
- package/src/deceased-panel/mortuary-summary/mortuary-summary.component.tsx +2 -10
- package/src/deceased-panel/mortuary-summary/mortuary-summary.scss +1 -1
- package/src/deceased-panel/panels/autopsy.component.tsx +11 -4
- package/src/declarations.d.ts +0 -13
- package/src/family-partner-history/family-history.component.tsx +2 -2
- package/src/family-partner-history/family-history.scss +1 -1
- package/src/family-partner-history/family-relationship.scss +1 -1
- package/src/family-partner-history/family-relationship.workspace.tsx +27 -12
- package/src/hooks/useContacts.ts +1 -0
- package/src/in-patient/in-patient-table/in-patient-table.component.tsx +4 -4
- package/src/in-patient/in-patient.component.tsx +3 -8
- package/src/maternal-and-child-health/maternal-health-component.scss +4 -3
- package/src/maternal-and-child-health/partography/labour-delivery.scss +7 -5
- package/src/maternal-and-child-health/partography/partograph-chart.scss +1 -1
- package/src/maternal-and-child-health/partography/partograph.component.tsx +5 -11
- package/src/peer-calendar/forms/peer-form.workspace.tsx +11 -11
- package/src/peer-calendar/header/reporting-period-input.component.tsx +3 -1
- package/src/peer-calendar/metrics/peer-calendar-metrics.component.tsx +2 -3
- package/src/peer-calendar/table/generic-data-table.scss +1 -1
- package/src/peer-calendar/table/generic-data-table.tsx +2 -1
- package/src/peer-calendar/table/peer-calendar-table-filter.component.tsx +6 -3
- package/src/relationships/forms/baseline-info-form-section.component.tsx +46 -31
- package/src/relationships/forms/form.scss +1 -1
- package/src/relationships/forms/patient-search-create-form.tsx +25 -20
- package/src/relationships/modals/birthdate-calculator.modal.tsx +3 -2
- package/src/relationships/relationship.resources.ts +18 -2
- package/src/relationships/tabs/relationships-tabs-component.tsx +2 -2
- package/src/relationships/tabs/relationships-tabs.scss +1 -1
- package/src/root.scss +1 -2
- package/src/specialized-clinics/generic-nav-links/generic-dashboard.component.tsx +3 -3
- package/src/specialized-clinics/hiv-care-and-treatment-services/defaulter-tracing/defaulter-tracing.component.tsx +5 -5
- package/src/specialized-clinics/hiv-care-and-treatment-services/defaulter-tracing/defaulter-tracing.test.tsx +2 -8
- package/src/specialized-clinics/hiv-care-and-treatment-services/hiv-testing-services/hiv-testing-component.scss +4 -3
- package/src/specialized-clinics/hiv-care-and-treatment-services/hiv-testing-services/views/hiv-testing/hiv-testing-services.component.tsx +3 -8
- package/src/ui/data-table/o-table.component.tsx +2 -2
- package/src/ui/data-table/o-table.scss +1 -1
- package/src/ui/encounter-list/encounter-list.scss +5 -3
- package/translations/en.json +1 -0
- package/dist/130.js +0 -2
- package/dist/130.js.LICENSE.txt +0 -7
- package/dist/130.js.map +0 -1
- package/dist/164.js +0 -2
- package/dist/164.js.map +0 -1
- package/dist/316.js +0 -2
- package/dist/316.js.map +0 -1
- package/dist/40.js +0 -1
- package/dist/40.js.map +0 -1
- package/dist/574.js +0 -1
- package/dist/589.js +0 -1
- package/dist/589.js.map +0 -1
- package/dist/591.js +0 -2
- package/dist/685.js +0 -2
- package/dist/685.js.map +0 -1
- package/dist/700.js +0 -2
- package/dist/700.js.map +0 -1
- package/dist/784.js +0 -2
- package/dist/784.js.map +0 -1
- /package/dist/{316.js.LICENSE.txt → 144.js.LICENSE.txt} +0 -0
- /package/dist/{700.js.LICENSE.txt → 349.js.LICENSE.txt} +0 -0
- /package/dist/{784.js.LICENSE.txt → 41.js.LICENSE.txt} +0 -0
- /package/dist/{685.js.LICENSE.txt → 474.js.LICENSE.txt} +0 -0
- /package/dist/{591.js.LICENSE.txt → 913.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"clinical-view-section","component":"clinicalViewPatientDashboard","slot":"patient-chart-dashboard-slot"},{"name":"family-history","slot":"patient-chart-family-history-slot","component":"familyHistory","order":0,"online":true,"offline":false},{"name":"relationships-link","component":"relationshipsLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationships-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationships","slot":"patient-chart-relationships-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"contact-list-form","component":"contactListForm"},{"name":"maternal-and-child-health-dashboard-group-link","slot":"clinical-view-section","component":"maternalAndChildHealthSideNavGroup"},{"name":"antenatal-care-dashboard-link","component":"antenatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-antenatal-care-dashboard-slot","path":"antenatal-care-dashboard","layoutMode":"anchored"}},{"name":"antenatal-care-dashboard","slot":"patient-chart-antenatal-care-dashboard-slot","component":"antenatalCare"},{"name":"postnatal-care-dashboard-link","component":"postnatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-postnatal-care-dashboard-slot","path":"postnatal-care-dashboard","layoutMode":"anchored"}},{"name":"postnatal-care-dashboard","slot":"patient-chart-postnatal-care-dashboard-slot","component":"postnatalCare"},{"name":"labour-and-delivery-dashboard-link","component":"labourAndDeliveryLink","slot":"maternal-and-child-health-slot","meta":{"fullWidth":true,"slot":"patient-chart-labour-and-delivery-dashboard-slot","path":"labour-and-delivery-dashboard","layoutMode":"anchored"}},{"name":"labour-and-delivery-dashboard","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"labourAndDelivery","meta":{"fullWidth":true}},{"name":"hiv-care-and-treatment-dashboard-group-link","slot":"special-clinics-slot","component":"hivCareAndTreatMentSideNavGroup"},{"name":"genericNavLinks","slot":"special-clinics-slot","component":"genericNavLinks","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinic-dashboard-slot","path":"special-clinics-dashboard","layoutMode":"anchored"}},{"name":"patient-chart-special-clinic-dashboard-slot","slot":"patient-chart-special-clinic-dashboard-slot","component":"genericDashboard"},{"name":"hts-dashboard-link","component":"htsDashboardLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hts-dashboard-slot","path":"hts-dashboard","layoutMode":"anchored"}},{"name":"hts-clinical-view","slot":"patient-chart-hts-dashboard-slot","component":"htsClinicalView","order":2,"online":true,"offline":false},{"name":"defaulter-tracing-dashboard-link","component":"defaulterTracingLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-defaulter-tracing-dashboard-slot","path":"defaulter-tracing-dashboard","layoutMode":"anchored"}},{"name":"defaulter-tracing-dashboard","slot":"patient-chart-defaulter-tracing-dashboard-slot","component":"defaulterTracing","order":3,"online":true,"offline":false},{"name":"special-clinics-dashboard-group-link","slot":"clinical-view-section","component":"specialClinicsSideNavGroup"},{"name":"clinical-encounter-link","component":"inPatientClinicalEncounterLink","slot":"clinical-view-section","order":40,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter","slot":"patient-chart-clinical-encounter-slot","component":"inPatientClinicalEncounter","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"deceased-panel-dashboard-link","component":"deceasedPanelDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-deceased-panel-slot","path":"deceased-panel","layoutMode":"anchored"}},{"name":"deceased-details-tabs","slot":"patient-chart-deceased-panel-slot","component":"deceasedDetailsTabs","order":0,"online":true,"offline":false},{"name":"parto-graph-chart","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"partograph","meta":{"fullWidth":true}}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"contact-list-update-form","component":"contactListUpdateForm","title":"Contact List Update Form","type":"form"},{"name":"other-relationship-form","component":"otherRelationshipsForm","title":"Other Relationships Form","type":"form"},{"name":"end-relationship-form","component":"endRelationshipWorkspace","title":"Discontinue relationship form","type":"form"}],"version":"5.4.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"clinical-view-section","component":"clinicalViewPatientDashboard","slot":"patient-chart-dashboard-slot"},{"name":"family-history","slot":"patient-chart-family-history-slot","component":"familyHistory","order":0,"online":true,"offline":false},{"name":"relationships-link","component":"relationshipsLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationships-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationships","slot":"patient-chart-relationships-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"contact-list-form","component":"contactListForm"},{"name":"maternal-and-child-health-dashboard-group-link","slot":"clinical-view-section","component":"maternalAndChildHealthSideNavGroup"},{"name":"antenatal-care-dashboard-link","component":"antenatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-antenatal-care-dashboard-slot","path":"antenatal-care-dashboard","layoutMode":"anchored"}},{"name":"antenatal-care-dashboard","slot":"patient-chart-antenatal-care-dashboard-slot","component":"antenatalCare"},{"name":"postnatal-care-dashboard-link","component":"postnatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-postnatal-care-dashboard-slot","path":"postnatal-care-dashboard","layoutMode":"anchored"}},{"name":"postnatal-care-dashboard","slot":"patient-chart-postnatal-care-dashboard-slot","component":"postnatalCare"},{"name":"labour-and-delivery-dashboard-link","component":"labourAndDeliveryLink","slot":"maternal-and-child-health-slot","meta":{"fullWidth":true,"slot":"patient-chart-labour-and-delivery-dashboard-slot","path":"labour-and-delivery-dashboard","layoutMode":"anchored"}},{"name":"labour-and-delivery-dashboard","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"labourAndDelivery","meta":{"fullWidth":true}},{"name":"hiv-care-and-treatment-dashboard-group-link","slot":"special-clinics-slot","component":"hivCareAndTreatMentSideNavGroup"},{"name":"genericNavLinks","slot":"special-clinics-slot","component":"genericNavLinks","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinic-dashboard-slot","path":"special-clinics-dashboard","layoutMode":"anchored"}},{"name":"patient-chart-special-clinic-dashboard-slot","slot":"patient-chart-special-clinic-dashboard-slot","component":"genericDashboard"},{"name":"hts-dashboard-link","component":"htsDashboardLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hts-dashboard-slot","path":"hts-dashboard","layoutMode":"anchored"}},{"name":"hts-clinical-view","slot":"patient-chart-hts-dashboard-slot","component":"htsClinicalView","order":2,"online":true,"offline":false},{"name":"defaulter-tracing-dashboard-link","component":"defaulterTracingLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-defaulter-tracing-dashboard-slot","path":"defaulter-tracing-dashboard","layoutMode":"anchored"}},{"name":"defaulter-tracing-dashboard","slot":"patient-chart-defaulter-tracing-dashboard-slot","component":"defaulterTracing","order":3,"online":true,"offline":false},{"name":"special-clinics-dashboard-group-link","slot":"clinical-view-section","component":"specialClinicsSideNavGroup"},{"name":"clinical-encounter-link","component":"inPatientClinicalEncounterLink","slot":"clinical-view-section","order":40,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter","slot":"patient-chart-clinical-encounter-slot","component":"inPatientClinicalEncounter","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"deceased-panel-dashboard-link","component":"deceasedPanelDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-deceased-panel-slot","path":"deceased-panel","layoutMode":"anchored"}},{"name":"deceased-details-tabs","slot":"patient-chart-deceased-panel-slot","component":"deceasedDetailsTabs","order":0,"online":true,"offline":false},{"name":"parto-graph-chart","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"partograph","meta":{"fullWidth":true}}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"contact-list-update-form","component":"contactListUpdateForm","title":"Contact List Update Form","type":"form"},{"name":"other-relationship-form","component":"otherRelationshipsForm","title":"Other Relationships Form","type":"form"},{"name":"end-relationship-form","component":"endRelationshipWorkspace","title":"Discontinue relationship form","type":"form"}],"version":"5.4.2-pre.2223"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-clinical-view-app",
|
|
3
|
-
"version": "5.4.2-pre.
|
|
3
|
+
"version": "5.4.2-pre.2223",
|
|
4
4
|
"description": "Patient clinical view microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/kenyaemr-esm-patient-clinical-view-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -48,5 +48,8 @@
|
|
|
48
48
|
"react-i18next": "11.x",
|
|
49
49
|
"react-router-dom": "6.x"
|
|
50
50
|
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"webpack": "^5.99.9"
|
|
53
|
+
},
|
|
51
54
|
"stableVersion": "5.4.1"
|
|
52
55
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Layer, Search
|
|
1
|
+
import { Layer, Search } from '@carbon/react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import React, { type HTMLAttributes, ReactNode, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import styles from './autosuggest.scss';
|
|
@@ -140,7 +140,7 @@ export const Autosuggest: React.FC<AutosuggestProps> = ({
|
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
const handleChange = (e
|
|
143
|
+
const handleChange = (e) => {
|
|
144
144
|
const query = e.target.value;
|
|
145
145
|
onSuggestionSelected(name, undefined);
|
|
146
146
|
|
|
@@ -154,7 +154,7 @@ export const Autosuggest: React.FC<AutosuggestProps> = ({
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
const handleClear = (
|
|
157
|
+
const handleClear = () => {
|
|
158
158
|
onSuggestionSelected(name, undefined);
|
|
159
159
|
};
|
|
160
160
|
|
|
@@ -10,7 +10,7 @@ const PatientSearchInfo: React.FC<PatientSearchInfoProps> = ({ patient }) => {
|
|
|
10
10
|
return (
|
|
11
11
|
<Tile className={styles.patientInfo}>
|
|
12
12
|
<div className={styles.patientAvatar} role="img">
|
|
13
|
-
<PatientPhoto patientUuid={patient.uuid} patientName={patient.person.display}
|
|
13
|
+
<PatientPhoto patientUuid={patient.uuid} patientName={patient.person.display} />
|
|
14
14
|
</div>
|
|
15
15
|
<div className={styles.patientDetails}>
|
|
16
16
|
<h2 className={styles.patientName}>{patient.person.display}</h2>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ComboBox, DataTableSkeleton, Dropdown, Layer, Pagination, Tile } from '@carbon/react';
|
|
2
|
-
import { formatDate, showModal, showSnackbar, useConfig, useLayoutType, usePagination } from '@openmrs/esm-framework';
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
formatDate,
|
|
4
|
+
launchWorkspace,
|
|
5
|
+
showModal,
|
|
6
|
+
showSnackbar,
|
|
7
|
+
useConfig,
|
|
8
|
+
useLayoutType,
|
|
9
|
+
usePagination,
|
|
10
|
+
} from '@openmrs/esm-framework';
|
|
11
|
+
import { CardHeader, EmptyDataIllustration, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
9
12
|
import React, { useState } from 'react';
|
|
10
13
|
import { useTranslation } from 'react-i18next';
|
|
11
14
|
import { KeyedMutator } from 'swr';
|
|
@@ -30,7 +33,7 @@ const CaseEncounterHeader = ({ patientUuid, mutate, onFilterChange }: CaseEncoun
|
|
|
30
33
|
const { caseManagementForms } = useConfig<ConfigObject>();
|
|
31
34
|
|
|
32
35
|
const handleOpenOrEditClinicalEncounterForm = (formUuid: string, encounterUUID = '') => {
|
|
33
|
-
|
|
36
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
34
37
|
workspaceTitle: 'Clinical Encounter',
|
|
35
38
|
mutateForm: mutate,
|
|
36
39
|
formInfo: {
|
|
@@ -145,7 +148,7 @@ const CaseEncounterOverviewComponent = ({ patientUuid }: CaseEncounterOverviewCo
|
|
|
145
148
|
const encounterTypeUuid = encounter.encounterType?.uuid ?? '';
|
|
146
149
|
const formUuid = encounter.form?.uuid ?? '';
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
149
152
|
workspaceTitle,
|
|
150
153
|
mutateForm: mutateVisits,
|
|
151
154
|
formInfo: {
|
|
@@ -21,8 +21,8 @@ const CaseManagementTabs: React.FC<CaseManagementTabsProps> = ({ setActiveTabInd
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<div data-id="case-management-list">
|
|
25
|
-
<Tabs selectedIndex={activeTabIndex} onChange={handleTabChange}
|
|
24
|
+
<div className={styles.tabs} data-id="case-management-list">
|
|
25
|
+
<Tabs selectedIndex={activeTabIndex} onChange={handleTabChange}>
|
|
26
26
|
<div style={{ display: 'flex' }}>
|
|
27
27
|
<TabList style={{ paddingLeft: '1rem' }} aria-label="case-management-tabs" contained>
|
|
28
28
|
<Tab className={styles.tab}>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { formatDate, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
3
|
+
import { formatDate, launchWorkspace, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
4
4
|
import { AdmissionDate_UUID, PriorityOfAdmission_UUID, AdmissionWard_UUID } from '../utils/constants';
|
|
5
5
|
import { getObsFromEncounter } from '../ui/encounter-list/encounter-list-utils';
|
|
6
|
-
import { EmptyState,
|
|
6
|
+
import { EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
7
7
|
import { OverflowMenu, OverflowMenuItem, InlineLoading } from '@carbon/react';
|
|
8
8
|
import { ConfigObject } from '../config-schema';
|
|
9
9
|
import SummaryCard from './summary/summary-card.component';
|
|
@@ -34,7 +34,7 @@ const ClinicalEncounter: React.FC<ClinicalEncounterProps> = ({
|
|
|
34
34
|
formsList: { clinicalEncounterFormUuid },
|
|
35
35
|
} = useConfig<ConfigObject>();
|
|
36
36
|
const handleOpenOrEditClinicalEncounterForm = (encounterUUID = '') => {
|
|
37
|
-
|
|
37
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
38
38
|
workspaceTitle: 'Clinical Encounter',
|
|
39
39
|
mutateForm: mutate,
|
|
40
40
|
formInfo: {
|
|
@@ -60,7 +60,7 @@ const ClinicalEncounter: React.FC<ClinicalEncounterProps> = ({
|
|
|
60
60
|
admittingDoctor: encounter.encounterProviders.length > 0 ? encounter.encounterProviders[0].provider.name : '',
|
|
61
61
|
admissionWard: getObsFromEncounter(encounter, AdmissionWard_UUID),
|
|
62
62
|
actions: (
|
|
63
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
63
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
64
64
|
<OverflowMenuItem
|
|
65
65
|
onClick={() => handleOpenOrEditClinicalEncounterForm(encounter.uuid)}
|
|
66
66
|
itemText={t('edit', 'Edit')}
|
|
@@ -44,7 +44,7 @@ const InPatientSummary: React.FC<InPatientSummaryProps> = ({ patientUuid, encoun
|
|
|
44
44
|
foetalPresentation: '',
|
|
45
45
|
maternalCondition: '',
|
|
46
46
|
actions: (
|
|
47
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
47
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
48
48
|
<OverflowMenuItem onClick={() => handleOpenOrEditMaternalForm(encounter.uuid)} itemText={t('edit', 'Edit')} />
|
|
49
49
|
<OverflowMenuItem itemText={t('delete', 'Delete')} isDelete />
|
|
50
50
|
</OverflowMenu>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
4
|
-
import { EmptyState,
|
|
3
|
+
import { launchWorkspace, useConfig } from '@openmrs/esm-framework';
|
|
4
|
+
import { EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
5
5
|
import { OverflowMenu, OverflowMenuItem, DataTableSkeleton } from '@carbon/react';
|
|
6
6
|
import { useClinicalEncounter } from '../../../hooks/useClinicalEncounter';
|
|
7
7
|
import { ConfigObject } from '../../../config-schema';
|
|
@@ -54,7 +54,7 @@ const MaternalSummary: React.FC<MaternalSummaryProps> = ({ patientUuid }) => {
|
|
|
54
54
|
],
|
|
55
55
|
);
|
|
56
56
|
const handleOpenOrEditMaternalForm = (encounterUUID = '') => {
|
|
57
|
-
|
|
57
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
58
58
|
workspaceTitle: 'Clinical Encounter',
|
|
59
59
|
mutateForm: mutate,
|
|
60
60
|
formInfo: {
|
|
@@ -73,7 +73,7 @@ const MaternalSummary: React.FC<MaternalSummaryProps> = ({ patientUuid }) => {
|
|
|
73
73
|
foetalPresentation: '',
|
|
74
74
|
maternalCondition: '',
|
|
75
75
|
actions: (
|
|
76
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
76
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
77
77
|
<OverflowMenuItem onClick={() => handleOpenOrEditMaternalForm(encounter.uuid)} itemText={t('edit', 'Edit')} />
|
|
78
78
|
<OverflowMenuItem itemText={t('delete', 'Delete')} isDelete />
|
|
79
79
|
</OverflowMenu>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { formatDate } from '@openmrs/esm-framework';
|
|
3
|
+
import { formatDate, launchWorkspace } from '@openmrs/esm-framework';
|
|
4
4
|
import {
|
|
5
5
|
MchEncounterType_UUID,
|
|
6
6
|
ModeOfDelivery_UUID,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
GivenVitaminK_UUID,
|
|
11
11
|
} from '../../../utils/constants';
|
|
12
12
|
import { getObsFromEncounter } from '../../../ui/encounter-list/encounter-list-utils';
|
|
13
|
-
import { EmptyState,
|
|
13
|
+
import { EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
14
14
|
import { OverflowMenu, OverflowMenuItem, InlineLoading } from '@carbon/react';
|
|
15
15
|
import { useNeonatalSummary } from '../../../hooks/useNeonatalSummary';
|
|
16
16
|
import SummaryCard from '../summary-card.component';
|
|
@@ -26,7 +26,7 @@ const NeonatalSummary: React.FC<NeonatalSummaryProps> = ({ patientUuid }) => {
|
|
|
26
26
|
const { encounters, isLoading, error, mutate } = useNeonatalSummary(patientUuid, MchEncounterType_UUID);
|
|
27
27
|
|
|
28
28
|
const handleOpenOrEditNeonatalSummaryForm = (encounterUUID = '') => {
|
|
29
|
-
|
|
29
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
30
30
|
workspaceTitle: 'Neonatal Summary',
|
|
31
31
|
mutateForm: mutate,
|
|
32
32
|
formInfo: {
|
|
@@ -52,7 +52,7 @@ const NeonatalSummary: React.FC<NeonatalSummaryProps> = ({ patientUuid }) => {
|
|
|
52
52
|
babyGivenVitaminK: getObsFromEncounter(encounter, GivenVitaminK_UUID),
|
|
53
53
|
|
|
54
54
|
actions: (
|
|
55
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
55
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
56
56
|
<OverflowMenuItem
|
|
57
57
|
onClick={() => handleOpenOrEditNeonatalSummaryForm(encounter.uuid)}
|
|
58
58
|
itemText={t('edit', 'Edit')}
|
package/src/clinical-encounter/summary/out-patient-summary/patient-medical-history.component.tsx
CHANGED
|
@@ -105,7 +105,7 @@ const OutPatientMedicalHistory: React.FC<OutPatientMedicalHistoryProps> = ({
|
|
|
105
105
|
accidentOrTrauma: getObsFromEncounter(encounter, ACCIDENT_TRAUMA_UUID),
|
|
106
106
|
finalDiagnosis: encounter.diagnoses.length > 0 ? encounter.diagnoses[0].diagnosis.coded.display : '--',
|
|
107
107
|
actions: (
|
|
108
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
108
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
109
109
|
<OverflowMenuItem
|
|
110
110
|
onClick={() => handleOpenOrEditClinicalEncounterForm(encounter.uuid)}
|
|
111
111
|
itemText={t('edit', 'Edit')}
|
|
@@ -148,7 +148,7 @@ const OutPatientMedicalHistory: React.FC<OutPatientMedicalHistoryProps> = ({
|
|
|
148
148
|
rows={tableRows}
|
|
149
149
|
headers={tableHeader}
|
|
150
150
|
render={({ rows, headers, getHeaderProps, getRowProps, getTableProps, getTableContainerProps }) => (
|
|
151
|
-
<TableContainer
|
|
151
|
+
<TableContainer {...getTableContainerProps()}>
|
|
152
152
|
<Table size="sm" {...getTableProps()} aria-label="sample table">
|
|
153
153
|
<TableHead>
|
|
154
154
|
<TableRow>
|
package/src/clinical-encounter/summary/out-patient-summary/patient-social-history.component.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { formatDate, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
3
|
+
import { formatDate, launchWorkspace, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
4
4
|
import {
|
|
5
5
|
Alcohol_Use_UUID,
|
|
6
6
|
Alcohol_Use_Duration_UUID,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Other_Substance_Abuse_UUID,
|
|
10
10
|
} from '../../../utils/constants';
|
|
11
11
|
import { getObsFromEncounter } from '../../../ui/encounter-list/encounter-list-utils';
|
|
12
|
-
import { EmptyState,
|
|
12
|
+
import { EmptyState, ErrorState, CardHeader } from '@openmrs/esm-patient-common-lib';
|
|
13
13
|
import {
|
|
14
14
|
OverflowMenu,
|
|
15
15
|
OverflowMenuItem,
|
|
@@ -52,7 +52,7 @@ const OutPatientSocialHistory: React.FC<OutPatientSocialHistoryProps> = ({
|
|
|
52
52
|
|
|
53
53
|
const headerTitle = t('socialHistory', 'Social History');
|
|
54
54
|
const handleOpenOrEditClinicalEncounterForm = (encounterUUID = '') => {
|
|
55
|
-
|
|
55
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
56
56
|
workspaceTitle: 'Social History',
|
|
57
57
|
mutateForm: mutate(
|
|
58
58
|
(key) => typeof key === 'string' && key.startsWith('/openmrs/ws/rest/v1/kenyaemr/flags'),
|
|
@@ -120,7 +120,7 @@ const OutPatientSocialHistory: React.FC<OutPatientSocialHistoryProps> = ({
|
|
|
120
120
|
smokingDuration: getObsFromEncounter(encounter, Smoking_Duration_UUID),
|
|
121
121
|
otherSubstanceAbuse: getObsFromEncounter(encounter, Other_Substance_Abuse_UUID),
|
|
122
122
|
actions: (
|
|
123
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
123
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
124
124
|
<OverflowMenuItem
|
|
125
125
|
onClick={() => handleOpenOrEditClinicalEncounterForm(encounter.uuid)}
|
|
126
126
|
itemText={t('edit', 'Edit')}
|
|
@@ -163,7 +163,7 @@ const OutPatientSocialHistory: React.FC<OutPatientSocialHistoryProps> = ({
|
|
|
163
163
|
rows={tableRows}
|
|
164
164
|
headers={tableHeader}
|
|
165
165
|
render={({ rows, headers, getHeaderProps, getRowProps, getTableProps, getTableContainerProps }) => (
|
|
166
|
-
<TableContainer
|
|
166
|
+
<TableContainer {...getTableContainerProps()}>
|
|
167
167
|
<Table size="sm" {...getTableProps()} aria-label="sample table">
|
|
168
168
|
<TableHead>
|
|
169
169
|
<TableRow>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { OverflowMenu, OverflowMenuItem, InlineLoading } from '@carbon/react';
|
|
4
|
-
import { formatDate, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
5
|
-
import { EmptyState,
|
|
4
|
+
import { formatDate, launchWorkspace, parseDate, useConfig } from '@openmrs/esm-framework';
|
|
5
|
+
import { EmptyState, ErrorState } from '@openmrs/esm-patient-common-lib';
|
|
6
6
|
import { AdmissionDate_UUID, PriorityOfAdmission_UUID, AdmissionWard_UUID } from '../../../utils/constants';
|
|
7
7
|
import { getObsFromEncounter } from '../../../ui/encounter-list/encounter-list-utils';
|
|
8
8
|
import { ConfigObject } from '../../../config-schema';
|
|
@@ -14,7 +14,6 @@ import { KeyedMutator } from 'swr';
|
|
|
14
14
|
interface SurgicalSummaryProps {
|
|
15
15
|
patientUuid: string;
|
|
16
16
|
formEntrySub?: any;
|
|
17
|
-
launchPatientWorkspace?: Function;
|
|
18
17
|
encounters: OpenmrsEncounter[];
|
|
19
18
|
isLoading: boolean;
|
|
20
19
|
error: Error;
|
|
@@ -34,7 +33,7 @@ const ClinicalEncounter: React.FC<SurgicalSummaryProps> = ({
|
|
|
34
33
|
formsList: { clinicalEncounterFormUuid },
|
|
35
34
|
} = useConfig<ConfigObject>();
|
|
36
35
|
const handleOpenOrEditClinicalEncounterForm = (encounterUUID = '') => {
|
|
37
|
-
|
|
36
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
38
37
|
workspaceTitle: 'Clinical Encounter',
|
|
39
38
|
mutateForm: mutate,
|
|
40
39
|
formInfo: {
|
|
@@ -59,7 +58,7 @@ const ClinicalEncounter: React.FC<SurgicalSummaryProps> = ({
|
|
|
59
58
|
admittingDoctor: encounter.encounterProviders.length > 0 ? encounter.encounterProviders[0].display : '',
|
|
60
59
|
admissionWard: getObsFromEncounter(encounter, AdmissionWard_UUID),
|
|
61
60
|
actions: (
|
|
62
|
-
<OverflowMenu aria-label="overflow-menu" flipped=
|
|
61
|
+
<OverflowMenu aria-label="overflow-menu" flipped={false}>
|
|
63
62
|
<OverflowMenuItem
|
|
64
63
|
onClick={() => handleOpenOrEditClinicalEncounterForm(encounter.uuid)}
|
|
65
64
|
itemText={t('edit', 'Edit')}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Button, ButtonSkeleton, Row } from '@carbon/react';
|
|
2
2
|
import { Microscope } from '@carbon/react/icons';
|
|
3
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
4
|
-
import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib';
|
|
3
|
+
import { launchWorkspace, useConfig } from '@openmrs/esm-framework';
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { ConfigObject } from '../config-schema';
|
|
7
6
|
import useRelativeHTSEncounter from '../hooks/useRelativeHTSEncounter';
|
|
@@ -24,15 +23,15 @@ const ContactActions: React.FC<ContactActionsProps> = ({ relativeUuid, baseLineH
|
|
|
24
23
|
if (isLoading || encounterLoading) {
|
|
25
24
|
return (
|
|
26
25
|
<Row>
|
|
27
|
-
<ButtonSkeleton
|
|
28
|
-
<ButtonSkeleton
|
|
26
|
+
<ButtonSkeleton size="sm" />
|
|
27
|
+
<ButtonSkeleton size="sm" />
|
|
29
28
|
</Row>
|
|
30
29
|
);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
const hivStatus = getHivStatusBasedOnEnrollmentAndHTSEncounters(encounters, enrollment);
|
|
34
33
|
const handleLauchHTSInitialForm = () => {
|
|
35
|
-
|
|
34
|
+
launchWorkspace('patient-form-entry-workspace', {
|
|
36
35
|
workspaceTitle: 'HTS Initial form',
|
|
37
36
|
formInfo: { encounterUuid: '9c0a7a57-62ff-4f75-babe-5835b0e921b7', formUuid: htsInitialTest },
|
|
38
37
|
});
|
|
@@ -2,6 +2,7 @@ export const contactListConceptMap = {
|
|
|
2
2
|
'1436AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': {
|
|
3
3
|
display: 'Partner HIV Status:',
|
|
4
4
|
answers: {
|
|
5
|
+
'166563AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'HIV exposed infant',
|
|
5
6
|
'703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'HIV Positive',
|
|
6
7
|
'664AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'HIV Negative',
|
|
7
8
|
'1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'Unknown',
|
|
@@ -234,9 +234,9 @@ const ContactList: React.FC<ContactListProps> = ({ patientUuid }) => {
|
|
|
234
234
|
<TableHeader
|
|
235
235
|
{...getHeaderProps({
|
|
236
236
|
header,
|
|
237
|
-
isSortable:
|
|
237
|
+
isSortable: true,
|
|
238
238
|
})}>
|
|
239
|
-
{header.header
|
|
239
|
+
{header.header}
|
|
240
240
|
</TableHeader>
|
|
241
241
|
))}
|
|
242
242
|
</TableRow>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button, ButtonSet, Column, DatePicker, DatePickerInput, Dropdown, Form, Stack } from '@carbon/react';
|
|
2
2
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
-
import { DefaultWorkspaceProps, useConfig, useSession } from '@openmrs/esm-framework';
|
|
3
|
+
import { DefaultWorkspaceProps, parseDate, useConfig, useSession } from '@openmrs/esm-framework';
|
|
4
4
|
import React, { useEffect, useMemo } from 'react';
|
|
5
5
|
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
@@ -12,6 +12,8 @@ import RelationshipBaselineInfoFormSection from '../relationships/forms/baseline
|
|
|
12
12
|
import PatientSearchCreate from '../relationships/forms/patient-search-create-form';
|
|
13
13
|
import styles from './contact-list-form.scss';
|
|
14
14
|
import { ContactListFormSchema, saveContact } from './contact-list.resource';
|
|
15
|
+
import dayjs from 'dayjs';
|
|
16
|
+
import { usePatientBirthdate } from '../relationships/relationship.resources';
|
|
15
17
|
interface ContactListFormProps extends DefaultWorkspaceProps {
|
|
16
18
|
patientUuid: string;
|
|
17
19
|
props: any;
|
|
@@ -45,6 +47,21 @@ const ContactListForm: React.FC<ContactListFormProps> = ({ closeWorkspace, patie
|
|
|
45
47
|
display: data!.find((r) => r.uuid === rel.uuid)?.display,
|
|
46
48
|
}))
|
|
47
49
|
: [];
|
|
50
|
+
const { isLoading: isPatientloading, birthdate } = usePatientBirthdate(personUuid);
|
|
51
|
+
const mode = form.watch('mode');
|
|
52
|
+
const dobCreateMode = form.watch('personBInfo.birthdate');
|
|
53
|
+
const patientAgeMonths = useMemo(() => {
|
|
54
|
+
let birthDate: Date | null = null;
|
|
55
|
+
if (mode === 'create') {
|
|
56
|
+
birthDate = dobCreateMode;
|
|
57
|
+
} else {
|
|
58
|
+
birthDate = birthdate ? parseDate(birthdate) : null;
|
|
59
|
+
}
|
|
60
|
+
if (birthDate) {
|
|
61
|
+
return dayjs().diff(birthDate, 'month');
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}, [mode, dobCreateMode, birthdate]);
|
|
48
65
|
|
|
49
66
|
const onSubmit = async (values: ContactListFormType) => {
|
|
50
67
|
try {
|
|
@@ -67,20 +84,18 @@ const ContactListForm: React.FC<ContactListFormProps> = ({ closeWorkspace, patie
|
|
|
67
84
|
<DatePicker
|
|
68
85
|
className={styles.datePickerInput}
|
|
69
86
|
dateFormat="d/m/Y"
|
|
70
|
-
id="startDate"
|
|
71
87
|
datePickerType="single"
|
|
72
88
|
{...field}
|
|
73
89
|
ref={undefined}
|
|
74
|
-
invalid={error?.message}
|
|
90
|
+
invalid={!!error?.message}
|
|
75
91
|
invalidText={error?.message}>
|
|
76
92
|
<DatePickerInput
|
|
77
93
|
id={`startdate-input`}
|
|
78
|
-
|
|
79
|
-
invalid={error?.message}
|
|
94
|
+
invalid={!!error?.message}
|
|
80
95
|
invalidText={error?.message}
|
|
81
96
|
placeholder="mm/dd/yyyy"
|
|
82
97
|
labelText={t('startDate', 'Start Date')}
|
|
83
|
-
size="
|
|
98
|
+
size="lg"
|
|
84
99
|
/>
|
|
85
100
|
</DatePicker>
|
|
86
101
|
)}
|
|
@@ -94,17 +109,17 @@ const ContactListForm: React.FC<ContactListFormProps> = ({ closeWorkspace, patie
|
|
|
94
109
|
<DatePicker
|
|
95
110
|
className={styles.datePickerInput}
|
|
96
111
|
dateFormat="d/m/Y"
|
|
97
|
-
id="endDate"
|
|
98
112
|
datePickerType="single"
|
|
99
113
|
{...field}
|
|
100
|
-
invalid={error?.message}
|
|
114
|
+
invalid={!!error?.message}
|
|
101
115
|
invalidText={error?.message}>
|
|
102
116
|
<DatePickerInput
|
|
103
|
-
|
|
117
|
+
id="endDate"
|
|
118
|
+
invalid={!!error?.message}
|
|
104
119
|
invalidText={error?.message}
|
|
105
120
|
placeholder="mm/dd/yyyy"
|
|
106
121
|
labelText={t('endDate', 'End Date')}
|
|
107
|
-
size="
|
|
122
|
+
size="lg"
|
|
108
123
|
/>
|
|
109
124
|
</DatePicker>
|
|
110
125
|
)}
|
|
@@ -117,7 +132,7 @@ const ContactListForm: React.FC<ContactListFormProps> = ({ closeWorkspace, patie
|
|
|
117
132
|
render={({ field, fieldState: { error } }) => (
|
|
118
133
|
<Dropdown
|
|
119
134
|
ref={field.ref}
|
|
120
|
-
invalid={error?.message}
|
|
135
|
+
invalid={!!error?.message}
|
|
121
136
|
invalidText={error?.message}
|
|
122
137
|
id="relationshipToPatient"
|
|
123
138
|
titleText={t('relationToPatient', 'Relation to patient')}
|
|
@@ -133,11 +148,11 @@ const ContactListForm: React.FC<ContactListFormProps> = ({ closeWorkspace, patie
|
|
|
133
148
|
/>
|
|
134
149
|
</Column>
|
|
135
150
|
|
|
136
|
-
<RelationshipBaselineInfoFormSection />
|
|
151
|
+
<RelationshipBaselineInfoFormSection patientAgeMonths={patientAgeMonths} patientUuid={personUuid} />
|
|
137
152
|
</Stack>
|
|
138
153
|
|
|
139
154
|
<ButtonSet className={styles.buttonSet}>
|
|
140
|
-
<Button className={styles.button} kind="secondary" onClick={closeWorkspace}>
|
|
155
|
+
<Button className={styles.button} kind="secondary" onClick={() => closeWorkspace()}>
|
|
141
156
|
{t('discard', 'Discard')}
|
|
142
157
|
</Button>
|
|
143
158
|
<Button className={styles.button} kind="primary" type="submit" disabled={form.formState.isSubmitting}>
|