Merge pull request #836 from RuthAlk/include_patch

Fix problem with _include=MedicationRequest:medication
This commit is contained in:
James Agnew 2018-05-22 08:40:08 -04:00 committed by GitHub
commit 3a68bc19e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -101,9 +101,15 @@ public class ResourceReferenceInfo {
if (resourceDef != null) {
RuntimeSearchParam searchParamDef = resourceDef.getSearchParam(paramName);
if (searchParamDef!=null) {
if (searchParamDef.getPathsSplit().contains(myOwningResource + "." + myName)) {
return true;
final String myCompleteName = myOwningResource + "." + myName;
boolean matched = false;
for (String s : searchParamDef.getPathsSplit()) {
if (s.equals(myCompleteName) ||
s.startsWith(myCompleteName + ".")) {
matched = true; break;
}
}
return matched;
}
}
return false;