Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Jun 19, 2020
2 parents f511b1e + eb09cf6 commit 54b3175
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tests/e2e/screenshots
selenium-debug.log

!.gitkeep
/build/config/*-custom.json5
3 changes: 2 additions & 1 deletion src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ export function getPatientEmail(patient = {}) {
export function getPatientHomeAddress(patient = {}) {
let a = (patient.address || []);
a = a.find(c => c.use == "home") || a[0] || {};
return [a.line, a.postalCode, a.city, a.country]
var l = [a.line, a.postalCode, a.city, a.country]
.map(x => String(x || "").trim())
.filter(Boolean)
.join(" ");
return l ? l : a.text || "";
}

/**
Expand Down

0 comments on commit 54b3175

Please sign in to comment.