added search % now test
This commit is contained in:
parent
42a9672cc2
commit
c974e9283b
|
@ -5,7 +5,11 @@ import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl;
|
||||||
import ca.uhn.fhir.jpa.util.TestUtil;
|
import ca.uhn.fhir.jpa.util.TestUtil;
|
||||||
import ca.uhn.fhir.parser.StrictErrorHandler;
|
import ca.uhn.fhir.parser.StrictErrorHandler;
|
||||||
import ca.uhn.fhir.rest.client.interceptor.CapturingInterceptor;
|
import ca.uhn.fhir.rest.client.interceptor.CapturingInterceptor;
|
||||||
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.hl7.fhir.r5.model.Bundle;
|
import org.hl7.fhir.r5.model.Bundle;
|
||||||
|
import org.hl7.fhir.r5.model.DateTimeType;
|
||||||
|
import org.hl7.fhir.r5.model.Observation;
|
||||||
import org.hl7.fhir.r5.model.Patient;
|
import org.hl7.fhir.r5.model.Patient;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
@ -84,6 +88,20 @@ public class ResourceProviderR5Test extends BaseResourceProviderR5Test {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDateNowSyntax() {
|
||||||
|
Observation observation = new Observation();
|
||||||
|
observation.setEffective(new DateTimeType("1965-08-09"));
|
||||||
|
IIdType oid = myObservationDao.create(observation).getId().toUnqualified();
|
||||||
|
String nowParam = UrlUtil.escapeUrlParam("%now");
|
||||||
|
Bundle output = ourClient
|
||||||
|
.search()
|
||||||
|
.byUrl("Observation?date=lt" + nowParam)
|
||||||
|
.returnBundle(Bundle.class)
|
||||||
|
.execute();
|
||||||
|
List<IIdType> ids = output.getEntry().stream().map(t -> t.getResource().getIdElement().toUnqualified()).collect(Collectors.toList());
|
||||||
|
assertThat(ids, containsInAnyOrder(oid));
|
||||||
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void afterClassClearContext() {
|
public static void afterClassClearContext() {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
public class InMemoryResourceMatcherTest {
|
public class InMemoryResourceMatcherR5Test {
|
||||||
public static final String OBSERVATION_DATE = "1970-10-17";
|
public static final String OBSERVATION_DATE = "1970-10-17";
|
||||||
private static final String EARLY_DATE = "1965-08-09";
|
private static final String EARLY_DATE = "1965-08-09";
|
||||||
private static final String LATE_DATE = "2000-06-29";
|
private static final String LATE_DATE = "2000-06-29";
|
Loading…
Reference in New Issue