diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpClient.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpClient.java
index ea568b9fc09..036e72a2205 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpClient.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/ApacheHttpClient.java
@@ -87,11 +87,13 @@ public class ApacheHttpClient extends BaseHttpClient implements IHttpClient {
}
+ @Override
protected IHttpRequest createHttpRequest() {
IHttpRequest retVal = createHttpRequest((HttpEntity)null);
return retVal;
}
+ @Override
protected IHttpRequest createHttpRequest(byte[] content) {
/*
* Note: Be careful about changing which constructor we use for
@@ -109,6 +111,7 @@ public class ApacheHttpClient extends BaseHttpClient implements IHttpClient {
return result;
}
+ @Override
protected IHttpRequest createHttpRequest(Map> theParams) {
List parameters = new ArrayList();
for (Entry> nextParam : theParams.entrySet()) {
@@ -124,6 +127,7 @@ public class ApacheHttpClient extends BaseHttpClient implements IHttpClient {
}
+ @Override
protected IHttpRequest createHttpRequest(String theContents) {
/*
* We aren't using a StringEntity here because the constructors
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java
index aa8ae708225..d46fdaf6b0b 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java
@@ -76,6 +76,7 @@ public class LoggingInterceptor implements IClientInterceptor {
}
}
+ @Override
@Hook(Pointcut.CLIENT_REQUEST)
public void interceptRequest(IHttpRequest theRequest) {
if (myLogRequestSummary) {
@@ -101,6 +102,7 @@ public class LoggingInterceptor implements IClientInterceptor {
}
}
+ @Override
@Hook(Pointcut.CLIENT_RESPONSE)
public void interceptResponse(IHttpResponse theResponse) throws IOException {
if (myLogResponseSummary) {
diff --git a/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu2.java b/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu2.java
index f863d6f6a7f..cb8219541aa 100644
--- a/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu2.java
+++ b/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu2.java
@@ -35,10 +35,12 @@ public class IgPackParserDstu2 extends BaseIgPackParser {
super(massage(theCtx));
}
+ @Override
protected IValidationSupport createValidationSupport(Map theIgResources) {
return new IgPackValidationSupportDstu2(theIgResources);
}
+ @Override
protected FhirVersionEnum provideExpectedVersion() {
return FhirVersionEnum.DSTU2_HL7ORG;
}
diff --git a/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu3.java b/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu3.java
index be2ba32dcbc..5ea1fe0aa86 100644
--- a/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu3.java
+++ b/hapi-fhir-igpacks/src/main/java/ca/uhn/fhir/igpacks/parser/IgPackParserDstu3.java
@@ -37,10 +37,12 @@ public class IgPackParserDstu3 extends BaseIgPackParser {
super(theCtx);
}
+ @Override
protected IValidationSupport createValidationSupport(Map theIgResources) {
return new IgPackValidationSupportDstu3(theIgResources);
}
+ @Override
protected FhirVersionEnum provideExpectedVersion() {
return FhirVersionEnum.DSTU3;
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithCriteriaDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithCriteriaDstu2Test.java
index 54e1f616fff..6efb25987eb 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithCriteriaDstu2Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithCriteriaDstu2Test.java
@@ -41,11 +41,13 @@ public class WebsocketWithCriteriaDstu2Test extends BaseResourceProviderDstu2Tes
private WebSocketClient myWebSocketClient;
private SocketImplementation mySocketImplementation;
+ @Override
@After
public void after() throws Exception {
super.after();
}
+ @Override
@Before
public void before() throws Exception {
super.before();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithSubscriptionIdDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithSubscriptionIdDstu2Test.java
index 692848a5260..5b292157efe 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithSubscriptionIdDstu2Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/websocket/WebsocketWithSubscriptionIdDstu2Test.java
@@ -58,6 +58,7 @@ public class WebsocketWithSubscriptionIdDstu2Test extends BaseResourceProviderDs
@Autowired
private SubscriptionTestUtil mySubscriptionTestUtil;
+ @Override
@After
public void after() throws Exception {
super.after();
@@ -70,6 +71,7 @@ public class WebsocketWithSubscriptionIdDstu2Test extends BaseResourceProviderDs
myWebSocketClient.stop();
}
+ @Override
@Before
public void before() throws Exception {
super.before();
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java
index 066a7f751a7..55a98a8fba1 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java
@@ -219,7 +219,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
}
}
for (String next : theRequest.getParameters().keySet()) {
- if (next.startsWith("_") && !SPECIAL_SEARCH_PARAMS.contains(next)) {
+ if (next.startsWith("_") && !SPECIAL_SEARCH_PARAMS.contains(truncModifierPart(next))) {
methodParamsTemp.add(next);
}
}
@@ -235,6 +235,13 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
return true;
}
+ private String truncModifierPart(String param) {
+ int indexOfSeparator = param.indexOf(":");
+ if (indexOfSeparator != -1) {
+ return param.substring(0, indexOfSeparator);
+ }
+ return param;
+ }
@Override
public IBundleProvider invokeServer(IRestfulServer> theServer, RequestDetails theRequest, Object[] theMethodParams) throws InvalidRequestException, InternalErrorException {
diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/validation/InstanceValidator.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/validation/InstanceValidator.java
index f369bbcf2c4..76850ebea67 100644
--- a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/validation/InstanceValidator.java
+++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/validation/InstanceValidator.java
@@ -1021,6 +1021,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
return Utilities.appendSlash(base) + type + "/" + id;
}
+ @Override
public BestPracticeWarningLevel getBasePracticeWarningLevel() {
return bpWarnings;
}
@@ -1416,6 +1417,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
this.anyExtensionsAllowed = anyExtensionsAllowed;
}
+ @Override
public void setBestPracticeWarningLevel(BestPracticeWarningLevel value) {
bpWarnings = value;
}
@@ -1429,10 +1431,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
this.suppressLoincSnomedMessages = suppressLoincSnomedMessages;
}
+ @Override
public IdStatus getResourceIdRule() {
return resourceIdRule;
}
+ @Override
public void setResourceIdRule(IdStatus resourceIdRule) {
this.resourceIdRule = resourceIdRule;
}
diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ContainedDt.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ContainedDt.java
index 01875435ced..987d1676252 100644
--- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ContainedDt.java
+++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ContainedDt.java
@@ -35,6 +35,7 @@ public class ContainedDt extends BaseContainedDt {
@Child(name = "resource", type = IResource.class, order = 0, min = 0, max = Child.MAX_UNLIMITED)
private List myContainedResources;
+ @Override
public List getContainedResources() {
if (myContainedResources == null) {
myContainedResources = new ArrayList();
diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/NarrativeDt.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/NarrativeDt.java
index 28555dd3a46..ce404c61268 100644
--- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/NarrativeDt.java
+++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/NarrativeDt.java
@@ -114,7 +114,8 @@ public class NarrativeDt extends BaseNarrativeDt {
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
*
*/
- public BoundCodeDt getStatus() {
+ @Override
+ public BoundCodeDt getStatus() {
if (myStatus == null) {
myStatus = new BoundCodeDt(NarrativeStatusEnum.VALUESET_BINDER);
}
@@ -170,7 +171,8 @@ public class NarrativeDt extends BaseNarrativeDt {
* The actual narrative content, a stripped down version of XHTML
*
*/
- public XhtmlDt getDiv() {
+ @Override
+ public XhtmlDt getDiv() {
if (myDiv == null) {
myDiv = new XhtmlDt();
}
diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java
index aafc9e886ca..58aa4b93a99 100644
--- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java
+++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java
@@ -162,7 +162,8 @@ public class ResourceReferenceDt
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
*
*/
- public IdDt getReference() {
+ @Override
+ public IdDt getReference() {
if (myReference == null) {
myReference = new IdDt();
}
@@ -183,6 +184,7 @@ public class ResourceReferenceDt
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
*
*/
+ @Override
public ResourceReferenceDt setReference(IdDt theValue) {
myReference = theValue;
return this;
@@ -196,7 +198,8 @@ public class ResourceReferenceDt
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
*
*/
- public ResourceReferenceDt setReference( String theId) {
+ @Override
+ public ResourceReferenceDt setReference(String theId) {
myReference = new IdDt(theId);
return this;
}
@@ -240,7 +243,8 @@ public class ResourceReferenceDt
* Plain text narrative that identifies the resource in addition to the resource reference
*
*/
- public ResourceReferenceDt setDisplay( String theString) {
+ @Override
+ public ResourceReferenceDt setDisplay(String theString) {
myDisplay = new StringDt(theString);
return this;
}
diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/resource/BaseResource.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/resource/BaseResource.java
index fe058d3eae8..8c03b43d360 100644
--- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/resource/BaseResource.java
+++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/resource/BaseResource.java
@@ -313,10 +313,12 @@ public abstract class BaseResource extends BaseElement implements IResource {
myContained = theContained;
}
+ @Override
public void setId(IdDt theId) {
myId = theId;
}
+ @Override
public BaseResource setId(IIdType theId) {
if (theId instanceof IdDt) {
myId = (IdDt) theId;
@@ -328,6 +330,7 @@ public abstract class BaseResource extends BaseElement implements IResource {
return this;
}
+ @Override
public BaseResource setId(String theId) {
if (theId == null) {
myId = null;
diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/ctx/FhirContextDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/ctx/FhirContextDstu2Test.java
index 97a17c3770c..79fc042d5ec 100644
--- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/ctx/FhirContextDstu2Test.java
+++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/ctx/FhirContextDstu2Test.java
@@ -142,6 +142,7 @@ public class FhirContextDstu2Test {
final CountDownLatch allDone = new CountDownLatch(numThreads);
for (final Runnable submittedTestRunnable : runnables) {
threadPool.submit(new Runnable() {
+ @Override
public void run() {
allExecutorThreadsReady.countDown();
try {
diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomMedicationOrderDstu2.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomMedicationOrderDstu2.java
index bc1ca425775..e2120ba5f49 100644
--- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomMedicationOrderDstu2.java
+++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomMedicationOrderDstu2.java
@@ -17,6 +17,7 @@ public class CustomMedicationOrderDstu2 extends MedicationOrder {
@Child(name = "medication", order = Child.REPLACE_PARENT, min = 1, max = 1, summary = false, modifier = false, type = { Medication.class })
private ResourceReferenceDt myMedication;
+ @Override
public ResourceReferenceDt getMedication() {
return myMedication;
}
diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java
index dbe6897d299..4756f7bfa1f 100644
--- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java
+++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java
@@ -7,10 +7,7 @@ import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Link;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.primitive.InstantDt;
-import ca.uhn.fhir.rest.annotation.Create;
-import ca.uhn.fhir.rest.annotation.RequiredParam;
-import ca.uhn.fhir.rest.annotation.ResourceParam;
-import ca.uhn.fhir.rest.annotation.Search;
+import ca.uhn.fhir.rest.annotation.*;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.MethodOutcome;
@@ -41,6 +38,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -407,6 +405,70 @@ public class SearchDstu2Test {
assertEquals("Patient", ourLastRef.getResourceType());
}
+ /**
+ * Verifies proper method binding to handle special search names(_id:[modifier], _language:[modifier])
+ */
+ @Test
+ public void testSearchByIdExact() throws Exception {
+ HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_id:exact=aaa&reference=value");
+ HttpResponse status = ourClient.execute(httpGet);
+ String responseContent = IOUtils.toString(status.getEntity().getContent(), Charset.defaultCharset());
+ IOUtils.closeQuietly(status.getEntity().getContent());
+ ourLog.info(responseContent);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+
+ assertEquals("idProvider", ourLastMethod);
+ }
+
+ @Test
+ public void testSearchByQualifiedIdQualifiedString() throws Exception {
+ HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_id:exact=aaa&stringParam:exact=value");
+ HttpResponse status = ourClient.execute(httpGet);
+ String responseContent = IOUtils.toString(status.getEntity().getContent(), Charset.defaultCharset());
+ IOUtils.closeQuietly(status.getEntity().getContent());
+ ourLog.info(responseContent);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+
+ assertEquals("stringParam:true:true", ourLastMethod);
+ }
+
+ @Test
+ public void testSearchByQualifiedString() throws Exception {
+ HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_id=aaa&stringParam:exact=value");
+ HttpResponse status = ourClient.execute(httpGet);
+ String responseContent = IOUtils.toString(status.getEntity().getContent(), Charset.defaultCharset());
+ IOUtils.closeQuietly(status.getEntity().getContent());
+ ourLog.info(responseContent);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+
+ assertEquals("stringParam:false:true", ourLastMethod);
+ }
+
+ @Test
+ public void testSearchByQualifiedIdString() throws Exception {
+ HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_id:exact=aaa&stringParam=value");
+ HttpResponse status = ourClient.execute(httpGet);
+ String responseContent = IOUtils.toString(status.getEntity().getContent(), Charset.defaultCharset());
+ IOUtils.closeQuietly(status.getEntity().getContent());
+ ourLog.info(responseContent);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+
+ assertEquals("stringParam:true:false", ourLastMethod);
+ }
+
+ @Test
+ public void testSearchByIdString() throws Exception {
+ HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_id=aaa&stringParam=value");
+ HttpResponse status = ourClient.execute(httpGet);
+ String responseContent = IOUtils.toString(status.getEntity().getContent(), Charset.defaultCharset());
+ IOUtils.closeQuietly(status.getEntity().getContent());
+ ourLog.info(responseContent);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+
+ assertEquals("stringParam:false:false", ourLastMethod);
+ }
+
+
@Test
public void testSearchWhitelist01Failing() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWhitelist01&ref=value");
@@ -439,12 +501,13 @@ public class SearchDstu2Test {
ourServer = new Server(0);
DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider();
+ DummyPatientResourceNoIdProvider patientResourceNoIdProviderProvider = new DummyPatientResourceNoIdProvider();
ServletHandler proxyHandler = new ServletHandler();
ourServlet = new RestfulServer(ourCtx);
ourServlet.setPagingProvider(new FifoMemoryPagingProvider(10));
ourServlet.setDefaultResponseEncoding(EncodingEnum.XML);
- ourServlet.setResourceProviders(patientProvider);
+ ourServlet.setResourceProviders(patientResourceNoIdProviderProvider, patientProvider);
ServletHolder servletHolder = new ServletHolder(ourServlet);
proxyHandler.addServletWithMapping(servletHolder, "/*");
@@ -459,6 +522,23 @@ public class SearchDstu2Test {
}
+ public static class DummyPatientResourceNoIdProvider implements IResourceProvider {
+
+ @Override
+ public Class extends IResource> getResourceType() {
+ return Patient.class;
+ }
+
+ //@formatter:off
+ @Search()
+ public List searchByRef(
+ @RequiredParam(name = "reference") ReferenceParam theParam) {
+ ourLastMethod = "noIdProvider";
+ return Collections.emptyList();
+ }
+ //@formatter:on
+ }
+
public static class DummyPatientResourceProvider implements IResourceProvider {
@Override
@@ -482,7 +562,27 @@ public class SearchDstu2Test {
public MethodOutcome create(@ResourceParam Patient thePatient) {
throw new UnsupportedOperationException();
}
-
+
+ //@formatter:off
+ @Search()
+ public List searchByIdRef(
+ @RequiredParam(name="_id") StringParam id,
+ @OptionalParam(name = "reference") ReferenceParam theParam) {
+ ourLastMethod = "idProvider";
+ return Collections.emptyList();
+ }
+ //@formatter:on
+
+ //@formatter:off
+ @Search()
+ public List searchByQualifiedString(
+ @RequiredParam(name="_id") StringParam id,
+ @RequiredParam(name = "stringParam") StringParam stringParam) {
+ ourLastMethod = "stringParam:" + id.isExact() + ":" + stringParam.isExact();
+ return Collections.emptyList();
+ }
+ //@formatter:on
+
//@formatter:off
@Search()
public List searchDateAndList(
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/jsonlike/JsonLikeParserTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/jsonlike/JsonLikeParserTest.java
index f82b2ce3153..72841e5450a 100644
--- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/jsonlike/JsonLikeParserTest.java
+++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/jsonlike/JsonLikeParserTest.java
@@ -1,732 +1,737 @@
-package ca.uhn.fhir.parser.jsonlike;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.Writer;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-
-import org.apache.commons.io.IOUtils;
-import org.hl7.fhir.instance.model.api.IBaseResource;
-import org.hl7.fhir.r4.model.IntegerType;
-import org.hl7.fhir.r4.model.Patient;
-import org.hl7.fhir.r4.model.Reference;
-import org.hl7.fhir.r4.model.Extension;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
-
-import ca.uhn.fhir.context.FhirContext;
-import ca.uhn.fhir.parser.DataFormatException;
-import ca.uhn.fhir.parser.IJsonLikeParser;
-import ca.uhn.fhir.parser.IParser;
-import ca.uhn.fhir.parser.json.GsonStructure;
-import ca.uhn.fhir.parser.json.JsonLikeArray;
-import ca.uhn.fhir.parser.json.JsonLikeObject;
-import ca.uhn.fhir.parser.json.JsonLikeStructure;
-import ca.uhn.fhir.parser.json.JsonLikeValue;
-import ca.uhn.fhir.parser.json.JsonLikeWriter;
-import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
-import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
-import ca.uhn.fhir.parser.view.ExtPatient;
-import ca.uhn.fhir.util.TestUtil;
-
-public class JsonLikeParserTest {
- private static FhirContext ourCtx = FhirContext.forR4();
- private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonLikeParserTest.class);
-
- /**
- * Test for JSON Parser with user-supplied JSON-like structure (use default GSON)
- */
- @Test
- public void testJsonLikeParseAndEncodeResourceFromXmlToJson() throws Exception {
- String content = IOUtils.toString(JsonLikeParserTest.class.getResourceAsStream("/extension-on-line.txt"));
-
- IBaseResource parsed = ourCtx.newJsonParser().parseResource(content);
-
- String encoded = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(parsed);
- ourLog.info(encoded);
-
- JsonLikeStructure jsonLikeStructure = new GsonStructure();
- jsonLikeStructure.load(new StringReader(encoded));
-
- IJsonLikeParser jsonLikeparser = (IJsonLikeParser)ourCtx.newJsonParser();
-
- IBaseResource resource = jsonLikeparser.parseResource(jsonLikeStructure);
- Assert.assertEquals("reparsed resource classes not equal", parsed.getClass().getName(), resource.getClass().getName());
- }
-
- /**
- * Test JSON-Like writer using custom stream writer
- *
- */
- @Test
- public void testJsonLikeParseWithCustomJSONStreamWriter() throws Exception {
- String refVal = "http://my.org/FooBar";
-
- Patient fhirPat = new Patient();
- fhirPat.addExtension().setUrl("x1").setValue(new Reference(refVal));
-
- IJsonLikeParser jsonLikeParser = (IJsonLikeParser)ourCtx.newJsonParser();
- JsonLikeMapWriter jsonLikeWriter = new JsonLikeMapWriter();
-
- jsonLikeParser.encodeResourceToJsonLikeWriter(fhirPat, jsonLikeWriter);
- Map jsonLikeMap = jsonLikeWriter.getResultMap();
-
- System.out.println("encoded map: " + jsonLikeMap.toString());
-
- Assert.assertNotNull("Encoded resource missing 'resourceType' element", jsonLikeMap.get("resourceType"));
- Assert.assertEquals("Expecting 'resourceType'='Patient'; found '"+jsonLikeMap.get("resourceType")+"'", jsonLikeMap.get("resourceType"), "Patient");
-
- Assert.assertNotNull("Encoded resource missing 'extension' element", jsonLikeMap.get("extension"));
- Assert.assertTrue("'extension' element is not a List", (jsonLikeMap.get("extension") instanceof List));
-
- List