@kenyaemr/esm-ward-app 7.0.3-pre.89 → 8.0.1-pre.95
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 +24 -16
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/169.js +1 -0
- package/dist/169.js.map +1 -0
- package/dist/269.js +1 -0
- package/dist/269.js.map +1 -0
- package/dist/346.js +1 -0
- package/dist/346.js.map +1 -0
- package/dist/348.js +1 -0
- package/dist/348.js.map +1 -0
- package/dist/466.js +1 -0
- package/dist/466.js.map +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/577.js +1 -0
- package/dist/577.js.map +1 -0
- package/dist/659.js +1 -0
- package/dist/659.js.map +1 -0
- package/dist/749.js +1 -0
- package/dist/749.js.map +1 -0
- package/dist/76.js +1 -0
- package/dist/76.js.map +1 -0
- package/dist/767.js +1 -0
- package/dist/767.js.map +1 -0
- package/dist/793.js +2 -0
- package/dist/793.js.map +1 -0
- package/dist/803.js +1 -0
- package/dist/803.js.map +1 -0
- package/dist/940.js +1 -0
- package/dist/940.js.map +1 -0
- package/dist/960.js +1 -0
- package/dist/960.js.map +1 -0
- package/dist/kenyaemr-esm-ward-app.js +1 -1
- package/dist/kenyaemr-esm-ward-app.js.buildmanifest.json +330 -42
- package/dist/kenyaemr-esm-ward-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 +3 -3
- package/src/action-menu-buttons/transfer-workspace-siderail.component.tsx +27 -0
- package/src/beds/empty-bed.component.tsx +1 -1
- package/src/beds/empty-bed.scss +6 -6
- package/src/beds/occupied-bed.component.tsx +5 -5
- package/src/beds/occupied-bed.scss +2 -3
- package/src/beds/occupied-bed.test.tsx +37 -21
- package/src/beds/unassigned-patient.component.tsx +20 -0
- package/src/beds/unassigned-patient.scss +6 -0
- package/src/config-schema-admission-request-note.ts +9 -0
- package/src/config-schema-extension-colored-obs-tags.ts +91 -0
- package/src/config-schema.ts +165 -231
- package/src/createDashboardLink.component.tsx +42 -0
- package/src/hooks/useAdmissionLocation.ts +12 -7
- package/src/hooks/useCurrentWardCardConfig.ts +32 -0
- package/src/hooks/useEmrConfiguration.ts +112 -0
- package/src/hooks/useInpatientAdmission.ts +28 -0
- package/src/hooks/useInpatientRequest.ts +39 -9
- package/src/hooks/useLocation.test.ts +38 -0
- package/src/hooks/useLocation.ts +9 -0
- package/src/hooks/useLocations.ts +54 -0
- package/src/hooks/useMostRecentObs.ts +27 -0
- package/src/hooks/useRestPatient.ts +18 -0
- package/src/hooks/useWardLocation.test.ts +108 -0
- package/src/hooks/useWardLocation.ts +26 -0
- package/src/index.ts +71 -4
- package/src/location-selector/location-selector.component.tsx +118 -0
- package/src/location-selector/location-selector.scss +48 -0
- package/src/root.component.tsx +2 -1
- package/src/routes.json +79 -12
- package/src/types/index.ts +87 -46
- package/src/ward-patient-card/card-rows/admission-request-note.extension.tsx +27 -0
- package/src/ward-patient-card/card-rows/colored-obs-tags-card-row.extension.tsx +13 -0
- package/src/ward-patient-card/row-elements/ward-patient-age.tsx +7 -13
- package/src/ward-patient-card/row-elements/ward-patient-bed-number.tsx +2 -2
- package/src/ward-patient-card/row-elements/ward-patient-coded-obs-tags.tsx +51 -50
- package/src/ward-patient-card/row-elements/ward-patient-gender.component.tsx +27 -0
- package/src/ward-patient-card/row-elements/ward-patient-header-address.tsx +16 -15
- package/src/ward-patient-card/row-elements/ward-patient-identifier.tsx +53 -0
- package/src/ward-patient-card/row-elements/ward-patient-name.tsx +7 -7
- package/src/ward-patient-card/row-elements/ward-patient-obs.resource.ts +4 -4
- package/src/ward-patient-card/row-elements/ward-patient-obs.tsx +45 -44
- package/src/ward-patient-card/row-elements/ward-patient-time-on-ward.tsx +22 -0
- package/src/ward-patient-card/row-elements/ward-patient-time-since-admission.tsx +22 -0
- package/src/ward-patient-card/ward-patient-card-element.component.tsx +65 -0
- package/src/ward-patient-card/ward-patient-card.component.tsx +64 -0
- package/src/ward-patient-card/ward-patient-card.scss +61 -12
- package/src/ward-patient-workspace/ward-patient-action-button.extension.tsx +18 -0
- package/src/ward-patient-workspace/ward-patient.style.scss +11 -0
- package/src/ward-patient-workspace/ward-patient.workspace.tsx +51 -0
- package/src/ward-view/ward-bed.component.tsx +0 -1
- package/src/ward-view/ward-view.component.tsx +114 -76
- package/src/ward-view/ward-view.resource.ts +2 -2
- package/src/ward-view/ward-view.scss +4 -4
- package/src/ward-view/ward-view.test.tsx +76 -49
- package/src/ward-view-header/admission-requests-bar.component.tsx +29 -28
- package/src/ward-view-header/admission-requests-bar.test.tsx +11 -15
- package/src/ward-view-header/admission-requests.scss +20 -25
- package/src/ward-view-header/ward-view-header.component.tsx +7 -7
- package/src/ward-view-header/ward-view-header.scss +2 -2
- package/src/ward-workspace/admission-request-card/admission-request-card-actions.component.tsx +29 -0
- package/src/ward-workspace/admission-request-card/admission-request-card-header.component.tsx +51 -0
- package/src/ward-workspace/admission-request-card/admission-request-card.component.tsx +16 -0
- package/src/ward-workspace/admission-request-card/admission-request-card.scss +49 -0
- package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.scss +12 -0
- package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.test.tsx +48 -0
- package/src/ward-workspace/admission-request-workspace/admission-requests.workspace.tsx +61 -0
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.scss +35 -0
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.test.tsx +341 -0
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.workspace.tsx +267 -0
- package/src/ward-workspace/admit-patient-form-workspace/types.ts +7 -0
- package/src/ward-workspace/patient-banner/patient-banner.component.tsx +29 -0
- package/src/ward-workspace/patient-banner/style.scss +23 -0
- package/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx +210 -0
- package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-request-form.component.tsx +238 -0
- package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.scss +73 -0
- package/src/ward-workspace/patient-transfer-bed-swap/patient-transfer-swap.workspace.tsx +44 -0
- package/src/ward-workspace/ward-patient-notes/form/notes-form.component.tsx +180 -0
- package/src/ward-workspace/ward-patient-notes/form/notes-form.scss +30 -0
- package/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx +116 -0
- package/src/ward-workspace/ward-patient-notes/history/note.component.tsx +53 -0
- package/src/ward-workspace/ward-patient-notes/history/notes-container.component.tsx +55 -0
- package/src/ward-workspace/ward-patient-notes/history/notes-container.test.tsx +84 -0
- package/src/ward-workspace/ward-patient-notes/history/styles.scss +61 -0
- package/src/ward-workspace/ward-patient-notes/notes-action-button.extension.tsx +18 -0
- package/src/ward-workspace/ward-patient-notes/notes.resource.ts +71 -0
- package/src/ward-workspace/ward-patient-notes/notes.workspace.tsx +25 -0
- package/src/ward-workspace/ward-patient-notes/types.ts +44 -0
- package/src/ward.resource.ts +25 -0
- package/translations/en.json +63 -2
- package/dist/443.js +0 -1
- package/dist/443.js.map +0 -1
- package/dist/589.js +0 -1
- package/dist/589.js.map +0 -1
- package/dist/695.js +0 -2
- package/dist/695.js.map +0 -1
- package/src/hooks/useAdmittedPatients.ts +0 -13
- package/src/ward-patient-card/row-elements/row-elements.scss +0 -16
- package/src/ward-patient-card/ward-patient-card-row.resources.tsx +0 -92
- package/src/ward-patient-card/ward-patient-card.tsx +0 -20
- package/src/ward-workspace/admission-request-card.component.tsx +0 -23
- package/src/ward-workspace/admission-request-card.scss +0 -34
- package/src/ward-workspace/admission-request-workspace.test.tsx +0 -38
- package/src/ward-workspace/admission-requests-workspace.component.tsx +0 -21
- package/src/ward-workspace/admission-requests-workspace.scss +0 -13
- /package/dist/{695.js.LICENSE.txt → 793.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type PatientNote } from '../types';
|
|
3
|
+
import { SkeletonText, Tag, Tile } from '@carbon/react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import styles from './styles.scss';
|
|
7
|
+
|
|
8
|
+
export const InPatientNoteSkeleton: React.FC = () => {
|
|
9
|
+
return (
|
|
10
|
+
<Tile className={styles.noteTile} data-testid="in-patient-note-skeleton">
|
|
11
|
+
<div className={styles.noteHeader}>
|
|
12
|
+
<SkeletonText heading width="30%" />
|
|
13
|
+
<SkeletonText width="20%" />
|
|
14
|
+
</div>
|
|
15
|
+
<SkeletonText width="15%" />
|
|
16
|
+
<SkeletonText width="100%" />
|
|
17
|
+
<SkeletonText width="80%" />
|
|
18
|
+
</Tile>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
interface InPatientNoteProps {
|
|
23
|
+
note: PatientNote;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const InPatientNote: React.FC<InPatientNoteProps> = ({ note }) => {
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const formattedDate = note.encounterNoteRecordedAt
|
|
29
|
+
? dayjs(note.encounterNoteRecordedAt).format('dddd, D MMM YYYY')
|
|
30
|
+
: '';
|
|
31
|
+
const formattedTime = note.encounterNoteRecordedAt ? dayjs(note.encounterNoteRecordedAt).format('HH:mm') : '';
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Tile className={styles.noteTile}>
|
|
35
|
+
<div className={styles.noteHeader}>
|
|
36
|
+
<span className={styles.noteProviderRole}>{t('note', 'Note')}</span>
|
|
37
|
+
<span className={styles.noteDateAndTime}>
|
|
38
|
+
{formattedDate}, {formattedTime}
|
|
39
|
+
</span>
|
|
40
|
+
</div>
|
|
41
|
+
{note.diagnoses &&
|
|
42
|
+
note.diagnoses.split(',').map((diagnosis, index) => (
|
|
43
|
+
<Tag key={index} type="red">
|
|
44
|
+
{diagnosis.trim()}
|
|
45
|
+
</Tag>
|
|
46
|
+
))}
|
|
47
|
+
<div className={styles.noteBody}>{note.encounterNote}</div>
|
|
48
|
+
<div className={styles.noteProviderName}>{note.encounterProvider}</div>
|
|
49
|
+
</Tile>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default InPatientNote;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { type PatientUuid } from '@openmrs/esm-framework';
|
|
4
|
+
import { usePatientNotes } from '../notes.resource';
|
|
5
|
+
import InPatientNote, { InPatientNoteSkeleton } from './note.component';
|
|
6
|
+
import styles from './styles.scss';
|
|
7
|
+
import { InlineNotification } from '@carbon/react';
|
|
8
|
+
import useEmrConfiguration from '../../../hooks/useEmrConfiguration';
|
|
9
|
+
|
|
10
|
+
interface PatientNotesHistoryProps {
|
|
11
|
+
patientUuid: PatientUuid;
|
|
12
|
+
visitUuid: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const PatientNotesHistory: React.FC<PatientNotesHistoryProps> = ({ patientUuid, visitUuid }) => {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
const { emrConfiguration, isLoadingEmrConfiguration, errorFetchingEmrConfiguration } = useEmrConfiguration();
|
|
18
|
+
|
|
19
|
+
const { patientNotes, isLoadingPatientNotes, errorFetchingPatientNotes } = usePatientNotes(
|
|
20
|
+
patientUuid,
|
|
21
|
+
visitUuid,
|
|
22
|
+
emrConfiguration?.visitNoteEncounterType?.uuid,
|
|
23
|
+
emrConfiguration?.consultFreeTextCommentsConcept.uuid,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const isLoading = isLoadingPatientNotes || isLoadingEmrConfiguration;
|
|
27
|
+
|
|
28
|
+
if (!isLoading && patientNotes.length === 0 && !errorFetchingPatientNotes) return null;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={styles.notesContainer}>
|
|
32
|
+
<div className={styles.notesContainerHeader}>
|
|
33
|
+
<div className={styles.notesContainerTitle}>History</div>
|
|
34
|
+
</div>
|
|
35
|
+
{isLoading ? [1, 2, 3, 4].map((item, index) => <InPatientNoteSkeleton key={index} />) : null}
|
|
36
|
+
{patientNotes.map((patientNote) => (
|
|
37
|
+
<InPatientNote key={patientNote.id} note={patientNote} />
|
|
38
|
+
))}
|
|
39
|
+
{errorFetchingPatientNotes && (
|
|
40
|
+
<InlineNotification
|
|
41
|
+
kind="error"
|
|
42
|
+
title={t('patientNotesDidntLoad', "Patient notes didn't load")}
|
|
43
|
+
subtitle={t(
|
|
44
|
+
'fetchingPatientNotesFailed',
|
|
45
|
+
'Fetching patient notes failed. Try refreshing the page or contact your system administrator.',
|
|
46
|
+
)}
|
|
47
|
+
lowContrast
|
|
48
|
+
hideCloseButton
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default PatientNotesHistory;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import PatientNotesHistory from './notes-container.component';
|
|
4
|
+
import { usePatientNotes } from '../notes.resource';
|
|
5
|
+
import useEmrConfiguration from '../../../hooks/useEmrConfiguration';
|
|
6
|
+
import { emrConfigurationMock } from '__mocks__';
|
|
7
|
+
|
|
8
|
+
const mockedUseEmrConfiguration = jest.mocked(useEmrConfiguration);
|
|
9
|
+
|
|
10
|
+
jest.mock('../../../hooks/useEmrConfiguration', () => jest.fn());
|
|
11
|
+
|
|
12
|
+
jest.mock('../notes.resource', () => ({
|
|
13
|
+
usePatientNotes: jest.fn(),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const mockPatientUuid = 'sample-patient-uuid';
|
|
17
|
+
|
|
18
|
+
const mockPatientNotes = [
|
|
19
|
+
{
|
|
20
|
+
id: 'note-1',
|
|
21
|
+
diagnoses: '',
|
|
22
|
+
encounterDate: '2024-08-01',
|
|
23
|
+
encounterNote: 'Patient shows improvement with current medication.',
|
|
24
|
+
encounterNoteRecordedAt: '2024-08-01T12:34:56Z',
|
|
25
|
+
encounterProvider: 'Dr. John Doe',
|
|
26
|
+
encounterProviderRole: 'Endocrinologist',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'note-2',
|
|
30
|
+
diagnoses: '',
|
|
31
|
+
encounterDate: '2024-08-02',
|
|
32
|
+
encounterNote: 'Blood pressure is slightly elevated. Consider adjusting medication.',
|
|
33
|
+
encounterNoteRecordedAt: '2024-08-02T14:22:00Z',
|
|
34
|
+
encounterProvider: 'Dr. Jane Smith',
|
|
35
|
+
encounterProviderRole: 'Cardiologist',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
describe('PatientNotesHistory', () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
jest.resetAllMocks();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('displays loading skeletons when loading', () => {
|
|
45
|
+
mockedUseEmrConfiguration.mockReturnValue({
|
|
46
|
+
emrConfiguration: emrConfigurationMock,
|
|
47
|
+
mutateEmrConfiguration: jest.fn(),
|
|
48
|
+
isLoadingEmrConfiguration: false,
|
|
49
|
+
errorFetchingEmrConfiguration: null,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
usePatientNotes.mockReturnValue({
|
|
53
|
+
patientNotes: [],
|
|
54
|
+
isLoadingPatientNotes: true,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
render(<PatientNotesHistory patientUuid={mockPatientUuid} />);
|
|
58
|
+
|
|
59
|
+
expect(screen.getAllByTestId('in-patient-note-skeleton')).toHaveLength(4);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('displays patient notes when available', () => {
|
|
63
|
+
mockedUseEmrConfiguration.mockReturnValue({
|
|
64
|
+
emrConfiguration: emrConfigurationMock,
|
|
65
|
+
mutateEmrConfiguration: jest.fn(),
|
|
66
|
+
isLoadingEmrConfiguration: false,
|
|
67
|
+
errorFetchingEmrConfiguration: null,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
usePatientNotes.mockReturnValue({
|
|
71
|
+
patientNotes: mockPatientNotes,
|
|
72
|
+
isLoadingPatientNotes: false,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
render(<PatientNotesHistory patientUuid={mockPatientUuid} />);
|
|
76
|
+
|
|
77
|
+
expect(screen.getByText('History')).toBeInTheDocument();
|
|
78
|
+
|
|
79
|
+
expect(screen.getByText('Patient shows improvement with current medication.')).toBeInTheDocument();
|
|
80
|
+
expect(screen.getByText('Dr. John Doe')).toBeInTheDocument();
|
|
81
|
+
expect(screen.getByText('Blood pressure is slightly elevated. Consider adjusting medication.')).toBeInTheDocument();
|
|
82
|
+
expect(screen.getByText('Dr. Jane Smith')).toBeInTheDocument();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
3
|
+
|
|
4
|
+
.notesContainer {
|
|
5
|
+
margin: layout.$spacing-04;
|
|
6
|
+
padding-bottom: layout.$spacing-04;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.notesContainerHeader {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
margin-top: layout.$spacing-05;
|
|
15
|
+
margin-bottom: layout.$spacing-02;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.notesContainerTitle {
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: layout.$spacing-05;
|
|
21
|
+
color: #393939;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.noteTile {
|
|
25
|
+
padding: layout.$spacing-04;
|
|
26
|
+
margin-bottom: layout.$spacing-04;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.noteHeader {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
margin-bottom: layout.$spacing-04;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.noteProviderRole {
|
|
37
|
+
flex-grow: 0;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
color: $text-02;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.noteBody {
|
|
44
|
+
font-size: 0.875rem;
|
|
45
|
+
color: $text-02;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.noteDateAndTime {
|
|
49
|
+
font-size: layout.$spacing-04;
|
|
50
|
+
color: $text-02;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.noteProviderName {
|
|
54
|
+
font-size: layout.$spacing-04;
|
|
55
|
+
margin-top: layout.$spacing-04;
|
|
56
|
+
color: $text-02;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.noteSkeletonContainer {
|
|
60
|
+
height: layout.$spacing-13;
|
|
61
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionMenuButton, launchWorkspace, StickyNoteAddIcon } from '@openmrs/esm-framework';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { type WardPatientWorkspaceProps } from '../../types';
|
|
5
|
+
|
|
6
|
+
export default function WardPatientNotesActionButton() {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<ActionMenuButton
|
|
11
|
+
getIcon={(props) => <StickyNoteAddIcon {...props} size={16} />}
|
|
12
|
+
label={t('PatientNote', 'Patient Note')}
|
|
13
|
+
iconDescription={t('PatientNote', 'Patient Note')}
|
|
14
|
+
handler={() => launchWorkspace<WardPatientWorkspaceProps>('ward-patient-notes-workspace')}
|
|
15
|
+
type={'ward-patient-notes'}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
import { type PatientNote, type UsePatientNotes, type VisitEncountersFetchResponse } from './types';
|
|
4
|
+
import { type EncounterPayload } from '../../types';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
export function savePatientNote(payload: EncounterPayload, abortController: AbortController = new AbortController()) {
|
|
8
|
+
return openmrsFetch(`${restBaseUrl}/encounter`, {
|
|
9
|
+
headers: {
|
|
10
|
+
'Content-Type': 'application/json',
|
|
11
|
+
},
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: payload,
|
|
14
|
+
signal: abortController.signal,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function usePatientNotes(
|
|
19
|
+
patientUuid: string,
|
|
20
|
+
visitUuid: string,
|
|
21
|
+
encounterType: string,
|
|
22
|
+
conceptUuid: string,
|
|
23
|
+
): UsePatientNotes {
|
|
24
|
+
const customRepresentation =
|
|
25
|
+
'custom:(uuid,display,encounterDatetime,patient,obs,' +
|
|
26
|
+
'encounterProviders:(uuid,display,' +
|
|
27
|
+
'encounterRole:(uuid,display),' +
|
|
28
|
+
'provider:(uuid,person:(uuid,display))),' +
|
|
29
|
+
'diagnoses';
|
|
30
|
+
const encountersApiUrl = `${restBaseUrl}/encounter?patient=${patientUuid}&encounterType=${encounterType}&visit=${visitUuid}&v=${customRepresentation}`;
|
|
31
|
+
|
|
32
|
+
const { data, error, isLoading, isValidating, mutate } = useSWR<FetchResponse<VisitEncountersFetchResponse>, Error>(
|
|
33
|
+
patientUuid && encounterType ? encountersApiUrl : null,
|
|
34
|
+
openmrsFetch,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const patientNotes: Array<PatientNote> | null = useMemo(
|
|
38
|
+
() =>
|
|
39
|
+
data
|
|
40
|
+
? data.data.results
|
|
41
|
+
.map((encounter) => {
|
|
42
|
+
const noteObs = encounter.obs.find((obs) => obs.concept.uuid === conceptUuid);
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
id: encounter.uuid,
|
|
46
|
+
diagnoses: encounter.diagnoses.map((d) => d.display).join(', '),
|
|
47
|
+
encounterDate: encounter.encounterDatetime,
|
|
48
|
+
encounterNote: noteObs ? noteObs.value : '',
|
|
49
|
+
encounterNoteRecordedAt: noteObs ? noteObs.obsDatetime : '',
|
|
50
|
+
encounterProvider: encounter.encounterProviders.map((ep) => ep.provider.person.display).join(', '),
|
|
51
|
+
encounterProviderRole: encounter.encounterProviders.map((ep) => ep.encounterRole.display).join(', '),
|
|
52
|
+
};
|
|
53
|
+
})
|
|
54
|
+
.sort(
|
|
55
|
+
(a, b) => new Date(b.encounterNoteRecordedAt).getTime() - new Date(a.encounterNoteRecordedAt).getTime(),
|
|
56
|
+
)
|
|
57
|
+
: [],
|
|
58
|
+
[data, conceptUuid],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
return useMemo(
|
|
62
|
+
() => ({
|
|
63
|
+
patientNotes,
|
|
64
|
+
errorFetchingPatientNotes: error,
|
|
65
|
+
isLoadingPatientNotes: isLoading,
|
|
66
|
+
isValidatingPatientNotes: isValidating,
|
|
67
|
+
mutatePatientNotes: mutate,
|
|
68
|
+
}),
|
|
69
|
+
[patientNotes, isLoading, isValidating, mutate, error],
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type WardPatientWorkspaceProps } from '../../types';
|
|
3
|
+
import WardPatientWorkspaceBanner from '../patient-banner/patient-banner.component';
|
|
4
|
+
import PatientNotesForm from './form/notes-form.component';
|
|
5
|
+
import PatientNotesHistory from './history/notes-container.component';
|
|
6
|
+
|
|
7
|
+
const WardPatientNotesWorkspace: React.FC<WardPatientWorkspaceProps> = (props) => {
|
|
8
|
+
const { wardPatient, ...restWorkspaceProps } = props;
|
|
9
|
+
const patientUuid = wardPatient?.patient?.uuid;
|
|
10
|
+
|
|
11
|
+
const notesFormState = {
|
|
12
|
+
patientUuid,
|
|
13
|
+
...restWorkspaceProps,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<WardPatientWorkspaceBanner {...wardPatient} />
|
|
19
|
+
<PatientNotesForm {...notesFormState} />
|
|
20
|
+
<PatientNotesHistory patientUuid={patientUuid} visitUuid={wardPatient?.visit.uuid} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default WardPatientNotesWorkspace;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Concept, type OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export interface VisitEncountersFetchResponse {
|
|
4
|
+
results: Array<RESTPatientNote>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface RESTPatientNote extends OpenmrsResource {
|
|
8
|
+
uuid: string;
|
|
9
|
+
display: string;
|
|
10
|
+
encounterDatetime: string;
|
|
11
|
+
encounterType: { name: string; uuid: string };
|
|
12
|
+
encounterProviders: [{ encounterRole: { uuid: string; display: string }; provider: { person: { display: string } } }];
|
|
13
|
+
location: { uuid: string; display: string; name: string };
|
|
14
|
+
obs: Array<ObsData>;
|
|
15
|
+
diagnoses: Array<OpenmrsResource>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PatientNote {
|
|
19
|
+
id: string;
|
|
20
|
+
diagnoses: string;
|
|
21
|
+
encounterDate: string;
|
|
22
|
+
encounterNote: string;
|
|
23
|
+
encounterNoteRecordedAt: string;
|
|
24
|
+
encounterProvider: string;
|
|
25
|
+
encounterProviderRole: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UsePatientNotes {
|
|
29
|
+
patientNotes: Array<PatientNote> | null;
|
|
30
|
+
errorFetchingPatientNotes: Error;
|
|
31
|
+
isLoadingPatientNotes: boolean;
|
|
32
|
+
isValidatingPatientNotes?: boolean;
|
|
33
|
+
mutatePatientNotes: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ObsData {
|
|
37
|
+
concept: Concept;
|
|
38
|
+
value?: string | any;
|
|
39
|
+
groupMembers?: Array<{
|
|
40
|
+
concept: Concept;
|
|
41
|
+
value?: string | any;
|
|
42
|
+
}>;
|
|
43
|
+
obsDatetime: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import type { Encounter, EncounterPayload } from './types';
|
|
3
|
+
|
|
4
|
+
export function createEncounter(encounterPayload: EncounterPayload) {
|
|
5
|
+
return openmrsFetch<Encounter>(`${restBaseUrl}/encounter`, {
|
|
6
|
+
method: 'POST',
|
|
7
|
+
headers: {
|
|
8
|
+
'content-type': 'application/json',
|
|
9
|
+
},
|
|
10
|
+
body: encounterPayload,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function assignPatientToBed(bedUuid: number, patientUuid: string, encounterUuid: string) {
|
|
15
|
+
return openmrsFetch(`${restBaseUrl}/beds/${bedUuid}`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
'content-type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
body: {
|
|
21
|
+
patientUuid,
|
|
22
|
+
encounterUuid,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
package/translations/en.json
CHANGED
|
@@ -1,11 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
+
"admissionRequests": "Admission requests",
|
|
3
|
+
"admissionRequestsCount_one": "{{count}} admission request",
|
|
4
|
+
"admissionRequestsCount_other": "{{count}} admission requests",
|
|
5
|
+
"admit": "Admit",
|
|
6
|
+
"admitPatient": "Admit patient",
|
|
7
|
+
"admitting": "Admitting...",
|
|
8
|
+
"bedManagementModuleNotInstalled": "Bed management module is not present to allow bed selection",
|
|
2
9
|
"bedShare": "Bed share",
|
|
10
|
+
"bedSwap": "Bed swap",
|
|
11
|
+
"cancel": "Cancel",
|
|
12
|
+
"chooseAnOption": "Choose an option",
|
|
13
|
+
"clinicalNoteLabel": "Write your notes",
|
|
14
|
+
"empty": "Empty",
|
|
3
15
|
"emptyBed": "Empty bed",
|
|
4
|
-
"
|
|
16
|
+
"emptyText": "Empty",
|
|
17
|
+
"errorAssigningBedToPatient": "Error assigning bed to patient",
|
|
18
|
+
"errorCreatingEncounter": "Failed to admit patient",
|
|
19
|
+
"errorCreatingTransferRequest": "Error creating transfer request",
|
|
20
|
+
"errorLoadingPatientAdmissionRequests": "Error Loading patient admission requests",
|
|
5
21
|
"errorLoadingPatients": "Error loading admitted patients",
|
|
6
22
|
"errorLoadingWardLocation": "Error loading ward location",
|
|
23
|
+
"female": "Female",
|
|
24
|
+
"fetchingEmrConfigurationFailed": "Fetching EMR configuration failed. Try refreshing the page or contact your system administrator.",
|
|
25
|
+
"fetchingPatientNotesFailed": "Fetching patient notes failed. Try refreshing the page or contact your system administrator.",
|
|
26
|
+
"inpatientNotesWorkspaceTitle": "In-patient notes",
|
|
27
|
+
"invalidElementIdCopy": "The configuration provided is invalid. It contains the following unknown element ID:",
|
|
7
28
|
"invalidLocationSpecified": "Invalid location specified",
|
|
8
29
|
"invalidWardLocation": "Invalid ward location: {{location}}",
|
|
30
|
+
"male": "Male",
|
|
31
|
+
"manage": "Manage",
|
|
32
|
+
"nextPage": "Next page",
|
|
9
33
|
"noBedsConfigured": "No beds configured for this location",
|
|
10
|
-
"
|
|
34
|
+
"noBedsConfiguredForLocation": "No beds configured for {{location}} location",
|
|
35
|
+
"noLocationsFound": "No locations found",
|
|
36
|
+
"note": "Note",
|
|
37
|
+
"notes": "Notes",
|
|
38
|
+
"other": "Other",
|
|
39
|
+
"patientAdmittedButBedNotAssigned": "Patient admitted successfully but fail to assign bed to patient",
|
|
40
|
+
"patientAdmittedSuccessfully": "Patient admitted successfully",
|
|
41
|
+
"patientAdmittedSuccessfullySubtitle": "{{patientName}} has been successfully admitted and assigned to bed {{bedNumber}}",
|
|
42
|
+
"patientAdmittedWoBed": "Patient admitted successfully to {{location}}",
|
|
43
|
+
"patientAssignedNewbed": "Patient assigned to new bed",
|
|
44
|
+
"patientAssignedToBed": "{{patientName}} assigned to bed {{bedNumber}}",
|
|
45
|
+
"patientNoteNowVisible": "It should be now visible in the notes history",
|
|
46
|
+
"patientNoteSaveError": "Error saving patient note",
|
|
47
|
+
"patientNotesDidntLoad": "Patient notes didn't load",
|
|
48
|
+
"patientTransferRequestCreated": "Patient transfer request created",
|
|
49
|
+
"pleaseSelectBed": "Please select a bed",
|
|
50
|
+
"pleaseSelectTransferLocation": "Please select transfer location",
|
|
51
|
+
"pleaseSelectTransferType": "Please select transfer type",
|
|
52
|
+
"previousPage": "Previous page",
|
|
53
|
+
"save": "Save",
|
|
54
|
+
"saving": "Saving...",
|
|
55
|
+
"searchForPatient": "Search for a patient",
|
|
56
|
+
"searchLocations": "Search locations",
|
|
57
|
+
"selectABed": "Select a bed",
|
|
58
|
+
"selectALocation": "Select a location",
|
|
59
|
+
"showingLocations_one": "{{start}}-{{end}} of {{count}} locations",
|
|
60
|
+
"showingLocations_other": "{{start}}-{{end}} of {{count}} locations",
|
|
61
|
+
"somePartsOfTheFormDidntLoad": "Some parts of the form didn't load",
|
|
62
|
+
"transfer": "Transfer",
|
|
63
|
+
"transferElsewhere": "Transfer elsewhere",
|
|
64
|
+
"transfers": "Transfers",
|
|
65
|
+
"transferType": "Transfer type",
|
|
66
|
+
"typeOfTransfer": "Type of transfer",
|
|
67
|
+
"unableToSelectBeds": "Unable to select beds",
|
|
68
|
+
"unknown": "Unknown",
|
|
69
|
+
"visitNoteSaved": "Patient note saved",
|
|
70
|
+
"wardClinicalNotePlaceholder": "Write any notes here",
|
|
71
|
+
"wards": "Wards"
|
|
11
72
|
}
|
package/dist/443.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.webpackChunk_kenyaemr_esm_ward_app=globalThis.webpackChunk_kenyaemr_esm_ward_app||[]).push([[443],{443:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.r(t),n.d(t,{I18nContext:()=>S,I18nextProvider:()=>ue,Trans:()=>q,Translation:()=>se,composeInitialProps:()=>R,date:()=>ge,getDefaults:()=>N,getI18n:()=>C,getInitialProps:()=>T,initReactI18next:()=>D,number:()=>me,plural:()=>be,select:()=>ve,selectOrdinal:()=>he,setDefaults:()=>k,setI18n:()=>Z,time:()=>ye,useSSR:()=>le,useTranslation:()=>ne,withSSR:()=>de,withTranslation:()=>ae});var o=n(6522),i=n(6666),a=n(5206),c=n(4896),s=n.n(c),u=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function l(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(s()[n[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var o=new RegExp(u),i=null;null!==(i=o.exec(e));)if(i[0].trim())if(i[1]){var a=i[1].trim(),c=[a,""];a.indexOf("=")>-1&&(c=a.split("=")),t.attrs[c[0]]=c[1],o.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var p=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,f=/^\s*$/,d=Object.create(null);function g(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(g,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var y={parse:function(e,t){t||(t={}),t.components||(t.components=d);var n,r=[],o=[],i=-1,a=!1;if(0!==e.indexOf("<")){var c=e.indexOf("<");r.push({type:"text",content:-1===c?e:e.substring(0,c)})}return e.replace(p,(function(c,s){if(a){if(c!=="</"+n.name+">")return;a=!1}var u,p="/"!==c.charAt(1),d=c.startsWith("\x3c!--"),g=s+c.length,y=e.charAt(g);if(d){var m=l(c);return i<0?(r.push(m),r):((u=o[i]).children.push(m),r)}if(p&&(i++,"tag"===(n=l(c)).type&&t.components[n.name]&&(n.type="component",a=!0),n.voidElement||a||!y||"<"===y||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),0===i&&r.push(n),(u=o[i-1])&&u.children.push(n),o[i]=n),(!p||n.voidElement)&&(i>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(i--,n=-1===i?r:o[i]),!a&&"<"!==y&&y)){u=-1===i?r:o[i].children;var v=e.indexOf("<",g),b=e.slice(g,-1===v?void 0:v);f.test(b)&&(b=" "),(v>-1&&i+u.length>=0||" "!==b)&&u.push({type:"text",content:b})}})),r},stringify:function(e){return e.reduce((function(e,t){return e+g("",t)}),"")}};const m=y;var v=n(9249),b=n(7371),h=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,O={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j=function(e){return O[e]};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x,E={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(h,j)}},S=(0,a.createContext)();function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};E=P(P({},E),e)}function N(){return E}var I=function(){function e(){(0,v.Z)(this,e),this.usedNamespaces={}}return(0,b.Z)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Z(e){x=e}function C(){return x}var D={type:"3rdParty",init:function(e){k(e.options.react),Z(e)}};function R(e){return function(t){return new Promise((function(n){var r=T();e.getInitialProps?e.getInitialProps(t).then((function(e){n(P(P({},e),r))})):n(r)}))}}function T(){var e=C(),t=e.reportNamespaces?e.reportNamespaces.getUsedNamespaces():[],n={},r={};return e.languages.forEach((function(n){r[n]={},t.forEach((function(t){r[n][t]=e.getResourceBundle(n,t)||{}}))})),n.initialI18nStore=r,n.initialLanguage=e.language,n}function A(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var L={};function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&L[t[0]]||("string"==typeof t[0]&&(L[t[0]]=new Date),A.apply(void 0,t))}function B(e,t,n){e.loadNamespaces(t,(function(){e.isInitialized?n():e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),n()}))}))}function U(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}var F=["format"],_=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function W(e){return e?e.props?e.props.children:e.children:[]}function M(e){return Array.isArray(e)?e:[e]}function $(e,t){if(!e)return"";var n="",i=M(e),c=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return i.forEach((function(e,i){if("string"==typeof e)n+="".concat(e);else if((0,a.isValidElement)(e)){var s=Object.keys(e.props).length,u=c.indexOf(e.type)>-1,l=e.props.children;if(!l&&u&&0===s)n+="<".concat(e.type,"/>");else if(l||u&&0===s)if(e.props.i18nIsDynamicList)n+="<".concat(i,"></").concat(i,">");else if(u&&1===s&&"string"==typeof l)n+="<".concat(e.type,">").concat(l,"</").concat(e.type,">");else{var p=$(l,t);n+="<".concat(i,">").concat(p,"</").concat(i,">")}else n+="<".concat(i,"></").concat(i,">")}else if(null===e)A("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===(0,o.Z)(e)){var f=e.format,d=r(e,F),g=Object.keys(d);if(1===g.length){var y=f?"".concat(g[0],", ").concat(f):g[0];n+="{{".concat(y,"}}")}else A("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else A("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)})),n}function q(e){var t=e.children,n=e.count,i=e.parent,c=e.i18nKey,s=e.context,u=e.tOptions,l=void 0===u?{}:u,p=e.values,f=e.defaults,d=e.components,g=e.ns,y=e.i18n,v=e.t,b=e.shouldUnescape,h=r(e,_),O=(0,a.useContext)(S)||{},j=O.i18n,w=O.defaultNS,P=y||j||C();if(!P)return z("You will need to pass in an i18next instance by using i18nextReactModule"),t;var x=v||P.t.bind(P)||function(e){return e};s&&(l.context=s);var E=K(K({},N()),P.options&&P.options.react),k=g||x.ns||w||P.options&&P.options.defaultNS;k="string"==typeof k?[k]:k||["translation"];var I=f||$(t,E)||E.transEmptyNodeValue||c,Z=E.hashTransKey,D=c||(Z?Z(I):I),R=p?l.interpolation:{interpolation:K(K({},l.interpolation),{},{prefix:"#$?",suffix:"?$#"})},T=K(K(K(K({},l),{},{count:n},p),R),{},{defaultValue:I,ns:k}),A=function(e,t,n,r,i,c){if(""===t)return[];var s=r.transKeepBasicHtmlNodesFor||[],u=t&&new RegExp(s.join("|")).test(t);if(!e&&!u)return[t];var l={};!function e(t){M(t).forEach((function(t){"string"!=typeof t&&(V(t)?e(W(t)):"object"!==(0,o.Z)(t)||(0,a.isValidElement)(t)||Object.assign(l,t))}))}(e);var p=m.parse("<0>".concat(t,"</0>")),f=K(K({},l),i);function d(e,t,n){var r=W(e),o=y(r,t.children,n);return function(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every((function(e){return(0,a.isValidElement)(e)}))}(r)&&0===o.length?r:o}function g(e,t,n,r,o){e.dummy&&(e.children=t),n.push((0,a.cloneElement)(e,K(K({},e.props),{},{key:r}),o?void 0:t))}function y(t,i,l){var p=M(t);return M(i).reduce((function(t,i,m){var v,b,h,O=i.children&&i.children[0]&&i.children[0].content&&n.services.interpolator.interpolate(i.children[0].content,f,n.language);if("tag"===i.type){var j=p[parseInt(i.name,10)];!j&&1===l.length&&l[0][i.name]&&(j=l[0][i.name]),j||(j={});var w=0!==Object.keys(i.attrs).length?(v={props:i.attrs},(h=K({},b=j)).props=Object.assign(v.props,b.props),h):j,P=(0,a.isValidElement)(w),x=P&&V(i,!0)&&!i.voidElement,E=u&&"object"===(0,o.Z)(w)&&w.dummy&&!P,S="object"===(0,o.Z)(e)&&null!==e&&Object.hasOwnProperty.call(e,i.name);if("string"==typeof w){var k=n.services.interpolator.interpolate(w,f,n.language);t.push(k)}else if(V(w)||x)g(w,d(w,i,l),t,m);else if(E){var N=y(p,i.children,l);t.push((0,a.cloneElement)(w,K(K({},w.props),{},{key:m}),N))}else if(Number.isNaN(parseFloat(i.name)))if(S)g(w,d(w,i,l),t,m,i.voidElement);else if(r.transSupportBasicHtmlNodes&&s.indexOf(i.name)>-1)if(i.voidElement)t.push((0,a.createElement)(i.name,{key:"".concat(i.name,"-").concat(m)}));else{var I=y(p,i.children,l);t.push((0,a.createElement)(i.name,{key:"".concat(i.name,"-").concat(m)},I))}else if(i.voidElement)t.push("<".concat(i.name," />"));else{var Z=y(p,i.children,l);t.push("<".concat(i.name,">").concat(Z,"</").concat(i.name,">"))}else if("object"!==(0,o.Z)(w)||P)1===i.children.length&&O?t.push((0,a.cloneElement)(w,K(K({},w.props),{},{key:m}),O)):t.push((0,a.cloneElement)(w,K(K({},w.props),{},{key:m})));else{var C=i.children[0]?O:null;C&&t.push(C)}}else if("text"===i.type){var D=r.transWrapTextNodes,R=c?r.unescape(n.services.interpolator.interpolate(i.content,f,n.language)):n.services.interpolator.interpolate(i.content,f,n.language);D?t.push((0,a.createElement)(D,{key:"".concat(i.name,"-").concat(m)},R)):t.push(R)}return t}),[])}return W(y([{dummy:!0,children:e||[]}],p,M(e||[]))[0])}(d||t,D?x(D,T):I,P,E,T,b),L=void 0!==i?i:E.defaultTransParent;return L?(0,a.createElement)(L,h,A):A}var Y=n(9868),J=n(7066),G=n(4434);function Q(e,t){return(0,Y.Z)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||(0,J.Z)(e,t)||(0,G.Z)()}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var te=function(e,t){var n=(0,a.useRef)();return(0,a.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=(0,a.useContext)(S)||{},o=r.i18n,i=r.defaultNS,c=n||o||C();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new I),!c){z("You will need to pass in an i18next instance by using initReactI18next");var s=function(e){return Array.isArray(e)?e[e.length-1]:e},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}c.options.react&&void 0!==c.options.react.wait&&z("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=ee(ee(ee({},N()),c.options.react),t),p=l.useSuspense,f=l.keyPrefix,d=e||i||c.options&&c.options.defaultNS;d="string"==typeof d?[d]:d||["translation"],c.reportNamespaces.addUsedNamespaces&&c.reportNamespaces.addUsedNamespaces(d);var g=(c.isInitialized||c.initializedStoreOnce)&&d.every((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!a(r,e)||o&&!a(i,e)))}(e,t,n):(z("i18n.languages were undefined or empty",t.languages),!0)}(e,c,l)}));function y(){return c.getFixedT(null,"fallback"===l.nsMode?d:d[0],f)}var m=Q((0,a.useState)(y),2),v=m[0],b=m[1],h=d.join(),O=te(h),j=(0,a.useRef)(!0);(0,a.useEffect)((function(){var e=l.bindI18n,t=l.bindI18nStore;function n(){j.current&&b(y)}return j.current=!0,g||p||B(c,d,(function(){j.current&&b(y)})),g&&O&&O!==h&&j.current&&b(y),e&&c&&c.on(e,n),t&&c&&c.store.on(t,n),function(){j.current=!1,e&&c&&e.split(" ").forEach((function(e){return c.off(e,n)})),t&&c&&t.split(" ").forEach((function(e){return c.store.off(e,n)}))}}),[c,h]);var w=(0,a.useRef)(!0);(0,a.useEffect)((function(){j.current&&!w.current&&b(y),w.current=!1}),[c,f]);var P=[v,c,g];if(P.t=v,P.i18n=c,P.ready=g,g)return P;if(!g&&!p)return P;throw new Promise((function(e){B(c,d,(function(){e()}))}))}var re=["forwardedRef"];function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){function o(o){var i=o.forwardedRef,c=r(o,re),s=Q(ne(e,ie(ie({},c),{},{keyPrefix:t.keyPrefix})),3),u=s[0],l=s[1],p=s[2],f=ie(ie({},c),{},{t:u,i18n:l,tReady:p});return t.withRef&&i?f.ref=i:!t.withRef&&i&&(f.forwardedRef=i),(0,a.createElement)(n,f)}return o.displayName="withI18nextTranslation(".concat(U(n),")"),o.WrappedComponent=n,t.withRef?(0,a.forwardRef)((function(e,t){return(0,a.createElement)(o,Object.assign({},e,{forwardedRef:t}))})):o}}var ce=["ns","children"];function se(e){var t=e.ns,n=e.children,o=Q(ne(t,r(e,ce)),3),i=o[0],a=o[1],c=o[2];return n(i,{i18n:a,lng:a.language},c)}function ue(e){var t=e.i18n,n=e.defaultNS,r=e.children,o=(0,a.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,a.createElement)(S.Provider,{value:o},r)}function le(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).i18n,r=((0,a.useContext)(S)||{}).i18n,o=n||r||C();o.options&&o.options.isClone||(e&&!o.initializedStoreOnce&&(o.services.resourceStore.data=e,o.options.ns=Object.values(e).reduce((function(e,t){return Object.keys(t).forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}),o.options.ns),o.initializedStoreOnce=!0,o.isInitialized=!0),t&&!o.initializedLanguageOnce&&(o.changeLanguage(t),o.initializedLanguageOnce=!0))}var pe=["initialI18nStore","initialLanguage"];function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(){return function(e){function t(t){var n=t.initialI18nStore,o=t.initialLanguage,c=r(t,pe);return le(n,o),(0,a.createElement)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},c))}return t.getInitialProps=R(e),t.displayName="withI18nextSSR(".concat(U(e),")"),t.WrappedComponent=e,t}}var ge=function(){return""},ye=function(){return""},me=function(){return""},ve=function(){return""},be=function(){return""},he=function(){return""}},4896:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},9868:(e,t,n)=>{"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{Z:()=>r})},9249:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:()=>r})},7371:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(2802);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(0,r.Z)(o.key),o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},6666:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(2802);function o(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},4434:(e,t,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{Z:()=>r})},2802:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(6522);function o(e){var t=function(e,t){if("object"!=(0,r.Z)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=(0,r.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.Z)(t)?t:String(t)}},6522:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})},7066:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}n.d(t,{Z:()=>o})}}]);
|