Skip to content

Commit

Permalink
Exclude undefined values for phone
Browse files Browse the repository at this point in the history
  • Loading branch information
pmanko committed Mar 7, 2024
1 parent 0093aab commit 5da6995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/lib/routes/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += ', ';
}
Expand Down Expand Up @@ -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 += ', ';
}
Expand Down

0 comments on commit 5da6995

Please sign in to comment.