wip
This commit is contained in:
parent
e38ec3e3dd
commit
c3ceffbd72
|
@ -809,11 +809,17 @@ class PredicateBuilderReference extends BasePredicateBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
assert parameterName != null;
|
assert parameterName != null;
|
||||||
|
|
||||||
|
//Ensure that the name of the search param
|
||||||
|
// (e.g. the `code` in Patient?_has:Observation:subject:code=sys|val)
|
||||||
|
// exists on the target resource type.
|
||||||
RuntimeSearchParam owningParameterDef = mySearchParamRegistry.getSearchParamByName(targetResourceDefinition, paramName);
|
RuntimeSearchParam owningParameterDef = mySearchParamRegistry.getSearchParamByName(targetResourceDefinition, paramName);
|
||||||
if (owningParameterDef == null) {
|
if (owningParameterDef == null) {
|
||||||
throw new InvalidRequestException("Unknown parameter name: " + targetResourceType + ':' + parameterName);
|
throw new InvalidRequestException("Unknown parameter name: " + targetResourceType + ':' + parameterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Ensure that the name of the back-referenced search param on the target (e.g. the `subject` in Patient?_has:Observation:subject:code=sys|val)
|
||||||
|
//exists on the target resource.
|
||||||
owningParameterDef = mySearchParamRegistry.getSearchParamByName(targetResourceDefinition, paramReference);
|
owningParameterDef = mySearchParamRegistry.getSearchParamByName(targetResourceDefinition, paramReference);
|
||||||
if (owningParameterDef == null) {
|
if (owningParameterDef == null) {
|
||||||
throw new InvalidRequestException("Unknown parameter name: " + targetResourceType + ':' + paramReference);
|
throw new InvalidRequestException("Unknown parameter name: " + targetResourceType + ':' + paramReference);
|
||||||
|
|
|
@ -363,6 +363,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
obs.addIdentifier().setSystem("urn:system").setValue("FOO");
|
obs.addIdentifier().setSystem("urn:system").setValue("FOO");
|
||||||
obs.setDevice(new Reference(devId));
|
obs.setDevice(new Reference(devId));
|
||||||
obs.setSubject(new Reference(pid0));
|
obs.setSubject(new Reference(pid0));
|
||||||
|
obs.setCode(new CodeableConcept(new Coding("sys", "val", "disp")));
|
||||||
myObservationDao.create(obs, mySrd).getId();
|
myObservationDao.create(obs, mySrd).getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,6 +383,16 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
IBundleProvider chainSearch = myObservationDao.search(chainQuery);
|
IBundleProvider chainSearch = myObservationDao.search(chainQuery);
|
||||||
List<SqlQuery> selectqueriesForCurrentThread = myCaptureQueriesListener.getSelectQueriesForCurrentThread();
|
List<SqlQuery> selectqueriesForCurrentThread = myCaptureQueriesListener.getSelectQueriesForCurrentThread();
|
||||||
assertThat(chainQuery.size(), is(equalTo(1)));
|
assertThat(chainQuery.size(), is(equalTo(1)));
|
||||||
|
|
||||||
|
SearchParameterMap hasQuery = new SearchParameterMap();
|
||||||
|
hasQuery.setLoadSynchronous(true);
|
||||||
|
hasQuery.add("_has", new HasParam("Observation", "subject", "code", "sys|val"));
|
||||||
|
//hasQuery.add(Observation.SP_DEVICE, new ReferenceParam("device", "urn:system|FOO").setChain("identifier"));
|
||||||
|
myCaptureQueriesListener.clear();
|
||||||
|
IBundleProvider hasSearch = myPatientDao.search(hasQuery);
|
||||||
|
selectqueriesForCurrentThread = myCaptureQueriesListener.getSelectQueriesForCurrentThread();
|
||||||
|
assertThat(hasQuery.size(), is(equalTo(1)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue