Skip to content

Commit 31da87b

Browse files
Fix. looping through the identifiers to find mobile number
1 parent 8147ee5 commit 31da87b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/patient-details/patientInfo.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ const PatientInfo = (props) => {
7676
function getPhoneNumber(){
7777
if(patient?.phoneNumber !== undefined)
7878
return patient.phoneNumber;
79-
for (var identifier in patient.identifiers){
80-
if(identifier.type === "MOBILE")
81-
return identifier.value;
82-
}
83-
return '-';
79+
const mobileIdentifier = patient.identifiers.find(identifier => {
80+
return identifier.type === 'MOBILE';
81+
});
82+
83+
return mobileIdentifier ? mobileIdentifier.value : '-';
8484
}
8585

8686
const address = getCustomAddress(patient);

0 commit comments

Comments
 (0)