@kenyaemr/esm-patient-registration-app 4.5.3 → 4.5.5
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/dist/117.js +2 -0
- package/dist/117.js.map +1 -0
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/208.js +1 -1
- package/dist/218.js +1 -0
- package/dist/218.js.map +1 -0
- package/dist/275.js +1 -0
- package/dist/275.js.map +1 -0
- package/dist/319.js +1 -1
- package/dist/{821.js → 348.js} +1 -1
- package/dist/{821.js.map → 348.js.map} +1 -1
- package/dist/574.js +1 -1
- package/dist/68.js +1 -1
- package/dist/68.js.map +1 -1
- package/dist/693.js +1 -0
- package/dist/693.js.map +1 -0
- package/dist/757.js +1 -1
- package/dist/788.js +1 -1
- package/dist/807.js +1 -1
- package/dist/833.js +1 -1
- package/dist/879.js +1 -0
- package/dist/879.js.map +1 -0
- package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +171 -122
- package/dist/kenyaemr-esm-patient-registration-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/jest.config.js +3 -0
- package/package.json +5 -2
- package/src/config-schema.ts +11 -5
- package/src/index.ts +9 -2
- package/src/offline.resources.ts +8 -4
- package/src/offline.ts +1 -1
- package/src/patient-registration/field/__mocks__/field.resource.ts +1 -1
- package/src/patient-registration/field/address/address-field.component.tsx +25 -70
- package/src/patient-registration/field/address/address-hierarchy-levels.component.tsx +11 -9
- package/src/patient-registration/field/address/address-hierarchy.resource.tsx +57 -3
- package/src/patient-registration/field/address/address-search.component.tsx +1 -1
- package/src/patient-registration/field/address/tests/address-hierarchy.test.tsx +137 -63
- package/src/patient-registration/field/address/tests/address-search-component.test.tsx +128 -0
- package/src/patient-registration/field/address/tests/mocks.ts +93 -99
- package/src/patient-registration/field/dob/dob.component.tsx +48 -44
- package/src/patient-registration/field/dob/dob.test.tsx +6 -1
- package/src/patient-registration/field/field.resource.ts +1 -1
- package/src/patient-registration/field/id/id-field.component.tsx +1 -1
- package/src/patient-registration/field/id/identifier-selection-overlay.tsx +1 -1
- package/src/patient-registration/field/name/name-field.component.tsx +38 -22
- package/src/patient-registration/field/obs/obs-field.component.tsx +14 -13
- package/src/patient-registration/field/person-attributes/coded-attributes.component.tsx +1 -1
- package/src/patient-registration/field/person-attributes/coded-person-attribute-field.component.tsx +1 -1
- package/src/patient-registration/field/person-attributes/coded-person-attribute-field.test.tsx +103 -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.tsx +1 -1
- package/src/patient-registration/field/person-attributes/text-person-attribute-field.component.tsx +3 -3
- package/src/patient-registration/field/person-attributes/text-person-attribute-field.test.tsx +88 -0
- package/src/patient-registration/form-manager.test.ts +1 -2
- package/src/patient-registration/form-manager.ts +1 -9
- package/src/patient-registration/input/basic-input/input/input.test.tsx +0 -135
- package/src/patient-registration/input/basic-input/select/select-input.test.tsx +8 -4
- package/src/patient-registration/input/combo-input/combo-input.component.tsx +8 -6
- package/src/patient-registration/input/custom-input/identifier/identifier-input.component.tsx +1 -1
- package/src/patient-registration/input/custom-input/identifier/utils.test.ts +81 -0
- package/src/patient-registration/input/custom-input/identifier/utils.ts +1 -1
- package/src/patient-registration/input/dummy-data/dummy-data-input.component.tsx +1 -2
- package/src/patient-registration/patient-registration-context.ts +1 -1
- package/src/patient-registration/patient-registration-hooks.ts +14 -2
- package/src/patient-registration/patient-registration-utils.ts +1 -4
- package/src/patient-registration/patient-registration.component.tsx +1 -12
- package/src/patient-registration/patient-registration.resource.tsx +1 -72
- package/src/patient-registration/patient-registration.test.tsx +250 -247
- package/src/patient-registration/{patient-registration-types.tsx → patient-registration.types.tsx} +45 -1
- package/src/patient-registration/section/patient-relationships/relationships-section.component.tsx +83 -79
- package/src/patient-registration/section/patient-relationships/relationships-section.test.tsx +88 -0
- package/src/patient-registration/section/patient-relationships/relationships.resource.tsx +1 -1
- package/src/patient-registration/validation/patient-registration-validation.tsx +1 -1
- package/src/patient-verification/patient-verification-hook.tsx +12 -1
- package/src/patient-verification/patient-verification-utils.ts +1 -1
- package/src/patient-verification/patient-verification.component.tsx +1 -1
- package/src/patient-verification/verification-modal/confirm-prompt.component.tsx +11 -0
- package/src/root.component.tsx +1 -1
- package/src/routes.json +62 -51
- package/src/widgets/cancel-patient-edit.test.tsx +24 -0
- package/src/widgets/delete-identifier-confirmation-modal.test.tsx +31 -0
- package/src/widgets/display-photo.test.tsx +37 -0
- package/src/widgets/edit-patient-details-button.test.tsx +36 -0
- package/translations/am.json +0 -7
- package/translations/en.json +2 -5
- package/translations/es.json +0 -7
- package/translations/fr.json +0 -7
- package/translations/he.json +0 -7
- package/translations/km.json +0 -7
- package/__mocks__/react-i18next.js +0 -49
- package/dist/196.js +0 -1
- package/dist/196.js.map +0 -1
- package/dist/59.js +0 -1
- package/dist/59.js.map +0 -1
- package/dist/9.js +0 -2
- package/dist/9.js.map +0 -1
- /package/dist/{9.js.LICENSE.txt → 117.js.LICENSE.txt} +0 -0
package/translations/en.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addRelationshipButtonText": "Add Relationship",
|
|
3
|
-
"address1": "Address line 1",
|
|
4
|
-
"address2": "Address line 2",
|
|
5
3
|
"addressHeader": "Address",
|
|
6
4
|
"age": "Age",
|
|
7
5
|
"allFieldsRequiredText": "All fields are required unless marked optional",
|
|
@@ -11,11 +9,11 @@
|
|
|
11
9
|
"birthFieldLabelText": "Birth",
|
|
12
10
|
"cancel": "Cancel",
|
|
13
11
|
"causeOfDeathInputLabel": "Cause of Death",
|
|
12
|
+
"configure": "Configure",
|
|
13
|
+
"contactSection": "Contact Details",
|
|
14
14
|
"cityVillage": "City",
|
|
15
15
|
"clientRegistryEmpty": "Create & Post Patient",
|
|
16
16
|
"clientVerificationWithClientRegistry": "Client verification with client registry",
|
|
17
|
-
"configure": "Configure",
|
|
18
|
-
"contactSection": "Contact Details",
|
|
19
17
|
"continue": "Continue",
|
|
20
18
|
"country": "Country",
|
|
21
19
|
"countyDistrict": "District",
|
|
@@ -93,7 +91,6 @@
|
|
|
93
91
|
"selectCountry": "Select country",
|
|
94
92
|
"selectIdentifierType": "Select identifier type",
|
|
95
93
|
"sexFieldLabelText": "Sex",
|
|
96
|
-
"stateProvince": "State",
|
|
97
94
|
"stroke": "Stroke",
|
|
98
95
|
"unableToFetch": "Unable to fetch person attribute type {personattributetype}",
|
|
99
96
|
"unknown": "Unknown",
|
package/translations/es.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addRelationshipButtonText": "Add Relationship",
|
|
3
|
-
"address1": "Address line 1",
|
|
4
|
-
"address2": "Address line 2",
|
|
5
3
|
"addressHeader": "Address",
|
|
6
4
|
"allFieldsRequiredText": "All fields are required unless marked optional",
|
|
7
5
|
"autoGeneratedPlaceholderText": "Auto-generated",
|
|
@@ -10,11 +8,8 @@
|
|
|
10
8
|
"birthFieldLabelText": "Birth",
|
|
11
9
|
"cancel": "Cancel",
|
|
12
10
|
"causeOfDeathInputLabel": "Cause of Death",
|
|
13
|
-
"cityVillage": "city",
|
|
14
11
|
"configure": "Configure",
|
|
15
12
|
"contactSection": "Contact Details",
|
|
16
|
-
"country": "Country",
|
|
17
|
-
"countyDistrict": "District",
|
|
18
13
|
"createNew": "Create New",
|
|
19
14
|
"dateOfBirthLabelText": "Date of Birth",
|
|
20
15
|
"deathDateInputLabel": "Date of Death",
|
|
@@ -63,7 +58,6 @@
|
|
|
63
58
|
"other": "Other",
|
|
64
59
|
"patient": "Patient",
|
|
65
60
|
"patientNameKnown": "Patient's Name is Known?",
|
|
66
|
-
"postalCode": "Postal code",
|
|
67
61
|
"registerPatient": "Register Patient",
|
|
68
62
|
"registrationSuccessToastDescription": "The patient can now be found by searching for them using their name or ID number",
|
|
69
63
|
"registrationSuccessToastTitle": "New Patient Created",
|
|
@@ -79,7 +73,6 @@
|
|
|
79
73
|
"searchAddress": "Search address",
|
|
80
74
|
"selectAnOption": "Select an option",
|
|
81
75
|
"sexFieldLabelText": "Sex",
|
|
82
|
-
"stateProvince": "State",
|
|
83
76
|
"stroke": "Stroke",
|
|
84
77
|
"unableToFetch": "Unable to fetch person attribute type - {personattributetype}",
|
|
85
78
|
"unknown": "Unknown",
|
package/translations/fr.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addRelationshipButtonText": "Ajouter un lien de parenté",
|
|
3
|
-
"address1": "Adresse 1",
|
|
4
|
-
"address2": "Adresse 2",
|
|
5
3
|
"addressHeader": "Adresse",
|
|
6
4
|
"allFieldsRequiredText": "Tous les champs sont requis sauf si explicitement indiqués facultatifs",
|
|
7
5
|
"autoGeneratedPlaceholderText": "Auto-generé",
|
|
@@ -10,11 +8,8 @@
|
|
|
10
8
|
"birthFieldLabelText": "Naissance",
|
|
11
9
|
"cancel": "Annuller",
|
|
12
10
|
"causeOfDeathInputLabel": "Cause de décès",
|
|
13
|
-
"cityVillage": "Ville",
|
|
14
11
|
"configure": "Configurer",
|
|
15
12
|
"contactSection": "Contact Details",
|
|
16
|
-
"country": "Pays",
|
|
17
|
-
"countyDistrict": "District",
|
|
18
13
|
"createNew": "Créer un nouveau",
|
|
19
14
|
"dateOfBirthLabelText": "Date de naissance",
|
|
20
15
|
"deathDateInputLabel": "Date de décès",
|
|
@@ -63,7 +58,6 @@
|
|
|
63
58
|
"other": "Autre",
|
|
64
59
|
"patient": "Patient",
|
|
65
60
|
"patientNameKnown": "Le nom du patient est connu?",
|
|
66
|
-
"postalCode": "Code postal",
|
|
67
61
|
"registerPatient": "Enregistrer un patient",
|
|
68
62
|
"registrationSuccessToastDescription": "Le patient peut maintenant être trouvé en faisant une recherche par son nom ou son numéro d'identification",
|
|
69
63
|
"registrationSuccessToastTitle": "Nouveau patient créé",
|
|
@@ -79,7 +73,6 @@
|
|
|
79
73
|
"searchAddress": "Chercher l'adresse",
|
|
80
74
|
"selectAnOption": "Select an option",
|
|
81
75
|
"sexFieldLabelText": "Sexe",
|
|
82
|
-
"stateProvince": "Etat",
|
|
83
76
|
"stroke": "Accident",
|
|
84
77
|
"unableToFetch": "Unable to fetch person attribute type - {personattributetype}",
|
|
85
78
|
"unknown": "Inconnu",
|
package/translations/he.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addRelationshipButtonText": "הוסף יחס",
|
|
3
|
-
"address1": "כתובת קו 1",
|
|
4
|
-
"address2": "כתובת קו 2",
|
|
5
3
|
"addressHeader": "כתובת",
|
|
6
4
|
"allFieldsRequiredText": "כל השדות נדרשים אלא אם צוין אחרת",
|
|
7
5
|
"autoGeneratedPlaceholderText": "נוצר אוטומטית",
|
|
@@ -10,11 +8,8 @@
|
|
|
10
8
|
"birthFieldLabelText": "לידה",
|
|
11
9
|
"cancel": "ביטול",
|
|
12
10
|
"causeOfDeathInputLabel": "סיבת המוות",
|
|
13
|
-
"cityVillage": "עיר",
|
|
14
11
|
"configure": "הגדר",
|
|
15
12
|
"contactSection": "Contact Details",
|
|
16
|
-
"country": "מדינה",
|
|
17
|
-
"countyDistrict": "מחוז",
|
|
18
13
|
"createNew": "צור חדש",
|
|
19
14
|
"dateOfBirthLabelText": "תאריך לידה",
|
|
20
15
|
"deathDateInputLabel": "תאריך המוות",
|
|
@@ -63,7 +58,6 @@
|
|
|
63
58
|
"other": "אחר",
|
|
64
59
|
"patient": "מטופל",
|
|
65
60
|
"patientNameKnown": "שם המטופל ידוע?",
|
|
66
|
-
"postalCode": "מיקוד",
|
|
67
61
|
"registerPatient": "רישום מטופל",
|
|
68
62
|
"registrationSuccessToastDescription": "המטופל נרשם בהצלחה וניתן למצוא אותו באמצעות חיפוש לפי שם או מספר תעודת זהות",
|
|
69
63
|
"registrationSuccessToastTitle": "נרשם מטופל חדש",
|
|
@@ -79,7 +73,6 @@
|
|
|
79
73
|
"searchAddress": "חיפוש כתובת",
|
|
80
74
|
"selectAnOption": "Select an option",
|
|
81
75
|
"sexFieldLabelText": "מין",
|
|
82
|
-
"stateProvince": "מחוז",
|
|
83
76
|
"stroke": "שבץ",
|
|
84
77
|
"unableToFetch": "Unable to fetch person attribute type - {personattributetype}",
|
|
85
78
|
"unknown": "לא ידוע",
|
package/translations/km.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"addRelationshipButtonText": "បន្ថែមទំនាក់ទំនង",
|
|
3
|
-
"address1": "អាសយដ្ឋានទី 1",
|
|
4
|
-
"address2": "អាសយដ្ឋានទី 2",
|
|
5
3
|
"addressHeader": "អាសយដ្ឋាន",
|
|
6
4
|
"allFieldsRequiredText": "តម្រូវឱ្យបំពេញគ្រប់កន្លែងចំហរទាំងអស់ លុះត្រាតែមានសម្គាល់ថាជាជម្រើស",
|
|
7
5
|
"autoGeneratedPlaceholderText": "ទាញចេញទិន្នន័យដោយស្វ័យប្រវត្តិ",
|
|
@@ -10,11 +8,8 @@
|
|
|
10
8
|
"birthFieldLabelText": "ថ្ងៃខែឆ្នាំកំណើត",
|
|
11
9
|
"cancel": "បោះបង់ចោល",
|
|
12
10
|
"causeOfDeathInputLabel": "មូលហេតុនៃការស្លាប់",
|
|
13
|
-
"cityVillage": "ទីក្រុង",
|
|
14
11
|
"configure": "កំណត់រចនាសម្ព័ន្ធ",
|
|
15
12
|
"contactSection": "Contact Details",
|
|
16
|
-
"country": "ប្រទេស",
|
|
17
|
-
"countyDistrict": "ស្រុក/ខ័ណ្ឌ",
|
|
18
13
|
"createNew": "បង្កើតថ្មី",
|
|
19
14
|
"dateOfBirthLabelText": "ថ្ងៃខែឆ្នាំកំណើត",
|
|
20
15
|
"deathDateInputLabel": "កាលបរិច្ឆេទនៃការស្លាប់",
|
|
@@ -63,7 +58,6 @@
|
|
|
63
58
|
"other": "ផ្សេងៗ",
|
|
64
59
|
"patient": "អ្នកជំងឺ",
|
|
65
60
|
"patientNameKnown": "ស្គាល់ឈ្មោះអ្នកជំងឺឬទេ?",
|
|
66
|
-
"postalCode": "លេខកូដប្រៃសណីយ៍",
|
|
67
61
|
"registerPatient": "ចុះឈ្មោះអ្នកជំងឺ",
|
|
68
62
|
"registrationSuccessToastDescription": "អ្នកជំងឺអាចត្រូវបានស្រាវជ្រាវរកពួកគេតាមរយ ប្រើប្រាស់ឈ្មោះឬអត្តលេខរបស់ពួកគេ",
|
|
69
63
|
"registrationSuccessToastTitle": "បង្កើតការចុះឈ្មោះអ្នកជំងឺថ្មី",
|
|
@@ -79,7 +73,6 @@
|
|
|
79
73
|
"searchAddress": "ស្វែងរកអាសយដ្ឋាន",
|
|
80
74
|
"selectAnOption": "Select an option",
|
|
81
75
|
"sexFieldLabelText": "ភេទ",
|
|
82
|
-
"stateProvince": "រដ្ឋ",
|
|
83
76
|
"stroke": "ជំងឺស្ទះសរសៃឈាមខួរក្បាល",
|
|
84
77
|
"unableToFetch": "Unable to fetch person attribute type - {personattributetype}",
|
|
85
78
|
"unknown": "មិនដឹង",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const React = require('react');
|
|
2
|
-
const reactI18next = require('react-i18next');
|
|
3
|
-
|
|
4
|
-
const hasChildren = (node) => node && (node.children || (node.props && node.props.children));
|
|
5
|
-
|
|
6
|
-
const getChildren = (node) => (node && node.children ? node.children : node.props && node.props.children);
|
|
7
|
-
|
|
8
|
-
const renderNodes = (reactNodes) => {
|
|
9
|
-
if (typeof reactNodes === 'string') {
|
|
10
|
-
return reactNodes;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return Object.keys(reactNodes).map((key, i) => {
|
|
14
|
-
const child = reactNodes[key];
|
|
15
|
-
const isElement = React.isValidElement(child);
|
|
16
|
-
|
|
17
|
-
if (typeof child === 'string') {
|
|
18
|
-
return child;
|
|
19
|
-
}
|
|
20
|
-
if (hasChildren(child)) {
|
|
21
|
-
const inner = renderNodes(getChildren(child));
|
|
22
|
-
return React.cloneElement(child, { ...child.props, key: i }, inner);
|
|
23
|
-
}
|
|
24
|
-
if (typeof child === 'object' && !isElement) {
|
|
25
|
-
return Object.keys(child).reduce((str, childKey) => `${str}${child[childKey]}`, '');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return child;
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const useMock = [(k) => k, {}];
|
|
33
|
-
useMock.t = (k, o) => (o && o.defaultValue) || (typeof o === 'string' ? o : k);
|
|
34
|
-
useMock.i18n = {};
|
|
35
|
-
|
|
36
|
-
module.exports = {
|
|
37
|
-
// this mock makes sure any components using the translate HoC receive the t function as a prop
|
|
38
|
-
Trans: ({ children }) => renderNodes(children),
|
|
39
|
-
Translation: ({ children }) => children((k) => k, { i18n: {} }),
|
|
40
|
-
useTranslation: () => useMock,
|
|
41
|
-
|
|
42
|
-
// mock if needed
|
|
43
|
-
I18nextProvider: reactI18next.I18nextProvider,
|
|
44
|
-
initReactI18next: reactI18next.initReactI18next,
|
|
45
|
-
setDefaults: reactI18next.setDefaults,
|
|
46
|
-
getDefaults: reactI18next.getDefaults,
|
|
47
|
-
setI18n: reactI18next.setI18n,
|
|
48
|
-
getI18n: reactI18next.getI18n,
|
|
49
|
-
};
|