Skip to content

Commit

Permalink
Fix. looping through the identifiers to find mobile number
Browse files Browse the repository at this point in the history
  • Loading branch information
SanoferSameera committed Jan 18, 2024
1 parent 8147ee5 commit 31da87b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/patient-details/patientInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ const PatientInfo = (props) => {
function getPhoneNumber(){
if(patient?.phoneNumber !== undefined)
return patient.phoneNumber;
for (var identifier in patient.identifiers){
if(identifier.type === "MOBILE")
return identifier.value;
}
return '-';
const mobileIdentifier = patient.identifiers.find(identifier => {
return identifier.type === 'MOBILE';
});

return mobileIdentifier ? mobileIdentifier.value : '-';
}

const address = getCustomAddress(patient);
Expand Down

0 comments on commit 31da87b

Please sign in to comment.