@openmrs/esm-patient-chart-app 11.3.0 → 11.3.1-patch.9310
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 +27 -24
- package/dist/1119.js +1 -1
- package/dist/1197.js +1 -1
- package/dist/1815.js +2 -0
- package/dist/1815.js.map +1 -0
- package/dist/2146.js +1 -1
- package/dist/2690.js +1 -1
- package/dist/2761.js +1 -1
- package/dist/2761.js.map +1 -1
- package/dist/2859.js +1 -1
- package/dist/2859.js.map +1 -1
- package/dist/3099.js +1 -1
- package/dist/3584.js +1 -1
- package/dist/3697.js +1 -0
- package/dist/3697.js.map +1 -0
- package/dist/4055.js +1 -1
- package/dist/4132.js +1 -1
- package/dist/4300.js +1 -1
- package/dist/4335.js +1 -1
- package/dist/4618.js +1 -1
- package/dist/4632.js +1 -1
- package/dist/4632.js.map +1 -1
- package/dist/4652.js +1 -1
- package/dist/4718.js +1 -1
- package/dist/4754.js +1 -1
- package/dist/4944.js +1 -1
- package/dist/5173.js +1 -1
- package/dist/5205.js +1 -1
- package/dist/5241.js +1 -1
- package/dist/5442.js +1 -1
- package/dist/5661.js +1 -1
- package/dist/5670.js +1 -0
- package/dist/5670.js.map +1 -0
- package/dist/5827.js +1 -0
- package/dist/5827.js.map +1 -0
- package/dist/6022.js +1 -1
- package/dist/6336.js +1 -0
- package/dist/6336.js.map +1 -0
- package/dist/6411.js +1 -1
- package/dist/6411.js.map +1 -1
- package/dist/6468.js +1 -1
- package/dist/6529.js +1 -1
- package/dist/6568.js +1 -0
- package/dist/6568.js.map +1 -0
- package/dist/6679.js +1 -1
- package/dist/68.js +2 -0
- package/dist/68.js.map +1 -0
- package/dist/6840.js +1 -1
- package/dist/6859.js +1 -1
- package/dist/6924.js +1 -0
- package/dist/6924.js.map +1 -0
- package/dist/7097.js +1 -1
- package/dist/7159.js +1 -1
- package/dist/723.js +1 -1
- package/dist/7617.js +1 -1
- package/dist/7816.js +2 -0
- package/dist/7816.js.map +1 -0
- package/dist/7818.js +1 -0
- package/dist/7818.js.map +1 -0
- package/dist/7822.js +1 -0
- package/dist/7822.js.map +1 -0
- package/dist/795.js +1 -1
- package/dist/8163.js +1 -1
- package/dist/8260.js +1 -0
- package/dist/8260.js.map +1 -0
- package/dist/8278.js +1 -0
- package/dist/8278.js.map +1 -0
- package/dist/8349.js +1 -1
- package/dist/8454.js +1 -1
- package/dist/8454.js.map +1 -1
- package/dist/8618.js +1 -1
- package/dist/8709.js +1 -1
- package/dist/8709.js.map +1 -1
- package/dist/890.js +1 -1
- package/dist/9007.js +1 -1
- package/dist/9007.js.map +1 -1
- package/dist/9214.js +1 -1
- package/dist/{4727.js → 9294.js} +1 -1
- package/dist/9294.js.map +1 -0
- package/dist/9329.js +1 -0
- package/dist/9329.js.map +1 -0
- package/dist/9538.js +1 -1
- package/dist/9569.js +1 -1
- package/dist/986.js +1 -1
- package/dist/9879.js +1 -1
- package/dist/9895.js +1 -1
- package/dist/9900.js +1 -1
- package/dist/9913.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-chart-app.js +1 -1
- package/dist/openmrs-esm-patient-chart-app.js.buildmanifest.json +457 -453
- package/dist/openmrs-esm-patient-chart-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +5 -4
- package/src/actions-buttons/delete-visit.component.tsx +8 -3
- package/src/actions-buttons/mark-patient-deceased.component.tsx +2 -2
- package/src/actions-buttons/start-visit.component.tsx +10 -5
- package/src/actions-buttons/start-visit.test.tsx +9 -5
- package/src/actions-buttons/stop-visit.component.tsx +1 -1
- package/src/clinical-views/encounter-list/{encounter-list-tabs.component.tsx → encounter-list-tabs.extension.tsx} +10 -6
- package/src/clinical-views/encounter-list/tag.component.test.tsx +306 -0
- package/src/clinical-views/encounter-list/tag.component.tsx +27 -28
- package/src/clinical-views/encounter-tile/encounter-tile.component.tsx +7 -6
- package/src/clinical-views/encounter-tile/tile.scss +0 -1
- package/src/clinical-views/hooks/useEncountersByVisit.ts +13 -0
- package/src/clinical-views/hooks/useLastEncounter.ts +1 -1
- package/src/clinical-views/types.ts +2 -1
- package/src/clinical-views/utils/concept-utils.ts +24 -0
- package/src/clinical-views/utils/helpers.ts +2 -2
- package/src/clinical-views/utils/index.ts +4 -1
- package/src/config-schema.ts +42 -9
- package/src/dashboard.meta.ts +4 -2
- package/src/index.ts +21 -22
- package/src/mark-patient-deceased/mark-patient-deceased-form.test.tsx +22 -11
- package/src/mark-patient-deceased/mark-patient-deceased-form.workspace.tsx +147 -138
- package/src/patient-banner-tags/{visit-attribute-tags.component.tsx → visit-attribute-tags.extension.tsx} +9 -4
- package/src/patient-chart/chart-review/dashboard-view.component.tsx +2 -2
- package/src/patient-chart/patient-chart.component.tsx +19 -36
- package/src/patient-chart/patient-chart.resources.ts +150 -0
- package/src/routes.json +17 -6
- package/src/visit/hooks/useDeleteVisit.test.tsx +39 -42
- package/src/visit/hooks/useDeleteVisit.tsx +33 -17
- package/src/visit/start-visit-button.component.tsx +2 -2
- package/src/visit/start-visit-button.test.tsx +2 -2
- package/src/visit/visit-action-items/edit-visit-details.component.tsx +29 -8
- package/src/visit/visit-form/base-visit-type.component.tsx +2 -2
- package/src/visit/visit-form/exported-visit-form.workspace.tsx +697 -0
- package/src/visit/visit-form/visit-attribute-type.component.tsx +2 -1
- package/src/visit/visit-form/visit-form.resource.ts +2 -1
- package/src/visit/visit-form/visit-form.test.tsx +28 -25
- package/src/visit/visit-form/visit-form.workspace.tsx +63 -643
- package/src/visit/visit-history-table/visit-actions-cell.component.tsx +3 -2
- package/src/visit/visit-history-table/visit-date-cell.component.tsx +1 -0
- package/src/visit/visit-history-table/visit-diagnoses-cell.component.tsx +1 -0
- package/src/visit/visit-history-table/visit-history-table.component.tsx +3 -2
- package/src/visit/visit-history-table/visit-type-cell.component.tsx +1 -0
- package/src/visit/visit-prompt/{delete-visit-dialog.component.tsx → delete-visit-dialog.modal.tsx} +10 -4
- package/src/visit/visit-prompt/delete-visit-dialog.test.tsx +21 -3
- package/src/visit/visit-prompt/{end-visit-dialog.component.tsx → end-visit-dialog.modal.tsx} +7 -1
- package/src/visit/visit-prompt/end-visit-dialog.test.tsx +20 -1
- package/src/visit/visit-prompt/{start-visit-dialog.component.tsx → start-visit-dialog.modal.tsx} +10 -4
- package/src/visit/visit-prompt/start-visit-dialog.test.tsx +3 -3
- package/src/visit/visits-widget/active-visit-buttons/active-visit-buttons.tsx +7 -6
- package/src/visit/visits-widget/current-visit-summary.extension.tsx +48 -0
- package/src/visit/visits-widget/current-visit-summary.test.tsx +45 -25
- package/src/visit/visits-widget/past-visits-components/encounters-table/encounters-table.component.tsx +15 -37
- package/src/visit/visits-widget/past-visits-components/encounters-table/encounters-table.resource.ts +0 -1
- package/src/visit/visits-widget/past-visits-components/medications-summary.component.tsx +2 -3
- package/src/visit/visits-widget/past-visits-components/visit-summary.component.tsx +8 -1
- package/src/visit/visits-widget/past-visits-components/visit-summary.scss +1 -1
- package/src/visit/visits-widget/single-visit-details/visit-timeline/visit-timeline.component.tsx +94 -0
- package/src/visit/visits-widget/single-visit-details/visit-timeline/visit-timeline.scss +60 -0
- package/src/visit/visits-widget/visit-context/retrospective-data-date-time-picker/retrospective-date-time-picker.component.tsx +6 -7
- package/src/visit/visits-widget/visit-context/{visit-context-header.component.tsx → visit-context-header.extension.tsx} +17 -15
- package/src/visit/visits-widget/visit-context/visit-context-header.test.tsx +35 -29
- package/src/visit/visits-widget/visit-context/visit-context-switcher.modal.tsx +15 -13
- package/src/visit/visits-widget/visit-context/visit-context-switcher.test.tsx +31 -9
- package/src/visit/visits-widget/visit-detail-overview.component.tsx +3 -2
- package/src/visit/visits-widget/visit-detail-overview.test.tsx +4 -4
- package/src/visit/visits-widget/visit.resource.tsx +1 -1
- package/translations/am.json +6 -0
- package/translations/ar.json +6 -0
- package/translations/ar_SY.json +6 -0
- package/translations/bn.json +6 -0
- package/translations/de.json +6 -0
- package/translations/en.json +7 -2
- package/translations/en_US.json +6 -0
- package/translations/es.json +6 -0
- package/translations/es_MX.json +6 -0
- package/translations/fr.json +15 -9
- package/translations/he.json +6 -0
- package/translations/hi.json +6 -0
- package/translations/hi_IN.json +6 -0
- package/translations/id.json +6 -0
- package/translations/it.json +24 -18
- package/translations/ka.json +6 -0
- package/translations/km.json +6 -0
- package/translations/ku.json +6 -0
- package/translations/ky.json +6 -0
- package/translations/lg.json +6 -0
- package/translations/ne.json +6 -0
- package/translations/pl.json +6 -0
- package/translations/pt.json +6 -0
- package/translations/pt_BR.json +6 -0
- package/translations/qu.json +6 -0
- package/translations/ro_RO.json +6 -0
- package/translations/ru_RU.json +6 -0
- package/translations/si.json +6 -0
- package/translations/sw.json +6 -0
- package/translations/sw_KE.json +6 -0
- package/translations/tr.json +6 -0
- package/translations/tr_TR.json +6 -0
- package/translations/uk.json +6 -0
- package/translations/uz.json +6 -0
- package/translations/uz@Latn.json +6 -0
- package/translations/uz_UZ.json +6 -0
- package/translations/vi.json +6 -0
- package/translations/zh.json +6 -0
- package/translations/zh_CN.json +6 -0
- package/dist/2537.js +0 -1
- package/dist/2537.js.map +0 -1
- package/dist/2735.js +0 -2
- package/dist/2735.js.map +0 -1
- package/dist/276.js +0 -1
- package/dist/276.js.map +0 -1
- package/dist/3042.js +0 -1
- package/dist/3042.js.map +0 -1
- package/dist/3119.js +0 -1
- package/dist/3119.js.map +0 -1
- package/dist/3184.js +0 -1
- package/dist/3184.js.map +0 -1
- package/dist/385.js +0 -2
- package/dist/385.js.map +0 -1
- package/dist/3905.js +0 -1
- package/dist/3905.js.map +0 -1
- package/dist/4713.js +0 -1
- package/dist/4713.js.map +0 -1
- package/dist/4727.js.map +0 -1
- package/dist/717.js +0 -1
- package/dist/717.js.map +0 -1
- package/dist/9162.js +0 -2
- package/dist/9162.js.map +0 -1
- package/dist/9206.js +0 -1
- package/dist/9206.js.map +0 -1
- package/dist/9615.js +0 -1
- package/dist/9615.js.map +0 -1
- package/src/visit/visits-widget/current-visit-summary.component.tsx +0 -55
- /package/dist/{9162.js.LICENSE.txt → 1815.js.LICENSE.txt} +0 -0
- /package/dist/{385.js.LICENSE.txt → 68.js.LICENSE.txt} +0 -0
- /package/dist/{2735.js.LICENSE.txt → 7816.js.LICENSE.txt} +0 -0
|
@@ -115,7 +115,8 @@ const AttributeTypeField: React.FC<AttributeTypeFieldProps> = ({
|
|
|
115
115
|
} = useConceptAnswersForVisitAttributeType(data?.datatypeConfig);
|
|
116
116
|
const { t } = useTranslation();
|
|
117
117
|
const baseId = useId();
|
|
118
|
-
const
|
|
118
|
+
const displayText = data?.display?.trim() || data?.name?.trim() || '--';
|
|
119
|
+
const labelText = !required ? `${displayText} (${t('optional', 'optional')})` : displayText;
|
|
119
120
|
|
|
120
121
|
const {
|
|
121
122
|
formState: { errors },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
|
-
import { useTranslation
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import type { TFunction } from 'i18next';
|
|
3
4
|
import dayjs from 'dayjs';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
import {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
useConfig,
|
|
12
12
|
useEmrConfiguration,
|
|
13
13
|
useLocations,
|
|
14
|
-
useVisitContextStore,
|
|
15
14
|
useVisitTypes,
|
|
16
15
|
type Visit,
|
|
17
16
|
} from '@openmrs/esm-framework';
|
|
@@ -27,10 +26,8 @@ import {
|
|
|
27
26
|
useVisitFormCallbacks,
|
|
28
27
|
useVisitFormSchemaAndDefaultValues,
|
|
29
28
|
} from './visit-form.resource';
|
|
30
|
-
import VisitForm from './visit-form.workspace';
|
|
31
|
-
|
|
32
|
-
// Fixed reference time used in time-dependent tests
|
|
33
|
-
const FIXED_NOW = new Date('2023-01-01T08:00:00.000Z');
|
|
29
|
+
import VisitForm, { type VisitFormProps } from './visit-form.workspace';
|
|
30
|
+
import { type PatientWorkspace2DefinitionProps } from '@openmrs/esm-patient-common-lib/src';
|
|
34
31
|
|
|
35
32
|
const visitUuid = 'test_visit_uuid';
|
|
36
33
|
const visitAttributes = {
|
|
@@ -57,17 +54,23 @@ const visitAttributes = {
|
|
|
57
54
|
};
|
|
58
55
|
|
|
59
56
|
const mockCloseWorkspace = jest.fn();
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const testProps = {
|
|
64
|
-
openedFrom: 'test',
|
|
65
|
-
patientUuid: mockPatient.id,
|
|
66
|
-
patient: mockPatient,
|
|
57
|
+
const mockMutateVisitContext = jest.fn();
|
|
58
|
+
const defaultProps: PatientWorkspace2DefinitionProps<VisitFormProps, {}> = {
|
|
67
59
|
closeWorkspace: mockCloseWorkspace,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
workspaceProps: {
|
|
61
|
+
openedFrom: 'test',
|
|
62
|
+
},
|
|
63
|
+
windowProps: {},
|
|
64
|
+
groupProps: {
|
|
65
|
+
patientUuid: mockPatient.id,
|
|
66
|
+
patient: mockPatient,
|
|
67
|
+
visitContext: null,
|
|
68
|
+
mutateVisitContext: mockMutateVisitContext,
|
|
69
|
+
},
|
|
70
|
+
workspaceName: '',
|
|
71
|
+
launchChildWorkspace: jest.fn(),
|
|
72
|
+
windowName: '',
|
|
73
|
+
isRootWorkspace: false,
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
const mockSaveVisit = jest.mocked(saveVisit);
|
|
@@ -153,9 +156,10 @@ jest.mock('../hooks/useDefaultFacilityLocation', () => {
|
|
|
153
156
|
|
|
154
157
|
return {
|
|
155
158
|
...requireActual,
|
|
156
|
-
|
|
159
|
+
useDefaultFacilityLocation: jest.fn(() => ({
|
|
157
160
|
defaultFacility: null,
|
|
158
161
|
isLoading: false,
|
|
162
|
+
error: null,
|
|
159
163
|
})),
|
|
160
164
|
};
|
|
161
165
|
});
|
|
@@ -181,14 +185,6 @@ mockSaveVisit.mockResolvedValue({
|
|
|
181
185
|
},
|
|
182
186
|
} as unknown as FetchResponse<Visit>);
|
|
183
187
|
|
|
184
|
-
jest.mocked(useVisitContextStore).mockReturnValue({
|
|
185
|
-
manuallySetVisitUuid: null,
|
|
186
|
-
patientUuid: null,
|
|
187
|
-
setVisitContext: jest.fn(),
|
|
188
|
-
mutateVisitCallbacks: {},
|
|
189
|
-
mutateVisit: jest.fn(),
|
|
190
|
-
});
|
|
191
|
-
|
|
192
188
|
describe('Visit form', () => {
|
|
193
189
|
beforeEach(() => {
|
|
194
190
|
mockUseConfig.mockReturnValue({
|
|
@@ -873,5 +869,12 @@ describe('useVisitFormSchemaAndDefaultValues', () => {
|
|
|
873
869
|
});
|
|
874
870
|
|
|
875
871
|
function renderVisitForm(visitToEdit?: Visit) {
|
|
876
|
-
|
|
872
|
+
const props: PatientWorkspace2DefinitionProps<VisitFormProps, {}> = {
|
|
873
|
+
...defaultProps,
|
|
874
|
+
groupProps: {
|
|
875
|
+
...defaultProps.groupProps,
|
|
876
|
+
visitContext: visitToEdit ?? null,
|
|
877
|
+
},
|
|
878
|
+
};
|
|
879
|
+
return render(<VisitForm {...props} />);
|
|
877
880
|
}
|