@openmrs/esm-patient-chart-app 11.3.1-patch.9310 → 11.3.1-patch.9508
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 +18 -21
- package/dist/1119.js +1 -1
- package/dist/1197.js +1 -1
- package/dist/2146.js +1 -1
- package/dist/2540.js +1 -0
- package/dist/2540.js.map +1 -0
- package/dist/2690.js +1 -1
- package/dist/276.js +1 -0
- package/dist/276.js.map +1 -0
- package/dist/2761.js.map +1 -1
- package/dist/3099.js +1 -1
- package/dist/{8278.js → 3119.js} +1 -1
- package/dist/{8278.js.map → 3119.js.map} +1 -1
- package/dist/3584.js +1 -1
- package/dist/3905.js +1 -0
- package/dist/3905.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/439.js +1 -0
- package/dist/4618.js +1 -1
- package/dist/4652.js +1 -1
- package/dist/4944.js +1 -1
- package/dist/5048.js +1 -0
- package/dist/5048.js.map +1 -0
- package/dist/506.js +2 -0
- package/dist/506.js.map +1 -0
- package/dist/5173.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 -1
- package/dist/6022.js +1 -1
- package/dist/6411.js +1 -1
- package/dist/6411.js.map +1 -1
- package/dist/6468.js +1 -1
- package/dist/6568.js +1 -1
- package/dist/6568.js.map +1 -1
- package/dist/6589.js +1 -0
- package/dist/6679.js +1 -1
- package/dist/6840.js +1 -1
- package/dist/6859.js +1 -1
- package/dist/6924.js +1 -1
- package/dist/6924.js.map +1 -1
- package/dist/{9294.js → 6997.js} +1 -1
- package/dist/6997.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/7810.js +1 -0
- package/dist/7810.js.map +1 -0
- package/dist/7822.js +1 -1
- package/dist/7822.js.map +1 -1
- package/dist/795.js +1 -1
- package/dist/8163.js +1 -1
- package/dist/8260.js +1 -1
- package/dist/8260.js.map +1 -1
- package/dist/8349.js +1 -1
- package/dist/8371.js +1 -0
- 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/9214.js +1 -1
- 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 +375 -285
- package/dist/openmrs-esm-patient-chart-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/actions-buttons/mark-patient-deceased.component.tsx +2 -2
- package/src/actions-buttons/start-visit.component.tsx +5 -10
- package/src/actions-buttons/start-visit.test.tsx +5 -9
- package/src/clinical-views/encounter-list/encounter-list-tabs.extension.tsx +2 -2
- package/src/clinical-views/utils/encounter-list-config-builder.ts +19 -6
- package/src/clinical-views/utils/helpers.ts +5 -4
- package/src/index.ts +18 -12
- package/src/mark-patient-deceased/mark-patient-deceased-form.test.tsx +9 -15
- package/src/mark-patient-deceased/mark-patient-deceased-form.workspace.tsx +138 -147
- package/src/patient-banner-tags/visit-attribute-tags.extension.tsx +21 -13
- package/src/patient-banner-tags/visit-attribute-tags.scss +8 -0
- package/src/patient-chart/chart-review/dashboard-view.component.tsx +2 -2
- package/src/patient-chart/chart-review/dashboard-view.scss +5 -0
- package/src/patient-chart/patient-chart.component.tsx +41 -50
- package/src/patient-chart/patient-chart.resources.ts +10 -52
- package/src/routes.json +7 -18
- package/src/visit/hooks/useDeleteVisit.tsx +1 -1
- 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 +8 -29
- package/src/visit/visit-form/base-visit-type.component.tsx +30 -21
- package/src/visit/visit-form/exported-visit-form.workspace.tsx +3 -0
- package/src/visit/visit-form/visit-form.test.tsx +18 -27
- package/src/visit/visit-form/visit-form.workspace.tsx +653 -35
- package/src/visit/visit-history-table/visit-actions-cell.component.tsx +2 -3
- package/src/visit/visit-history-table/visit-date-cell.component.tsx +0 -1
- package/src/visit/visit-history-table/visit-diagnoses-cell.component.tsx +0 -1
- package/src/visit/visit-history-table/visit-history-table.component.tsx +2 -3
- package/src/visit/visit-history-table/visit-type-cell.component.tsx +0 -1
- package/src/visit/visit-prompt/delete-visit-dialog.test.tsx +1 -1
- package/src/visit/visit-prompt/{end-visit-dialog.modal.tsx → end-visit-dialog.component.tsx} +1 -1
- package/src/visit/visit-prompt/end-visit-dialog.test.tsx +1 -1
- package/src/visit/visit-prompt/{start-visit-dialog.modal.tsx → start-visit-dialog.component.tsx} +4 -10
- package/src/visit/visit-prompt/start-visit-dialog.test.tsx +3 -3
- package/src/visit/visits-widget/current-visit-summary.extension.tsx +3 -3
- package/src/visit/visits-widget/past-visits-components/encounters-table/encounters-table.component.tsx +35 -12
- package/src/visit/visits-widget/visit-context/retrospective-data-date-time-picker/retrospective-date-time-picker.component.tsx +0 -1
- package/src/visit/visits-widget/visit-context/visit-context-switcher.modal.tsx +2 -2
- package/src/visit/visits-widget/visit-context/visit-context-switcher.test.tsx +20 -22
- package/src/visit/visits-widget/visit-detail-overview.component.tsx +2 -3
- package/src/visit/visits-widget/visit-detail-overview.test.tsx +4 -4
- package/translations/am.json +1 -2
- package/translations/ar.json +2 -3
- package/translations/ar_SY.json +1 -2
- package/translations/bn.json +1 -2
- package/translations/cs.json +196 -0
- package/translations/de.json +1 -2
- package/translations/en.json +1 -1
- package/translations/en_US.json +1 -2
- package/translations/es.json +2 -3
- package/translations/es_MX.json +1 -2
- package/translations/fr.json +7 -8
- package/translations/he.json +2 -3
- package/translations/hi.json +1 -2
- package/translations/hi_IN.json +1 -2
- package/translations/id.json +2 -3
- package/translations/it.json +2 -3
- package/translations/ka.json +2 -3
- package/translations/km.json +2 -3
- package/translations/ku.json +1 -2
- package/translations/ky.json +1 -2
- package/translations/lg.json +1 -2
- package/translations/ne.json +1 -2
- package/translations/pl.json +1 -2
- package/translations/pt.json +2 -3
- package/translations/pt_BR.json +2 -3
- package/translations/qu.json +1 -2
- package/translations/ro_RO.json +2 -3
- package/translations/ru_RU.json +1 -2
- package/translations/si.json +1 -2
- package/translations/sq.json +196 -0
- package/translations/sw.json +1 -2
- package/translations/sw_KE.json +1 -2
- package/translations/tr.json +1 -2
- package/translations/tr_TR.json +1 -2
- package/translations/uk.json +1 -2
- package/translations/uz.json +1 -2
- package/translations/uz@Latn.json +1 -2
- package/translations/uz_UZ.json +1 -2
- package/translations/vi.json +2 -3
- package/translations/zh.json +2 -3
- package/translations/zh_CN.json +2 -3
- package/translations/zh_TW.json +196 -0
- package/dist/1815.js +0 -2
- package/dist/1815.js.map +0 -1
- package/dist/3697.js +0 -1
- package/dist/3697.js.map +0 -1
- package/dist/5827.js +0 -1
- package/dist/5827.js.map +0 -1
- package/dist/7818.js +0 -1
- package/dist/7818.js.map +0 -1
- package/dist/9294.js.map +0 -1
- package/dist/9329.js +0 -1
- package/dist/9329.js.map +0 -1
- /package/dist/{1815.js.LICENSE.txt → 506.js.LICENSE.txt} +0 -0
- /package/src/visit/visit-prompt/{delete-visit-dialog.modal.tsx → delete-visit-dialog.component.tsx} +0 -0
|
@@ -4,15 +4,14 @@ import styles from './visit-actions-cell.scss';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
visit: Visit;
|
|
7
|
-
patient: fhir.Patient;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
const VisitActionsCell: React.FC<Props> = ({ visit
|
|
9
|
+
const VisitActionsCell: React.FC<Props> = ({ visit }) => {
|
|
11
10
|
return (
|
|
12
11
|
<ExtensionSlot
|
|
13
12
|
name="visit-detail-overview-actions"
|
|
14
13
|
className={styles.visitActions}
|
|
15
|
-
state={{ patientUuid: visit.patient.uuid,
|
|
14
|
+
state={{ patientUuid: visit.patient.uuid, visit, compact: true }}
|
|
16
15
|
/>
|
|
17
16
|
);
|
|
18
17
|
};
|
|
@@ -27,13 +27,12 @@ import styles from './visit-history-table.scss';
|
|
|
27
27
|
|
|
28
28
|
interface VisitHistoryTableProps {
|
|
29
29
|
patientUuid: string;
|
|
30
|
-
patient: fhir.Patient;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* This show a list of visit histories in the visit tab in patient chart
|
|
35
34
|
*/
|
|
36
|
-
const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid
|
|
35
|
+
const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid }) => {
|
|
37
36
|
const defaultPageSize = 10;
|
|
38
37
|
const [pageSize, setPageSize] = useState(defaultPageSize);
|
|
39
38
|
const pageSizes = [10, 20, 30, 40, 50];
|
|
@@ -55,7 +54,7 @@ const VisitHistoryTable: React.FC<VisitHistoryTableProps> = ({ patientUuid, pati
|
|
|
55
54
|
const rowData = visits?.map((visit) => {
|
|
56
55
|
const row: Record<string, JSX.Element | string> = { id: visit.uuid };
|
|
57
56
|
for (const { key, CellComponent } of columns) {
|
|
58
|
-
row[key] = <CellComponent key={key} visit={visit}
|
|
57
|
+
row[key] = <CellComponent key={key} visit={visit} />;
|
|
59
58
|
}
|
|
60
59
|
return row;
|
|
61
60
|
});
|
|
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
4
4
|
import { mockCurrentVisit } from '__mocks__';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { mockPatient } from 'tools';
|
|
7
|
-
import DeleteVisitDialog from './delete-visit-dialog.
|
|
7
|
+
import DeleteVisitDialog from './delete-visit-dialog.component';
|
|
8
8
|
|
|
9
9
|
const mockCloseModal = jest.fn();
|
|
10
10
|
const mockOpenmrsFetch = jest.mocked(openmrsFetch);
|
package/src/visit/visit-prompt/{end-visit-dialog.modal.tsx → end-visit-dialog.component.tsx}
RENAMED
|
@@ -35,7 +35,7 @@ const EndVisitDialog: React.FC<EndVisitDialogProps> = ({ patientUuid, closeModal
|
|
|
35
35
|
mutate();
|
|
36
36
|
window.dispatchEvent(new CustomEvent('queue-entry-updated'));
|
|
37
37
|
closeModal();
|
|
38
|
-
if (visitContext?.uuid
|
|
38
|
+
if (visitContext?.uuid === activeVisit.uuid) {
|
|
39
39
|
setVisitContext(null, null);
|
|
40
40
|
}
|
|
41
41
|
showSnackbar({
|
|
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
3
3
|
import { screen, render } from '@testing-library/react';
|
|
4
4
|
import { showSnackbar, updateVisit, useVisit, type Visit, type FetchResponse } from '@openmrs/esm-framework';
|
|
5
5
|
import { mockCurrentVisit } from '__mocks__';
|
|
6
|
-
import EndVisitDialog from './end-visit-dialog.
|
|
6
|
+
import EndVisitDialog from './end-visit-dialog.component';
|
|
7
7
|
import { usePatientChartStore } from '@openmrs/esm-patient-common-lib';
|
|
8
8
|
|
|
9
9
|
const endVisitPayload = {
|
package/src/visit/visit-prompt/{start-visit-dialog.modal.tsx → start-visit-dialog.component.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
|
|
4
|
-
import {
|
|
4
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
|
5
5
|
import { launchPatientChartWithWorkspaceOpen } from '@openmrs/esm-patient-common-lib';
|
|
6
6
|
import styles from './start-visit-dialog.scss';
|
|
7
7
|
|
|
@@ -9,15 +9,9 @@ interface StartVisitDialogProps {
|
|
|
9
9
|
patientUuid: string;
|
|
10
10
|
closeModal: () => void;
|
|
11
11
|
launchPatientChart?: boolean;
|
|
12
|
-
onVisitStarted?: () => void;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
const StartVisitDialog: React.FC<StartVisitDialogProps> = ({
|
|
16
|
-
patientUuid,
|
|
17
|
-
closeModal,
|
|
18
|
-
launchPatientChart,
|
|
19
|
-
onVisitStarted,
|
|
20
|
-
}) => {
|
|
14
|
+
const StartVisitDialog: React.FC<StartVisitDialogProps> = ({ patientUuid, closeModal, launchPatientChart }) => {
|
|
21
15
|
const { t } = useTranslation();
|
|
22
16
|
|
|
23
17
|
const handleStartNewVisit = useCallback(() => {
|
|
@@ -28,11 +22,11 @@ const StartVisitDialog: React.FC<StartVisitDialogProps> = ({
|
|
|
28
22
|
additionalProps: { openedFrom: 'patient-chart-start-visit' },
|
|
29
23
|
});
|
|
30
24
|
} else {
|
|
31
|
-
|
|
25
|
+
launchWorkspace('start-visit-workspace-form', { openedFrom: 'patient-chart-start-visit' });
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
closeModal();
|
|
35
|
-
}, [closeModal, patientUuid, launchPatientChart
|
|
29
|
+
}, [closeModal, patientUuid, launchPatientChart]);
|
|
36
30
|
|
|
37
31
|
const modalHeaderText = t('noActiveVisit', 'No active visit');
|
|
38
32
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import {
|
|
5
|
-
import StartVisitDialog from './start-visit-dialog.
|
|
4
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
|
5
|
+
import StartVisitDialog from './start-visit-dialog.component';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
8
8
|
patientUuid: 'some-uuid',
|
|
@@ -10,7 +10,7 @@ const defaultProps = {
|
|
|
10
10
|
visitType: null,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const mockLaunchWorkspace = jest.mocked(
|
|
13
|
+
const mockLaunchWorkspace = jest.mocked(launchWorkspace);
|
|
14
14
|
|
|
15
15
|
describe('StartVisit', () => {
|
|
16
16
|
test('should launch start visit form', async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
3
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
|
4
4
|
import { CardHeader, EmptyState, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
|
|
5
5
|
import VisitSummary from './past-visits-components/visit-summary.component';
|
|
6
6
|
import styles from './current-visit-summary.scss';
|
|
@@ -25,9 +25,9 @@ const CurrentVisitSummary: React.FC<CurrentVisitSummaryProps> = ({ patientUuid }
|
|
|
25
25
|
return (
|
|
26
26
|
<EmptyState
|
|
27
27
|
headerTitle={t('currentVisit', 'Current visit')}
|
|
28
|
-
displayText={t('
|
|
28
|
+
displayText={t('activeVisits__lower', 'active visits')}
|
|
29
29
|
launchForm={() =>
|
|
30
|
-
|
|
30
|
+
launchWorkspace('start-visit-workspace-form', { openedFrom: 'patient-chart-current-visit-summary' })
|
|
31
31
|
}
|
|
32
32
|
/>
|
|
33
33
|
);
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
EditIcon,
|
|
29
29
|
isDesktop,
|
|
30
|
-
|
|
30
|
+
launchWorkspace,
|
|
31
31
|
showModal,
|
|
32
32
|
showSnackbar,
|
|
33
33
|
TrashCanIcon,
|
|
@@ -35,11 +35,17 @@ import {
|
|
|
35
35
|
useLayoutType,
|
|
36
36
|
userHasAccess,
|
|
37
37
|
useSession,
|
|
38
|
+
useVisit,
|
|
38
39
|
type EncounterType,
|
|
39
40
|
ExtensionSlot,
|
|
40
41
|
useFeatureFlag,
|
|
41
42
|
} from '@openmrs/esm-framework';
|
|
42
|
-
import {
|
|
43
|
+
import {
|
|
44
|
+
type HtmlFormEntryForm,
|
|
45
|
+
launchFormEntryOrHtmlForms,
|
|
46
|
+
invalidateVisitAndEncounterData,
|
|
47
|
+
usePatientChartStore,
|
|
48
|
+
} from '@openmrs/esm-patient-common-lib';
|
|
43
49
|
import { jsonSchemaResourceName } from '../../../../constants';
|
|
44
50
|
import {
|
|
45
51
|
deleteEncounter,
|
|
@@ -80,7 +86,12 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
|
|
|
80
86
|
const responsiveSize = desktopLayout ? 'sm' : 'lg';
|
|
81
87
|
const { data: encounterTypes, isLoading: isLoadingEncounterTypes } = useEncounterTypes();
|
|
82
88
|
const enableEmbeddedFormView = useFeatureFlag('enable-embedded-form-view');
|
|
89
|
+
|
|
83
90
|
const { encounterEditableDuration, encounterEditableDurationOverridePrivileges } = useConfig<ChartConfig>();
|
|
91
|
+
const formsConfig: { htmlFormEntryForms: HtmlFormEntryForm[] } = useConfig({
|
|
92
|
+
externalModuleName: '@openmrs/esm-patient-forms-app',
|
|
93
|
+
});
|
|
94
|
+
const { htmlFormEntryForms } = formsConfig;
|
|
84
95
|
const paginatedMappedEncounters = useMemo(
|
|
85
96
|
() => (paginatedEncounters ?? []).map(mapEncounter).filter(Boolean),
|
|
86
97
|
[paginatedEncounters],
|
|
@@ -259,16 +270,22 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
|
|
|
259
270
|
itemText={t('editThisEncounter', 'Edit this encounter')}
|
|
260
271
|
onClick={() => {
|
|
261
272
|
if (isVisitNoteEncounter(encounter)) {
|
|
262
|
-
|
|
273
|
+
launchWorkspace('visit-notes-form-workspace', {
|
|
263
274
|
encounter,
|
|
264
275
|
formContext: 'editing',
|
|
265
276
|
patientUuid,
|
|
266
277
|
});
|
|
267
278
|
} else {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
279
|
+
launchFormEntryOrHtmlForms(
|
|
280
|
+
htmlFormEntryForms,
|
|
281
|
+
patientUuid,
|
|
282
|
+
encounter.form,
|
|
283
|
+
encounter.visitUuid,
|
|
284
|
+
encounter.id,
|
|
285
|
+
encounter.visitTypeUuid,
|
|
286
|
+
encounter.visitStartDatetime,
|
|
287
|
+
encounter.visitStopDatetime,
|
|
288
|
+
);
|
|
272
289
|
}
|
|
273
290
|
}}
|
|
274
291
|
/>
|
|
@@ -310,16 +327,22 @@ const EncountersTable: React.FC<EncountersTableProps> = ({
|
|
|
310
327
|
kind="ghost"
|
|
311
328
|
onClick={() => {
|
|
312
329
|
if (isVisitNoteEncounter(encounter)) {
|
|
313
|
-
|
|
330
|
+
launchWorkspace('visit-notes-form-workspace', {
|
|
314
331
|
encounter,
|
|
315
332
|
formContext: 'editing',
|
|
316
333
|
patientUuid,
|
|
317
334
|
});
|
|
318
335
|
} else {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
336
|
+
launchFormEntryOrHtmlForms(
|
|
337
|
+
htmlFormEntryForms,
|
|
338
|
+
patientUuid,
|
|
339
|
+
encounter.form,
|
|
340
|
+
encounter.visitUuid,
|
|
341
|
+
encounter.id,
|
|
342
|
+
encounter.visitTypeUuid,
|
|
343
|
+
encounter.visitStartDatetime,
|
|
344
|
+
encounter.visitStopDatetime,
|
|
345
|
+
);
|
|
323
346
|
}
|
|
324
347
|
}}
|
|
325
348
|
renderIcon={(props: ComponentProps<typeof EditIcon>) => (
|
|
@@ -5,7 +5,7 @@ import { Button, ModalBody, ModalFooter, ModalHeader, RadioButton, InlineLoading
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import {
|
|
7
7
|
ErrorState,
|
|
8
|
-
|
|
8
|
+
launchWorkspace,
|
|
9
9
|
OpenmrsDatePicker,
|
|
10
10
|
useDebounce,
|
|
11
11
|
useOnVisible,
|
|
@@ -51,7 +51,7 @@ const VisitContextSwitcherModal: React.FC<VisitContextSwitcherProps> = ({
|
|
|
51
51
|
|
|
52
52
|
const openStartVisitWorkspace = () => {
|
|
53
53
|
closeModal();
|
|
54
|
-
|
|
54
|
+
launchWorkspace('start-visit-workspace-form', {
|
|
55
55
|
openedFrom: 'visit-context-switcher',
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -6,35 +6,18 @@ import { mockCurrentVisit, mockVisit2, mockVisit3 } from '__mocks__';
|
|
|
6
6
|
import { useInfiniteVisits } from '../visit.resource';
|
|
7
7
|
import VisitContextSwitcherModal from './visit-context-switcher.modal';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
errorFetchingSystemVisitSetting: null,
|
|
11
|
-
isLoadingSystemVisitSetting: false,
|
|
12
|
-
systemVisitEnabled: true,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const mockUseInfiniteVisits = jest.fn(useInfiniteVisits).mockReturnValue({
|
|
16
|
-
visits: [mockCurrentVisit, mockVisit2, mockVisit3],
|
|
17
|
-
error: null,
|
|
18
|
-
mutate: jest.fn(),
|
|
19
|
-
isValidating: false,
|
|
20
|
-
isLoading: false,
|
|
21
|
-
totalCount: 3,
|
|
22
|
-
hasMore: false,
|
|
23
|
-
loadMore: jest.fn(),
|
|
24
|
-
nextUri: '',
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
jest.mock('@openmrs/esm-patient-common-lib/src/useSystemVisitSetting', () => ({
|
|
28
|
-
useSystemVisitSetting: () => mockUseSystemVisitSetting(),
|
|
29
|
-
}));
|
|
9
|
+
const mockUseInfiniteVisits = jest.fn(useInfiniteVisits);
|
|
30
10
|
|
|
31
11
|
jest.mock('../visit.resource', () => ({
|
|
32
12
|
useInfiniteVisits: () => mockUseInfiniteVisits('some-uuid'),
|
|
33
13
|
}));
|
|
34
14
|
|
|
35
15
|
const mockSetVisitContext = jest.fn();
|
|
16
|
+
const mockUseSystemVisitSetting = jest.fn(useSystemVisitSetting);
|
|
17
|
+
|
|
36
18
|
jest.mock('@openmrs/esm-patient-common-lib', () => ({
|
|
37
19
|
...jest.requireActual('@openmrs/esm-patient-common-lib'),
|
|
20
|
+
useSystemVisitSetting: jest.fn(),
|
|
38
21
|
usePatientChartStore: jest.fn(() => ({
|
|
39
22
|
visitContext: null,
|
|
40
23
|
setVisitContext: mockSetVisitContext,
|
|
@@ -43,7 +26,22 @@ jest.mock('@openmrs/esm-patient-common-lib', () => ({
|
|
|
43
26
|
|
|
44
27
|
describe('VisitContextSwitcherModal', () => {
|
|
45
28
|
beforeEach(() => {
|
|
46
|
-
|
|
29
|
+
mockUseInfiniteVisits.mockReturnValue({
|
|
30
|
+
visits: [mockCurrentVisit, mockVisit2, mockVisit3],
|
|
31
|
+
error: null,
|
|
32
|
+
mutate: jest.fn(),
|
|
33
|
+
isValidating: false,
|
|
34
|
+
isLoading: false,
|
|
35
|
+
totalCount: 3,
|
|
36
|
+
hasMore: false,
|
|
37
|
+
loadMore: jest.fn(),
|
|
38
|
+
nextUri: '',
|
|
39
|
+
});
|
|
40
|
+
mockUseSystemVisitSetting.mockReturnValue({
|
|
41
|
+
errorFetchingSystemVisitSetting: null,
|
|
42
|
+
isLoadingSystemVisitSetting: false,
|
|
43
|
+
systemVisitEnabled: true,
|
|
44
|
+
});
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
it('should display a list of past visits', () => {
|
|
@@ -9,10 +9,9 @@ import styles from './visit-detail-overview.scss';
|
|
|
9
9
|
|
|
10
10
|
interface VisitOverviewComponentProps {
|
|
11
11
|
patientUuid: string;
|
|
12
|
-
patient: fhir.Patient;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
function VisitDetailOverviewComponent({ patientUuid
|
|
14
|
+
function VisitDetailOverviewComponent({ patientUuid }: VisitOverviewComponentProps) {
|
|
16
15
|
const { t } = useTranslation();
|
|
17
16
|
const [tabIndex, setTabIndex] = useState(0);
|
|
18
17
|
const { showAllEncountersTab } = useConfig<ChartConfig>();
|
|
@@ -34,7 +33,7 @@ function VisitDetailOverviewComponent({ patientUuid, patient }: VisitOverviewCom
|
|
|
34
33
|
</TabList>
|
|
35
34
|
<TabPanels>
|
|
36
35
|
<TabPanel>
|
|
37
|
-
<VisitHistoryTable patientUuid={patientUuid}
|
|
36
|
+
<VisitHistoryTable patientUuid={patientUuid} />
|
|
38
37
|
</TabPanel>
|
|
39
38
|
{showAllEncountersTab && (
|
|
40
39
|
<TabPanel>
|
|
@@ -82,7 +82,7 @@ describe('VisitDetailOverview', () => {
|
|
|
82
82
|
});
|
|
83
83
|
mockGetConfig.mockResolvedValue({ htmlFormEntryForms: [] });
|
|
84
84
|
|
|
85
|
-
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id}
|
|
85
|
+
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
|
|
86
86
|
|
|
87
87
|
await waitForLoadingToFinish();
|
|
88
88
|
|
|
@@ -106,7 +106,7 @@ describe('VisitDetailOverview', () => {
|
|
|
106
106
|
error,
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id}
|
|
109
|
+
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
|
|
110
110
|
|
|
111
111
|
await waitForLoadingToFinish();
|
|
112
112
|
|
|
@@ -125,7 +125,7 @@ describe('VisitDetailOverview', () => {
|
|
|
125
125
|
});
|
|
126
126
|
mockUsePaginatedVisits.mockReturnValue(mockPaginatedVisitsData);
|
|
127
127
|
|
|
128
|
-
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id}
|
|
128
|
+
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
|
|
129
129
|
|
|
130
130
|
await waitForLoadingToFinish();
|
|
131
131
|
|
|
@@ -161,7 +161,7 @@ describe('VisitDetailOverview', () => {
|
|
|
161
161
|
});
|
|
162
162
|
mockUsePaginatedVisits.mockReturnValue(mockPaginatedVisitsData);
|
|
163
163
|
|
|
164
|
-
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id}
|
|
164
|
+
renderWithSwr(<VisitDetailOverview patientUuid={mockPatient.id} />);
|
|
165
165
|
|
|
166
166
|
await waitForLoadingToFinish();
|
|
167
167
|
|
package/translations/am.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dosingInstructions": "Dosing Instructions",
|
|
39
39
|
"editEncounter": "Edit",
|
|
40
40
|
"editThisEncounter": "Edit this encounter",
|
|
41
|
+
"editVisit": "Edit visit",
|
|
41
42
|
"editVisitDetails": "Edit visit details",
|
|
42
43
|
"emptyStateText": "There are no {{displayText}} to display for this patient",
|
|
43
44
|
"enable": "Enable",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"errorUpdatingVisitAttribute": "Could not update {{attributeName}} attribute",
|
|
76
77
|
"errorUpdatingVisitDetails": "Error updating visit details",
|
|
77
78
|
"errorWhenRestoringVisit": "Error occurred when restoring {{visit}}",
|
|
78
|
-
"failedToLoadCurrentVisit": "Failed loading current visit",
|
|
79
79
|
"fieldRequired": "This field is required",
|
|
80
80
|
"filterByEncounterType": "Filter by encounter type",
|
|
81
81
|
"form": "Form name",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"indication": "Indication",
|
|
86
86
|
"inThePast": "In the past",
|
|
87
87
|
"loading": "Loading",
|
|
88
|
-
"loadingVisit": "Loading current visit...",
|
|
89
88
|
"markAliveSuccessfully": "Patient marked alive successfully",
|
|
90
89
|
"markDeceasedWarning": "Marking the patient as deceased will end any active visits for this patient",
|
|
91
90
|
"markPatientAlive": "Mark patient alive",
|
package/translations/ar.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dosingInstructions": "Dosing Instructions",
|
|
39
39
|
"editEncounter": "Edit",
|
|
40
40
|
"editThisEncounter": "تعديل هذا اللقاء",
|
|
41
|
+
"editVisit": "Edit visit",
|
|
41
42
|
"editVisitDetails": "Edit visit details",
|
|
42
43
|
"emptyStateText": "لا يوجد {{displayText}} لعرضه لهذا المريض",
|
|
43
44
|
"enable": "Enable",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"errorUpdatingVisitAttribute": "Could not update {{attributeName}} attribute",
|
|
76
77
|
"errorUpdatingVisitDetails": "Error updating visit details",
|
|
77
78
|
"errorWhenRestoringVisit": "Error occurred when restoring {{visit}}",
|
|
78
|
-
"failedToLoadCurrentVisit": "فشل في تحميل الزيارة الحالية",
|
|
79
79
|
"fieldRequired": "This field is required",
|
|
80
80
|
"filterByEncounterType": "تصفية حسب نوع اللقاء",
|
|
81
81
|
"form": "Form name",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"indication": "دلالة",
|
|
86
86
|
"inThePast": "In the past",
|
|
87
87
|
"loading": "جار التحميل",
|
|
88
|
-
"loadingVisit": "جار تحميل الزيارة الحالية...",
|
|
89
88
|
"markAliveSuccessfully": "Patient marked alive successfully",
|
|
90
89
|
"markDeceasedWarning": "Marking the patient as deceased will end any active visits for this patient",
|
|
91
90
|
"markPatientAlive": "Mark patient alive",
|
|
@@ -99,7 +98,7 @@
|
|
|
99
98
|
"nextPage": "Next page",
|
|
100
99
|
"no": "لا",
|
|
101
100
|
"noActiveVisit": "لا يوجد زيارة نشطة",
|
|
102
|
-
"noActiveVisitMessage": "
|
|
101
|
+
"noActiveVisitMessage": "active visit",
|
|
103
102
|
"noActiveVisitNoRDEText": "لا يمكنك إضافة بيانات إلى السجل الطبي للمريض بدون زيارة نشطة. هل ترغب في بدء زيارة جديدة؟",
|
|
104
103
|
"noDiagnosesFound": "لم يتم العثور على تشخيصات",
|
|
105
104
|
"noEncountersToDisplay": "لا يوجد لقاءات لعرضها",
|
package/translations/ar_SY.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dosingInstructions": "Dosing Instructions",
|
|
39
39
|
"editEncounter": "Edit",
|
|
40
40
|
"editThisEncounter": "Edit this encounter",
|
|
41
|
+
"editVisit": "Edit visit",
|
|
41
42
|
"editVisitDetails": "Edit visit details",
|
|
42
43
|
"emptyStateText": "There are no {{displayText}} to display for this patient",
|
|
43
44
|
"enable": "Enable",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"errorUpdatingVisitAttribute": "Could not update {{attributeName}} attribute",
|
|
76
77
|
"errorUpdatingVisitDetails": "Error updating visit details",
|
|
77
78
|
"errorWhenRestoringVisit": "Error occurred when restoring {{visit}}",
|
|
78
|
-
"failedToLoadCurrentVisit": "Failed loading current visit",
|
|
79
79
|
"fieldRequired": "This field is required",
|
|
80
80
|
"filterByEncounterType": "Filter by encounter type",
|
|
81
81
|
"form": "Form name",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"indication": "Indication",
|
|
86
86
|
"inThePast": "In the past",
|
|
87
87
|
"loading": "Loading",
|
|
88
|
-
"loadingVisit": "Loading current visit...",
|
|
89
88
|
"markAliveSuccessfully": "Patient marked alive successfully",
|
|
90
89
|
"markDeceasedWarning": "Marking the patient as deceased will end any active visits for this patient",
|
|
91
90
|
"markPatientAlive": "Mark patient alive",
|
package/translations/bn.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dosingInstructions": "Dosing Instructions",
|
|
39
39
|
"editEncounter": "Edit",
|
|
40
40
|
"editThisEncounter": "Edit this encounter",
|
|
41
|
+
"editVisit": "Edit visit",
|
|
41
42
|
"editVisitDetails": "Edit visit details",
|
|
42
43
|
"emptyStateText": "There are no {{displayText}} to display for this patient",
|
|
43
44
|
"enable": "Enable",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"errorUpdatingVisitAttribute": "Could not update {{attributeName}} attribute",
|
|
76
77
|
"errorUpdatingVisitDetails": "Error updating visit details",
|
|
77
78
|
"errorWhenRestoringVisit": "Error occurred when restoring {{visit}}",
|
|
78
|
-
"failedToLoadCurrentVisit": "Failed loading current visit",
|
|
79
79
|
"fieldRequired": "This field is required",
|
|
80
80
|
"filterByEncounterType": "Filter by encounter type",
|
|
81
81
|
"form": "Form name",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"indication": "Indication",
|
|
86
86
|
"inThePast": "In the past",
|
|
87
87
|
"loading": "Loading",
|
|
88
|
-
"loadingVisit": "Loading current visit...",
|
|
89
88
|
"markAliveSuccessfully": "Patient marked alive successfully",
|
|
90
89
|
"markDeceasedWarning": "Marking the patient as deceased will end any active visits for this patient",
|
|
91
90
|
"markPatientAlive": "Mark patient alive",
|