@ampath/esm-patient-registration-app 6.0.1-pre.6
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 +41 -0
- package/README.md +7 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/249.js +2 -0
- package/dist/249.js.LICENSE.txt +46 -0
- package/dist/249.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/365.js +1 -0
- package/dist/365.js.map +1 -0
- package/dist/460.js +1 -0
- package/dist/525.js +1 -0
- package/dist/525.js.map +1 -0
- package/dist/537.js +1 -0
- package/dist/537.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/621.js +1 -0
- package/dist/621.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/735.js +1 -0
- package/dist/735.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/879.js +1 -0
- package/dist/879.js.map +1 -0
- package/dist/ampath-esm-patient-registration-app.js +1 -0
- package/dist/ampath-esm-patient-registration-app.js.buildmanifest.json +649 -0
- package/dist/ampath-esm-patient-registration-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +56 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/docs/images/patient-registration-hierarchy.png +0 -0
- package/jest.config.js +3 -0
- package/package.json +61 -0
- package/src/add-patient-link.scss +3 -0
- package/src/add-patient-link.test.tsx +20 -0
- package/src/add-patient-link.tsx +21 -0
- package/src/config-schema.ts +410 -0
- package/src/constants.ts +14 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +71 -0
- package/src/nav-link.test.tsx +13 -0
- package/src/nav-link.tsx +10 -0
- package/src/offline.resources.ts +155 -0
- package/src/offline.ts +91 -0
- package/src/patient-registration/before-save-prompt.tsx +73 -0
- package/src/patient-registration/date-util.ts +52 -0
- package/src/patient-registration/field/__mocks__/field.resource.ts +60 -0
- package/src/patient-registration/field/address/address-field.component.tsx +153 -0
- package/src/patient-registration/field/address/address-hierarchy-levels.component.tsx +73 -0
- package/src/patient-registration/field/address/address-hierarchy.resource.tsx +157 -0
- package/src/patient-registration/field/address/address-search.component.tsx +85 -0
- package/src/patient-registration/field/address/address-search.scss +53 -0
- package/src/patient-registration/field/address/custom-address-field.component.tsx +31 -0
- package/src/patient-registration/field/address/tests/address-hierarchy.test.tsx +214 -0
- package/src/patient-registration/field/address/tests/address-search-component.test.tsx +135 -0
- package/src/patient-registration/field/custom-field.component.tsx +25 -0
- package/src/patient-registration/field/dob/dob.component.tsx +159 -0
- package/src/patient-registration/field/dob/dob.test.tsx +75 -0
- package/src/patient-registration/field/field.component.tsx +47 -0
- package/src/patient-registration/field/field.resource.ts +35 -0
- package/src/patient-registration/field/field.scss +127 -0
- package/src/patient-registration/field/field.test.tsx +294 -0
- package/src/patient-registration/field/gender/gender-field.component.tsx +49 -0
- package/src/patient-registration/field/gender/gender-field.test.tsx +59 -0
- package/src/patient-registration/field/id/id-field.component.tsx +144 -0
- package/src/patient-registration/field/id/id-field.test.tsx +107 -0
- package/src/patient-registration/field/id/identifier-selection-overlay.component.tsx +198 -0
- package/src/patient-registration/field/id/identifier-selection.scss +37 -0
- package/src/patient-registration/field/name/name-field.component.tsx +142 -0
- package/src/patient-registration/field/obs/obs-field.component.tsx +204 -0
- package/src/patient-registration/field/obs/obs-field.test.tsx +205 -0
- package/src/patient-registration/field/person-attributes/coded-attributes.component.tsx +60 -0
- package/src/patient-registration/field/person-attributes/coded-person-attribute-field.component.tsx +116 -0
- package/src/patient-registration/field/person-attributes/coded-person-attribute-field.test.tsx +127 -0
- package/src/patient-registration/field/person-attributes/person-attribute-field.component.tsx +88 -0
- package/src/patient-registration/field/person-attributes/person-attribute-field.test.tsx +187 -0
- package/src/patient-registration/field/person-attributes/person-attributes.resource.ts +20 -0
- package/src/patient-registration/field/person-attributes/text-person-attribute-field.component.tsx +58 -0
- package/src/patient-registration/field/person-attributes/text-person-attribute-field.test.tsx +88 -0
- package/src/patient-registration/field/phone/phone-field.component.tsx +16 -0
- package/src/patient-registration/form-manager.test.ts +67 -0
- package/src/patient-registration/form-manager.ts +414 -0
- package/src/patient-registration/input/basic-input/input/input.component.tsx +179 -0
- package/src/patient-registration/input/basic-input/input/input.test.tsx +72 -0
- package/src/patient-registration/input/basic-input/select/select-input.component.tsx +32 -0
- package/src/patient-registration/input/basic-input/select/select-input.test.tsx +49 -0
- package/src/patient-registration/input/combo-input/combo-input.component.tsx +128 -0
- package/src/patient-registration/input/combo-input/selection-tick.component.tsx +20 -0
- package/src/patient-registration/input/custom-input/autosuggest/autosuggest.component.tsx +187 -0
- package/src/patient-registration/input/custom-input/autosuggest/autosuggest.scss +62 -0
- package/src/patient-registration/input/custom-input/autosuggest/autosuggest.test.tsx +132 -0
- package/src/patient-registration/input/custom-input/identifier/identifier-input.component.tsx +156 -0
- package/src/patient-registration/input/custom-input/identifier/identifier-input.test.tsx +107 -0
- package/src/patient-registration/input/custom-input/identifier/utils.test.ts +81 -0
- package/src/patient-registration/input/custom-input/identifier/utils.ts +19 -0
- package/src/patient-registration/input/dummy-data/dummy-data-input.component.tsx +53 -0
- package/src/patient-registration/input/dummy-data/dummy-data-input.test.tsx +43 -0
- package/src/patient-registration/input/input.scss +118 -0
- package/src/patient-registration/patient-registration-context.ts +24 -0
- package/src/patient-registration/patient-registration-hooks.ts +287 -0
- package/src/patient-registration/patient-registration-utils.ts +216 -0
- package/src/patient-registration/patient-registration.component.tsx +240 -0
- package/src/patient-registration/patient-registration.resource.test.tsx +26 -0
- package/src/patient-registration/patient-registration.resource.ts +250 -0
- package/src/patient-registration/patient-registration.scss +122 -0
- package/src/patient-registration/patient-registration.test.tsx +471 -0
- package/src/patient-registration/patient-registration.types.ts +318 -0
- package/src/patient-registration/section/death-info/death-info-section.component.tsx +31 -0
- package/src/patient-registration/section/death-info/death-info-section.test.tsx +64 -0
- package/src/patient-registration/section/demographics/demographics-section.component.tsx +30 -0
- package/src/patient-registration/section/demographics/demographics-section.test.tsx +83 -0
- package/src/patient-registration/section/generic-section.component.tsx +17 -0
- package/src/patient-registration/section/patient-relationships/relationships-section.component.tsx +235 -0
- package/src/patient-registration/section/patient-relationships/relationships-section.test.tsx +100 -0
- package/src/patient-registration/section/patient-relationships/relationships.resource.tsx +78 -0
- package/src/patient-registration/section/patient-relationships/relationships.scss +35 -0
- package/src/patient-registration/section/section-wrapper.component.tsx +40 -0
- package/src/patient-registration/section/section.component.tsx +23 -0
- package/src/patient-registration/section/section.scss +1 -0
- package/src/patient-registration/ui-components/overlay/overlay.component.tsx +51 -0
- package/src/patient-registration/ui-components/overlay/overlay.scss +63 -0
- package/src/patient-registration/validation/patient-registration-validation.test.tsx +157 -0
- package/src/patient-registration/validation/patient-registration-validation.tsx +60 -0
- package/src/patient-verification/client-registry-constants.ts +13 -0
- package/src/patient-verification/client-registry.component.tsx +66 -0
- package/src/patient-verification/client-registry.scss +1 -0
- package/src/patient-verification/utils.tsx +56 -0
- package/src/patient-verification/verification-modal.scss +20 -0
- package/src/patient-verification/verification.component.tsx +48 -0
- package/src/resource.ts +12 -0
- package/src/root.component.tsx +63 -0
- package/src/root.scss +7 -0
- package/src/root.test.tsx +32 -0
- package/src/routes.json +66 -0
- package/src/widgets/cancel-patient-edit.component.tsx +37 -0
- package/src/widgets/cancel-patient-edit.test.tsx +27 -0
- package/src/widgets/delete-identifier-confirmation-modal.test.tsx +34 -0
- package/src/widgets/delete-identifier-confirmation-modal.tsx +41 -0
- package/src/widgets/delete-identifier-modal.scss +34 -0
- package/src/widgets/display-photo.component.tsx +30 -0
- package/src/widgets/display-photo.test.tsx +37 -0
- package/src/widgets/edit-patient-details-button.component.tsx +34 -0
- package/src/widgets/edit-patient-details-button.scss +3 -0
- package/src/widgets/edit-patient-details-button.test.tsx +41 -0
- package/translations/am.json +97 -0
- package/translations/ar.json +97 -0
- package/translations/en.json +103 -0
- package/translations/es.json +97 -0
- package/translations/fr.json +97 -0
- package/translations/he.json +97 -0
- package/translations/km.json +97 -0
- package/translations/zh.json +89 -0
- package/translations/zh_CN.json +89 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import DeleteIdentifierConfirmationModal from './delete-identifier-confirmation-modal';
|
|
5
|
+
|
|
6
|
+
describe('DeleteIdentifierConfirmationModal component', () => {
|
|
7
|
+
const mockDeleteIdentifier = jest.fn();
|
|
8
|
+
const mockIdentifierName = 'Identifier Name';
|
|
9
|
+
const mockIdentifierValue = 'Identifier Value';
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders the modal and triggers deleteIdentifier function', async () => {
|
|
16
|
+
const user = userEvent.setup();
|
|
17
|
+
|
|
18
|
+
render(
|
|
19
|
+
<DeleteIdentifierConfirmationModal
|
|
20
|
+
deleteIdentifier={mockDeleteIdentifier}
|
|
21
|
+
identifierName={mockIdentifierName}
|
|
22
|
+
identifierValue={mockIdentifierValue}
|
|
23
|
+
/>,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const cancelButton = screen.getByRole('button', { name: /cancel/i });
|
|
27
|
+
await user.click(cancelButton);
|
|
28
|
+
expect(mockDeleteIdentifier).toHaveBeenCalledWith(false);
|
|
29
|
+
|
|
30
|
+
const removeButton = screen.getByRole('button', { name: /remove identifier/i });
|
|
31
|
+
await user.click(removeButton);
|
|
32
|
+
expect(mockDeleteIdentifier).toHaveBeenCalledWith(true);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import styles from './delete-identifier-modal.scss';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Button } from '@carbon/react';
|
|
5
|
+
|
|
6
|
+
interface DeleteIdentifierConfirmationModalProps {
|
|
7
|
+
deleteIdentifier: (x: boolean) => void;
|
|
8
|
+
identifierName: string;
|
|
9
|
+
identifierValue: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DeleteIdentifierConfirmationModal: React.FC<DeleteIdentifierConfirmationModalProps> = ({
|
|
13
|
+
deleteIdentifier,
|
|
14
|
+
identifierName,
|
|
15
|
+
identifierValue,
|
|
16
|
+
}) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={styles.modalContent}>
|
|
21
|
+
<h1 className={styles.productiveHeading}>{t('deleteIdentifierModalHeading', 'Remove identifier?')}</h1>
|
|
22
|
+
<h3 className={styles.modalSubtitle}>
|
|
23
|
+
{identifierName}
|
|
24
|
+
{t('deleteIdentifierModalText', ' has a value of ')} {identifierValue}
|
|
25
|
+
</h3>
|
|
26
|
+
<p className={styles.modalBody}>
|
|
27
|
+
{t('confirmIdentifierDeletionText', 'Are you sure you want to remove this identifier?')}
|
|
28
|
+
</p>
|
|
29
|
+
<div className={styles.buttonSet}>
|
|
30
|
+
<Button kind="secondary" size="lg" onClick={() => deleteIdentifier(false)}>
|
|
31
|
+
{t('cancel', 'Cancel')}
|
|
32
|
+
</Button>
|
|
33
|
+
<Button kind="danger" size="lg" onClick={() => deleteIdentifier(true)}>
|
|
34
|
+
{t('removeIdentifierButton', 'Remove Identifier')}
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default DeleteIdentifierConfirmationModal;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@import '../patient-registration/patient-registration.scss';
|
|
4
|
+
|
|
5
|
+
.productiveHeading {
|
|
6
|
+
@include type.type-style('heading-compact-02');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.modalContent {
|
|
10
|
+
width: 100%;
|
|
11
|
+
background-color: $ui-01;
|
|
12
|
+
padding: spacing.$spacing-05;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.modalSubtitle {
|
|
16
|
+
@include type.type-style('body-compact-01');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.modalBody {
|
|
20
|
+
@include type.type-style('body-compact-01');
|
|
21
|
+
margin: spacing.$spacing-05 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.buttonSet {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: 1fr 1fr;
|
|
27
|
+
margin-left: -(spacing.$spacing-05);
|
|
28
|
+
margin-right: -(spacing.$spacing-05);
|
|
29
|
+
margin-bottom: -(spacing.$spacing-05);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.buttonSet > button {
|
|
33
|
+
max-width: unset !important;
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Avatar from 'react-avatar';
|
|
3
|
+
import GeoPattern from 'geopattern';
|
|
4
|
+
import { usePatientPhoto } from '../patient-registration/patient-registration.resource';
|
|
5
|
+
|
|
6
|
+
interface DisplayPatientPhotoProps {
|
|
7
|
+
patientName: string;
|
|
8
|
+
patientUuid: string;
|
|
9
|
+
size?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function DisplayPatientPhoto({ patientUuid, patientName, size }: DisplayPatientPhotoProps) {
|
|
13
|
+
const { data: photo } = usePatientPhoto(patientUuid);
|
|
14
|
+
const patternUrl: string = GeoPattern.generate(patientUuid).toDataUri();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Avatar
|
|
18
|
+
alt={`${patientName ? `${patientName}'s avatar` : 'Patient avatar'}`}
|
|
19
|
+
color="rgba(0,0,0,0)"
|
|
20
|
+
name={patientName}
|
|
21
|
+
src={photo?.imageSrc}
|
|
22
|
+
size={size === 'small' ? '48' : '80'}
|
|
23
|
+
textSizeRatio={size === 'small' ? 1 : 2}
|
|
24
|
+
style={{
|
|
25
|
+
backgroundImage: `url(${patternUrl})`,
|
|
26
|
+
backgroundRepeat: 'round',
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { mockPatient } from '__mocks__';
|
|
4
|
+
import DisplayPatientPhoto from './display-photo.component';
|
|
5
|
+
|
|
6
|
+
jest.mock('../patient-registration/patient-registration.resource', () => ({
|
|
7
|
+
usePatientPhoto: jest.fn().mockReturnValue({ data: { imageSrc: 'test-image-src' } }),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
jest.mock('geopattern', () => ({
|
|
11
|
+
generate: jest.fn().mockReturnValue({
|
|
12
|
+
toDataUri: jest.fn().mockReturnValue('https://example.com'),
|
|
13
|
+
}),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const patientUuid = mockPatient.uuid;
|
|
17
|
+
const patientName = mockPatient.name;
|
|
18
|
+
|
|
19
|
+
describe('DisplayPatientPhoto Component', () => {
|
|
20
|
+
it('should render the component with the patient photo and size should not be small', () => {
|
|
21
|
+
render(<DisplayPatientPhoto patientUuid={patientUuid} patientName={patientName} />);
|
|
22
|
+
|
|
23
|
+
const avatarImage = screen.getByTitle(`${patientName}`);
|
|
24
|
+
|
|
25
|
+
expect(avatarImage).toBeInTheDocument();
|
|
26
|
+
expect(avatarImage).toHaveAttribute('style', expect.stringContaining('width: 80px; height: 80px'));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should render the component with the patient photo and size should be small i.e. 48px', () => {
|
|
30
|
+
render(<DisplayPatientPhoto patientUuid={patientUuid} patientName={patientName} size="small" />);
|
|
31
|
+
|
|
32
|
+
const avatarImage = screen.getByTitle(`${patientName}`);
|
|
33
|
+
|
|
34
|
+
expect(avatarImage).toBeInTheDocument();
|
|
35
|
+
expect(avatarImage).toHaveAttribute('style', expect.stringContaining('width: 48px; height: 48px'));
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { navigate } from '@openmrs/esm-framework';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import styles from './edit-patient-details-button.scss';
|
|
5
|
+
|
|
6
|
+
interface EditPatientDetailsButtonProps {
|
|
7
|
+
onTransition?: () => void;
|
|
8
|
+
patientUuid: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const EditPatientDetailsButton: React.FC<EditPatientDetailsButtonProps> = ({ patientUuid, onTransition }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const handleClick = React.useCallback(() => {
|
|
14
|
+
navigate({ to: `\${openmrsSpaBase}/patient/${patientUuid}/edit` });
|
|
15
|
+
onTransition && onTransition();
|
|
16
|
+
}, [onTransition, patientUuid]);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<li className="cds--overflow-menu-options__option">
|
|
20
|
+
<button
|
|
21
|
+
className="cds--overflow-menu-options__btn"
|
|
22
|
+
role="menuitem"
|
|
23
|
+
title={t('editPatientDetails', 'Edit patient details')}
|
|
24
|
+
data-floating-menu-primary-focus
|
|
25
|
+
onClick={handleClick}>
|
|
26
|
+
<span className="cds--overflow-menu-options__option-content">
|
|
27
|
+
{t('editPatientDetails', 'Edit patient details')}
|
|
28
|
+
</span>
|
|
29
|
+
</button>
|
|
30
|
+
</li>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default EditPatientDetailsButton;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { navigate } from '@openmrs/esm-framework';
|
|
5
|
+
import { mockPatient } from '__mocks__';
|
|
6
|
+
import EditPatientDetailsButton from './edit-patient-details-button.component';
|
|
7
|
+
|
|
8
|
+
describe('EditPatientDetailsButton', () => {
|
|
9
|
+
const patientUuid = mockPatient.uuid;
|
|
10
|
+
|
|
11
|
+
it('should navigate to the edit page when clicked', async () => {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const mockNavigate = navigate as jest.Mock;
|
|
14
|
+
|
|
15
|
+
jest.mock('@openmrs/esm-framework', () => {
|
|
16
|
+
const originalModule = jest.requireActual('@openmrs/esm-framework');
|
|
17
|
+
return {
|
|
18
|
+
...originalModule,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
render(<EditPatientDetailsButton patientUuid={patientUuid} />);
|
|
23
|
+
|
|
24
|
+
const button = screen.getByRole('menuitem');
|
|
25
|
+
await user.click(button);
|
|
26
|
+
|
|
27
|
+
expect(mockNavigate).toHaveBeenCalledWith({ to: expect.stringContaining(`/patient/${patientUuid}/edit`) });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should call the onTransition function when provided', async () => {
|
|
31
|
+
const user = userEvent.setup();
|
|
32
|
+
|
|
33
|
+
const onTransitionMock = jest.fn();
|
|
34
|
+
render(<EditPatientDetailsButton patientUuid={patientUuid} onTransition={onTransitionMock} />);
|
|
35
|
+
|
|
36
|
+
const button = screen.getByRole('menuitem');
|
|
37
|
+
await user.click(button);
|
|
38
|
+
|
|
39
|
+
expect(onTransitionMock).toHaveBeenCalled();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addRelationshipButtonText": "Add Relationship",
|
|
3
|
+
"addressHeader": "Address",
|
|
4
|
+
"allFieldsRequiredText": "All fields are required unless marked optional",
|
|
5
|
+
"autoGeneratedPlaceholderText": "Auto-generated",
|
|
6
|
+
"birthdayNotInTheFuture": "",
|
|
7
|
+
"birthdayRequired": "",
|
|
8
|
+
"birthFieldLabelText": "Birth",
|
|
9
|
+
"cancel": "Cancel",
|
|
10
|
+
"causeOfDeathInputLabel": "Cause of Death",
|
|
11
|
+
"closeOverlay": "Close overlay",
|
|
12
|
+
"codedPersonAttributeAnswerSetEmpty": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an answer concept set UUID '{{answerConceptSetUuid}}' that does not have any concept answers.",
|
|
13
|
+
"codedPersonAttributeAnswerSetInvalid": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an invalid answer concept set UUID '{{answerConceptSetUuid}}'.",
|
|
14
|
+
"codedPersonAttributeNoAnswerSet": "The person attribute field '{{codedPersonAttributeFieldId}}' is of type 'coded' but has been defined without an answer concept set UUID. The 'answerConceptSetUuid' key is required.",
|
|
15
|
+
"configure": "Configure",
|
|
16
|
+
"configureIdentifiers": "Configure identifiers",
|
|
17
|
+
"contactSection": "Contact Details",
|
|
18
|
+
"createNew": "Create New",
|
|
19
|
+
"dateOfBirthLabelText": "Date of Birth",
|
|
20
|
+
"deathDateInputLabel": "Date of Death",
|
|
21
|
+
"deathdayNotInTheFuture": "",
|
|
22
|
+
"deathSection": "Death Info",
|
|
23
|
+
"deleteIdentifierTooltip": "Delete",
|
|
24
|
+
"deleteRelationshipTooltipText": "Delete",
|
|
25
|
+
"demographicsSection": "Basic Info",
|
|
26
|
+
"discard": "Discard",
|
|
27
|
+
"discardModalBody": "The changes you made to this patient's details have not been saved. Discard changes?",
|
|
28
|
+
"discardModalHeader": "Confirm Discard Changes",
|
|
29
|
+
"dobToggleLabelText": "Date of Birth Known?",
|
|
30
|
+
"edit": "Edit",
|
|
31
|
+
"editIdentifierTooltip": "Edit",
|
|
32
|
+
"editPatientDetails": "Edit patient details",
|
|
33
|
+
"editPatientDetailsBreadcrumb": "Edit patient details",
|
|
34
|
+
"error": "Error",
|
|
35
|
+
"errorFetchingOrderedFields": "Error occured fetching ordered fields for address hierarchy",
|
|
36
|
+
"estimatedAgeInMonthsLabelText": "Estimated age in months",
|
|
37
|
+
"estimatedAgeInYearsLabelText": "Estimated age in years",
|
|
38
|
+
"familyNameLabelText": "Family Name",
|
|
39
|
+
"familyNameRequired": "",
|
|
40
|
+
"female": "Female",
|
|
41
|
+
"fullNameLabelText": "Full Name",
|
|
42
|
+
"genderLabelText": "Sex",
|
|
43
|
+
"genderRequired": "",
|
|
44
|
+
"genderUnspecified": "",
|
|
45
|
+
"givenNameLabelText": "First Name",
|
|
46
|
+
"givenNameRequired": "",
|
|
47
|
+
"identifierValueRequired": "Identifier value is required",
|
|
48
|
+
"idFieldLabelText": "Identifiers",
|
|
49
|
+
"IDInstructions": "Select the identifiers you'd like to add for this patient:",
|
|
50
|
+
"incompleteForm": "Incomplete form",
|
|
51
|
+
"invalidEmail": "",
|
|
52
|
+
"invalidInput": "Invalid Input",
|
|
53
|
+
"isDeadInputLabel": "Is Dead",
|
|
54
|
+
"jumpTo": "Jump to",
|
|
55
|
+
"male": "Male",
|
|
56
|
+
"middleNameLabelText": "Middle Name",
|
|
57
|
+
"negativeMonths": "",
|
|
58
|
+
"negativeYears": "",
|
|
59
|
+
"no": "No",
|
|
60
|
+
"numberInNameDubious": "",
|
|
61
|
+
"obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
|
|
62
|
+
"optional": "optional",
|
|
63
|
+
"other": "Other",
|
|
64
|
+
"patient": "Patient",
|
|
65
|
+
"patientNameKnown": "Patient's Name is Known?",
|
|
66
|
+
"patientRegistrationBreadcrumb": "Patient Registration",
|
|
67
|
+
"registerPatient": "Register Patient",
|
|
68
|
+
"registerPatientSuccessSnackbarSubtitle": "The patient can now be found by searching for them using their name or ID number",
|
|
69
|
+
"registerPatientSuccessSnackbarTitle": "New Patient Created",
|
|
70
|
+
"registrationErrorSnackbarTitle": "Patient Registration Failed",
|
|
71
|
+
"relationship": "Relationship",
|
|
72
|
+
"relationshipPersonMustExist": "Related person must be an existing person",
|
|
73
|
+
"relationshipPlaceholder": "Relationship",
|
|
74
|
+
"relationshipRemovedText": "Relationship removed",
|
|
75
|
+
"relationshipsSection": "Relationships",
|
|
76
|
+
"relationshipToPatient": "Relationship to patient",
|
|
77
|
+
"relativeFullNameLabelText": "Related person",
|
|
78
|
+
"relativeNamePlaceholder": "Firstname Familyname",
|
|
79
|
+
"resetIdentifierTooltip": "Reset",
|
|
80
|
+
"restoreRelationshipActionButton": "Undo",
|
|
81
|
+
"searchAddress": "Search address",
|
|
82
|
+
"searchIdentifierPlaceholder": "Search identifier",
|
|
83
|
+
"selectAnOption": "Select an option",
|
|
84
|
+
"sexFieldLabelText": "Sex",
|
|
85
|
+
"source": "Source",
|
|
86
|
+
"stroke": "Stroke",
|
|
87
|
+
"submitting": "Submitting",
|
|
88
|
+
"unableToFetch": "Unable to fetch person attribute type - {{personattributetype}}",
|
|
89
|
+
"unknown": "Unknown",
|
|
90
|
+
"unknownPatientAttributeType": "Patient attribute type has unknown format {{personAttributeTypeFormat}}",
|
|
91
|
+
"updatePatient": "Update Patient",
|
|
92
|
+
"updatePatientErrorSnackbarTitle": "Patient Details Update Failed",
|
|
93
|
+
"updatePatientSuccessSnackbarSubtitle": "The patient's information has been successfully updated",
|
|
94
|
+
"updatePatientSuccessSnackbarTitle": "Patient Details Updated",
|
|
95
|
+
"yearsEstimateRequired": "",
|
|
96
|
+
"yes": "Yes"
|
|
97
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addRelationshipButtonText": "أضف علاقة",
|
|
3
|
+
"addressHeader": "العنوان",
|
|
4
|
+
"allFieldsRequiredText": "جميع الحقول مطلوبة ما لم يتم التأشير عليها بأنها اختيارية",
|
|
5
|
+
"autoGeneratedPlaceholderText": "تم إنشاؤه تلقائيًا",
|
|
6
|
+
"birthdayNotInTheFuture": "",
|
|
7
|
+
"birthdayRequired": "",
|
|
8
|
+
"birthFieldLabelText": "الميلاد",
|
|
9
|
+
"cancel": "إلغاء",
|
|
10
|
+
"causeOfDeathInputLabel": "سبب الوفاة",
|
|
11
|
+
"closeOverlay": "Close overlay",
|
|
12
|
+
"codedPersonAttributeAnswerSetEmpty": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an answer concept set UUID '{{answerConceptSetUuid}}' that does not have any concept answers.",
|
|
13
|
+
"codedPersonAttributeAnswerSetInvalid": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an invalid answer concept set UUID '{{answerConceptSetUuid}}'.",
|
|
14
|
+
"codedPersonAttributeNoAnswerSet": "The person attribute field '{{codedPersonAttributeFieldId}}' is of type 'coded' but has been defined without an answer concept set UUID. The 'answerConceptSetUuid' key is required.",
|
|
15
|
+
"configure": "تكوين",
|
|
16
|
+
"configureIdentifiers": "Configure identifiers",
|
|
17
|
+
"contactSection": "تفاصيل الاتصال",
|
|
18
|
+
"createNew": "أنشئ جديد",
|
|
19
|
+
"dateOfBirthLabelText": "تاريخ الميلاد",
|
|
20
|
+
"deathDateInputLabel": "تاريخ الوفاة",
|
|
21
|
+
"deathdayNotInTheFuture": "",
|
|
22
|
+
"deathSection": "معلومات الوفاة",
|
|
23
|
+
"deleteIdentifierTooltip": "حذف",
|
|
24
|
+
"deleteRelationshipTooltipText": "حذف",
|
|
25
|
+
"demographicsSection": "معلومات أساسية",
|
|
26
|
+
"discard": "تجاهل",
|
|
27
|
+
"discardModalBody": "لم يتم حفظ التغييرات التي قمت بها في تفاصيل هذا المريض. هل تريد تجاهل التغييرات؟",
|
|
28
|
+
"discardModalHeader": "تأكيد تجاهل التغييرات",
|
|
29
|
+
"dobToggleLabelText": "هل تاريخ الميلاد معروف؟",
|
|
30
|
+
"edit": "تعديل",
|
|
31
|
+
"editIdentifierTooltip": "تعديل",
|
|
32
|
+
"editPatientDetails": "تعديل تفاصيل المريض",
|
|
33
|
+
"editPatientDetailsBreadcrumb": "Edit patient details",
|
|
34
|
+
"error": "خطأ",
|
|
35
|
+
"errorFetchingOrderedFields": "حدث خطأ أثناء جلب الحقول المرتبة لتسلسل العنوان",
|
|
36
|
+
"estimatedAgeInMonthsLabelText": "العمر المقدر بالشهور",
|
|
37
|
+
"estimatedAgeInYearsLabelText": "العمر المقدر بالسنوات",
|
|
38
|
+
"familyNameLabelText": "اسم العائلة",
|
|
39
|
+
"familyNameRequired": "",
|
|
40
|
+
"female": "أنثى",
|
|
41
|
+
"fullNameLabelText": "الاسم الكامل",
|
|
42
|
+
"genderLabelText": "الجنس",
|
|
43
|
+
"genderRequired": "",
|
|
44
|
+
"genderUnspecified": "",
|
|
45
|
+
"givenNameLabelText": "الاسم الأول",
|
|
46
|
+
"givenNameRequired": "",
|
|
47
|
+
"identifierValueRequired": "قيمة المعرف مطلوبة",
|
|
48
|
+
"idFieldLabelText": "المعرفات",
|
|
49
|
+
"IDInstructions": "Select the identifiers you'd like to add for this patient:",
|
|
50
|
+
"incompleteForm": "نموذج غير مكتمل",
|
|
51
|
+
"invalidEmail": "",
|
|
52
|
+
"invalidInput": "إدخال غير صالح",
|
|
53
|
+
"isDeadInputLabel": "هل المريض متوفى؟",
|
|
54
|
+
"jumpTo": "اذهب إلى",
|
|
55
|
+
"male": "ذكر",
|
|
56
|
+
"middleNameLabelText": "الاسم الأوسط",
|
|
57
|
+
"negativeMonths": "",
|
|
58
|
+
"negativeYears": "",
|
|
59
|
+
"no": "لا",
|
|
60
|
+
"numberInNameDubious": "",
|
|
61
|
+
"obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
|
|
62
|
+
"optional": "اختياري",
|
|
63
|
+
"other": "آخر",
|
|
64
|
+
"patient": "المريض",
|
|
65
|
+
"patientNameKnown": "هل اسم المريض معروف؟",
|
|
66
|
+
"patientRegistrationBreadcrumb": "Patient Registration",
|
|
67
|
+
"registerPatient": "تسجيل المريض",
|
|
68
|
+
"registerPatientSuccessSnackbarSubtitle": "The patient can now be found by searching for them using their name or ID number",
|
|
69
|
+
"registerPatientSuccessSnackbarTitle": "New Patient Created",
|
|
70
|
+
"registrationErrorSnackbarTitle": "Patient Registration Failed",
|
|
71
|
+
"relationship": "العلاقة",
|
|
72
|
+
"relationshipPersonMustExist": "Related person must be an existing person",
|
|
73
|
+
"relationshipPlaceholder": "العلاقة",
|
|
74
|
+
"relationshipRemovedText": "تمت إزالة العلاقة",
|
|
75
|
+
"relationshipsSection": "العلاقات",
|
|
76
|
+
"relationshipToPatient": "العلاقة بالمريض",
|
|
77
|
+
"relativeFullNameLabelText": "الاسم الكامل للقريب",
|
|
78
|
+
"relativeNamePlaceholder": "الاسم الأول اسم العائلة",
|
|
79
|
+
"resetIdentifierTooltip": "إعادة تعيين",
|
|
80
|
+
"restoreRelationshipActionButton": "تراجع",
|
|
81
|
+
"searchAddress": "ابحث عن العنوان",
|
|
82
|
+
"searchIdentifierPlaceholder": "Search identifier",
|
|
83
|
+
"selectAnOption": "اختر خيارًا",
|
|
84
|
+
"sexFieldLabelText": "الجنس",
|
|
85
|
+
"source": "Source",
|
|
86
|
+
"stroke": "جلطة",
|
|
87
|
+
"submitting": "Submitting",
|
|
88
|
+
"unableToFetch": "تعذر الجلب نوع السمة الشخصية - {{personattributetype}}",
|
|
89
|
+
"unknown": "غير معروف",
|
|
90
|
+
"unknownPatientAttributeType": "Patient attribute type has unknown format {{personAttributeTypeFormat}}",
|
|
91
|
+
"updatePatient": "تحديث المريض",
|
|
92
|
+
"updatePatientErrorSnackbarTitle": "Patient Details Update Failed",
|
|
93
|
+
"updatePatientSuccessSnackbarSubtitle": "The patient's information has been successfully updated",
|
|
94
|
+
"updatePatientSuccessSnackbarTitle": "Patient Details Updated",
|
|
95
|
+
"yearsEstimateRequired": "",
|
|
96
|
+
"yes": "نعم"
|
|
97
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addRelationshipButtonText": "Add Relationship",
|
|
3
|
+
"addressHeader": "Address",
|
|
4
|
+
"allFieldsRequiredText": "All fields are required unless marked optional",
|
|
5
|
+
"autoGeneratedPlaceholderText": "Auto-generated",
|
|
6
|
+
"birthdayNotInTheFuture": "Birthday cannot be in the future",
|
|
7
|
+
"birthdayRequired": "Birthday is required",
|
|
8
|
+
"birthFieldLabelText": "Birth",
|
|
9
|
+
"cancel": "Cancel",
|
|
10
|
+
"causeOfDeathInputLabel": "Cause of Death",
|
|
11
|
+
"clientRegistry": "Client registry",
|
|
12
|
+
"closeOverlay": "Close overlay",
|
|
13
|
+
"codedPersonAttributeAnswerSetEmpty": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an answer concept set UUID '{{answerConceptSetUuid}}' that does not have any concept answers.",
|
|
14
|
+
"codedPersonAttributeAnswerSetInvalid": "The coded person attribute field '{{codedPersonAttributeFieldId}}' has been defined with an invalid answer concept set UUID '{{answerConceptSetUuid}}'.",
|
|
15
|
+
"codedPersonAttributeNoAnswerSet": "The person attribute field '{{codedPersonAttributeFieldId}}' is of type 'coded' but has been defined without an answer concept set UUID. The 'answerConceptSetUuid' key is required.",
|
|
16
|
+
"configure": "Configure",
|
|
17
|
+
"configureIdentifiers": "Configure identifiers",
|
|
18
|
+
"contactSection": "Contact Details",
|
|
19
|
+
"contactSupport": "Contact supportt",
|
|
20
|
+
"createNew": "Create New",
|
|
21
|
+
"dateOfBirthLabelText": "Date of Birth",
|
|
22
|
+
"deathDateInputLabel": "Date of Death",
|
|
23
|
+
"deathdayNotInTheFuture": "Death day cannot be in the future",
|
|
24
|
+
"deathSection": "Death Info",
|
|
25
|
+
"deleteIdentifierTooltip": "Delete",
|
|
26
|
+
"deleteRelationshipTooltipText": "Delete",
|
|
27
|
+
"demographicsSection": "Basic Info",
|
|
28
|
+
"discard": "Discard",
|
|
29
|
+
"discardModalBody": "The changes you made to this patient's details have not been saved. Discard changes?",
|
|
30
|
+
"discardModalHeader": "Confirm Discard Changes",
|
|
31
|
+
"dobToggleLabelText": "Date of Birth Known?",
|
|
32
|
+
"edit": "Edit",
|
|
33
|
+
"editIdentifierTooltip": "Edit",
|
|
34
|
+
"editPatientDetails": "Edit patient details",
|
|
35
|
+
"editPatientDetailsBreadcrumb": "Edit patient details",
|
|
36
|
+
"error": "Error",
|
|
37
|
+
"errorFetchingOrderedFields": "Error occured fetching ordered fields for address hierarchy",
|
|
38
|
+
"estimatedAgeInMonthsLabelText": "Estimated age in months",
|
|
39
|
+
"estimatedAgeInYearsLabelText": "Estimated age in years",
|
|
40
|
+
"familyNameLabelText": "Family Name",
|
|
41
|
+
"familyNameRequired": "Family name is required",
|
|
42
|
+
"female": "Female",
|
|
43
|
+
"fullNameLabelText": "Full Name",
|
|
44
|
+
"gender": "Gender",
|
|
45
|
+
"genderLabelText": "Sex",
|
|
46
|
+
"genderRequired": "Gender is required",
|
|
47
|
+
"genderUnspecified": "Gender is not specified",
|
|
48
|
+
"givenNameLabelText": "First Name",
|
|
49
|
+
"givenNameRequired": "Given name is required",
|
|
50
|
+
"identifierValueRequired": "Identifier value is required",
|
|
51
|
+
"idFieldLabelText": "Identifiers",
|
|
52
|
+
"IDInstructions": "Select the identifiers you'd like to add for this patient:",
|
|
53
|
+
"incompleteForm": "Incomplete form",
|
|
54
|
+
"invalidEmail": "A valid email has to be given",
|
|
55
|
+
"invalidInput": "Invalid Input",
|
|
56
|
+
"isDeadInputLabel": "Is Dead",
|
|
57
|
+
"jumpTo": "Jump to",
|
|
58
|
+
"male": "Male",
|
|
59
|
+
"middleNameLabelText": "Middle Name",
|
|
60
|
+
"negativeMonths": "Negative months",
|
|
61
|
+
"negativeYears": "Negative years",
|
|
62
|
+
"no": "No",
|
|
63
|
+
"numberInNameDubious": "Number in name is dubious",
|
|
64
|
+
"obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
|
|
65
|
+
"optional": "optional",
|
|
66
|
+
"other": "Other",
|
|
67
|
+
"patient": "Patient",
|
|
68
|
+
"patientNameKnown": "Patient's Name is Known?",
|
|
69
|
+
"patientRegistrationBreadcrumb": "Patient Registration",
|
|
70
|
+
"patientVerification": "Patient Verification",
|
|
71
|
+
"registerPatient": "Register Patient",
|
|
72
|
+
"registerPatientSuccessSnackbarSubtitle": "The patient can now be found by searching for them using their name or ID number",
|
|
73
|
+
"registerPatientSuccessSnackbarTitle": "New Patient Created",
|
|
74
|
+
"registrationErrorSnackbarTitle": "Patient Registration Failed",
|
|
75
|
+
"relationship": "Relationship",
|
|
76
|
+
"relationshipPersonMustExist": "Related person must be an existing person",
|
|
77
|
+
"relationshipPlaceholder": "Relationship",
|
|
78
|
+
"relationshipRemovedText": "Relationship removed",
|
|
79
|
+
"relationshipsSection": "Relationships",
|
|
80
|
+
"relationshipToPatient": "Relationship to patient",
|
|
81
|
+
"relativeFullNameLabelText": "Related person",
|
|
82
|
+
"relativeNamePlaceholder": "Firstname Familyname",
|
|
83
|
+
"resetIdentifierTooltip": "Reset",
|
|
84
|
+
"restoreRelationshipActionButton": "Undo",
|
|
85
|
+
"searchAddress": "Search address",
|
|
86
|
+
"searchIdentifierPlaceholder": "Search identifier",
|
|
87
|
+
"searchRegistry": "Search Registry",
|
|
88
|
+
"selectAnOption": "Select an option",
|
|
89
|
+
"sexFieldLabelText": "Sex",
|
|
90
|
+
"source": "Source",
|
|
91
|
+
"stroke": "Stroke",
|
|
92
|
+
"submitting": "Submitting",
|
|
93
|
+
"unableToFetch": "Unable to fetch person attribute type {{personattributetype}}",
|
|
94
|
+
"unknown": "Unknown",
|
|
95
|
+
"unknownPatientAttributeType": "Patient attribute type has unknown format {{personAttributeTypeFormat}}",
|
|
96
|
+
"updatePatient": "Update Patient",
|
|
97
|
+
"updatePatientErrorSnackbarTitle": "Patient Details Update Failed",
|
|
98
|
+
"updatePatientSuccessSnackbarSubtitle": "The patient's information has been successfully updated",
|
|
99
|
+
"updatePatientSuccessSnackbarTitle": "Patient Details Updated",
|
|
100
|
+
"useValues": "Use Values",
|
|
101
|
+
"yearsEstimateRequired": "Years estimate required",
|
|
102
|
+
"yes": "Yes"
|
|
103
|
+
}
|