Fix problem with _include=MedicationRequest:medication with R4

A query for MedicationRequest that should include medication
did not work, because the SearchParamDefinition defined the
path as (MedicationRequest.medication as Reference)

Enhanced the matchesInclude method to allow extra parts after
the search path
This commit is contained in:
Erwin Oldenkamp 2023-07-14 15:39:48 +02:00
parent 6178075448
commit 1b479426a1
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,9 @@ public class ResourceReferenceInfo {
final String completeName = myOwningResource + "." + myName;
boolean matched = false;
for (String s : searchParamDef.getPathsSplit()) {
if (s.equals(completeName) || s.startsWith(completeName + ".")) {
if (s.equals(completeName)
|| s.startsWith(completeName + ".")
|| s.startsWith("(" + completeName )) {
matched = true;
break;
}