Whack of matcher changes for vector calculation to only count _relevant_ field matchers

This commit is contained in:
Tadgh 2020-11-11 14:25:36 -05:00
parent 3d34502fae
commit 46235226cf
3 changed files with 5 additions and 7 deletions

View File

@ -77,7 +77,7 @@ public class EmpiProviderMatchR4Test extends BaseProviderR4Test {
Bundle.BundleEntrySearchComponent searchComponent = entry0.getSearch();
assertEquals(Bundle.SearchEntryMode.MATCH, searchComponent.getMode());
assertEquals(2.0 / 3.0, searchComponent.getScore().doubleValue(), 0.01);
assertEquals(1.0 / 1.0, searchComponent.getScore().doubleValue(), 0.01);
Extension matchGradeExtension = searchComponent.getExtensionByUrl(EmpiConstants.FIHR_STRUCTURE_DEF_MATCH_GRADE_URL_NAMESPACE);
assertNotNull(matchGradeExtension);
assertEquals(MatchGrade.CERTAIN.toCode(), matchGradeExtension.getValue().toString());

View File

@ -43,11 +43,9 @@
{
"name": "cosine-code",
"resourceType": "Medication",
"resourcePath": "code",
"similarity": {
"algorithm": "COSINE",
"matchThreshold": 0.8,
"exact": true
"resourcePath": "code.coding.code",
"matcher": {
"algorithm": "STRING"
}
},
{

View File

@ -134,7 +134,7 @@ public class EmpiResourceMatcherSvc {
}
EmpiMatchOutcome retVal = new EmpiMatchOutcome(vector, score);
retVal.setEmpiRuleCount(myFieldMatchers.size());
retVal.setEmpiRuleCount(resourceRelevantFieldMatchers.size());
return retVal;
}
}