@kenyaemr/esm-patient-registration-app 8.0.1-pre.99 → 8.0.3-pre.131
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 +23 -22
- package/dist/108.js +1 -0
- package/dist/108.js.map +1 -0
- package/dist/130.js +1 -1
- package/dist/130.js.LICENSE.txt +2 -0
- package/dist/130.js.map +1 -1
- package/dist/2.js +1 -0
- package/dist/2.js.map +1 -0
- package/dist/250.js +1 -0
- package/dist/250.js.map +1 -0
- package/dist/271.js +1 -1
- package/dist/319.js +1 -1
- package/dist/325.js +1 -0
- package/dist/325.js.map +1 -0
- package/dist/372.js +2 -0
- package/dist/372.js.map +1 -0
- package/dist/460.js +1 -1
- package/dist/574.js +1 -1
- package/dist/644.js +1 -1
- package/dist/66.js +1 -0
- package/dist/66.js.map +1 -0
- package/dist/662.js +1 -0
- package/dist/662.js.map +1 -0
- package/dist/757.js +1 -1
- package/dist/{59.js → 76.js} +1 -1
- package/dist/{59.js.map → 76.js.map} +1 -1
- package/dist/788.js +1 -1
- package/dist/807.js +1 -1
- package/dist/833.js +1 -1
- package/dist/895.js +2 -0
- package/dist/895.js.LICENSE.txt +34 -0
- package/dist/895.js.map +1 -0
- package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +161 -188
- package/dist/kenyaemr-esm-patient-registration-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +10 -0
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package-lock.json +6047 -0
- package/package.json +3 -3
- package/src/client-registry/client-registry.component.tsx +22 -0
- package/src/client-registry/hie-client-registry/hie-client-registry.component.tsx +134 -0
- package/src/client-registry/hie-client-registry/hie-client-registry.scss +53 -0
- package/src/client-registry/hie-client-registry/hie-resource.ts +162 -0
- package/src/client-registry/hie-client-registry/hie-types.ts +29 -0
- package/src/client-registry/hie-client-registry/modal/confirm-hie.modal.tsx +82 -0
- package/src/client-registry/hie-client-registry/modal/confirm-hie.scss +10 -0
- package/src/{patient-verification → client-registry/patient-verification}/patient-verification-hook.tsx +1 -1
- package/src/{patient-verification → client-registry/patient-verification}/patient-verification-utils.ts +1 -1
- package/src/{patient-verification → client-registry/patient-verification}/patient-verification.component.tsx +1 -1
- package/src/{patient-verification → client-registry/patient-verification}/patient-verification.scss +1 -1
- package/src/{patient-verification → client-registry/patient-verification}/verification-modal/empty-prompt.component.tsx +9 -6
- package/src/config-schema.ts +72 -2
- package/src/index.ts +6 -6
- package/src/patient-registration/field/cause-of-death/cause-of-death.component.tsx +98 -0
- package/src/patient-registration/field/date-and-time-of-death/date-and-time-of-death.component.tsx +84 -0
- package/src/patient-registration/field/dob/dob.component.tsx +21 -7
- package/src/patient-registration/field/field.component.tsx +11 -5
- package/src/patient-registration/field/field.resource.ts +11 -4
- package/src/patient-registration/field/field.scss +44 -5
- package/src/patient-registration/field/gender/gender-field.component.tsx +2 -1
- package/src/patient-registration/field/gender/gender-field.test.tsx +1 -0
- package/src/patient-registration/field/id/id-field.component.tsx +8 -6
- package/src/patient-registration/field/id/id-field.test.tsx +27 -8
- package/src/patient-registration/field/name/name-field.component.tsx +5 -1
- package/src/patient-registration/field/person-attributes/coded-person-attribute-field.component.tsx +1 -0
- package/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx +76 -27
- package/src/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx +105 -0
- package/src/patient-registration/field/person-attributes/location-person-attribute-field.resource.tsx +48 -0
- package/src/patient-registration/field/person-attributes/person-attribute-field.component.tsx +12 -1
- package/src/patient-registration/field/person-attributes/useUpdateIdentifierRequirement.tsx +83 -0
- package/src/patient-registration/form-manager.test.ts +21 -0
- package/src/patient-registration/form-manager.ts +40 -20
- package/src/patient-registration/input/basic-input/input/input.component.tsx +5 -1
- package/src/patient-registration/input/custom-input/identifier/identifier-input.component.tsx +18 -10
- package/src/patient-registration/input/custom-input/identifier/identifier-input.test.tsx +166 -67
- package/src/patient-registration/input/dummy-data/dummy-data-input.component.tsx +3 -0
- package/src/patient-registration/input/input.scss +5 -0
- package/src/patient-registration/patient-registration-context.ts +4 -3
- package/src/patient-registration/patient-registration-hooks.ts +67 -9
- package/src/patient-registration/patient-registration-utils.ts +3 -7
- package/src/patient-registration/patient-registration.component.tsx +44 -30
- package/src/patient-registration/patient-registration.resource.ts +8 -0
- package/src/patient-registration/patient-registration.test.tsx +9 -3
- package/src/patient-registration/patient-registration.types.ts +4 -1
- package/src/patient-registration/section/death-info/death-info-section.component.tsx +22 -17
- package/src/patient-registration/section/death-info/death-info-section.test.tsx +4 -14
- package/src/patient-registration/section/section.component.tsx +1 -1
- package/src/patient-registration/section/section.scss +5 -0
- package/src/patient-registration/validation/{patient-registration-validation.test.tsx → patient-registration-validation.test.ts} +26 -4
- package/src/patient-registration/validation/patient-registration-validation.ts +126 -0
- package/src/routes.json +14 -17
- package/src/widgets/cancel-patient-edit.modal.tsx +33 -0
- package/src/widgets/cancel-patient-edit.test.tsx +2 -3
- package/src/widgets/delete-identifier-confirmation.modal.tsx +22 -15
- package/src/widgets/delete-identifier-confirmation.test.tsx +2 -1
- package/translations/am.json +36 -25
- package/translations/ar.json +37 -26
- package/translations/en.json +51 -20
- package/translations/es.json +38 -26
- package/translations/fr.json +47 -35
- package/translations/he.json +37 -30
- package/translations/km.json +37 -30
- package/translations/zh.json +37 -20
- package/translations/zh_CN.json +37 -20
- package/dist/152.js +0 -1
- package/dist/152.js.map +0 -1
- package/dist/255.js +0 -2
- package/dist/255.js.map +0 -1
- package/dist/303.js +0 -1
- package/dist/303.js.map +0 -1
- package/dist/330.js +0 -1
- package/dist/330.js.map +0 -1
- package/dist/564.js +0 -1
- package/dist/564.js.map +0 -1
- package/dist/623.js +0 -1
- package/dist/623.js.map +0 -1
- package/dist/729.js +0 -1
- package/dist/729.js.map +0 -1
- package/dist/735.js +0 -1
- package/dist/735.js.map +0 -1
- package/dist/831.js +0 -2
- package/dist/831.js.LICENSE.txt +0 -14
- package/dist/831.js.map +0 -1
- package/src/patient-registration/validation/patient-registration-validation.tsx +0 -60
- package/src/widgets/cancel-patient-edit.component.tsx +0 -37
- package/src/widgets/delete-identifier-confirmation.scss +0 -34
- /package/dist/{255.js.LICENSE.txt → 372.js.LICENSE.txt} +0 -0
- /package/src/{patient-verification → client-registry/patient-verification}/assets/counties.json +0 -0
- /package/src/{patient-verification → client-registry/patient-verification}/assets/verification-assets.ts +0 -0
- /package/src/{patient-verification → client-registry/patient-verification}/verification-modal/confirm-prompt.component.tsx +0 -0
- /package/src/{patient-verification → client-registry/patient-verification}/verification-types.ts +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as Yup from 'yup';
|
|
2
|
-
import mapValues from 'lodash/mapValues';
|
|
3
|
-
import { type FormValues } from '../patient-registration.types';
|
|
4
|
-
import { type RegistrationConfig } from '../../config-schema';
|
|
5
|
-
|
|
6
|
-
export function getValidationSchema(config: RegistrationConfig) {
|
|
7
|
-
return Yup.object({
|
|
8
|
-
givenName: Yup.string().required('givenNameRequired'),
|
|
9
|
-
familyName: Yup.string().required('familyNameRequired'),
|
|
10
|
-
additionalGivenName: Yup.string().when('addNameInLocalLanguage', {
|
|
11
|
-
is: true,
|
|
12
|
-
then: Yup.string().required('givenNameRequired'),
|
|
13
|
-
otherwise: Yup.string().notRequired(),
|
|
14
|
-
}),
|
|
15
|
-
additionalFamilyName: Yup.string().when('addNameInLocalLanguage', {
|
|
16
|
-
is: true,
|
|
17
|
-
then: Yup.string().required('familyNameRequired'),
|
|
18
|
-
otherwise: Yup.string().notRequired(),
|
|
19
|
-
}),
|
|
20
|
-
gender: Yup.string()
|
|
21
|
-
.oneOf(
|
|
22
|
-
config.fieldConfigurations.gender.map((g) => g.value),
|
|
23
|
-
'genderUnspecified',
|
|
24
|
-
)
|
|
25
|
-
.required('genderRequired'),
|
|
26
|
-
birthdate: Yup.date().when('birthdateEstimated', {
|
|
27
|
-
is: false,
|
|
28
|
-
then: Yup.date().required('birthdayRequired').max(Date(), 'birthdayNotInTheFuture').nullable(),
|
|
29
|
-
otherwise: Yup.date().nullable(),
|
|
30
|
-
}),
|
|
31
|
-
yearsEstimated: Yup.number().when('birthdateEstimated', {
|
|
32
|
-
is: true,
|
|
33
|
-
then: Yup.number().required('yearsEstimateRequired').min(0, 'negativeYears'),
|
|
34
|
-
otherwise: Yup.number().nullable(),
|
|
35
|
-
}),
|
|
36
|
-
monthsEstimated: Yup.number().min(0, 'negativeMonths'),
|
|
37
|
-
deathDate: Yup.date().max(Date(), 'deathdayNotInTheFuture').nullable(),
|
|
38
|
-
email: Yup.string().optional().email('invalidEmail'),
|
|
39
|
-
identifiers: Yup.lazy((obj: FormValues['identifiers']) =>
|
|
40
|
-
Yup.object(
|
|
41
|
-
mapValues(obj, () =>
|
|
42
|
-
Yup.object({
|
|
43
|
-
required: Yup.bool(),
|
|
44
|
-
identifierValue: Yup.string().when('required', {
|
|
45
|
-
is: true,
|
|
46
|
-
then: Yup.string().required('identifierValueRequired'),
|
|
47
|
-
otherwise: Yup.string().notRequired(),
|
|
48
|
-
}),
|
|
49
|
-
}),
|
|
50
|
-
),
|
|
51
|
-
),
|
|
52
|
-
),
|
|
53
|
-
relationships: Yup.array().of(
|
|
54
|
-
Yup.object().shape({
|
|
55
|
-
relatedPersonUuid: Yup.string().required(),
|
|
56
|
-
relationshipType: Yup.string().required(),
|
|
57
|
-
}),
|
|
58
|
-
),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '@carbon/react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
interface CancelPatientEditProps {
|
|
6
|
-
close(): void;
|
|
7
|
-
onConfirm(): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const CancelPatientEdit: React.FC<CancelPatientEditProps> = ({ close, onConfirm }) => {
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<div className="cds--modal-header">
|
|
15
|
-
<h3 className="cds--modal-header__heading">{t('discardModalHeader', 'Confirm Discard Changes')}</h3>
|
|
16
|
-
</div>
|
|
17
|
-
<div className="cds--modal-content">
|
|
18
|
-
<p>
|
|
19
|
-
{t(
|
|
20
|
-
'discardModalBody',
|
|
21
|
-
"The changes you made to this patient's details have not been saved. Discard changes?",
|
|
22
|
-
)}
|
|
23
|
-
</p>
|
|
24
|
-
</div>
|
|
25
|
-
<div className="cds--modal-footer">
|
|
26
|
-
<Button kind="secondary" onClick={close}>
|
|
27
|
-
{t('cancel', 'Cancel')}
|
|
28
|
-
</Button>
|
|
29
|
-
<Button kind="danger" onClick={onConfirm}>
|
|
30
|
-
{t('discard', 'Discard')}
|
|
31
|
-
</Button>
|
|
32
|
-
</div>
|
|
33
|
-
</>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default CancelPatientEdit;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
@use '@carbon/layout';
|
|
2
|
-
@use '@carbon/type';
|
|
3
|
-
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
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: layout.$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: layout.$spacing-05 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.buttonSet {
|
|
25
|
-
display: grid;
|
|
26
|
-
grid-template-columns: 1fr 1fr;
|
|
27
|
-
margin-left: -(layout.$spacing-05);
|
|
28
|
-
margin-right: -(layout.$spacing-05);
|
|
29
|
-
margin-bottom: -(layout.$spacing-05);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.buttonSet > button {
|
|
33
|
-
max-width: unset !important;
|
|
34
|
-
}
|
|
File without changes
|
/package/src/{patient-verification → client-registry/patient-verification}/assets/counties.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{patient-verification → client-registry/patient-verification}/verification-types.ts
RENAMED
|
File without changes
|