@kenyaemr/esm-patient-registration-app 8.0.1-pre.95 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +18 -16
- package/dist/108.js +1 -0
- package/dist/108.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/623.js +1 -1
- package/dist/735.js +1 -1
- package/dist/745.js +2 -0
- package/dist/{831.js.LICENSE.txt → 745.js.LICENSE.txt} +10 -0
- package/dist/745.js.map +1 -0
- package/dist/{59.js → 76.js} +1 -1
- package/dist/{59.js.map → 76.js.map} +1 -1
- package/dist/830.js +1 -0
- package/dist/830.js.map +1 -0
- package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +69 -69
- 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.json +2 -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 +160 -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 +2 -2
- 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 +4 -1
- package/src/{patient-verification → client-registry/patient-verification}/patient-verification.scss +17 -1
- package/src/{patient-verification → client-registry/patient-verification}/verification-modal/empty-prompt.component.tsx +9 -6
- package/src/config-schema.ts +37 -0
- package/src/index.ts +5 -2
- package/src/patient-registration/field/obs/obs-field.component.tsx +1 -1
- package/src/patient-registration/patient-registration-hooks.ts +4 -1
- package/src/patient-registration/patient-registration.component.tsx +24 -17
- package/src/routes.json +7 -2
- package/translations/en.json +12 -0
- 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/831.js +0 -2
- package/dist/831.js.map +0 -1
- /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
package/src/config-schema.ts
CHANGED
|
@@ -83,6 +83,11 @@ export interface RegistrationConfig {
|
|
|
83
83
|
encounterProviderRoleUuid: string;
|
|
84
84
|
registrationFormUuid: string | null;
|
|
85
85
|
};
|
|
86
|
+
hieClientRegistry: {
|
|
87
|
+
identifierTypes: Array<{ identifierType: string; identifierValue: string }>;
|
|
88
|
+
baseUrl: string;
|
|
89
|
+
encodedCredentials: string;
|
|
90
|
+
};
|
|
86
91
|
}
|
|
87
92
|
|
|
88
93
|
export const builtInSections: Array<SectionDefinition> = [
|
|
@@ -364,6 +369,38 @@ export const esmPatientRegistrationSchema = {
|
|
|
364
369
|
'The form UUID to associate with the registration encounter. By default no form will be associated.',
|
|
365
370
|
},
|
|
366
371
|
},
|
|
372
|
+
hieClientRegistry: {
|
|
373
|
+
identifierTypes: {
|
|
374
|
+
_type: Type.Array,
|
|
375
|
+
_elements: {
|
|
376
|
+
identifierType: {
|
|
377
|
+
_type: Type.String,
|
|
378
|
+
_description: 'The label of the identifier type',
|
|
379
|
+
},
|
|
380
|
+
identifierValue: {
|
|
381
|
+
_type: Type.String,
|
|
382
|
+
_description: 'The value of the identifier type',
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
_default: [
|
|
386
|
+
{ identifierType: 'National ID', identifierValue: 'national-id' },
|
|
387
|
+
{ identifierType: 'Passport Number', identifierValue: 'passport-number' },
|
|
388
|
+
{ identifierType: 'Birth Certificate Number', identifierValue: 'birth-certificate-number' },
|
|
389
|
+
{ identifierType: 'Alien ID Number', identifierValue: 'alien-id-number' },
|
|
390
|
+
{ identifierType: 'Refugee ID Number', identifierValue: 'refugee-number' },
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
baseUrl: {
|
|
394
|
+
_type: Type.String,
|
|
395
|
+
_default: 'https://hie.paperless.co.ke/v4/custom/',
|
|
396
|
+
_description: 'The base URL for the HIE API',
|
|
397
|
+
},
|
|
398
|
+
encodedCredentials: {
|
|
399
|
+
_type: Type.String,
|
|
400
|
+
_default: 'a2VueWFfZW1yOkFsZG5iJmtmayZKc2whMjM0',
|
|
401
|
+
_description: 'The base64 encoded credentials for the HIE API',
|
|
402
|
+
},
|
|
403
|
+
},
|
|
367
404
|
_validators: [
|
|
368
405
|
validator(
|
|
369
406
|
(config: RegistrationConfig) =>
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import rootComponent from './root.component';
|
|
|
6
6
|
import addPatientLinkComponent from './add-patient-link';
|
|
7
7
|
import editPatientDetailsButtonComponent from './widgets/edit-patient-details-button.component';
|
|
8
8
|
import { PatientPhotoExtension } from './patient-photo.extension';
|
|
9
|
+
import HIEConfirmationModal from './client-registry/hie-client-registry/modal/confirm-hie.modal';
|
|
9
10
|
|
|
10
11
|
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
11
12
|
|
|
@@ -68,11 +69,13 @@ export const deleteIdentifierConfirmationModal = getAsyncLifecycle(
|
|
|
68
69
|
);
|
|
69
70
|
|
|
70
71
|
export const confirmClientRegistryModal = getAsyncLifecycle(
|
|
71
|
-
() => import('./patient-verification/verification-modal/confirm-prompt.component'),
|
|
72
|
+
() => import('./client-registry/patient-verification/verification-modal/confirm-prompt.component'),
|
|
72
73
|
options,
|
|
73
74
|
);
|
|
74
75
|
|
|
75
76
|
export const emptyClientRegistryModal = getAsyncLifecycle(
|
|
76
|
-
() => import('./patient-verification/verification-modal/empty-prompt.component'),
|
|
77
|
+
() => import('./client-registry/patient-verification/verification-modal/empty-prompt.component'),
|
|
77
78
|
options,
|
|
78
79
|
);
|
|
80
|
+
|
|
81
|
+
export const hieConfirmationModal = getSyncLifecycle(HIEConfirmationModal, options);
|
|
@@ -14,7 +14,10 @@ import useSWR from 'swr';
|
|
|
14
14
|
import { v4 } from 'uuid';
|
|
15
15
|
import { type RegistrationConfig } from '../config-schema';
|
|
16
16
|
import { patientRegistration } from '../constants';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useConceptAnswers,
|
|
19
|
+
useGlobalProperties,
|
|
20
|
+
} from '../client-registry/patient-verification/patient-verification-hook';
|
|
18
21
|
import {
|
|
19
22
|
type FormValues,
|
|
20
23
|
type PatientRegistration,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
interpolateUrl,
|
|
13
13
|
usePatient,
|
|
14
14
|
usePatientPhoto,
|
|
15
|
+
useFeatureFlag,
|
|
15
16
|
} from '@openmrs/esm-framework';
|
|
16
17
|
import { getValidationSchema } from './validation/patient-registration-validation';
|
|
17
18
|
import { type FormValues, type CapturePhotoProps } from './patient-registration.types';
|
|
@@ -19,14 +20,15 @@ import { PatientRegistrationContext } from './patient-registration-context';
|
|
|
19
20
|
import { type SavePatientForm, SavePatientTransactionManager } from './form-manager';
|
|
20
21
|
import { DummyDataInput } from './input/dummy-data/dummy-data-input.component';
|
|
21
22
|
import { cancelRegistration, filterOutUndefinedPatientIdentifiers, scrollIntoView } from './patient-registration-utils';
|
|
22
|
-
import { useInitialAddressFieldValues, useInitialFormValues, usePatientUuidMap
|
|
23
|
+
import { useInitialAddressFieldValues, useInitialFormValues, usePatientUuidMap } from './patient-registration-hooks';
|
|
23
24
|
import { ResourcesContext } from '../offline.resources';
|
|
24
25
|
import { builtInSections, type RegistrationConfig, type SectionDefinition } from '../config-schema';
|
|
25
26
|
import { SectionWrapper } from './section/section-wrapper.component';
|
|
26
27
|
import BeforeSavePrompt from './before-save-prompt';
|
|
27
28
|
import styles from './patient-registration.scss';
|
|
28
|
-
import PatientVerification from '../patient-verification/patient-verification.component';
|
|
29
|
-
import { handleSavePatientToClientRegistry } from '../patient-verification/patient-verification-hook';
|
|
29
|
+
import PatientVerification from '../client-registry/patient-verification/patient-verification.component';
|
|
30
|
+
import { handleSavePatientToClientRegistry } from '../client-registry/patient-verification/patient-verification-hook';
|
|
31
|
+
import ClientRegistry from '../client-registry/client-registry.component';
|
|
30
32
|
|
|
31
33
|
let exportedInitialFormValuesForTesting = {} as FormValues;
|
|
32
34
|
|
|
@@ -36,6 +38,7 @@ export interface PatientRegistrationProps {
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePatientForm, isOffline }) => {
|
|
41
|
+
const healthInformationExchangeFlag = useFeatureFlag('healthInformationExchange');
|
|
39
42
|
const { currentSession, identifierTypes } = useContext(ResourcesContext);
|
|
40
43
|
const { search } = useLocation();
|
|
41
44
|
const config = useConfig() as RegistrationConfig;
|
|
@@ -158,6 +161,8 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
158
161
|
}
|
|
159
162
|
};
|
|
160
163
|
|
|
164
|
+
const enableRegistryButton = healthInformationExchangeFlag ? false : !enableClientRegistry;
|
|
165
|
+
|
|
161
166
|
const displayErrors = (errors) => {
|
|
162
167
|
if (errors && typeof errors === 'object' && !!Object.keys(errors).length) {
|
|
163
168
|
Object.keys(errors).forEach((error) => {
|
|
@@ -198,18 +203,20 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
198
203
|
</Link>
|
|
199
204
|
</div>
|
|
200
205
|
))}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
{!healthInformationExchangeFlag && (
|
|
207
|
+
<Button
|
|
208
|
+
renderIcon={ShareKnowledge}
|
|
209
|
+
disabled={!currentSession || !identifierTypes}
|
|
210
|
+
onClick={() => {
|
|
211
|
+
setEnableClientRegistry(true);
|
|
212
|
+
props.isValid
|
|
213
|
+
? handleSavePatientToClientRegistry(props.values, props.setValues, inEditMode)
|
|
214
|
+
: props.validateForm().then((errors) => displayErrors(errors));
|
|
215
|
+
}}
|
|
216
|
+
className={styles.submitButton}>
|
|
217
|
+
{t('postToRegistry', 'Post to registry')}
|
|
218
|
+
</Button>
|
|
219
|
+
)}
|
|
213
220
|
<Button
|
|
214
221
|
className={styles.submitButton}
|
|
215
222
|
type="submit"
|
|
@@ -217,7 +224,7 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
217
224
|
// Current session and identifiers are required for patient registration.
|
|
218
225
|
// If currentSession or identifierTypes are not available, then the
|
|
219
226
|
// user should be blocked to register the patient.
|
|
220
|
-
disabled={!currentSession || !identifierTypes || props.isSubmitting ||
|
|
227
|
+
disabled={!currentSession || !identifierTypes || props.isSubmitting || enableRegistryButton}>
|
|
221
228
|
{props.isSubmitting ? (
|
|
222
229
|
<InlineLoading
|
|
223
230
|
className={styles.spinner}
|
|
@@ -249,7 +256,7 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
249
256
|
initialFormValues: props.initialValues,
|
|
250
257
|
setInitialFormValues,
|
|
251
258
|
}}>
|
|
252
|
-
<
|
|
259
|
+
<ClientRegistry props={props} setInitialFormValues={setInitialFormValues} />
|
|
253
260
|
{sections.map((section, index) => (
|
|
254
261
|
<SectionWrapper
|
|
255
262
|
key={`registration-section-${section.id}`}
|
package/src/routes.json
CHANGED
package/translations/en.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"deleteIdentifierTooltip": "Delete",
|
|
34
34
|
"deleteRelationshipTooltipText": "Delete",
|
|
35
35
|
"demographicsSection": "Basic Info",
|
|
36
|
+
"dependents": "Dependents",
|
|
36
37
|
"discard": "Discard",
|
|
37
38
|
"discardModalBody": "The changes you made to this patient's details have not been saved. Discard changes?",
|
|
38
39
|
"discardModalHeader": "Confirm Discard Changes",
|
|
@@ -40,8 +41,10 @@
|
|
|
40
41
|
"editIdentifierTooltip": "Edit",
|
|
41
42
|
"editPatientDetails": "Edit patient details",
|
|
42
43
|
"editPatientDetailsBreadcrumb": "Edit patient details",
|
|
44
|
+
"enterIdentifierSearchValue": "Enter identifier search value",
|
|
43
45
|
"error": "Error",
|
|
44
46
|
"errorFetchingOrderedFields": "Error occured fetching ordered fields for address hierarchy",
|
|
47
|
+
"errorFetchingPatient": "Error fetching patient",
|
|
45
48
|
"estimatedAgeInMonthsLabelText": "Estimated age in months",
|
|
46
49
|
"estimatedAgeInYearsLabelText": "Estimated age in years",
|
|
47
50
|
"familyNameLabelText": "Family Name",
|
|
@@ -54,6 +57,10 @@
|
|
|
54
57
|
"genderUnspecified": "Gender is not specified",
|
|
55
58
|
"givenNameLabelText": "First Name",
|
|
56
59
|
"givenNameRequired": "Given name is required",
|
|
60
|
+
"healthID": "HealthID",
|
|
61
|
+
"hieModal": "HIE Patient Record Found",
|
|
62
|
+
"identifierSearch": "Identifier search",
|
|
63
|
+
"identifierType": "Identifier type",
|
|
57
64
|
"identifierValueRequired": "Identifier value is required",
|
|
58
65
|
"idFieldLabelText": "Identifiers",
|
|
59
66
|
"IDInstructions": "Select the identifiers you'd like to add for this patient:",
|
|
@@ -63,6 +70,7 @@
|
|
|
63
70
|
"isDeadInputLabel": "Is Dead",
|
|
64
71
|
"jumpTo": "Jump to",
|
|
65
72
|
"male": "Male",
|
|
73
|
+
"maritalStatus": "Marital status",
|
|
66
74
|
"middleNameLabelText": "Middle Name",
|
|
67
75
|
"nationalId": "National ID",
|
|
68
76
|
"negativeMonths": "Negative months",
|
|
@@ -78,6 +86,7 @@
|
|
|
78
86
|
"patientNameKnown": "Patient's Name is Known?",
|
|
79
87
|
"patientNotFound": "The patient records could not be found in Client registry, do you want to continue to create and post patient to registry",
|
|
80
88
|
"patientRegistrationBreadcrumb": "Patient Registration",
|
|
89
|
+
"patientVerificationFromHIE": "Patient verification from HIE",
|
|
81
90
|
"postToRegistry": "Post to registry",
|
|
82
91
|
"registerPatient": "Register Patient",
|
|
83
92
|
"registerPatientSuccessSnackbarSubtitle": "The patient can now be found by searching for them using their name or ID number",
|
|
@@ -97,6 +106,8 @@
|
|
|
97
106
|
"searchAddress": "Search address",
|
|
98
107
|
"searchClientRegistry": "Search client registry",
|
|
99
108
|
"searchIdentifierPlaceholder": "Search identifier",
|
|
109
|
+
"searchingRegistry": "Searching registry...",
|
|
110
|
+
"searchRegistry": "Search registry",
|
|
100
111
|
"selectAnOption": "Select an option",
|
|
101
112
|
"selectCountry": "Select country",
|
|
102
113
|
"selectIdentifierType": "Select identifier type",
|
|
@@ -114,6 +125,7 @@
|
|
|
114
125
|
"updatePatientSuccessSnackbarTitle": "Patient Details Updated",
|
|
115
126
|
"useValues": "Use values",
|
|
116
127
|
"validate": "Validate",
|
|
128
|
+
"viewFullResponse": "View full response",
|
|
117
129
|
"yearsEstimateRequired": "Years estimate required",
|
|
118
130
|
"yes": "Yes"
|
|
119
131
|
}
|
package/dist/330.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_kenyaemr_esm_patient_registration_app=globalThis.webpackChunk_kenyaemr_esm_patient_registration_app||[]).push([[330],{1330:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(268),o=n.n(a),r=n(4924),c=n(5950);const i=function(e){var t=e.close,n=e.onConfirm,a=(0,r.useTranslation)().t;return o().createElement(o().Fragment,null,o().createElement("div",{className:"cds--modal-header"},o().createElement("h3",{className:"cds--modal-header__heading"},a("clientRegistryEmpty","Create & Post Patient"))),o().createElement("div",{className:"cds--modal-content"},o().createElement("p",null,a("patientNotFound","The patient records could not be found in Client registry, do you want to continue to create and post patient to registry"))),o().createElement("div",{className:"cds--modal-footer"},o().createElement(c.zxk,{kind:"secondary",onClick:t},a("cancel","Cancel")),o().createElement(c.zxk,{onClick:n},a("continue","Continue to registration"))))}}}]);
|
package/dist/330.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"330.js","mappings":"mPAkCA,QAzBgD,Y,IAAGA,EAAAA,EAAAA,MAAOC,EAAAA,EAAAA,UAClD,GAAQC,EAAAA,EAAAA,kBAANC,EACR,OACE,oCACE,kBAACC,MAAAA,CAAIC,UAAU,qBACb,kBAACC,KAAAA,CAAGD,UAAU,8BAA8BF,EAAE,sBAAuB,2BAEvE,kBAACC,MAAAA,CAAIC,UAAU,sBACb,kBAACE,IAAAA,KACEJ,EACC,kBACA,+HAIN,kBAACC,MAAAA,CAAIC,UAAU,qBACb,kBAACG,EAAAA,IAAMA,CAACC,KAAK,YAAYC,QAASV,GAC/BG,EAAE,SAAU,WAEf,kBAACK,EAAAA,IAAMA,CAACE,QAAST,GAAYE,EAAE,WAAY,8BAInD,C","sources":["webpack://@kenyaemr/esm-patient-registration-app/./src/patient-verification/verification-modal/empty-prompt.component.tsx"],"names":["close","onConfirm","useTranslation","t","div","className","h3","p","Button","kind","onClick"],"sourceRoot":""}
|