@kenyaemr/esm-patient-registration-app 6.0.0 → 6.0.1-pre.1.0.1

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/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhoto","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"6.0.0"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhoto","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"6.0.1-pre.1.0.1"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-patient-registration-app",
3
- "version": "6.0.0",
3
+ "version": "6.0.1-pre.1.0.1",
4
4
  "description": "Patient registration microfrontend for the OpenMRS SPA",
5
5
  "browser": "dist/kenyaemr-esm-patient-registration-app.js",
6
6
  "main": "src/index.ts",
@@ -60,6 +60,10 @@ export interface RegistrationConfig {
60
60
  };
61
61
  phone: {
62
62
  personAttributeUuid: string;
63
+ validation: {
64
+ required: boolean;
65
+ matches: string;
66
+ };
63
67
  };
64
68
  };
65
69
  links: {
@@ -312,6 +316,14 @@ export const esmPatientRegistrationSchema = {
312
316
  _default: '14d4f066-15f5-102d-96e4-000c29c2a5d7',
313
317
  _description: 'The UUID of the phone number person attribute type',
314
318
  },
319
+ validation: {
320
+ required: { _type: Type.Boolean, _default: false },
321
+ matches: {
322
+ _type: Type.String,
323
+ _default: null,
324
+ _description: 'Optional RegEx for testing the validity of the input.',
325
+ },
326
+ },
315
327
  },
316
328
  },
317
329
  links: {
@@ -22,6 +22,7 @@ export const AddressField: React.FC<AddressFieldProps> = ({ fieldDefinition }) =
22
22
  id={fieldDefinition.id}
23
23
  labelText={t(`${fieldDefinition.label}`, `${fieldDefinition.label}`)}
24
24
  {...field}
25
+ required={fieldDefinition?.validation?.required}
25
26
  />
26
27
  );
27
28
  }}
@@ -11,6 +11,7 @@ export function PhoneField() {
11
11
  type: 'person attribute',
12
12
  uuid: config.fieldConfigurations.phone.personAttributeUuid,
13
13
  showHeading: false,
14
+ validation: config.fieldConfigurations.phone?.validation,
14
15
  };
15
16
  return <PersonAttributeField fieldDefinition={fieldDefinition} />;
16
17
  }
@@ -54,8 +54,8 @@ const ConfirmPrompt: React.FC<ConfirmPromptProps> = ({ close, onConfirm, patient
54
54
  <PatientInfo label={t('age', 'Age')} value={age(patient?.dateOfBirth)} />
55
55
  <PatientInfo label={t('dateOfBirth', 'Date of birth')} value={formatDate(new Date(patient?.dateOfBirth))} />
56
56
  <PatientInfo label={t('gender', 'Gender')} value={capitalize(patient?.gender)} />
57
- <PatientInfo label={t('NUPI')} value={patient?.clientNumber} />
58
- <PatientInfo label={t('SHA Number')} value={'--'} />
57
+ <PatientInfo label={t('nupiIdentification', 'NUPI')} value={patient?.clientNumber} />
58
+ <PatientInfo label={t('shaNumber', 'SHA Number')} value={'--'} />
59
59
  </div>
60
60
  </div>
61
61
  </div>
@@ -65,7 +65,7 @@
65
65
  "negativeYears": "Negative years",
66
66
  "no": "No",
67
67
  "numberInNameDubious": "Number in name is dubious",
68
- "NUPI": "",
68
+ "nupiIdentification": "NUPI",
69
69
  "obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
70
70
  "optional": "optional",
71
71
  "other": "Other",
@@ -97,7 +97,7 @@
97
97
  "selectCountry": "Select country",
98
98
  "selectIdentifierType": "Select identifier type",
99
99
  "sexFieldLabelText": "Sex",
100
- "SHA Number": "",
100
+ "shaNumber": "SHA Number",
101
101
  "source": "Source",
102
102
  "stroke": "Stroke",
103
103
  "submitting": "Submitting",