@kenyaemr/esm-patient-registration-app 8.1.1-pre.119 → 8.1.1-pre.121

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":"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}],"modals":[{"name":"cancel-patient-edit-modal","component":"cancelPatientEditModal"},{"name":"delete-identifier-confirmation-modal","component":"deleteIdentifierConfirmationModal"},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal"},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal"},{"component":"hieConfirmationModal","name":"hie-confirmation-modal"}],"version":"8.1.1-pre.119"}
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":"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}],"modals":[{"name":"cancel-patient-edit-modal","component":"cancelPatientEditModal"},{"name":"delete-identifier-confirmation-modal","component":"deleteIdentifierConfirmationModal"},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal"},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal"},{"component":"hieConfirmationModal","name":"hie-confirmation-modal"}],"version":"8.1.1-pre.121"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-patient-registration-app",
3
- "version": "8.1.1-pre.119",
3
+ "version": "8.1.1-pre.121",
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",
@@ -61,7 +61,7 @@ class PatientMapper extends Mapper<HIEPatient, FormValues> {
61
61
  private mapTelecomToAttributes(telecom: Array<fhir.ContactPoint>): Record<string, string> {
62
62
  return telecom.reduce<Record<string, string>>((acc, { system, value }) => {
63
63
  if (system && value && this.config.teleComMap[system]) {
64
- const filteredValue = value.replace(/^254/, '0');
64
+ const filteredValue = value.replace(/^\+254/, '0');
65
65
  if (filteredValue) {
66
66
  acc[this.config.teleComMap[system]] = filteredValue;
67
67
  }
@@ -75,22 +75,24 @@ class PatientMapper extends Mapper<HIEPatient, FormValues> {
75
75
  currentFormValues: FormValues,
76
76
  ): Record<string, PatientIdentifierValue> {
77
77
  const updatedIdentifiers: Record<string, PatientIdentifierValue> = { ...currentFormValues.identifiers };
78
-
79
78
  // Map Social Health Authority Unique Identification Number to HIE Patient ID
80
79
  // See https://github.com/palladiumkenya/openmrs-module-kenyaemr/blob/1e1d281eaba8041c45318e60ca0730449b8e4197/api/src/main/distro/metadata/identifierTypes.xml#L33
81
- updatedIdentifiers.socialHealthAuthorityIdentificationNumber = {
82
- ...currentFormValues.identifiers['socialHealthAuthorityIdentificationNumber'],
80
+ updatedIdentifiers.socialHealthInsuranceNumber = {
81
+ ...currentFormValues.identifiers['socialHealthInsuranceNumber'],
83
82
  identifierValue: hiePatient.id,
84
83
  };
85
84
 
86
85
  // Map fhir.Patient.Identifier to identifiers
87
- hiePatient.identifier?.forEach((identifier) => {
88
- const system = identifier.system?.split('/').pop();
89
- if (system && this.config.identifierMap[system]) {
90
- const key = this.config.identifierMap[system];
91
- updatedIdentifiers[key] = {
92
- ...currentFormValues.identifiers[key],
93
- identifierValue: identifier.value || '',
86
+ hiePatient.identifier?.forEach((identifier: fhir.Identifier) => {
87
+ const identifierType = identifier.type?.coding?.[0]?.code;
88
+ const mappedIdentifierType = this.convertToCamelCase(identifierType);
89
+ const identifierValue = identifier.value;
90
+
91
+ const existingIdentifier = currentFormValues.identifiers[mappedIdentifierType];
92
+ if (existingIdentifier) {
93
+ updatedIdentifiers[mappedIdentifierType] = {
94
+ ...existingIdentifier,
95
+ identifierValue,
94
96
  };
95
97
  }
96
98
  });
@@ -117,6 +119,13 @@ class PatientMapper extends Mapper<HIEPatient, FormValues> {
117
119
  return acc;
118
120
  }, {});
119
121
  }
122
+
123
+ private convertToCamelCase(input: string): string {
124
+ return input
125
+ .split('-')
126
+ .map((word, index) => (index === 0 ? word : capitalize(word)))
127
+ .join('');
128
+ }
120
129
  }
121
130
 
122
131
  // Update MapperConfig interface in hie-types.ts