@kenyaemr/esm-patient-registration-app 6.0.1-pre.1.0.6 → 6.0.2

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":"patientPhotoExtension","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-local.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":"patientPhotoExtension","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.6"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-patient-registration-app",
3
- "version": "6.0.1-pre.1.0.6",
3
+ "version": "6.0.2",
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",
@@ -189,7 +189,6 @@ export class FormManager {
189
189
  );
190
190
  } else {
191
191
  const encounterToSave: Encounter = {
192
- encounterDatetime: new Date(),
193
192
  patient: savePatientResponse.data.uuid,
194
193
  encounterType: config.registrationObs.encounterTypeUuid,
195
194
  location: currentLocation,
@@ -177,7 +177,11 @@ export const RelationshipsSection = () => {
177
177
  uuid: type.uuid,
178
178
  direction: 'bIsToA',
179
179
  };
180
- aIsToB.display === bIsToA.display ? tmp.push(aIsToB) : tmp.push(aIsToB, bIsToA);
180
+ aIsToB.display === bIsToA.display
181
+ ? tmp.push(aIsToB)
182
+ : bIsToA.display === 'Patient'
183
+ ? tmp.push(aIsToB, { display: `Patient (${aIsToB.display})`, uuid: type.uuid, direction: 'bIsToA' })
184
+ : tmp.push(aIsToB, bIsToA);
181
185
  });
182
186
  setDisplayRelationshipTypes(tmp);
183
187
  }
@@ -7,5 +7,5 @@ export const countries = [
7
7
  export const verificationIdentifierTypes = [
8
8
  { name: 'National ID', value: 'national-id' },
9
9
  { name: 'Passport', value: 'passport' },
10
- { name: 'Birth certificate number', value: 'birth-certificate-number' },
10
+ { name: 'Birth certificate number', value: 'birth-certificate' },
11
11
  ];
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { Tile, ComboBox, Layer, Button, Search, InlineLoading } from '@carbon/react';
3
+ import { Tile, ComboBox, Layer, Button, Search, InlineLoading, InlineNotification } from '@carbon/react';
4
4
  import styles from './patient-verification.scss';
5
5
  import { countries, verificationIdentifierTypes } from './assets/verification-assets';
6
6
  import { searchClientRegistry, useGlobalProperties } from './patient-verification-hook';
@@ -48,13 +48,6 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
48
48
  }
49
49
  };
50
50
 
51
- if (error) {
52
- return (
53
- <Tile className={styles.errorWrapper}>
54
- <p>Error occurred while reaching the client registry, please proceed with registration and try again later</p>
55
- </Tile>
56
- );
57
- }
58
51
  return (
59
52
  <div id={'patientVerification'}>
60
53
  <h3 className={styles.productiveHeading02} style={{ color: '#161616' }}>
@@ -64,6 +57,20 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
64
57
  <Layer>
65
58
  {isLoading && <InlineLoading status="active" iconDescription="Loading" description="Loading data..." />}
66
59
  </Layer>
60
+ {error && (
61
+ <InlineNotification
62
+ className={styles.errorWrapper}
63
+ aria-label="closes notification"
64
+ kind="error"
65
+ lowContrast
66
+ statusIconDescription="notification"
67
+ subtitle={t(
68
+ 'clientRegistryErrorSubtitle',
69
+ 'Please proceed with registration contact system admin and try again later',
70
+ )}
71
+ title={t('clientRegistryError', 'Error occurred while reaching the client registry')}
72
+ />
73
+ )}
67
74
  <Tile className={styles.verificationWrapper}>
68
75
  <Layer>
69
76
  <ComboBox
@@ -75,7 +82,7 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
75
82
  titleText={t('selectCountry', 'Select country')}
76
83
  initialSelectedItem={countries[0]}
77
84
  onChange={({ selectedItem }) =>
78
- setVerificationCriteria({ ...verificationCriteria, countryCode: selectedItem.initials })
85
+ setVerificationCriteria({ ...verificationCriteria, countryCode: selectedItem?.initials })
79
86
  }
80
87
  />
81
88
  </Layer>
@@ -88,7 +95,7 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
88
95
  label="Select identifier type"
89
96
  titleText={t('selectIdentifierType', 'Select identifier type')}
90
97
  onChange={({ selectedItem }) =>
91
- setVerificationCriteria({ ...verificationCriteria, identifierType: selectedItem.value })
98
+ setVerificationCriteria({ ...verificationCriteria, identifierType: selectedItem?.value })
92
99
  }
93
100
  />
94
101
  </Layer>
@@ -21,9 +21,5 @@
21
21
  }
22
22
 
23
23
  .errorWrapper {
24
- color: colors.$red-50;
25
24
  margin: 0 0 1rem 0;
26
- display: flex;
27
- justify-content: center;
28
- align-items: center;
29
25
  }
@@ -45,7 +45,7 @@
45
45
  "givenNameLabelText": "名字",
46
46
  "givenNameRequired": "名字是必填项",
47
47
  "identifierValueRequired": "ID标识是必填项",
48
- "idFieldLabelText": "ID标识",
48
+ "idFieldLabelText": "ID",
49
49
  "IDInstructions": "选择您想为该患者添加的ID标识:",
50
50
  "incompleteForm": "表单未填完",
51
51
  "invalidEmail": "需要提供一个有效的电子邮件地址",
@@ -45,7 +45,7 @@
45
45
  "givenNameLabelText": "名字",
46
46
  "givenNameRequired": "名字是必填项",
47
47
  "identifierValueRequired": "ID标识是必填项",
48
- "idFieldLabelText": "ID标识",
48
+ "idFieldLabelText": "ID",
49
49
  "IDInstructions": "选择您想为该患者添加的ID标识:",
50
50
  "incompleteForm": "表单未填完",
51
51
  "invalidEmail": "需要提供一个有效的电子邮件地址",