From 0093aab70f791212c0ce303b2b4ba0c9b82d05cb Mon Sep 17 00:00:00 2001 From: reagan-meant Date: Sun, 25 Feb 2024 22:48:18 +0300 Subject: [PATCH] Append all phone numbers --- server/lib/routes/match.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/lib/routes/match.js b/server/lib/routes/match.js index feef7a00..0982c3f5 100644 --- a/server/lib/routes/match.js +++ b/server/lib/routes/match.js @@ -1159,11 +1159,14 @@ router.post('/matches', (req, res) => { } } let systemName = generalMixin.getClientDisplayName(clientUserId); - let phone; + let phone = ''; if(patient.telecom) { for(let telecom of patient.telecom) { if(telecom.system === 'phone') { - phone = telecom.value; + if (phone) { + phone += ', '; + } + phone += telecom.value; } } } @@ -1359,11 +1362,14 @@ router.get('/potential-matches/:id', (req, res) => { } } let systemName = generalMixin.getClientDisplayName(clientUserId); - let phone; + let phone = ''; if(patient.telecom) { for(let telecom of patient.telecom) { if(telecom.system === 'phone') { - phone = telecom.value; + if (phone) { + phone += ', '; + } + phone += telecom.value; } } }