Skip to content

Commit

Permalink
(fix) O3-3519: Identifier source should be mapped to the defined iden…
Browse files Browse the repository at this point in the history
…tifierType only (#1222)
  • Loading branch information
vasharma05 authored Jul 1, 2024
1 parent 02ad417 commit 2bbc81e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/esm-patient-registration-app/src/offline.resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ export async function fetchPatientIdentifierTypesWithSources(): Promise<Array<Pa
const allIdentifierSources = identifierSourcesResponse.data.results;

for (let i = 0; i < identifierTypes?.length; i++) {
identifierTypes[i].identifierSources = allIdentifierSources.map((source) => {
const option = find(autoGenOptions.data.results, { source: { uuid: source.uuid } });
source.autoGenerationOption = option;
return source;
});
identifierTypes[i].identifierSources = allIdentifierSources
.filter((source) => source.identifierType.uuid === identifierTypes[i].uuid)
.map((source) => {
const option = find(autoGenOptions.data.results, { source: { uuid: source.uuid } });
source.autoGenerationOption = option;
return source;
});
}

return identifierTypes;
Expand Down

0 comments on commit 2bbc81e

Please sign in to comment.