diff --git a/server/lib/medMatching.js b/server/lib/medMatching.js index 7cf3dc7f..0ac99669 100644 --- a/server/lib/medMatching.js +++ b/server/lib/medMatching.js @@ -122,19 +122,20 @@ module.exports = () => ({ if (!isMatch) { missMatchFound = true; } - case 'metaphone': + break; + case 'metaphone': isMatch = this.metaphoneMatcher(sourceValue, targetValue); if (!isMatch) { missMatchFound = true; } break; - case 'double-metaphone': + case 'double-metaphone': isMatch = this.doubleMetaphoneMatcher(sourceValue, targetValue); if (!isMatch) { missMatchFound = true; } break; - default: + default: missMatchFound = true; break; } diff --git a/server/lib/routes/match.js b/server/lib/routes/match.js index 5426169e..5163b238 100644 --- a/server/lib/routes/match.js +++ b/server/lib/routes/match.js @@ -1509,10 +1509,9 @@ router.get(`/get-match-issues`, (req, res) => { if(link) { link = link.split('/')[1]; } - const validSystem = entry.resource.identifier && entry.resource.identifier.find(identifier => { - return 'http://openclientregistry.org/fhir/sourceid' && identifier.value; - }); - + + const validSystem = generalMixin.getClientIdentifier(entry.resource); + let matchTag = entry.resource.meta.tag.find((tag) => { return tag.system === matchIssuesURI; }); @@ -1560,9 +1559,9 @@ router.get(`/get-new-auto-matches`, (req, res) => { if(link) { link = link.split('/')[1]; } - const validSystem = entry.resource.identifier && entry.resource.identifier.find(identifier => { - return 'http://openclientregistry.org/fhir/sourceid' && identifier.value; - }); + + const validSystem = generalMixin.getClientIdentifier(entry.resource); + let matchTag = entry.resource.meta.tag.find((tag) => { return tag.system === matchAutoURI;