Skip to content

Commit

Permalink
(fix) identifier sources (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet authored Jul 2, 2024
1 parent d07fd4c commit 2924276
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 2924276

Please sign in to comment.