parent
6b15754b4a
commit
1d5714aec2
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
type: fix
|
||||
issue: 3261
|
||||
title: "When performing a search with a `_revinclude`. the results sometimes incorrectly included
|
||||
resources that were reverse included by other search parameters with the same name. Thanks to
|
||||
GitHub user @vivektk84 for reporting and to Jean-Francois Briere for proposing a fix."
|
|
@ -997,7 +997,7 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
continue;
|
||||
}
|
||||
|
||||
paths = param.getPathsSplit();
|
||||
paths = param.getPathsSplitForResourceType(resType);
|
||||
|
||||
String targetResourceType = defaultString(nextInclude.getParamTargetType(), null);
|
||||
for (String nextPath : paths) {
|
||||
|
|
|
@ -1964,6 +1964,29 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
|||
assertThat(ids, containsInAnyOrder(obsId, ptId, encId));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchWithRevIncludeDoesntSelectWrongResourcesWithSameSpName() {
|
||||
Patient pt = new Patient();
|
||||
pt.setActive(true);
|
||||
IIdType ptId = myPatientDao.create(pt, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
Encounter enc = new Encounter();
|
||||
enc.setStatus(Encounter.EncounterStatus.ARRIVED);
|
||||
enc.getSubject().setReference(ptId.getValue());
|
||||
IIdType encId = myEncounterDao.create(enc, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
Observation obs = new Observation();
|
||||
obs.getSubject().setReference(ptId.getValue());
|
||||
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
SearchParameterMap map = new SearchParameterMap()
|
||||
.addRevInclude(Encounter.INCLUDE_PATIENT);
|
||||
IBundleProvider outcome = myPatientDao.search(map);
|
||||
List<IIdType> ids = toUnqualifiedVersionlessIds(outcome);
|
||||
assertThat(ids, contains(ptId, encId));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchWithRevIncludeStarQualified() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue