From 5da6995f758dbc409e2bd83a5e7892b5eb6dc730 Mon Sep 17 00:00:00 2001 From: Piotr Mankowski Date: Thu, 7 Mar 2024 22:09:17 +0000 Subject: [PATCH] Exclude undefined values for phone --- server/lib/routes/match.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/routes/match.js b/server/lib/routes/match.js index 0982c3f5..5426169e 100644 --- a/server/lib/routes/match.js +++ b/server/lib/routes/match.js @@ -1162,7 +1162,7 @@ router.post('/matches', (req, res) => { let phone = ''; if(patient.telecom) { for(let telecom of patient.telecom) { - if(telecom.system === 'phone') { + if(telecom.system === 'phone' && telecom.value !== '' && telecom.value !== undefined) { if (phone) { phone += ', '; } @@ -1365,7 +1365,7 @@ router.get('/potential-matches/:id', (req, res) => { let phone = ''; if(patient.telecom) { for(let telecom of patient.telecom) { - if(telecom.system === 'phone') { + if(telecom.system === 'phone' && telecom.value !== '' && telecom.value !== undefined) { if (phone) { phone += ', '; }