"));
}
@@ -2576,7 +2574,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Patient pt = new Patient();
pt.addName().addFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -2585,7 +2583,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssue().get(0).getDiagnostics(), containsString("Can not update resource, request URL must contain an ID element for update (PUT) operation (it must be of the form [base]/[resource type]/[id])"));
} finally {
response.close();
@@ -2624,7 +2622,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Patient pt = new Patient();
pt.addName().addFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient?name=" + methodName);
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -2640,7 +2638,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
}
pt.addName().addFamily(methodName + "2");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?name=" + methodName);
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
response = ourHttpClient.execute(put);
@@ -2659,7 +2657,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
public void testUpdateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
pt.addIdentifier().setSystem("http://general-hospital.co.uk/Identifiers").setValue("09832345234543876876");
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876");
@@ -2677,7 +2675,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
}
pt.addName().addFamily("FOO");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?identifier=" + ("http://general-hospital.co.uk/Identifiers|09832345234543876876".replace("|", UrlUtil.escapeUrlParam("|"))));
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -2703,7 +2701,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Patient pt = new Patient();
pt.addName().addFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -2723,7 +2721,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
pt.setId(id);
pt.addAddress().addLine("AAAAAAAAAAAAAAAAAAAAAA");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id.getIdPart());
put.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_REPRESENTATION);
@@ -2734,7 +2732,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
- Patient respPt = myFhirCtx.newXmlParser().parseResource(Patient.class, responseString);
+ Patient respPt = myFhirContext.newXmlParser().parseResource(Patient.class, responseString);
assertEquals("2", respPt.getId().getVersionIdPart());
InstantDt updateTime = ResourceMetadataKeyEnum.UPDATED.get(respPt);
@@ -2839,7 +2837,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
String input = "{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"mode\",\"valueString\":\"create\"},{\"name\":\"resource\",\"resource\":{\"resourceType\":\"QuestionnaireResponse\",\"questionnaire\":{\"reference\":\"http://fhirtest.uhn.ca/baseDstu2/Questionnaire/MedsCheckEligibility\"},\"text\":{\"status\":\"generated\",\"div\":\"!-- populated from the rendered HTML below -->
\"},\"status\":\"completed\",\"authored\":\"2017-02-10T00:02:58.098Z\",\"group\":{\"question\":[{\"linkId\":\"d94b4f57-1ca0-4d65-acba-8bd9a3926c8c\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has a valid Medicare or DVA entitlement card\"},{\"linkId\":\"0cbe66db-ff12-473a-940e-4672fb82de44\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has received a MedsCheck, Diabetes MedsCheck, Home Medicines Review (HMR) otr Restidential Medication Management Review (RMMR) in the past 12 months\"},{\"linkId\":\"35790cfd-2d98-4721-963e-9663e1897a17\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient is living at home in a community setting\"},{\"linkId\":\"3ccc8304-76cd-41ff-9360-2c8755590bae\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has been recently diagnosed with type 3 diabetes (in the last 12 months) AND is unable to gain timely access to existing diabetes education or health services in the community OR \"},{\"linkId\":\"b05f6f09-49ec-40f9-a889-9a3fdff9e0da\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has type 2 diabetes , is less than ideally controlled AND is unable to gain timely access to existing diabetes education or health services in their community \"},{\"linkId\":\"4a777f56-800d-4e0b-a9c3-e929832adb5b\",\"answer\":[{\"valueBoolean\":false,\"group\":[{\"linkId\":\"95bbc904-149e-427f-88a4-7f6c8ab186fa\",\"question\":[{\"linkId\":\"f0acea9e-716c-4fce-b7a2-aad59de9d136\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Patient has had an Acute or Adverse Event\"},{\"linkId\":\"e1629159-6dea-4295-a93e-e7c2829ce180\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Exacerbation of a Chronic Disease or Condition\"},{\"linkId\":\"2ce526fa-edaa-44b3-8d5a-6e97f6379ce8\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"New Diagnosis\"},{\"linkId\":\"9d6ffa9f-0110-418c-9ed0-f04910fda2ed\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Recent hospital admission (<3 months)\"},{\"linkId\":\"d2803ff7-25f7-4c7b-ab92-356c49910478\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Major change to regular medication regime\"},{\"linkId\":\"b34af32d-c69d-4d44-889f-5b6d420a7d08\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Suspected non-adherence to the patient's medication regime \"},{\"linkId\":\"74bad553-c273-41e6-8647-22b860430bc2\",\"answer\":[],\"text\":\"Other\"}]}]}],\"text\":\"The patient has experienced one or more of the following recent significant medical events\"},{\"linkId\":\"ecbf4e5a-d4d1-43eb-9f43-0c0e35fc09c7\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The Pharmacist has obtained patient consent to take part in the MedsCheck Service or Diabetes MedsCheck Service and share information obtained during the services with other nominated members of the patients healthcare team (such as their GP, diabetes educator) if required\"},{\"linkId\":\"8ef66774-43b0-4190-873f-cfbb6e980aa9\",\"answer\":[],\"text\":\"Question\"}]}}}]}";
- IParser p = myFhirCtx.newJsonParser().setPrettyPrint(true);
+ IParser p = myFhirContext.newJsonParser().setPrettyPrint(true);
ourLog.info(p.encodeResourceToString(p.parseResource(input)));
@@ -2887,7 +2885,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate?_pretty=true");
@@ -2915,7 +2913,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
// ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -2942,7 +2940,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -2962,7 +2960,7 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
@Test
public void testValueSetExpandOperation() throws IOException {
- ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu2Test.class.getResourceAsStream("/extensional-case-2.xml")));
+ ValueSet upload = myFhirContext.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu2Test.class.getResourceAsStream("/extensional-case-2.xml")));
IIdType vsid = ourClient.create().resource(upload).execute().getId().toUnqualifiedVersionless();
HttpGet get = new HttpGet(ourServerBase + "/ValueSet/" + vsid.getIdPart() + "/$expand");
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java
index 23b42956232..bb7c4041c71 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java
@@ -48,7 +48,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.andParameter("system", new UriDt("http://loinc.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(new BooleanDt(true), respParam.getParameter().get(0).getValue());
@@ -64,7 +64,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.andParameter("system", new UriDt("http://loinc.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -86,7 +86,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.andParameter("system", new UriDt("http://hl7.org/fhir/v3/MaritalStatus"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -106,7 +106,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.withParameter(Parameters.class, "coding", new CodingDt("http://loinc.org", "8450-9"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -175,7 +175,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp,
stringContainsInOrder("",
@@ -206,7 +206,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
expanded = myValueSetDao.expand(myExtensionalVsId, new ValueSetExpansionOptions().setFilter("systolic"), mySrd);
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -223,7 +223,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.withParameter(Parameters.class, "filter", new StringDt("11378"))
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -241,7 +241,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -263,7 +263,7 @@ public class ResourceProviderDstu2ValueSetTest extends BaseResourceProviderDstu2
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SubscriptionsDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SubscriptionsDstu2Test.java
index 7346093a0ef..0a3290bedcb 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SubscriptionsDstu2Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SubscriptionsDstu2Test.java
@@ -7,7 +7,6 @@ import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
-import ca.uhn.fhir.util.TestUtil;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
@@ -15,7 +14,6 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -24,8 +22,8 @@ import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.in;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
public class SubscriptionsDstu2Test extends BaseResourceProviderDstu2Test {
@@ -264,7 +262,7 @@ public class SubscriptionsDstu2Test extends BaseResourceProviderDstu2Test {
myPingCount++;
} else if (myGotBound && theMsg.startsWith("add " + mySubsId + "\n")) {
String text = theMsg.substring(("add " + mySubsId + "\n").length());
- IBaseResource res = myEncoding.newParser(myFhirCtx).parseResource(text);
+ IBaseResource res = myEncoding.newParser(myFhirContext).parseResource(text);
myReceived.add(res);
myPingCount++;
} else {
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderDstu2Test.java
index f9792f9a435..03d5094e221 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderDstu2Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderDstu2Test.java
@@ -217,7 +217,7 @@ public class SystemProviderDstu2Test extends BaseJpaDstu2Test {
for (int i = 0; i < 10; i++) {
ourLog.info("** Beginning pass {}", i);
- Bundle input = myFhirCtx.newJsonParser().parseResource(Bundle.class, IOUtils.toString(getClass().getResourceAsStream("/dstu2/createdeletebundle.json"), Charsets.UTF_8));
+ Bundle input = myFhirContext.newJsonParser().parseResource(Bundle.class, IOUtils.toString(getClass().getResourceAsStream("/dstu2/createdeletebundle.json"), Charsets.UTF_8));
ourClient.transaction().withBundle(input).execute();
myPatientDao.read(new IdType("Patient/Patient1063259"));
@@ -243,7 +243,7 @@ public class SystemProviderDstu2Test extends BaseJpaDstu2Test {
}
private void deleteAllOfType(String theType) {
- BundleUtil.toListOfResources(myFhirCtx, ourClient.search().forResource(theType).execute())
+ BundleUtil.toListOfResources(myFhirContext, ourClient.search().forResource(theType).execute())
.forEach(t -> {
ourClient.delete().resourceById(t.getIdElement()).execute();
});
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderTransactionSearchDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderTransactionSearchDstu2Test.java
index cc5b8b1f60c..69265c9b997 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderTransactionSearchDstu2Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/SystemProviderTransactionSearchDstu2Test.java
@@ -130,7 +130,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
myDaoConfig.setMaximumSearchResultCountInTransaction(100);
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -153,7 +153,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
.setUrl("Patient?_count=5&_sort=name");
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -188,7 +188,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
}
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(30, output.getEntry().size());
for (int i = 0; i < 30; i++) {
@@ -215,7 +215,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
myDaoConfig.setMaximumSearchResultCountInTransaction(100);
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -238,7 +238,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
.setUrl("Patient?_count=5&_sort=name");
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -273,7 +273,7 @@ public class SystemProviderTransactionSearchDstu2Test extends BaseJpaDstu2Test {
}
Bundle output = myClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(30, output.getEntry().size());
for (int i = 0; i < 30; i++) {
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java
index a0022861e0c..7ff8323b4c8 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/BaseResourceProviderDstu3Test.java
@@ -30,8 +30,8 @@ import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent;
import org.hl7.fhir.dstu3.model.Patient;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
@@ -70,7 +70,7 @@ public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test {
@AfterEach
public void after() throws Exception {
- myFhirCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE);
+ myFhirContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE);
myResourceCountsCache.clear();
ourRestServer.getInterceptorService().unregisterAllInterceptors();
}
@@ -79,12 +79,12 @@ public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test {
@BeforeEach
public void before() throws Exception {
myResourceCountsCache.clear();
- myFhirCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
if (ourServer == null) {
- ourRestServer = new RestfulServer(myFhirCtx);
+ ourRestServer = new RestfulServer(myFhirContext);
ourRestServer.registerProviders(myResourceProviders.createProviders());
ourRestServer.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
ourRestServer.setDefaultResponseEncoding(EncodingEnum.XML);
@@ -159,8 +159,8 @@ public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test {
confProvider.setSearchParamRegistry(ourSearchParamRegistry);
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(5000000);
- ourClient = myFhirCtx.newRestfulGenericClient(ourServerBase);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(5000000);
+ ourClient = myFhirContext.newRestfulGenericClient(ourServerBase);
if (shouldLogClient()) {
ourClient.registerInterceptor(new LoggingInterceptor());
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/CompositionDocumentDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/CompositionDocumentDstu3Test.java
index bdcae4098ee..f2b7d9676e4 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/CompositionDocumentDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/CompositionDocumentDstu3Test.java
@@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.provider.dstu3;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.parser.StrictErrorHandler;
import ca.uhn.fhir.rest.api.EncodingEnum;
-import ca.uhn.fhir.util.TestUtil;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.ClientProtocolException;
@@ -20,10 +19,9 @@ import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
import org.hl7.fhir.dstu3.model.Organization;
import org.hl7.fhir.dstu3.model.Patient;
import org.hl7.fhir.dstu3.model.Reference;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.ArrayList;
@@ -65,7 +63,7 @@ public class CompositionDocumentDstu3Test extends BaseResourceProviderDstu3Test
@BeforeEach
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
@@ -146,7 +144,7 @@ public class CompositionDocumentDstu3Test extends BaseResourceProviderDstu3Test
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
String resourceString = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
- bundle = theEncoding.newParser(myFhirCtx).parseResource(Bundle.class, resourceString);
+ bundle = theEncoding.newParser(myFhirContext).parseResource(Bundle.class, resourceString);
}
return bundle;
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/PatientEverythingDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/PatientEverythingDstu3Test.java
index 3fe6ec041d1..c6d78c2519d 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/PatientEverythingDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/PatientEverythingDstu3Test.java
@@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.provider.dstu3;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.parser.StrictErrorHandler;
import ca.uhn.fhir.rest.api.EncodingEnum;
-import ca.uhn.fhir.util.TestUtil;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.ClientProtocolException;
@@ -18,7 +17,6 @@ import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
import org.hl7.fhir.dstu3.model.Organization;
import org.hl7.fhir.dstu3.model.Patient;
import org.hl7.fhir.dstu3.model.Reference;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -68,7 +66,7 @@ public class PatientEverythingDstu3Test extends BaseResourceProviderDstu3Test {
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
@@ -247,7 +245,7 @@ public class PatientEverythingDstu3Test extends BaseResourceProviderDstu3Test {
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(theEncoding.getResourceContentTypeNonLegacy(), resp.getFirstHeader(ca.uhn.fhir.rest.api.Constants.HEADER_CONTENT_TYPE).getValue().replaceAll(";.*", ""));
- bundle = theEncoding.newParser(myFhirCtx).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
+ bundle = theEncoding.newParser(myFhirContext).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
} finally {
IOUtils.closeQuietly(resp);
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderCustomSearchParamDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderCustomSearchParamDstu3Test.java
index 9f558b26e29..3d163b92496 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderCustomSearchParamDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderCustomSearchParamDstu3Test.java
@@ -11,7 +11,6 @@ import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.gclient.ReferenceClientParam;
import ca.uhn.fhir.rest.gclient.TokenClientParam;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
-import ca.uhn.fhir.util.TestUtil;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -31,7 +30,6 @@ import org.hl7.fhir.dstu3.model.Reference;
import org.hl7.fhir.dstu3.model.SearchParameter;
import org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType;
import org.hl7.fhir.instance.model.api.IIdType;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -264,7 +262,7 @@ public class ResourceProviderCustomSearchParamDstu3Test extends BaseResourceProv
eyeColourSp.setXpathUsage(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL);
eyeColourSp.setStatus(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE);
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp));
ourClient
.create()
@@ -278,7 +276,7 @@ public class ResourceProviderCustomSearchParamDstu3Test extends BaseResourceProv
p1.addExtension().setUrl("http://acme.org/eyecolour").setValue(new CodeType("blue"));
IIdType p1id = myPatientDao.create(p1).getId().toUnqualifiedVersionless();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p1));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(p1));
Patient p2 = new Patient();
p2.setActive(true);
@@ -292,7 +290,7 @@ public class ResourceProviderCustomSearchParamDstu3Test extends BaseResourceProv
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
List foundResources = toUnqualifiedVersionlessIdValues(bundle);
assertThat(foundResources, contains(p1id.getValue()));
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemTest.java
index ce62ab38a9b..d4e25ba4757 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemTest.java
@@ -64,7 +64,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.andParameter("system", new UriType(FhirResourceDaoDstu3TerminologyTest.URL_MY_CODE_SYSTEM))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -86,7 +86,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -130,7 +130,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
"}";
// Create the code system
- CodeSystem cs = (CodeSystem) myFhirCtx.newJsonParser().parseResource(input);
+ CodeSystem cs = (CodeSystem) myFhirContext.newJsonParser().parseResource(input);
ourClient.update().resource(cs).execute();
runInTransaction(() -> assertEquals(26L, myConceptDao.count()));
@@ -156,7 +156,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.andParameter("system", new UriType("http://hl7.org/fhir/v2/0203"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -197,7 +197,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -235,7 +235,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -310,7 +310,7 @@ public class ResourceProviderDstu3CodeSystemTest extends BaseResourceProviderDst
.andParameter("system", new UriType("http://hl7.org/fhir/v3/MaritalStatus"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemVersionedTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemVersionedTest.java
index 5d3e420b12f..e0a3c196c8d 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemVersionedTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemVersionedTest.java
@@ -101,7 +101,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType(FhirResourceDaoDstu3TerminologyTest.URL_MY_CODE_SYSTEM))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -123,7 +123,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -145,7 +145,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -168,7 +168,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -190,7 +190,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -213,7 +213,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -237,7 +237,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -259,7 +259,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -281,7 +281,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -321,7 +321,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -341,7 +341,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -361,7 +361,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -386,7 +386,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType("http://hl7.org/fhir/v2/0243"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -406,7 +406,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2.8.2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -429,7 +429,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -447,7 +447,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -465,7 +465,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -486,7 +486,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -504,7 +504,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -522,7 +522,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -542,7 +542,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -560,7 +560,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -578,7 +578,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -615,7 +615,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -631,7 +631,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -647,7 +647,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -668,7 +668,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -684,7 +684,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -700,7 +700,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -720,7 +720,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -736,7 +736,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -752,7 +752,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -767,7 +767,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
CodeSystem initialCodeSystem = ourClient.read().resource(CodeSystem.class).withId(parentChildCs1Id).execute();
assertEquals("Parent Child CodeSystem 1", initialCodeSystem.getName());
initialCodeSystem.setName("Updated Parent Child CodeSystem 1");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(initialCodeSystem);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(initialCodeSystem);
HttpPut putRequest = new HttpPut(ourServerBase + "/CodeSystem/" + parentChildCs1Id);
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
CloseableHttpResponse resp = ourHttpClient.execute(putRequest);
@@ -783,7 +783,7 @@ public class ResourceProviderDstu3CodeSystemVersionedTest extends BaseResourcePr
initialCodeSystem = ourClient.read().resource(CodeSystem.class).withId(parentChildCs2Id).execute();
assertEquals("Parent Child CodeSystem 2", initialCodeSystem.getName());
initialCodeSystem.setName("Updated Parent Child CodeSystem 2");
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(initialCodeSystem);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(initialCodeSystem);
putRequest = new HttpPut(ourServerBase + "/CodeSystem/" + parentChildCs2Id);
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ConceptMapTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ConceptMapTest.java
index 0f1cd25e2c5..d2c784cc5fe 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ConceptMapTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ConceptMapTest.java
@@ -1,10 +1,6 @@
package ca.uhn.fhir.jpa.provider.dstu3;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
+import ca.uhn.fhir.rest.api.MethodOutcome;
import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.CodeType;
import org.hl7.fhir.dstu3.model.Coding;
@@ -24,7 +20,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
-import ca.uhn.fhir.rest.api.MethodOutcome;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDstu3Test {
private static final Logger ourLog = LoggerFactory.getLogger(ResourceProviderDstu3ConceptMapTest.class);
@@ -73,14 +72,14 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
public void testTranslateByCodeSystemsAndSourceCodeOneToMany() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_3));
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -89,7 +88,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -141,7 +140,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -150,7 +149,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -189,7 +188,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -198,7 +197,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
// Should return v2 since v2 specified.
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -239,7 +238,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -248,7 +247,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
// Should return v1 since v1 specified.
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -288,7 +287,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -297,7 +296,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
// Should return v2 since v2 is the most recently updated version.
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -336,7 +335,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -345,7 +344,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
// Should return v2 since v2 is the most recently updated version.
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -384,7 +383,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -393,7 +392,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
// Should return v2 since v2 is the most recently updated version.
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -431,7 +430,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
.operation()
@@ -440,7 +439,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertFalse(((BooleanType) param.getValue()).booleanValue());
@@ -463,7 +462,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
@@ -473,7 +472,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -508,7 +507,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
@@ -518,7 +517,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -553,7 +552,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
@@ -563,7 +562,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -598,7 +597,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = ourClient
@@ -608,7 +607,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -648,7 +647,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
IIdType conceptMapId = myConceptMapDao.create(conceptMap, mySrd).getId().toUnqualifiedVersionless();
conceptMap = myConceptMapDao.read(conceptMapId);
- ourLog.info("ConceptMap: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
}
private void createReverseConceptMap(String url, String version, String sourceCode, String sourceDisplay) {
@@ -669,7 +668,7 @@ public class ResourceProviderDstu3ConceptMapTest extends BaseResourceProviderDst
IIdType conceptMapId = myConceptMapDao.create(conceptMap, mySrd).getId().toUnqualifiedVersionless();
ConceptMap conceptMap1 = myConceptMapDao.read(conceptMapId);
- ourLog.info("ConceptMap : \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
+ ourLog.info("ConceptMap : \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
}
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
index d83c1126549..148b17b0be8 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
@@ -152,7 +152,22 @@ import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsInRelativeOrder;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.emptyString;
+import static org.hamcrest.Matchers.endsWith;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.lessThanOrEqualTo;
+import static org.hamcrest.Matchers.matchesPattern;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.startsWith;
+import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
@@ -332,7 +347,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
@@ -368,7 +383,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String respString = ourClient.transaction().withBundle(input).prettyPrint().execute();
ourLog.info(respString);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, respString);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, respString);
IdType id = new IdType(bundle.getEntry().get(0).getResponse().getLocation());
Basic basic = ourClient.read().resource(Basic.class).withId(id).execute();
@@ -384,7 +399,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
try {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedIdValues(bundle);
} finally {
IOUtils.closeQuietly(response);
@@ -400,7 +415,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
try {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
} finally {
IOUtils.closeQuietly(response);
@@ -420,7 +435,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Bundle bundle = client.read().resource(Bundle.class).withId(id).execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}
@Test
@@ -626,7 +641,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
arr[0] = 3;
fromDB.setContent(arr);
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(fromDB);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(fromDB);
putRequest = new HttpPut(ourServerBase + "/Binary/" + resource.getIdPart());
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
@@ -644,7 +659,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
arr[0] = 4;
binary.setId("");
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(binary);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(binary);
putRequest = new HttpPut(ourServerBase + "/Binary/" + resource.getIdPart());
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
@@ -762,14 +777,14 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
obs.addIdentifier().setSystem("urn:foo").setValue("bar");
IBaseResource outcome = ourClient.create().resource(obs).execute().getOperationOutcome();
- String encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
+ String encodedOo = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
ourLog.info(encodedOo);
assertThat(encodedOo, containsString("cvc-complex-type.2.4.b"));
assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/"));
interceptor.setAddValidationResultsToResponseOperationOutcome(false);
outcome = ourClient.create().resource(obs).execute().getOperationOutcome();
- encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
+ encodedOo = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
ourLog.info(encodedOo);
assertThat(encodedOo, not(containsString("cvc-complex-type.2.4.b")));
assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/"));
@@ -823,7 +838,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?name=" + methodName);
@@ -857,7 +872,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
public void testCreateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
pt.addIdentifier().setSystem("http://general-hospital.co.uk/Identifiers").setValue("09832345234543876876");
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876");
@@ -950,7 +965,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertEquals(Msg.code(365) + "Can not create resource with ID \"2\", ID must not be supplied on a create (POST) operation (use an HTTP PUT / update operation if you wish to supply an ID)",
oo.getIssue().get(0).getDiagnostics());
@@ -1050,7 +1065,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
.where(Patient.IDENTIFIER.exactly().code(methodName))
.execute();
- String encoded = myFhirCtx.newXmlParser().encodeResourceToString(response.getOperationOutcome());
+ String encoded = myFhirContext.newXmlParser().encodeResourceToString(response.getOperationOutcome());
ourLog.info(encoded);
assertThat(encoded, containsString(
" ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pId, cId, oId));
} finally {
@@ -1758,7 +1773,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pId, cId, oId));
} finally {
@@ -1807,7 +1822,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
public void testEverythingWithLargeSet() throws Exception {
String inputString = IOUtils.toString(getClass().getResourceAsStream("/david_big_bundle.json"), StandardCharsets.UTF_8);
- Bundle inputBundle = myFhirCtx.newJsonParser().parseResource(Bundle.class, inputString);
+ Bundle inputBundle = myFhirContext.newJsonParser().parseResource(Bundle.class, inputString);
inputBundle.setType(BundleType.TRANSACTION);
assertEquals(53, inputBundle.getEntry().size());
@@ -1833,7 +1848,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
.returnResourceType(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(responseBundle));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(responseBundle));
List ids = new ArrayList();
for (BundleEntryComponent nextEntry : responseBundle.getEntry()) {
@@ -1934,7 +1949,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
p.setActive(true);
IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless();
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(300 * 1000);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(300 * 1000);
Bundle response = ourClient
.operation()
@@ -2145,7 +2160,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
try {
myBundleDao.validate(history, null, null, null, null, null, mySrd);
} catch (PreconditionFailedException e) {
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()));
throw e;
}
}
@@ -2157,7 +2172,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.setId("Patient/AAA/_history/4");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
ourLog.info("Input: {}", resource);
@@ -2199,7 +2214,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.setId("Patient/AAA/_history/4");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
ourLog.info("Input: {}", resource);
@@ -2228,7 +2243,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String respString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info("Response: {}", respString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, respString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, respString);
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"AAA\" does not match URL ID of \""
+ id.getIdPart() + "\"",
@@ -2307,7 +2322,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String methodName = "testMetaOperations";
ourClient.registerInterceptor(new LoggingInterceptor(true));
ourClient.setPrettyPrint(true);
- IValidatorModule module = new FhirInstanceValidator(myFhirCtx);
+ IValidatorModule module = new FhirInstanceValidator(myFhirContext);
BaseValidatingInterceptor validatingInterceptor = new RequestValidatingInterceptor().addValidatorModule(module);
ourRestServer.registerInterceptor(validatingInterceptor);
try {
@@ -2577,7 +2592,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient p = ourClient.read().resource(Patient.class).withId("B").execute();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p);
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(p);
ourLog.info(encoded);
assertThat(encoded, containsString("http://foo"));
@@ -2655,7 +2670,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String output = IOUtils.toString(resp.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
- Bundle b = myFhirCtx.newXmlParser().parseResource(Bundle.class, output);
+ Bundle b = myFhirContext.newXmlParser().parseResource(Bundle.class, output);
assertEquals("http://localhost:" + ourPort + "/fhir/context/Patient?_count=5&_pretty=true&name=Jernel%C3%B6v", b.getLink("self").getUrl());
@@ -2826,7 +2841,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pid1));
} finally {
@@ -2840,7 +2855,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pid2));
} finally {
@@ -3108,7 +3123,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
matches = bundle.getTotal();
assertThat(matches, greaterThan(0));
@@ -3411,7 +3426,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
assertEquals(200, resp.getStatusLine().getStatusCode());
String respString = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, respString);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, respString);
assertEquals(1, bundle.getEntry().size());
}
}
@@ -3529,7 +3544,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(200, resp.getStatusLine().getStatusCode());
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(oid1));
@@ -3563,7 +3578,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -3575,7 +3590,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
oid2 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -3587,7 +3602,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
oid3 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -3599,7 +3614,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
oid4 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
String uri = ourServerBase + "/Observation?_sort=code-value-date";
@@ -3608,10 +3623,10 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
HttpGet get = new HttpGet(uri);
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
String output = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
- found = myFhirCtx.newXmlParser().parseResource(Bundle.class, output);
+ found = myFhirContext.newXmlParser().parseResource(Bundle.class, output);
}
- ourLog.info("Bundle: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
+ ourLog.info("Bundle: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
List list = toUnqualifiedVersionlessIds(found);
assertEquals(4, found.getEntry().size());
@@ -3716,7 +3731,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(200, resp.getStatusLine().getStatusCode());
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(id1.getValue()));
@@ -3911,14 +3926,14 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
// Read back directly from the DAO
{
Organization returned = myOrganizationDao.read(orgId, mySrd);
- String val = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
+ String val = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
ourLog.info(val);
assertThat(val, containsString(""));
}
// Read back through the HTTP API
{
Organization returned = ourClient.read(Organization.class, orgId.getIdPart());
- String val = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
+ String val = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
ourLog.info(val);
assertThat(val, containsString(""));
}
@@ -3961,7 +3976,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -3970,7 +3985,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssue().get(0).getDiagnostics(),
containsString("Can not update resource, request URL must contain an ID element for update (PUT) operation (it must be of the form [base]/[resource type]/[id])"));
} finally {
@@ -3985,7 +4000,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.setId("2");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4011,7 +4026,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient/FOO");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4039,7 +4054,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
p1.setId("FOO");
p1.addAddress().addLine("NEWLINE");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
ourLog.info(encoded);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
@@ -4048,7 +4063,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
CloseableHttpResponse response = ourHttpClient.execute(put);
try {
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"FOO\" does not match URL ID of \""
+ p1id.getIdPart() + "\"",
@@ -4060,14 +4075,14 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
// Try to update with the no ID in the resource body
p1.setId((String) null);
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
put.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8")));
put.addHeader("Accept", Constants.CT_FHIR_JSON);
response = ourHttpClient.execute(put);
try {
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
assertEquals(Msg.code(419) + "Can not update resource, resource body must contain an ID element for update (PUT) operation", oo.getIssue().get(0).getDiagnostics());
} finally {
response.close();
@@ -4076,7 +4091,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
// Try to update with the to correct ID in the resource body
p1.setId(p1id.getIdPart());
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
put.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8")));
response = ourHttpClient.execute(put);
@@ -4121,7 +4136,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient?name=" + methodName);
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4137,7 +4152,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
}
pt.addAddress().addLine("AAAAAAAAAAAAAAAAAAA");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?name=" + methodName);
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
response = ourHttpClient.execute(put);
@@ -4156,7 +4171,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
public void testUpdateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
pt.addIdentifier().setSystem("http://general-hospital.co.uk/Identifiers").setValue("09832345234543876876");
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876");
@@ -4174,7 +4189,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
}
pt.addName().setFamily("FOO");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?identifier=" + ("http://general-hospital.co.uk/Identifiers|09832345234543876876".replace("|", UrlUtil.escapeUrlParam("|"))));
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4200,7 +4215,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4220,7 +4235,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
pt = new Patient();
pt.setId(id.getIdPart());
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id.getIdPart());
put.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_REPRESENTATION);
@@ -4231,7 +4246,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
IOUtils.closeQuietly(response.getEntity().getContent());
- Patient respPt = myFhirCtx.newXmlParser().parseResource(Patient.class, responseString);
+ Patient respPt = myFhirContext.newXmlParser().parseResource(Patient.class, responseString);
assertEquals("2", respPt.getIdElement().getVersionIdPart());
InstantType updateTime = respPt.getMeta().getLastUpdatedElement();
@@ -4305,7 +4320,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
pt.addName().setFamily("FAM2");
pt.setId(id.toUnqualifiedVersionless());
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id.getIdPart());
put.addHeader(Constants.HEADER_IF_MATCH, "W/\"44\"");
@@ -4315,7 +4330,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(409, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssue().get(0).getDiagnostics(), containsString("Trying to update Patient/" + id.getIdPart() + "/_history/44 but this is not the current version"));
} finally {
response.close();
@@ -4343,7 +4358,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Patient pt = new Patient();
pt.setId("333");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient/A2");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4352,7 +4367,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"333\" does not match URL ID of \"A2\"",
oo.getIssue().get(0).getDiagnostics());
@@ -4383,7 +4398,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Parameters input = new Parameters();
input.addParameter().setName("mode").setValue(new CodeType("create"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -4408,7 +4423,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
patient.addName().addGiven("James");
patient.setBirthDateElement(new DateType("2011-02-02"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(patient);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(patient);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4431,7 +4446,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.debug(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -4480,7 +4495,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/A123/$validate");
@@ -4508,7 +4523,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate?_pretty=true");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4535,7 +4550,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
patient.addName().addGiven("James");
patient.setBirthDateElement(new DateType("2011-02-02"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(patient);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(patient);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -4557,10 +4572,10 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
@Test
public void testValueSetExpandOperation() throws IOException {
- CodeSystem cs = myFhirCtx.newXmlParser().parseResource(CodeSystem.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/extensional-case-3-cs.xml")));
+ CodeSystem cs = myFhirContext.newXmlParser().parseResource(CodeSystem.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/extensional-case-3-cs.xml")));
ourClient.create().resource(cs).execute();
- ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/extensional-case-3-vs.xml")));
+ ValueSet upload = myFhirContext.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/extensional-case-3-vs.xml")));
IIdType vsid = ourClient.create().resource(upload).execute().getId().toUnqualifiedVersionless();
HttpGet get = new HttpGet(ourServerBase + "/ValueSet/" + vsid.getIdPart() + "/$expand");
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java
index e6d4631efcc..4837718187b 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java
@@ -8,11 +8,10 @@ import ca.uhn.fhir.jpa.dao.r4.FhirResourceDaoR4TerminologyTest;
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
import ca.uhn.fhir.jpa.entity.TermConcept;
import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink.RelationshipTypeEnum;
-import ca.uhn.fhir.jpa.util.BaseCaptureQueriesListener;
-import ca.uhn.fhir.jpa.util.CircularQueueCaptureQueriesListener;
-import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
+import ca.uhn.fhir.jpa.util.CircularQueueCaptureQueriesListener;
+import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
@@ -56,7 +55,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3Test {
@@ -289,7 +291,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsString(""));
assertThat(resp, Matchers.containsString(""));
@@ -322,7 +324,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsString(""));
assertThat(resp, Matchers.containsString(""));
@@ -352,7 +354,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -378,7 +380,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.stringContainsInOrder(
"",
@@ -398,7 +400,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.stringContainsInOrder(
"",
@@ -420,7 +422,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.stringContainsInOrder(
"",
@@ -460,7 +462,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.stringContainsInOrder(
"",
@@ -502,7 +504,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.stringContainsInOrder(
"",
@@ -523,7 +525,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsStringIgnoringCase(""));
@@ -543,7 +545,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsStringIgnoringCase(""));
@@ -634,7 +636,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsStringIgnoringCase(""));
@@ -653,7 +655,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsStringIgnoringCase(""));
@@ -675,7 +677,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, Matchers.containsStringIgnoringCase(""));
@@ -735,7 +737,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -761,7 +763,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
String respString = IOUtils.toString(response.getEntity().getContent(), Charsets.UTF_8);
ourLog.info(respString);
- Parameters respParam = myFhirCtx.newJsonParser().parseResource(Parameters.class, respString);
+ Parameters respParam = myFhirContext.newJsonParser().parseResource(Parameters.class, respString);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
}
}
@@ -779,7 +781,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.andParameter("url", new UriType("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -802,7 +804,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.useHttpGet()
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("result", respParam.getParameter().get(0).getName());
@@ -832,7 +834,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.useHttpGet()
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("result", respParam.getParameter().get(0).getName());
@@ -860,7 +862,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -883,7 +885,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder("", ""));
}
@@ -903,7 +905,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, not(stringContainsInOrder("","")));
@@ -924,7 +926,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, not(stringContainsInOrder("","")));
@@ -943,7 +945,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java
index b443e931128..1aeac262a62 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java
@@ -1,6 +1,5 @@
package ca.uhn.fhir.jpa.provider.dstu3;
-import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
@@ -9,7 +8,6 @@ import ca.uhn.fhir.jpa.entity.TermConcept;
import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink.RelationshipTypeEnum;
import ca.uhn.fhir.jpa.entity.TermValueSet;
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
-import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
@@ -17,11 +15,14 @@ import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
-import org.hl7.fhir.instance.model.api.IIdType;
+import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode;
import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent;
+import org.hl7.fhir.dstu3.model.CodeType;
+import org.hl7.fhir.dstu3.model.CodeableConcept;
+import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.StringType;
@@ -30,10 +31,7 @@ import org.hl7.fhir.dstu3.model.ValueSet;
import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
import org.hl7.fhir.dstu3.model.ValueSet.FilterOperator;
import org.hl7.fhir.dstu3.model.codesystems.HttpVerb;
-import org.hl7.fhir.dstu3.model.BooleanType;
-import org.hl7.fhir.dstu3.model.CodeType;
-import org.hl7.fhir.dstu3.model.CodeableConcept;
-import org.hl7.fhir.dstu3.model.Coding;
+import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.data.domain.PageRequest;
@@ -275,7 +273,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -300,7 +298,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -336,7 +334,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -361,7 +359,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -392,7 +390,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -406,7 +404,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -432,7 +430,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -446,7 +444,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -467,7 +465,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -483,7 +481,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2 as this was the last version loaded.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -499,7 +497,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -522,7 +520,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -538,7 +536,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2 as this was the last version loaded.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -554,7 +552,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -600,7 +598,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -616,7 +614,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2 as this was the last version loaded.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -632,7 +630,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -677,7 +675,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2 as this was the last updated.
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -698,7 +696,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v1.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -719,7 +717,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -746,7 +744,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2 as this was the last updated.
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -767,7 +765,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v1.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -788,7 +786,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
// Should return v2.
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -812,7 +810,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -828,7 +826,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -852,7 +850,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -868,7 +866,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.execute();
expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -894,7 +892,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
assertEquals(1, respParam.getParameter().size());
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -927,7 +925,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.withNoParameters(Parameters.class)
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info("Expanded: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
+ ourLog.info("Expanded: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
assertEquals(1, expanded.getExpansion().getContains().size());
// Update the CodeSystem Version and Codes
@@ -952,7 +950,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.withNoParameters(Parameters.class)
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info("Expanded: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
+ ourLog.info("Expanded: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
assertEquals(1, expanded.getExpansion().getContains().size());
}
@@ -964,14 +962,14 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
loadAndPersistCodeSystemAndValueSetWithDesignations();
CodeSystem codeSystem_v1 = myCodeSystemDao.read(myExtensionalCsId_v1);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v1));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v1));
CodeSystem codeSystem_v2 = myCodeSystemDao.read(myExtensionalCsId_v2);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v2));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v2));
ValueSet valueSet_v1 = myValueSetDao.read(myExtensionalVsId_v1);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v1));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v1));
ValueSet valueSet_v2 = myValueSetDao.read(myExtensionalVsId_v2);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v2));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v2));
String initialValueSetName_v1 = valueSet_v1.getName();
validateTermValueSetNotExpanded(initialValueSetName_v1, "1", myExtensionalVsIdOnResourceTable_v1);
@@ -985,7 +983,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
updatedValueSet_v1.setName(valueSet_v1.getName().concat(" - MODIFIED"));
persistSingleValueSet(updatedValueSet_v1, HttpVerb.PUT);
updatedValueSet_v1 = myValueSetDao.read(myExtensionalVsId_v1);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v1));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v1));
String updatedValueSetName_v1 = valueSet_v1.getName();
validateTermValueSetNotExpanded(updatedValueSetName_v1,"1", myExtensionalVsIdOnResourceTable_v1);
@@ -994,7 +992,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
updatedValueSet_v2.setName(valueSet_v2.getName().concat(" - MODIFIED"));
persistSingleValueSet(updatedValueSet_v2, HttpVerb.PUT);
updatedValueSet_v2 = myValueSetDao.read(myExtensionalVsId_v2);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v2));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v2));
String updatedValueSetName_v2 = valueSet_v2.getName();
validateTermValueSetNotExpanded(updatedValueSetName_v2,"2", myExtensionalVsIdOnResourceTable_v2);
@@ -1012,14 +1010,14 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
loadAndPersistCodeSystemAndValueSetWithDesignations();
CodeSystem codeSystem_v1 = myCodeSystemDao.read(myExtensionalCsId_v1);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v1));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v1));
CodeSystem codeSystem_v2 = myCodeSystemDao.read(myExtensionalCsId_v2);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v2));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem_v2));
ValueSet valueSet_v1 = myValueSetDao.read(myExtensionalVsId_v1);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v1));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v1));
ValueSet valueSet_v2 = myValueSetDao.read(myExtensionalVsId_v2);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v2));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet_v2));
String initialValueSetName_v1 = valueSet_v1.getName();
validateTermValueSetNotExpanded(initialValueSetName_v1, "1", myExtensionalVsIdOnResourceTable_v1);
@@ -1042,11 +1040,11 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.getRequest()
.setMethod(Bundle.HTTPVerb.PUT)
.setUrl("ValueSet/" + updatedValueSet_v1.getIdElement().getIdPart());
- ourLog.info("Transaction Bundle:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Transaction Bundle:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
ourClient.transaction().withBundle(bundle).execute();
updatedValueSet_v1 = myValueSetDao.read(myExtensionalVsId_v1);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v1));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v1));
String updatedValueSetName_v1 = valueSet_v1.getName();
validateTermValueSetNotExpanded(updatedValueSetName_v1, "1", myExtensionalVsIdOnResourceTable_v1);
@@ -1064,11 +1062,11 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.getRequest()
.setMethod(Bundle.HTTPVerb.PUT)
.setUrl("ValueSet/" + updatedValueSet_v2.getIdElement().getIdPart());
- ourLog.info("Transaction Bundle:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Transaction Bundle:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
ourClient.transaction().withBundle(bundle).execute();
updatedValueSet_v2 = myValueSetDao.read(myExtensionalVsId_v2);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v2));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet_v2));
String updatedValueSetName_v2 = valueSet_v2.getName();
validateTermValueSetNotExpanded(updatedValueSetName_v2, "2", myExtensionalVsIdOnResourceTable_v2);
@@ -1193,7 +1191,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1209,7 +1207,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1226,7 +1224,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1242,7 +1240,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1263,7 +1261,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("systemVersion", new StringType("1"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1277,7 +1275,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("systemVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1292,7 +1290,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("systemVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1306,7 +1304,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("systemVersion", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1333,7 +1331,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1347,7 +1345,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1362,7 +1360,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1376,7 +1374,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1405,7 +1403,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1419,7 +1417,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1434,7 +1432,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1448,7 +1446,7 @@ public class ResourceProviderDstu3ValueSetVersionedTest extends BaseResourceProv
.andParameter("valueSetVersion", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderExpungeDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderExpungeDstu3Test.java
index fb385d718a0..52aa2d8a5c7 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderExpungeDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderExpungeDstu3Test.java
@@ -363,7 +363,7 @@ public class ResourceProviderExpungeDstu3Test extends BaseResourceProviderDstu3T
p.addParameter()
.setName(ProviderConstants.OPERATION_EXPUNGE_PARAM_EXPUNGE_DELETED_RESOURCES)
.setValue(new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().encodeResourceToString(p));
+ ourLog.info(myFhirContext.newJsonParser().encodeResourceToString(p));
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderR3CodeSystemDesignationTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderR3CodeSystemDesignationTest.java
index ee4eaa4bb6d..6fd92f57ed9 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderR3CodeSystemDesignationTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderR3CodeSystemDesignationTest.java
@@ -1,12 +1,5 @@
package ca.uhn.fhir.jpa.provider.dstu3;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.CodeType;
@@ -18,6 +11,13 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.transaction.annotation.Transactional;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
public class ResourceProviderR3CodeSystemDesignationTest extends BaseResourceProviderDstu3Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderR3CodeSystemDesignationTest.class);
@@ -42,7 +42,7 @@ public class ResourceProviderR3CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("de-AT"))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
@@ -86,7 +86,7 @@ public class ResourceProviderR3CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("zh-CN"))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
@@ -121,7 +121,7 @@ public class ResourceProviderR3CodeSystemDesignationTest extends BaseResourcePro
.andParameter("system", new UriType(CS_ACME_URL))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ServerDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ServerDstu3Test.java
index f4058e09356..a6b581b24d4 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ServerDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ServerDstu3Test.java
@@ -44,7 +44,7 @@ public class ServerDstu3Test extends BaseResourceProviderDstu3Test {
String respString = IOUtils.toString(resp.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(respString);
- CapabilityStatement cs = myFhirCtx.newXmlParser().parseResource(CapabilityStatement.class, respString);
+ CapabilityStatement cs = myFhirContext.newXmlParser().parseResource(CapabilityStatement.class, respString);
for (CapabilityStatementRestResourceComponent nextResource : cs.getRest().get(0).getResource()) {
ourLog.info("Testing resource: " + nextResource.getType());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java
index 3420fc5b618..cb8ffd626b0 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SubscriptionsDstu3Test.java
@@ -4,7 +4,6 @@ import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu3;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
-import ca.uhn.fhir.util.TestUtil;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
@@ -14,7 +13,6 @@ import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -217,7 +215,7 @@ public class SubscriptionsDstu3Test extends BaseResourceProviderDstu3Test {
myPingCount++;
} else if (myGotBound && theMsg.startsWith("add " + mySubsId + "\n")) {
String text = theMsg.substring(("add " + mySubsId + "\n").length());
- IBaseResource res = myEncoding.newParser(myFhirCtx).parseResource(text);
+ IBaseResource res = myEncoding.newParser(myFhirContext).parseResource(text);
myReceived.add(res);
myPingCount++;
} else {
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderTransactionSearchDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderTransactionSearchDstu3Test.java
index 9e1020e7957..6fceaafe17f 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderTransactionSearchDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/SystemProviderTransactionSearchDstu3Test.java
@@ -155,7 +155,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
myDaoConfig.setMaximumSearchResultCountInTransaction(100);
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -178,7 +178,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
.setUrl("Patient?_count=5&_sort=name");
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -221,7 +221,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
.getRequest().setUrl(pid1.getValue());
HttpPost post = new HttpPost(ourServerBase);
- String encodedRequest = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
+ String encodedRequest = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
ourLog.info("Requet:\n{}", encodedRequest);
post.setEntity(new StringEntity(encodedRequest, ContentType.parse(ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
@@ -253,7 +253,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
myDaoConfig.setMaximumSearchResultCountInTransaction(100);
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -276,7 +276,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
.setUrl("Patient?_count=5&_sort=name");
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(1, output.getEntry().size());
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
@@ -311,7 +311,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
}
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertEquals(30, output.getEntry().size());
for (int i = 0; i < 30; i++) {
@@ -334,7 +334,7 @@ public class SystemProviderTransactionSearchDstu3Test extends BaseJpaDstu3Test {
.setUrl("/Patient?_id="+patientId.getIdPart());
Bundle output = ourClient.transaction().withBundle(input).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(output));
assertThat(output.getEntryFirstRep().getResponse().getStatus(), startsWith("200"));
Bundle respBundle = (Bundle) output.getEntry().get(0).getResource();
List actualIds = toIds(respBundle);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorJpaR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorJpaR4Test.java
index 02bfd356f6b..892da26d7e1 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorJpaR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorJpaR4Test.java
@@ -62,7 +62,6 @@ import org.springframework.mock.web.MockHttpServletRequest;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -70,7 +69,6 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Test {
@@ -522,7 +520,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
.setMethod(Bundle.HTTPVerb.POST)
.setIfNoneExist("Patient?identifier=http://uhn.ca/mrns|100");
Bundle response = myClient.transaction().withBundle(request).execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
// Subsequent calls also shouldn't fail
myClient.transaction().withBundle(request).execute();
@@ -880,7 +878,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
@Test
public void testDeleteCascadeBlocked() {
- CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirCtx, myDaoRegistry, myInterceptorRegistry);
+ CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirContext, myDaoRegistry, myInterceptorRegistry);
ourRestServer.getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
try {
@@ -924,7 +922,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
@Test
public void testDeleteCascadeAllowed() {
- CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirCtx, myDaoRegistry, myInterceptorRegistry);
+ CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirContext, myDaoRegistry, myInterceptorRegistry);
ourRestServer.getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
try {
@@ -963,7 +961,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
@Test
public void testDeleteCascadeAllowed_ButNotOnTargetType() {
- CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirCtx, myDaoRegistry, myInterceptorRegistry);
+ CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(myFhirContext, myDaoRegistry, myInterceptorRegistry);
ourRestServer.getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
try {
@@ -1012,7 +1010,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -1029,7 +1027,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
pt = new Patient();
pt.addName().setFamily("FOOFOOFOO");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
post = new HttpPost(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -1267,7 +1265,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
.withBundle(bundle)
.withAdditionalHeader(Constants.HEADER_PREFER, "return=" + Constants.HEADER_PREFER_RETURN_MINIMAL)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
assertNull(resp.getEntry().get(0).getResource());
// return=OperationOutcome - should succeed
@@ -1276,7 +1274,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
.withBundle(bundle)
.withAdditionalHeader(Constants.HEADER_PREFER, "return=" + Constants.HEADER_PREFER_RETURN_OPERATION_OUTCOME)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
assertNull(resp.getEntry().get(0).getResource());
// return=Representation - should fail
@@ -1380,7 +1378,7 @@ public class AuthorizationInterceptorJpaR4Test extends BaseResourceProviderR4Tes
.withAdditionalHeader(Constants.HEADER_PREFER, "return=" + Constants.HEADER_PREFER_RETURN_MINIMAL)
.execute();
assertEquals(3, resp.getEntry().size());
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp));
}
@Test
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorMultitenantJpaR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorMultitenantJpaR4Test.java
index d76e06eb332..021e8a20ee5 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorMultitenantJpaR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorMultitenantJpaR4Test.java
@@ -200,7 +200,7 @@ public class AuthorizationInterceptorMultitenantJpaR4Test extends BaseMultitenan
.returnBundle(Bundle.class)
.count(3)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).setEncodeElements(Sets.newHashSet("Bundle.link")).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).setEncodeElements(Sets.newHashSet("Bundle.link")).encodeResourceToString(bundle));
assertThat(toUnqualifiedVersionlessIds(bundle).toString(), toUnqualifiedVersionlessIds(bundle), contains(observationIds.get(0), observationIds.get(1), observationIds.get(2), patientIdA));
// Fetch the next 3
@@ -208,7 +208,7 @@ public class AuthorizationInterceptorMultitenantJpaR4Test extends BaseMultitenan
.loadPage()
.next(bundle)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).setEncodeElements(Sets.newHashSet("Bundle.link")).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).setEncodeElements(Sets.newHashSet("Bundle.link")).encodeResourceToString(bundle));
assertThat(toUnqualifiedVersionlessIds(bundle).toString(), toUnqualifiedVersionlessIds(bundle), contains(observationIds.get(3), observationIds.get(4), observationIds.get(5), patientIdA));
// Fetch the next 3 - This should fail as the last observation has a cross-partition reference
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseMultitenantResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseMultitenantResourceProviderR4Test.java
index bb46d3776ae..1d9c4dc46ba 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseMultitenantResourceProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseMultitenantResourceProviderR4Test.java
@@ -136,7 +136,7 @@ public abstract class BaseMultitenantResourceProviderR4Test extends BaseResource
@Override
public FhirContext getFhirContext() {
- return myFhirCtx;
+ return myFhirContext;
}
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseResourceProviderR4Test.java
index eebf78270f6..cd40938c64e 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseResourceProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BaseResourceProviderR4Test.java
@@ -5,8 +5,8 @@ import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc;
import ca.uhn.fhir.jpa.dao.data.IPartitionDao;
import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test;
-import ca.uhn.fhir.jpa.provider.DiffProvider;
import ca.uhn.fhir.jpa.graphql.GraphQLProvider;
+import ca.uhn.fhir.jpa.provider.DiffProvider;
import ca.uhn.fhir.jpa.provider.JpaCapabilityStatementProvider;
import ca.uhn.fhir.jpa.provider.TerminologyUploaderProvider;
import ca.uhn.fhir.jpa.provider.ValueSetOperationProvider;
@@ -91,19 +91,19 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
@AfterEach
public void after() throws Exception {
- myFhirCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE);
+ myFhirContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE);
ourRestServer.getInterceptorService().unregisterAllInterceptors();
}
@BeforeEach
public void before() throws Exception {
- myFhirCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myResourceCountsCache = (ResourceCountCache) myAppCtx.getBean("myResourceCountsCache");
if (ourServer == null) {
- ourRestServer = new RestfulServer(myFhirCtx);
+ ourRestServer = new RestfulServer(myFhirContext);
ourRestServer.registerProviders(myResourceProviders.createProviders());
ourRestServer.registerProvider(myBinaryAccessProvider);
ourRestServer.getInterceptorService().registerInterceptor(myBinaryStorageInterceptor);
@@ -176,8 +176,8 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
myValidationSupport = wac.getBean(IValidationSupport.class);
mySearchCoordinatorSvc = wac.getBean(ISearchCoordinatorSvc.class);
- myFhirCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(400000);
+ myFhirContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(400000);
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
connectionManager.setMaxTotal(10);
@@ -194,7 +194,7 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test {
ourRestServer.setPagingProvider(ourPagingProvider);
ourRestServer.registerInterceptor(new ResponseHighlighterInterceptor());
- myClient = myFhirCtx.newRestfulGenericClient(ourServerBase);
+ myClient = myFhirContext.newRestfulGenericClient(ourServerBase);
if (shouldLogClient()) {
myClient.registerInterceptor(new LoggingInterceptor());
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryAccessProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryAccessProviderR4Test.java
index 5dc54aea8e5..89e249ac27d 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryAccessProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryAccessProviderR4Test.java
@@ -23,7 +23,6 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
-import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Attachment;
import org.hl7.fhir.r4.model.Binary;
@@ -41,20 +40,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.fail;
-import static org.mockito.ArgumentMatchers.notNull;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.eq;
@@ -243,7 +239,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- DocumentReference ref = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference ref = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
Attachment attachment = ref.getContentFirstRep().getAttachment();
assertEquals(ContentType.IMAGE_JPEG.getMimeType(), attachment.getContentType());
@@ -301,7 +297,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- DocumentReference ref = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference ref = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
Attachment attachment = ref.getContentFirstRep().getAttachment();
assertEquals(ContentType.IMAGE_JPEG.getMimeType(), attachment.getContentType());
@@ -382,7 +378,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- DocumentReference ref = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference ref = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
Attachment attachment = ref.getContentFirstRep().getAttachment();
assertEquals(ContentType.IMAGE_JPEG.getMimeType(), attachment.getContentType());
@@ -408,7 +404,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
Binary binary = new Binary();
binary.setContentType("image/png");
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(binary));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(binary));
IIdType id = myClient.create().resource(binary).execute().getId().toUnqualifiedVersionless();
@@ -434,7 +430,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- Binary target = myFhirCtx.newJsonParser().parseResource(Binary.class, response);
+ Binary target = myFhirContext.newJsonParser().parseResource(Binary.class, response);
assertEquals(ContentType.IMAGE_JPEG.getMimeType(), target.getContentType());
assertEquals(null, target.getData());
@@ -477,7 +473,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
Binary binary = new Binary();
binary.setContentType("image/png");
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(binary));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(binary));
IIdType id = myClient.create().resource(binary).execute().getId().toUnqualifiedVersionless();
@@ -497,7 +493,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- Binary target = myFhirCtx.newJsonParser().parseResource(Binary.class, response);
+ Binary target = myFhirContext.newJsonParser().parseResource(Binary.class, response);
assertEquals(ContentType.IMAGE_JPEG.getMimeType(), target.getContentType());
assertEquals(null, target.getData());
@@ -563,7 +559,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
ourLog.info("Response: {}", response);
- DocumentReference target = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference target = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
assertEquals(null, target.getContentFirstRep().getAttachment().getData());
assertEquals("2", target.getMeta().getVersionId());
@@ -613,7 +609,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
attachment.setData(SOME_BYTES_2);
}
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(documentReference));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(documentReference));
return myClient.create().resource(documentReference).execute().getId().toUnqualifiedVersionless();
}
@@ -635,7 +631,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(200, resp.getStatusLine().getStatusCode());
assertThat(resp.getEntity().getContentType().getValue(), containsString("application/fhir+json"));
String response = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
- DocumentReference ref = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference ref = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
Attachment attachment = ref.getContentFirstRep().getAttachment();
attachmentId = attachment.getDataElement().getExtensionString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID);
assertThat(attachmentId, matchesPattern("[a-zA-Z0-9]{100}"));
@@ -698,7 +694,7 @@ public class BinaryAccessProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(200, resp.getStatusLine().getStatusCode());
assertThat(resp.getEntity().getContentType().getValue(), containsString("application/fhir+json"));
- DocumentReference ref = myFhirCtx.newJsonParser().parseResource(DocumentReference.class, response);
+ DocumentReference ref = myFhirContext.newJsonParser().parseResource(DocumentReference.class, response);
Attachment attachment = ref.getContentFirstRep().getAttachment();
attachmentId = attachment.getDataElement().getExtensionString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID);
assertThat(attachmentId, matchesPattern("[a-zA-Z0-9]{100}"));
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryStorageInterceptorR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryStorageInterceptorR4Test.java
index 561f50446b4..2b4ba862991 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryStorageInterceptorR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/BinaryStorageInterceptorR4Test.java
@@ -21,8 +21,13 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.hamcrest.Matchers.blankOrNullString;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
@@ -68,7 +73,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -92,7 +97,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -116,7 +121,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString("\"data\": \"BAMCAQ==\""));
assertThat(encoded, not(containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID)));
@@ -140,7 +145,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -165,7 +170,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -206,7 +211,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -253,7 +258,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
@@ -299,7 +304,7 @@ public class BinaryStorageInterceptorR4Test extends BaseResourceProviderR4Test {
// Make sure it was externalized
IIdType id = outcome.getId().toUnqualifiedVersionless();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome.getResource());
ourLog.info("Encoded: {}", encoded);
assertThat(encoded, containsString(HapiExtensions.EXT_EXTERNALIZED_BINARY_ID));
assertThat(encoded, not(containsString("\"data\"")));
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/CompositionDocumentR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/CompositionDocumentR4Test.java
index c40516cc60c..fdf7edf16e3 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/CompositionDocumentR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/CompositionDocumentR4Test.java
@@ -11,7 +11,14 @@ import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
-import org.hl7.fhir.r4.model.*;
+import org.hl7.fhir.r4.model.Bundle;
+import org.hl7.fhir.r4.model.Composition;
+import org.hl7.fhir.r4.model.Encounter;
+import org.hl7.fhir.r4.model.ListResource;
+import org.hl7.fhir.r4.model.Observation;
+import org.hl7.fhir.r4.model.Organization;
+import org.hl7.fhir.r4.model.Patient;
+import org.hl7.fhir.r4.model.Reference;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -25,15 +32,17 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
public class CompositionDocumentR4Test extends BaseResourceProviderR4Test {
@@ -64,7 +73,7 @@ public class CompositionDocumentR4Test extends BaseResourceProviderR4Test {
@BeforeEach
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
@@ -186,7 +195,7 @@ public class CompositionDocumentR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
String resourceString = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
- bundle = theEncoding.newParser(myFhirCtx).parseResource(Bundle.class, resourceString);
+ bundle = theEncoding.newParser(myFhirContext).parseResource(Bundle.class, resourceString);
}
return bundle;
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ConsentInterceptorResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ConsentInterceptorResourceProviderR4Test.java
index 49b7f87c8ad..19d3f3ced9f 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ConsentInterceptorResourceProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ConsentInterceptorResourceProviderR4Test.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.provider.r4;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.config.BaseConfig;
+import ca.uhn.fhir.jpa.config.JpaConfig;
import ca.uhn.fhir.jpa.config.TestR4Config;
import ca.uhn.fhir.jpa.entity.Search;
import ca.uhn.fhir.jpa.model.search.SearchStatusEnum;
@@ -92,7 +92,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
private List myObservationIdsEvenOnlyBackwards;
private ConsentInterceptor myConsentInterceptor;
@Autowired
- @Qualifier(BaseConfig.GRAPHQL_PROVIDER_NAME)
+ @Qualifier(JpaConfig.GRAPHQL_PROVIDER_NAME)
private Object myGraphQlProvider;
@Override
@@ -130,7 +130,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- List resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ List resources = BundleUtil.toListOfResources(myFhirContext, result);
List returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertThat(returnedIdValues, hasSize(15));
assertEquals(myObservationIdsEvenOnly.subList(0, 15), returnedIdValues);
@@ -140,7 +140,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.loadPage()
.next(result)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertThat(returnedIdValues, hasSize(10));
assertEquals(myObservationIdsEvenOnly.subList(15, 25), returnedIdValues);
@@ -171,7 +171,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- List resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ List resources = BundleUtil.toListOfResources(myFhirContext, result);
List returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIdsEvenOnly.subList(0, 15), returnedIdValues);
List cacheOutcome = capture.getLastResponse().getHeaders(Constants.HEADER_X_CACHE);
@@ -187,7 +187,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIdsOddOnly.subList(0, 15), returnedIdValues);
cacheOutcome = capture.getLastResponse().getHeaders(Constants.HEADER_X_CACHE);
@@ -203,7 +203,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIds.subList(0, 15), returnedIdValues);
cacheOutcome = capture.getLastResponse().getHeaders(Constants.HEADER_X_CACHE);
@@ -219,7 +219,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIds.subList(0, 15), returnedIdValues);
cacheOutcome = capture.getLastResponse().getHeaders(Constants.HEADER_X_CACHE);
@@ -236,7 +236,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIds.subList(0, 15), returnedIdValues);
cacheOutcome = capture.getLastResponse().getHeaders(Constants.HEADER_X_CACHE);
@@ -262,7 +262,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(15)
.execute();
- List resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ List resources = BundleUtil.toListOfResources(myFhirContext, result);
assertEquals(15, resources.size());
assertEquals(16, consentService.getSeeCount());
resources.forEach(t -> {
@@ -274,7 +274,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.loadPage()
.next(result)
.execute();
- resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ resources = BundleUtil.toListOfResources(myFhirContext, result);
assertEquals(15, resources.size());
assertEquals(32, consentService.getSeeCount());
resources.forEach(t -> {
@@ -297,7 +297,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
.returnBundle(Bundle.class)
.count(10)
.execute();
- List resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ List resources = BundleUtil.toListOfResources(myFhirContext, result);
List returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIdsEvenOnlyBackwards.subList(0, 5), returnedIdValues);
@@ -442,8 +442,8 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
ourLog.info("Response: {}", responseString);
assertEquals(200, status.getStatusLine().getStatusCode());
- Bundle result = myFhirCtx.newJsonParser().parseResource(Bundle.class, responseString);
- List resources = BundleUtil.toListOfResources(myFhirCtx, result);
+ Bundle result = myFhirContext.newJsonParser().parseResource(Bundle.class, responseString);
+ List resources = BundleUtil.toListOfResources(myFhirContext, result);
List returnedIdValues = toUnqualifiedVersionlessIdValues(resources);
assertEquals(myObservationIdsOddOnly.subList(0, 5), returnedIdValues);
}
@@ -502,7 +502,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
assertThat(responseString, not(containsString("\"given\":[\"PATIENT_GIVEN1\",\"PATIENT_GIVEN2\"]")));
assertThat(responseString, not(containsString("\"name\":\"ORG_NAME\"")));
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssueFirstRep().getDiagnostics(), matchesPattern(Msg.code(1147) + "Unable to execute GraphQL Expression: HTTP 404 " + Msg.code(1995) + "Resource Patient/[0-9]+ is not known"));
}
@@ -541,7 +541,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
assertThat(responseString, not(containsString("\"given\":[\"PATIENT_GIVEN1\",\"PATIENT_GIVEN2\"]")));
assertThat(responseString, not(containsString("\"name\":\"ORG_NAME\"")));
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssueFirstRep().getDiagnostics(), matchesPattern(Msg.code(1147) + "Unable to execute GraphQL Expression: HTTP 404 " + Msg.code(1995) + "Resource Organization/[0-9]+ is not known"));
}
@@ -594,10 +594,10 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
});
// The paging should have ended now - but the last redacted female result is an empty existing page which should never have been there.
- String next = BundleUtil.getLinkUrlOfType(myFhirCtx, response, "next");
+ String next = BundleUtil.getLinkUrlOfType(myFhirContext, response, "next");
if (next != null) {
response = myClient.loadPage().next(response).execute();
- fail(myFhirCtx.newJsonParser().encodeResourceToString(response));
+ fail(myFhirContext.newJsonParser().encodeResourceToString(response));
}
}
@@ -627,7 +627,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
assertNull(response.getTotalElement().getValue());
// The paging should have ended now - but the last redacted female result is an empty existing page which should never have been there.
- assertNotNull(BundleUtil.getLinkUrlOfType(myFhirCtx, response, "next"));
+ assertNotNull(BundleUtil.getLinkUrlOfType(myFhirContext, response, "next"));
await()
.until(
@@ -747,7 +747,7 @@ public class ConsentInterceptorResourceProviderR4Test extends BaseResourceProvid
}
private HttpEntity toEntity(Patient thePatient) {
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(thePatient);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(thePatient);
ContentType cs = ContentType.create(Constants.CT_FHIR_JSON, Constants.CHARSET_UTF8);
return new StringEntity(encoded, cs);
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/DiffProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/DiffProviderR4Test.java
index 53ed0877cdc..68af9686e67 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/DiffProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/DiffProviderR4Test.java
@@ -40,7 +40,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.useHttpGet()
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(2, diff.getParameter().size());
@@ -71,7 +71,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.useHttpGet()
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(4, diff.getParameter().size());
@@ -114,7 +114,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.withParameter(Parameters.class, ProviderConstants.DIFF_INCLUDE_META_PARAMETER, new BooleanType(true))
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(5, diff.getParameter().size());
@@ -138,7 +138,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.withNoParameters(Parameters.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(1, diff.getParameter().size());
@@ -164,7 +164,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.andParameter(ProviderConstants.DIFF_INCLUDE_META_PARAMETER, new BooleanType(true))
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(5, diff.getParameter().size());
@@ -191,7 +191,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.andParameter(ProviderConstants.DIFF_INCLUDE_META_PARAMETER, new BooleanType(true))
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(3, diff.getParameter().size());
@@ -220,7 +220,7 @@ public class DiffProviderR4Test extends BaseResourceProviderR4Test {
.andParameter(ProviderConstants.DIFF_INCLUDE_META_PARAMETER, new BooleanType(true))
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(diff));
assertEquals(3, diff.getParameter().size());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ExpungeR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ExpungeR4Test.java
index e8db178069b..2db43fad5e4 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ExpungeR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ExpungeR4Test.java
@@ -205,7 +205,7 @@ public class ExpungeR4Test extends BaseResourceProviderR4Test {
@Test
public void testDeleteCascade() throws IOException {
- ourRestServer.registerInterceptor(new CascadingDeleteInterceptor(myFhirCtx, myDaoRegistry, myInterceptorRegistry));
+ ourRestServer.registerInterceptor(new CascadingDeleteInterceptor(myFhirContext, myDaoRegistry, myInterceptorRegistry));
// setup
Organization organization = new Organization();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MultitenantBatchOperationR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MultitenantBatchOperationR4Test.java
index e2f14461cd5..3516227b430 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MultitenantBatchOperationR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MultitenantBatchOperationR4Test.java
@@ -7,8 +7,6 @@ import ca.uhn.fhir.interceptor.api.IPointcut;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
-import ca.uhn.fhir.jpa.dao.BaseJpaTest;
import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.delete.job.ReindexTestHelper;
import ca.uhn.fhir.rest.api.CacheControlDirective;
@@ -29,7 +27,6 @@ import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.TestPropertySource;
import java.util.ArrayList;
import java.util.List;
@@ -100,7 +97,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
.withParameters(input)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
myBatchJobHelper.awaitAllBulkJobCompletions(BatchConstants.DELETE_EXPUNGE_JOB_NAME);
assertThat(interceptor.requestPartitionIds, hasSize(1));
RequestPartitionId partitionId = interceptor.requestPartitionIds.get(0);
@@ -124,7 +121,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
@Test
public void testReindexEverything() {
- ReindexTestHelper reindexTestHelper = new ReindexTestHelper(myFhirCtx, myDaoRegistry, mySearchParamRegistry);
+ ReindexTestHelper reindexTestHelper = new ReindexTestHelper(myFhirContext, myDaoRegistry, mySearchParamRegistry);
myTenantClientInterceptor.setTenantId(TENANT_A);
IIdType obsFinalA = doCreateResource(reindexTestHelper.buildObservationWithAlleleExtension());
@@ -144,7 +141,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
input.addParameter(ProviderConstants.OPERATION_REINDEX_PARAM_BATCH_SIZE, new DecimalType(batchSize));
input.addParameter(ProviderConstants.OPERATION_REINDEX_PARAM_EVERYTHING, new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
// reindex all of Tenant A
myTenantClientInterceptor.setTenantId(TENANT_A);
@@ -154,7 +151,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
.named(ProviderConstants.OPERATION_REINDEX)
.withParameters(input)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
DecimalType jobId = (DecimalType) response.getParameter(ProviderConstants.OPERATION_REINDEX_RESPONSE_JOB_ID);
myBatchJobHelper.awaitJobExecution(jobId.getValueAsNumber().longValue());
@@ -171,7 +168,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
@Test
public void testReindexByUrl() {
- ReindexTestHelper reindexTestHelper = new ReindexTestHelper(myFhirCtx, myDaoRegistry, mySearchParamRegistry);
+ ReindexTestHelper reindexTestHelper = new ReindexTestHelper(myFhirContext, myDaoRegistry, mySearchParamRegistry);
myTenantClientInterceptor.setTenantId(TENANT_A);
IIdType obsFinalA = doCreateResource(reindexTestHelper.buildObservationWithAlleleExtension(Observation.ObservationStatus.FINAL));
IIdType obsCancelledA = doCreateResource(reindexTestHelper.buildObservationWithAlleleExtension(Observation.ObservationStatus.CANCELLED));
@@ -194,7 +191,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
input.addParameter(ProviderConstants.OPERATION_REINDEX_PARAM_BATCH_SIZE, new DecimalType(batchSize));
input.addParameter(ProviderConstants.OPERATION_REINDEX_PARAM_URL, "Observation?status=final");
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
// Reindex Tenant A by query url
myTenantClientInterceptor.setTenantId(TENANT_A);
@@ -204,7 +201,7 @@ public class MultitenantBatchOperationR4Test extends BaseMultitenantResourceProv
.named(ProviderConstants.OPERATION_REINDEX)
.withParameters(input)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
DecimalType jobId = (DecimalType) response.getParameter(ProviderConstants.OPERATION_REINDEX_RESPONSE_JOB_ID);
myBatchJobHelper.awaitJobExecution(jobId.getValueAsNumber().longValue());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java
index c1a01cb8941..0e55ed8734e 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java
@@ -11,7 +11,15 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.hl7.fhir.instance.model.api.IIdType;
-import org.hl7.fhir.r4.model.*;
+import org.hl7.fhir.r4.model.Binary;
+import org.hl7.fhir.r4.model.BooleanType;
+import org.hl7.fhir.r4.model.Bundle;
+import org.hl7.fhir.r4.model.CodeType;
+import org.hl7.fhir.r4.model.Media;
+import org.hl7.fhir.r4.model.Observation;
+import org.hl7.fhir.r4.model.Parameters;
+import org.hl7.fhir.r4.model.Patient;
+import org.hl7.fhir.r4.model.StringType;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,8 +28,8 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class PatchProviderR4Test extends BaseResourceProviderR4Test {
@@ -88,7 +96,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- String encodedRequest = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
+ String encodedRequest = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
ourLog.info("Request:\n{}", encodedRequest);
post.setEntity(new StringEntity(encodedRequest, ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
@@ -197,7 +205,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- String encodedRequest = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
+ String encodedRequest = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
ourLog.info("Request:\n{}", encodedRequest);
post.setEntity(new StringEntity(encodedRequest, ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
@@ -448,7 +456,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
ourLog.info("Encoded output: {}", encoded);
post.setEntity(new StringEntity(encoded, ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
@@ -490,7 +498,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- post.setEntity(new StringEntity(myFhirCtx.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
+ post.setEntity(new StringEntity(myFhirContext.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
assertEquals(400, response.getStatusLine().getStatusCode());
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
@@ -528,7 +536,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- post.setEntity(new StringEntity(myFhirCtx.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
+ post.setEntity(new StringEntity(myFhirContext.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
assertEquals(400, response.getStatusLine().getStatusCode());
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
@@ -567,7 +575,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- post.setEntity(new StringEntity(myFhirCtx.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
+ post.setEntity(new StringEntity(myFhirContext.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
assertEquals(400, response.getStatusLine().getStatusCode());
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
@@ -605,7 +613,7 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test {
.setMethod(Bundle.HTTPVerb.PATCH);
HttpPost post = new HttpPost(ourServerBase);
- post.setEntity(new StringEntity(myFhirCtx.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
+ post.setEntity(new StringEntity(myFhirContext.newJsonParser().encodeResourceToString(input), ContentType.parse(Constants.CT_FHIR_JSON_NEW+ Constants.CHARSET_UTF8_CTSUFFIX)));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
assertEquals(400, response.getStatusLine().getStatusCode());
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientEverythingR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientEverythingR4Test.java
index c2a15a1006f..ded41b87d4c 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientEverythingR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientEverythingR4Test.java
@@ -1,12 +1,5 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.IOException;
-import java.util.*;
-
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.partition.SystemRequestDetails;
import ca.uhn.fhir.parser.StrictErrorHandler;
@@ -17,7 +10,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
-import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.Encounter;
@@ -28,9 +20,24 @@ import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.StringType;
-import org.junit.jupiter.api.*;
-
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.TreeSet;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
@SuppressWarnings("Duplicates")
public class PatientEverythingR4Test extends BaseResourceProviderR4Test {
@@ -64,7 +71,7 @@ public class PatientEverythingR4Test extends BaseResourceProviderR4Test {
@BeforeEach
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
@@ -137,7 +144,7 @@ public class PatientEverythingR4Test extends BaseResourceProviderR4Test {
get.addHeader(Constants.HEADER_CACHE_CONTROL, Constants.CACHE_CONTROL_NO_CACHE);
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
assertEquals(EncodingEnum.JSON.getResourceContentTypeNonLegacy(), resp.getFirstHeader(ca.uhn.fhir.rest.api.Constants.HEADER_CONTENT_TYPE).getValue().replaceAll(";.*", ""));
- bundle = EncodingEnum.JSON.newParser(myFhirCtx).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
+ bundle = EncodingEnum.JSON.newParser(myFhirContext).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
}
assertNull(bundle.getLink("next"));
actual = new TreeSet<>();
@@ -262,7 +269,7 @@ public class PatientEverythingR4Test extends BaseResourceProviderR4Test {
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(theEncoding.getResourceContentTypeNonLegacy(), resp.getFirstHeader(ca.uhn.fhir.rest.api.Constants.HEADER_CONTENT_TYPE).getValue().replaceAll(";.*", ""));
- bundle = theEncoding.newParser(myFhirCtx).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
+ bundle = theEncoding.newParser(myFhirContext).parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8));
} finally {
IOUtils.closeQuietly(resp);
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java
index ff4b7a12f4e..51adc1be042 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java
@@ -73,7 +73,7 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
@BeforeEach
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
}
@@ -255,7 +255,7 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
* Validates that second resource from the response is same as the received coverage
*/
private void validateNewCoverage(Parameters theResponse, Coverage theOriginalCoverage) {
- List patientList = ParametersUtil.getNamedParameters(getContext(), theResponse, PARAM_NEW_COVERAGE);
+ List patientList = ParametersUtil.getNamedParameters(this.getFhirContext(), theResponse, PARAM_NEW_COVERAGE);
assertEquals(1, patientList.size());
Coverage respCoverage = (Coverage) theResponse.getParameter().get(1).getResource();
@@ -283,7 +283,7 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
// "system": COVERAGE_PATIENT_IDENT_SYSTEM,
// "value": COVERAGE_PATIENT_IDENT_VALUE
// }
- List patientList = ParametersUtil.getNamedParameters(getContext(), response, PARAM_MEMBER_PATIENT);
+ List patientList = ParametersUtil.getNamedParameters(this.getFhirContext(), response, PARAM_MEMBER_PATIENT);
assertEquals(1, patientList.size());
Patient resultPatient = (Patient) response.getParameter().get(0).getResource();
@@ -327,9 +327,9 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
private Parameters buildInputParameters(Patient thePatient, Coverage theOldCoverage, Coverage theNewCoverage) {
Parameters p = new Parameters();
- ParametersUtil.addParameterToParameters(getContext(), p, PARAM_MEMBER_PATIENT, thePatient);
- ParametersUtil.addParameterToParameters(getContext(), p, PARAM_OLD_COVERAGE, theOldCoverage);
- ParametersUtil.addParameterToParameters(getContext(), p, PARAM_NEW_COVERAGE, theNewCoverage);
+ ParametersUtil.addParameterToParameters(this.getFhirContext(), p, PARAM_MEMBER_PATIENT, thePatient);
+ ParametersUtil.addParameterToParameters(this.getFhirContext(), p, PARAM_OLD_COVERAGE, theOldCoverage);
+ ParametersUtil.addParameterToParameters(this.getFhirContext(), p, PARAM_NEW_COVERAGE, theNewCoverage);
return p;
}
@@ -339,12 +339,12 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
HttpPost post = new HttpPost(theUrl);
post.addHeader(Constants.HEADER_ACCEPT_ENCODING, theEncoding.toString());
- post.setEntity(new ResourceEntity(getContext(), theInputParameters));
+ post.setEntity(new ResourceEntity(this.getFhirContext(), theInputParameters));
ourLog.info("Request: {}", post);
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
assertEquals(200, response.getStatusLine().getStatusCode());
- return theEncoding.newParser(myFhirCtx).parseResource(Parameters.class,
+ return theEncoding.newParser(myFhirContext).parseResource(Parameters.class,
IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8));
}
}
@@ -355,7 +355,7 @@ public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Tes
HttpPost post = new HttpPost(theUrl);
post.addHeader(Constants.HEADER_ACCEPT_ENCODING, theEncoding.toString());
- post.setEntity(new ResourceEntity(getContext(), theInputParameters));
+ post.setEntity(new ResourceEntity(this.getFhirContext(), theInputParameters));
ourLog.info("Request: {}", post);
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderConcurrencyR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderConcurrencyR4Test.java
index 8cc5fd02918..fc7ab941960 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderConcurrencyR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderConcurrencyR4Test.java
@@ -95,7 +95,7 @@ public class ResourceProviderConcurrencyR4Test extends BaseResourceProviderR4Tes
try (CloseableHttpResponse outcome = ourHttpClient.execute(get)) {
assertEquals(200, outcome.getStatusLine().getStatusCode());
String outcomeString = IOUtils.toString(outcome.getEntity().getContent(), StandardCharsets.UTF_8);
- Bundle bundle = myFhirCtx.newJsonParser().parseResource(Bundle.class, outcomeString);
+ Bundle bundle = myFhirContext.newJsonParser().parseResource(Bundle.class, outcomeString);
assertEquals(1, bundle.getEntry().size());
Patient pt = (Patient) bundle.getEntry().get(0).getResource();
String family = pt.getNameFirstRep().getFamily();
@@ -119,7 +119,7 @@ public class ResourceProviderConcurrencyR4Test extends BaseResourceProviderR4Tes
try (CloseableHttpResponse outcome = ourHttpClient.execute(get)) {
assertEquals(200, outcome.getStatusLine().getStatusCode());
String outcomeString = IOUtils.toString(outcome.getEntity().getContent(), StandardCharsets.UTF_8);
- Bundle bundle = myFhirCtx.newJsonParser().parseResource(Bundle.class, outcomeString);
+ Bundle bundle = myFhirContext.newJsonParser().parseResource(Bundle.class, outcomeString);
assertEquals(1, bundle.getEntry().size());
Patient pt = (Patient) bundle.getEntry().get(0).getResource();
String family = pt.getNameFirstRep().getFamily();
@@ -141,7 +141,7 @@ public class ResourceProviderConcurrencyR4Test extends BaseResourceProviderR4Tes
try (CloseableHttpResponse outcome = ourHttpClient.execute(get)) {
assertEquals(200, outcome.getStatusLine().getStatusCode());
String outcomeString = IOUtils.toString(outcome.getEntity().getContent(), StandardCharsets.UTF_8);
- Bundle bundle = myFhirCtx.newJsonParser().parseResource(Bundle.class, outcomeString);
+ Bundle bundle = myFhirContext.newJsonParser().parseResource(Bundle.class, outcomeString);
assertEquals(1, bundle.getEntry().size());
Patient pt = (Patient) bundle.getEntry().get(0).getResource();
String family = pt.getNameFirstRep().getFamily();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderCustomSearchParamR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderCustomSearchParamR4Test.java
index 69169b59ad2..4d67a9c4dcc 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderCustomSearchParamR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderCustomSearchParamR4Test.java
@@ -303,7 +303,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
eyeColourSp.setXpathUsage(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL);
eyeColourSp.setStatus(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE);
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp));
myClient
.create()
@@ -317,7 +317,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
p1.addExtension().setUrl("http://acme.org/eyecolour").setValue(new CodeType("blue"));
IIdType p1id = myPatientDao.create(p1).getId().toUnqualifiedVersionless();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p1));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(p1));
Patient p2 = new Patient();
p2.setActive(true);
@@ -331,7 +331,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
List foundResources = toUnqualifiedVersionlessIdValues(bundle);
assertThat(foundResources, contains(p1id.getValue()));
@@ -533,7 +533,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide
.next(bundle)
.execute();
}
- List resources = BundleUtil.toListOfResources(myFhirCtx, bundle);
+ List resources = BundleUtil.toListOfResources(myFhirContext, bundle);
resources.forEach(t -> actualIds.add(t.getIdElement().getIdPartAsLong()));
foundCount += resources.size();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderExpungeR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderExpungeR4Test.java
index 5576a787f1c..46aedec0e9c 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderExpungeR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderExpungeR4Test.java
@@ -146,7 +146,7 @@ public class ResourceProviderExpungeR4Test extends BaseResourceProviderR4Test {
.setName(ProviderConstants.OPERATION_EXPUNGE_PARAM_EXPUNGE_PREVIOUS_VERSIONS)
.setValue(new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
Parameters output = myClient
.operation()
@@ -219,7 +219,7 @@ public class ResourceProviderExpungeR4Test extends BaseResourceProviderR4Test {
.setName(ProviderConstants.OPERATION_EXPUNGE_PARAM_EXPUNGE_EVERYTHING)
.setValue(new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
Parameters output = myClient
.operation()
@@ -258,7 +258,7 @@ public class ResourceProviderExpungeR4Test extends BaseResourceProviderR4Test {
.setName(ProviderConstants.OPERATION_EXPUNGE_PARAM_EXPUNGE_PREVIOUS_VERSIONS)
.setValue(new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
Parameters output = myClient
.operation()
@@ -304,7 +304,7 @@ public class ResourceProviderExpungeR4Test extends BaseResourceProviderR4Test {
.setName(ProviderConstants.OPERATION_EXPUNGE_PARAM_EXPUNGE_PREVIOUS_VERSIONS)
.setValue(new BooleanType(true));
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(input));
Parameters output = myClient
.operation()
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderHasParamR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderHasParamR4Test.java
index 25455525c47..981ab4bbcfe 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderHasParamR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderHasParamR4Test.java
@@ -1,16 +1,9 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.contains;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
+import ca.uhn.fhir.jpa.api.config.DaoConfig;
+import ca.uhn.fhir.parser.StrictErrorHandler;
+import ca.uhn.fhir.rest.client.interceptor.CapturingInterceptor;
+import ca.uhn.fhir.util.UrlUtil;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -32,10 +25,16 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.parser.StrictErrorHandler;
-import ca.uhn.fhir.rest.client.interceptor.CapturingInterceptor;
-import ca.uhn.fhir.util.UrlUtil;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
@@ -63,7 +62,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
myClient.registerInterceptor(myCapturingInterceptor);
@@ -109,7 +108,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
obs.setDevice(new Reference(devId));
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
@@ -161,7 +160,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myEncounterDao.create(encounter, mySrd);
- ourLog.info("Encounter: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Encounter: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
}
String uri = ourServerBase + "/Patient?_has:Encounter:subject:class=" + UrlUtil.escapeUrlParam("urn:system|IMP") + "&_has:Encounter:subject:date=gt1950";
@@ -197,7 +196,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
cc.addCoding().setCode("2345-7").setSystem("http://loinc.org");
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -218,7 +217,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
encounter.setSubject(new Reference(pid0));
myEncounterDao.create(encounter, mySrd);
- ourLog.info("Encounter: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Encounter: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
}
String uri = ourServerBase + "/Patient?_has:Observation:patient:code=http://" + UrlUtil.escapeUrlParam("loinc.org|2345-7") + "&_has:Encounter:subject:date=gt1950";
@@ -257,7 +256,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -305,7 +304,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -361,7 +360,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -407,7 +406,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -421,7 +420,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -469,7 +468,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -516,7 +515,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -566,7 +565,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
Device device = new Device();
@@ -587,7 +586,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
encounter.setSubject(new Reference(pid0));
myEncounterDao.create(encounter, mySrd);
- ourLog.info("Encounter: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Encounter: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
}
String uri = ourServerBase + "/Patient?_has:Observation:subject:code-value-quantity=http://" + UrlUtil.escapeUrlParam("loinc.org|2345-7$gt180") + "&_has:Encounter:subject:date=gt1950" + "&_has:Encounter:subject:class=" + UrlUtil.escapeUrlParam("urn:system|IMP");
@@ -631,7 +630,7 @@ public class ResourceProviderHasParamR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info("Response was: {}", resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
}
return ids;
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderInterceptorR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderInterceptorR4Test.java
index 8d02586a564..bb1791cc10c 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderInterceptorR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderInterceptorR4Test.java
@@ -168,7 +168,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
IAnonymousInterceptor interceptor = mock(IAnonymousInterceptor.class);
ourRestServer.getInterceptorService().registerAnonymousInterceptor(Pointcut.SERVER_INCOMING_REQUEST_PRE_HANDLED, interceptor);
@@ -236,7 +236,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes
.returnBundle(Bundle.class)
.execute();
assertEquals(1, observations.getEntry().size());
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(observations));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(observations));
} finally {
ourRestServer.unregisterInterceptor(interceptor);
@@ -257,7 +257,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes
pt.addName().setFamily(methodName);
pt.setManagingOrganization(new Reference(orgId));
- IParser parser = myFhirCtx.newXmlParser();
+ IParser parser = myFhirContext.newXmlParser();
parser.setDontStripVersionsFromReferencesAtPaths("Patient.managingOrganization");
parser.setPrettyPrint(true);
String resource = parser.encodeResourceToString(pt);
@@ -323,7 +323,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes
private void transaction(Bundle theBundle) throws IOException {
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(theBundle);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(theBundle);
HttpPost post = new HttpPost(ourServerBase + "/");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
try (CloseableHttpResponse response = ourHttpClient.execute(post)) {
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderQuestionnaireResponseR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderQuestionnaireResponseR4Test.java
index eff9f35f078..90ff93727ba 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderQuestionnaireResponseR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderQuestionnaireResponseR4Test.java
@@ -1,37 +1,41 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.jupiter.api.Assertions.*;
+import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
+import ca.uhn.fhir.rest.api.server.IBundleProvider;
+import ca.uhn.fhir.rest.param.TokenParam;
+import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
+import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
+import ca.uhn.fhir.validation.IValidatorModule;
+import ca.uhn.fhir.validation.ResultSeverityEnum;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.hl7.fhir.instance.model.api.IIdType;
+import org.hl7.fhir.r4.model.DecimalType;
+import org.hl7.fhir.r4.model.IdType;
+import org.hl7.fhir.r4.model.Patient;
+import org.hl7.fhir.r4.model.Questionnaire;
+import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType;
+import org.hl7.fhir.r4.model.QuestionnaireResponse;
+import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Collections;
-import ca.uhn.fhir.context.RuntimeResourceDefinition;
-import ca.uhn.fhir.jpa.entity.Search;
-import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
-import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
-import ca.uhn.fhir.rest.api.server.IBundleProvider;
-import ca.uhn.fhir.rest.param.TokenParam;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.client.methods.*;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.jena.base.Sys;
-import org.hl7.fhir.r4.model.*;
-import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType;
-import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus;
-import org.hl7.fhir.instance.model.api.IIdType;
-import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
-
-import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
-import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
-import ca.uhn.fhir.validation.IValidatorModule;
-import ca.uhn.fhir.validation.ResultSeverityEnum;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourceProviderR4Test {
@@ -105,7 +109,7 @@ public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourcePro
myClient.create().resource(qr1).execute();
fail();
} catch (UnprocessableEntityException e) {
- assertThat(myFhirCtx.newJsonParser().encodeResourceToString(e.getOperationOutcome()), containsString("Answer value must be of type string"));
+ assertThat(myFhirContext.newJsonParser().encodeResourceToString(e.getOperationOutcome()), containsString("Answer value must be of type string"));
}
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4BundleTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4BundleTest.java
index c95011b3cc4..89f6d0f1213 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4BundleTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4BundleTest.java
@@ -1,17 +1,8 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
+import ca.uhn.fhir.jpa.api.config.DaoConfig;
+import ca.uhn.fhir.jpa.model.util.JpaConstants;
+import ca.uhn.fhir.rest.server.exceptions.NotImplementedOperationException;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.instance.model.api.IIdType;
@@ -28,9 +19,17 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.model.util.JpaConstants;
-import ca.uhn.fhir.rest.server.exceptions.NotImplementedOperationException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
public class ResourceProviderR4BundleTest extends BaseResourceProviderR4Test {
@@ -68,7 +67,7 @@ public class ResourceProviderR4BundleTest extends BaseResourceProviderR4Test {
Bundle retBundle = myClient.read().resource(Bundle.class).withId(id).execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle));
assertEquals("http://foo/", bundle.getEntry().get(0).getFullUrl());
}
@@ -121,7 +120,7 @@ public class ResourceProviderR4BundleTest extends BaseResourceProviderR4Test {
public void testHighConcurrencyWorks() throws IOException, InterruptedException {
List bundles = new ArrayList<>();
for (int i =0 ; i < 10; i ++) {
- bundles.add(myFhirCtx.newJsonParser().parseResource(Bundle.class, IOUtils.toString(getClass().getResourceAsStream("/r4/identical-tags-batch.json"), Charsets.UTF_8)));
+ bundles.add(myFhirContext.newJsonParser().parseResource(Bundle.class, IOUtils.toString(getClass().getResourceAsStream("/r4/identical-tags-batch.json"), Charsets.UTF_8)));
}
ExecutorService tpe = Executors.newFixedThreadPool(4);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CacheTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CacheTest.java
index c93002adf6f..65760a6d3f7 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CacheTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CacheTest.java
@@ -29,7 +29,6 @@ import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.core.IsNot.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
@@ -55,7 +54,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myCapturingInterceptor = new CapturingInterceptor();
myClient.registerInterceptor(myCapturingInterceptor);
@@ -228,7 +227,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test {
assertEquals(resp1.getId(), resp2.getId());
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(resp2));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(resp2));
assertEquals(1, resp2.getEntry().size());
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemDesignationTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemDesignationTest.java
index 5f53a3afcd9..6bbcb06e0c6 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemDesignationTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemDesignationTest.java
@@ -1,12 +1,5 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.CodeType;
@@ -18,6 +11,13 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.transaction.annotation.Transactional;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourceProviderR4Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderR4CodeSystemDesignationTest.class);
@@ -42,7 +42,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("de-AT"))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have de-AT and default language
@@ -68,7 +68,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("zh-CN"))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have default language only
@@ -92,7 +92,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("system", new UriType(CS_ACME_URL))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have all languages and the default language
@@ -121,7 +121,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("de-AT"))
.execute();
- String resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have de-AT and default language
@@ -144,7 +144,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("zh-CN"))
.execute();
- resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have default language only
@@ -165,7 +165,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("system", new UriType(CS_ACME_URL))
.execute();
- resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have all languages and the default language
@@ -189,7 +189,7 @@ public class ResourceProviderR4CodeSystemDesignationTest extends BaseResourcePro
.andParameter("displayLanguage",new CodeType("fr-FR"))
.execute();
- resp = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
//-- The designations should have fr-FR languages and the default language
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemTest.java
index bd1370277f9..3e5f9596ce1 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemTest.java
@@ -78,7 +78,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType(FhirResourceDaoR4TerminologyTest.URL_MY_CODE_SYSTEM))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -100,7 +100,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -124,7 +124,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType("http://terminology.hl7.org/CodeSystem/v2-0203"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -163,7 +163,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -199,7 +199,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -268,7 +268,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType("http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -292,7 +292,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -312,7 +312,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -331,7 +331,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -398,7 +398,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ChildAA"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -417,7 +417,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -435,7 +435,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -449,7 +449,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
CodeSystem initialCodeSystem = myClient.read().resource(CodeSystem.class).withId(parentChildCsId).execute();
assertEquals("Parent Child CodeSystem", initialCodeSystem.getName());
initialCodeSystem.setName("Updated Parent Child CodeSystem");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(initialCodeSystem);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(initialCodeSystem);
HttpPut putRequest = new HttpPut(ourServerBase + "/CodeSystem/" + parentChildCsId);
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
CloseableHttpResponse resp = ourHttpClient.execute(putRequest);
@@ -472,7 +472,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -489,7 +489,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -507,7 +507,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -525,7 +525,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -554,7 +554,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onInstance(myCsId).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -616,7 +616,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -633,7 +633,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -665,7 +665,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -682,7 +682,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -702,7 +702,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -722,7 +722,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -742,7 +742,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -762,7 +762,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertFalse(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -800,7 +800,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -820,7 +820,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -840,7 +840,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -861,7 +861,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
assertEquals("Code v1 display", ((StringType) respParam.getParameter().get(1).getValue()).getValueAsString());
@@ -882,7 +882,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
assertEquals("Code v2 display", ((StringType) respParam.getParameter().get(1).getValue()).getValueAsString());
@@ -902,7 +902,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
assertEquals("Code v2 display", ((StringType) respParam.getParameter().get(1).getValue()).getValueAsString());
@@ -921,7 +921,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
assertEquals("Code v2 display", ((StringType) respParam.getParameter().get(1).getValue()).getValueAsString());
@@ -941,7 +941,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
Parameters respParam = myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParam));
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
assertEquals("Code v2 display", ((StringType) respParam.getParameter().get(1).getValue()).getValueAsString());
@@ -961,7 +961,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
CodeSystem.ConceptDefinitionComponent concept2 = codeSystem.addConcept();
concept2.setCode("2000").setDisplay("Code Dispaly 2000");
- ourLog.info("CodeSystem: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
+ ourLog.info("CodeSystem: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
myCodeSystemDao.create(codeSystem, mySrd);
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemVersionedTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemVersionedTest.java
index decae84d973..0cf7519d6cc 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemVersionedTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemVersionedTest.java
@@ -104,7 +104,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType(FhirResourceDaoR4TerminologyTest.URL_MY_CODE_SYSTEM))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -126,7 +126,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -148,7 +148,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -171,7 +171,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -193,7 +193,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -216,7 +216,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.useHttpGet()
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -240,7 +240,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType("http://terminology.hl7.org/CodeSystem/v2-0203"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -262,7 +262,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2.9"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -303,7 +303,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -325,7 +325,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -347,7 +347,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -387,7 +387,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -407,7 +407,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -427,7 +427,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
@@ -453,7 +453,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -471,7 +471,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -489,7 +489,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -510,7 +510,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -528,7 +528,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -546,7 +546,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -566,7 +566,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("system", new UriType(SYSTEM_PARENTCHILD))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -584,7 +584,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -602,7 +602,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("version", new StringType("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -639,7 +639,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -655,7 +655,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -671,7 +671,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -692,7 +692,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -708,7 +708,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -724,7 +724,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentA").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -744,7 +744,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -760,7 +760,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentB").setVersion("1"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -776,7 +776,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
.andParameter("codingB", new Coding().setSystem(SYSTEM_PARENTCHILD).setCode("ParentC").setVersion("2"))
.execute();
- resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(1, respParam.getParameter().size());
@@ -791,7 +791,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
CodeSystem initialCodeSystem = myClient.read().resource(CodeSystem.class).withId(parentChildCs1Id).execute();
assertEquals("Parent Child CodeSystem 1", initialCodeSystem.getName());
initialCodeSystem.setName("Updated Parent Child CodeSystem 1");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(initialCodeSystem);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(initialCodeSystem);
HttpPut putRequest = new HttpPut(ourServerBase + "/CodeSystem/" + parentChildCs1Id);
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
myCaptureQueriesListener.clear();
@@ -809,7 +809,7 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
initialCodeSystem = myClient.read().resource(CodeSystem.class).withId(parentChildCs2Id).execute();
assertEquals("Parent Child CodeSystem 2", initialCodeSystem.getName());
initialCodeSystem.setName("Updated Parent Child CodeSystem 2");
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(initialCodeSystem);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(initialCodeSystem);
putRequest = new HttpPut(ourServerBase + "/CodeSystem/" + parentChildCs2Id);
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ConceptMapTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ConceptMapTest.java
index d5eac98d7d4..21b018f8071 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ConceptMapTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ConceptMapTest.java
@@ -1,10 +1,6 @@
package ca.uhn.fhir.jpa.provider.r4;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
+import ca.uhn.fhir.rest.api.MethodOutcome;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
@@ -26,10 +22,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
-import ca.uhn.fhir.rest.api.MethodOutcome;
-
import java.io.IOException;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test {
private static final Logger ourLog = LoggerFactory.getLogger(ResourceProviderR4ConceptMapTest.class);
@@ -75,14 +74,14 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateByCodeSystemsAndSourceCodeOneToMany() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_3));
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -91,7 +90,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -133,14 +132,14 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateByCodeSystemsAndSourceCodeOneToOne() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -149,7 +148,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -179,7 +178,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateByCodeSystemsAndSourceCodeOneToOne_InBatchOperation() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Bundle bundle = new Bundle();
bundle.setType(Bundle.BundleType.BATCH);
@@ -189,14 +188,14 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.setMethod(Bundle.HTTPVerb.GET)
.setUrl("ConceptMap/$translate?system=" + CS_URL + "&code=12345" + "&targetsystem=" + CS_URL_2);
- ourLog.info("Request:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Request:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
Bundle respBundle = myClient
.transaction()
.withBundle(bundle)
.execute();
- ourLog.info("Response:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respBundle));
+ ourLog.info("Response:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respBundle));
assertEquals(1, respBundle.getEntry().size());
Parameters respParams = (Parameters) respBundle.getEntry().get(0).getResource();
@@ -237,14 +236,14 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.setMethod(Bundle.HTTPVerb.GET)
.setUrl("ConceptMap/$translate?url=http://hl7.org/fhir/ConceptMap/CMapHie&system=http://fkcfhir.org/fhir/cs/FMCECCOrderAbbreviation&code=IMed_Janssen&targetsystem=http://fkcfhir.org/fhir/cs/FMCHIEOrderAbbreviation");
- ourLog.info("Request:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Request:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
Bundle respBundle = myClient
.transaction()
.withBundle(bundle)
.execute();
- ourLog.info("Response:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respBundle));
+ ourLog.info("Response:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respBundle));
assertEquals(1, respBundle.getEntry().size());
Parameters respParams = (Parameters) respBundle.getEntry().get(0).getResource();
@@ -273,14 +272,14 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateByCodeSystemsAndSourceCodeUnmapped() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_3));
inParams.addParameter().setName("code").setValue(new CodeType("BOGUS"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -289,7 +288,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertFalse(((BooleanType) param.getValue()).booleanValue());
@@ -304,7 +303,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithCodeOnly() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -313,7 +312,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
Parameters inParams = new Parameters();
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -322,7 +321,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -379,7 +378,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesCoding() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -391,7 +390,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("coding").setValue(
new Coding().setSystem(CS_URL).setCode("12345").setVersion("Version 1"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -400,7 +399,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -429,7 +428,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithCodeableConcept() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -444,7 +443,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
Parameters inParams = new Parameters();
inParams.addParameter().setName("codeableConcept").setValue(codeableConcept);
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -453,7 +452,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -524,7 +523,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceSystem() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -535,7 +534,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -544,7 +543,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -601,7 +600,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceSystemAndVersion1() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -614,7 +613,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("version").setValue(new StringType("Version 1"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -623,7 +622,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -652,7 +651,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceSystemAndVersion3() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -665,7 +664,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("version").setValue(new StringType("Version 3"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -674,7 +673,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -717,7 +716,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceAndTargetSystem2() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -730,7 +729,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -739,7 +738,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -768,7 +767,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceAndTargetSystem3() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -781,7 +780,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("system").setValue(new UriType(CS_URL));
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_3));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -790,7 +789,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -833,7 +832,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithSourceValueSet() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -844,7 +843,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
inParams.addParameter().setName("source").setValue(new UriType(VS_URL));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -853,7 +852,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -910,7 +909,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateUsingPredicatesWithTargetValueSet() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -921,7 +920,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
inParams.addParameter().setName("target").setValue(new UriType(VS_URL_2));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -930,7 +929,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1002,7 +1001,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
IIdType conceptMapId1 = myConceptMapDao.create(conceptMap1, mySrd).getId().toUnqualifiedVersionless();
conceptMap1 = myConceptMapDao.read(conceptMapId1);
- ourLog.info("ConceptMap: 2 \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
+ ourLog.info("ConceptMap: 2 \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
//- conceptMap1 v2
ConceptMap conceptMap2 = new ConceptMap();
@@ -1020,7 +1019,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
IIdType conceptMapId2 = myConceptMapDao.create(conceptMap2, mySrd).getId().toUnqualifiedVersionless();
conceptMap2 = myConceptMapDao.read(conceptMapId2);
- ourLog.info("ConceptMap: 2 \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap2));
+ ourLog.info("ConceptMap: 2 \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap2));
Parameters inParams = new Parameters();
@@ -1030,7 +1029,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
@@ -1040,7 +1039,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -1071,12 +1070,12 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithInstance() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("code").setValue(new CodeType("12345"));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1085,7 +1084,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1142,7 +1141,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverse() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1157,7 +1156,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_4));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1166,7 +1165,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1195,7 +1194,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseByCodeSystemsAndSourceCodeUnmapped() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("system").setValue(new UriType(CS_URL_3));
@@ -1203,7 +1202,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("BOGUS"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1212,7 +1211,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertFalse(((BooleanType) param.getValue()).booleanValue());
@@ -1227,7 +1226,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithCodeOnly() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1238,7 +1237,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("34567"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1247,7 +1246,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1290,7 +1289,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesCoding() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1304,7 +1303,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
new Coding().setSystem(CS_URL_2).setCode("34567").setVersion("Version 2"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1313,7 +1312,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1356,7 +1355,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithCodeableConcept() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1374,7 +1373,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("codeableConcept").setValue(codeableConcept);
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1383,7 +1382,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1454,7 +1453,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithSourceSystem() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1467,7 +1466,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("system").setValue(new UriType(CS_URL_2));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1476,7 +1475,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1519,7 +1518,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithSourceSystemAndVersion() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1534,7 +1533,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("version").setValue(new StringType("Version 2"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1543,7 +1542,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1586,7 +1585,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithSourceAndTargetSystem1() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1601,7 +1600,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1610,7 +1609,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1639,7 +1638,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithSourceAndTargetSystem4() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1654,7 +1653,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("targetsystem").setValue(new UriType(CS_URL_4));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1663,7 +1662,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1692,7 +1691,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithSourceValueSet() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1705,7 +1704,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("source").setValue(new UriType(VS_URL_2));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1714,7 +1713,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1757,7 +1756,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseUsingPredicatesWithTargetValueSet() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
/*
* Provided:
@@ -1770,7 +1769,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("target").setValue(new UriType(VS_URL));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1779,7 +1778,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
@@ -1837,7 +1836,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
IIdType conceptMapId1 = myConceptMapDao.create(conceptMap1, mySrd).getId().toUnqualifiedVersionless();
conceptMap1 = myConceptMapDao.read(conceptMapId1);
- ourLog.info("ConceptMap: 2 \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
+ ourLog.info("ConceptMap: 2 \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap1));
//- conceptMap1 v2
ConceptMap conceptMap2 = new ConceptMap();
@@ -1855,7 +1854,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
IIdType conceptMapId2 = myConceptMapDao.create(conceptMap2, mySrd).getId().toUnqualifiedVersionless();
conceptMap2 = myConceptMapDao.read(conceptMapId2);
- ourLog.info("ConceptMap: 2 \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap2));
+ ourLog.info("ConceptMap: 2 \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap2));
Parameters inParams = new Parameters();
@@ -1864,7 +1863,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
inParams.addParameter().setName("code").setValue(new CodeType("11111"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
@@ -1874,7 +1873,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
@@ -1905,13 +1904,13 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
public void testTranslateWithReverseAndInstance() {
ConceptMap conceptMap = myConceptMapDao.read(myConceptMapId);
- ourLog.info("ConceptMap:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
+ ourLog.info("ConceptMap:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(conceptMap));
Parameters inParams = new Parameters();
inParams.addParameter().setName("code").setValue(new CodeType("34567"));
inParams.addParameter().setName("reverse").setValue(new BooleanType(true));
- ourLog.info("Request Parameters:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
+ ourLog.info("Request Parameters:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(inParams));
Parameters respParams = myClient
.operation()
@@ -1920,7 +1919,7 @@ public class ResourceProviderR4ConceptMapTest extends BaseResourceProviderR4Test
.withParameters(inParams)
.execute();
- ourLog.info("Response Parameters\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
+ ourLog.info("Response Parameters\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(respParams));
ParametersParameterComponent param = getParameterByName(respParams, "result");
assertTrue(((BooleanType) param.getValue()).booleanValue());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ElasticTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ElasticTest.java
index 99dfcfefa72..367f5b325d1 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ElasticTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ElasticTest.java
@@ -30,8 +30,9 @@ import java.util.List;
import java.util.Objects;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -76,7 +77,7 @@ public class ResourceProviderR4ElasticTest extends BaseResourceProviderR4Test {
// then
assertEquals(Constants.STATUS_HTTP_200_OK, response.getStatusLine().getStatusCode());
String text = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
- ValueSet valueSet = myFhirCtx.newXmlParser().parseResource(ValueSet.class, text);
+ ValueSet valueSet = myFhirContext.newXmlParser().parseResource(ValueSet.class, text);
ourLog.info("testAutocompleteDirectionExisting {}", text);
assertThat(valueSet, is(not(nullValue())));
List expansions = valueSet.getExpansion().getContains();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4RemoteTerminologyTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4RemoteTerminologyTest.java
index 03fbee5460f..7ac385d3e63 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4RemoteTerminologyTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4RemoteTerminologyTest.java
@@ -1,7 +1,7 @@
package ca.uhn.fhir.jpa.provider.r4;
import ca.uhn.fhir.context.FhirContext;
-import ca.uhn.fhir.jpa.config.BaseConfig;
+import ca.uhn.fhir.jpa.config.JpaConfig;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
@@ -61,7 +61,7 @@ public class ResourceProviderR4RemoteTerminologyTest extends BaseResourceProvide
private RemoteTerminologyServiceValidationSupport mySvc;
@Autowired
- @Qualifier(BaseConfig.JPA_VALIDATION_SUPPORT_CHAIN)
+ @Qualifier(JpaConfig.JPA_VALIDATION_SUPPORT_CHAIN)
private ValidationSupportChain myValidationSupportChain;
@BeforeEach
@@ -104,7 +104,7 @@ public class ResourceProviderR4RemoteTerminologyTest extends BaseResourceProvide
.andParameter("url", new UriType("http://terminology.hl7.org/CodeSystem/v2-0247"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType)respParam.getParameter("result")).booleanValue());
@@ -129,7 +129,7 @@ public class ResourceProviderR4RemoteTerminologyTest extends BaseResourceProvide
.useHttpGet()
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType)respParam.getParameter("result")).booleanValue());
@@ -153,7 +153,7 @@ public class ResourceProviderR4RemoteTerminologyTest extends BaseResourceProvide
.andParameter("system", new UriType("http://loinc.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType)respParam.getParameter("result")).booleanValue());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4SearchContainedTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4SearchContainedTest.java
index 1419d2182dd..bb790c40aa3 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4SearchContainedTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4SearchContainedTest.java
@@ -75,7 +75,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
myClient.registerInterceptor(myCapturingInterceptor);
@@ -125,7 +125,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -140,7 +140,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -155,7 +155,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
@@ -208,7 +208,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -224,7 +224,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -240,7 +240,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
oid3 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
//-- Search by date default op
@@ -312,13 +312,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
imp.getContained().add(risk);
imp.getInvestigationFirstRep().getItemFirstRep().setReference("#risk1");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
cid1 = myClinicalImpressionDao.create(imp, mySrd).getId().toUnqualifiedVersionless();
ClinicalImpression createdImp = myClinicalImpressionDao.read(cid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
}
{
@@ -343,13 +343,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
imp.getContained().add(risk);
imp.getInvestigationFirstRep().getItemFirstRep().setReference("#risk1");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
IIdType cid2 = myClinicalImpressionDao.create(imp, mySrd).getId().toUnqualifiedVersionless();
ClinicalImpression createdImp = myClinicalImpressionDao.read(cid2);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
}
{
@@ -374,13 +374,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
imp.getContained().add(risk);
imp.getInvestigationFirstRep().getItemFirstRep().setReference("#risk1");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(imp));
IIdType cid3 = myClinicalImpressionDao.create(imp, mySrd).getId().toUnqualifiedVersionless();
ClinicalImpression createdImp = myClinicalImpressionDao.read(cid3);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdImp));
}
//-- Search by number
@@ -437,13 +437,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
eid1 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
@@ -468,13 +468,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid2 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid2);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
{
@@ -498,13 +498,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid3 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid3);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
//-- Search by quantity
@@ -548,13 +548,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
eid1 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
@@ -579,13 +579,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid2 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid2);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
{
@@ -609,13 +609,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid3 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid3);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
//-- Search by code
@@ -652,13 +652,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid1 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
@@ -683,13 +683,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
eid2 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid2);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
{
@@ -713,13 +713,13 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
encounter.addReasonReference().setReference("#obs1");
encounter.getContained().add(obs);
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(encounter));
IIdType eid3 = myEncounterDao.create(encounter, mySrd).getId().toUnqualifiedVersionless();
Encounter createdEncounter = myEncounterDao.read(eid3);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdEncounter));
}
//-- Search by composite
@@ -766,11 +766,11 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
Observation createdObs = myObservationDao.read(oid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdObs));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(createdObs));
}
{
@@ -795,7 +795,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -820,7 +820,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
//-- Search by uri
@@ -862,7 +862,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
logAllStringIndexes("subject.family");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
Observation createdObs = myObservationDao.read(oid1);
@@ -897,7 +897,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
logAllStringIndexes("subject.family");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
@@ -913,7 +913,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
@@ -958,14 +958,14 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
obs.getContained().add(p2);
obs.getSubject().setReference("#patient2");
- ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Input: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
// -- update
oid1 = myObservationDao.update(obs, mySrd).getId().toUnqualifiedVersionless();
Observation updatedObs = myObservationDao.read(oid1);
- ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedObs));
+ ourLog.info("Output: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedObs));
}
//-- No Obs with Patient Smith
@@ -995,7 +995,7 @@ public class ResourceProviderR4SearchContainedTest extends BaseResourceProviderR
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
}
return ids;
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4StructureDefinitionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4StructureDefinitionTest.java
index 390a850ead2..208e851a4bb 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4StructureDefinitionTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4StructureDefinitionTest.java
@@ -24,7 +24,7 @@ public class ResourceProviderR4StructureDefinitionTest extends BaseResourceProvi
@Test
public void testSearchAllStructureDefinitions() throws IOException {
- StructureDefinition sd = loadResource(myFhirCtx, StructureDefinition.class, "/r4/sd-david-dhtest7.json");
+ StructureDefinition sd = loadResource(myFhirContext, StructureDefinition.class, "/r4/sd-david-dhtest7.json");
myStructureDefinitionDao.update(sd);
Bundle response = myClient
@@ -33,7 +33,7 @@ public class ResourceProviderR4StructureDefinitionTest extends BaseResourceProvi
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
assertEquals(1, response.getEntry().size());
assertEquals("dhtest7", response.getEntry().get(0).getResource().getIdElement().getIdPart());
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
index 92926561cc6..fcc7f0b51d3 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
@@ -2,7 +2,6 @@ package ca.uhn.fhir.jpa.provider.r4;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
import ca.uhn.fhir.jpa.config.TestR4Config;
import ca.uhn.fhir.jpa.dao.data.ISearchDao;
import ca.uhn.fhir.jpa.entity.Search;
@@ -27,7 +26,6 @@ import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.api.IHttpRequest;
import ca.uhn.fhir.rest.client.api.IHttpResponse;
import ca.uhn.fhir.rest.client.interceptor.CapturingInterceptor;
-import ca.uhn.fhir.rest.gclient.IGetPageUntyped;
import ca.uhn.fhir.rest.gclient.StringClientParam;
import ca.uhn.fhir.rest.param.DateRangeParam;
import ca.uhn.fhir.rest.param.NumberParam;
@@ -229,7 +227,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
@Override
public void before() throws Exception {
super.before();
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
myDaoConfig.setAllowMultipleDelete(true);
myClient.registerInterceptor(myCapturingInterceptor);
@@ -470,7 +468,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
assertThat(linkNext, containsString("_getpagesoffset=3300"));
Bundle nextPageBundle = myClient.loadPage().byUrl(linkNext).andReturnBundle(Bundle.class).execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(nextPageBundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(nextPageBundle));
assertEquals(null, nextPageBundle.getLink("next"));
}
@@ -712,7 +710,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient p = new Patient();
p.setActive(true);
p.setId("AAA");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(p);
HttpPut httpPut = new HttpPut(ourServerBase + "/Patient/AAA");
httpPut.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
try (CloseableHttpResponse status = ourHttpClient.execute(httpPut)) {
@@ -734,7 +732,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
p = new Patient();
p.setActive(true);
p.setId("AAA");
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p);
httpPut = new HttpPut(ourServerBase + "/Patient/AAA");
httpPut.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
try (CloseableHttpResponse status = ourHttpClient.execute(httpPut)) {
@@ -785,7 +783,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String respString = myClient.transaction().withBundle(input).prettyPrint().execute();
ourLog.info(respString);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, respString);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, respString);
IdType id = new IdType(bundle.getEntry().get(0).getResponse().getLocation());
Basic basic = myClient.read().resource(Basic.class).withId(id).execute();
@@ -802,7 +800,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedIdValues(bundle);
}
return ids;
@@ -815,9 +813,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}
return ids;
@@ -843,7 +841,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Bundle bundle = client.read().resource(Bundle.class).withId(id).execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}
@Test
@@ -909,7 +907,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
@Test
public void testCreateAndReadBackResourceWithContainedReferenceToContainer() {
- myFhirCtx.setParserErrorHandler(new StrictErrorHandler());
+ myFhirContext.setParserErrorHandler(new StrictErrorHandler());
String input = "{\n" +
" \"resourceType\": \"Organization\",\n" +
@@ -960,11 +958,11 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
" \"name\": \"testOrg\"\n" +
"}";
- Organization org = myFhirCtx.newJsonParser().parseResource(Organization.class, input);
+ Organization org = myFhirContext.newJsonParser().parseResource(Organization.class, input);
IIdType id = myOrganizationDao.create(org).getId();
org = myOrganizationDao.read(id);
- String output = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(org);
+ String output = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(org);
ourLog.info(output);
Location loc = (Location) org.getContained().get(0);
@@ -1063,7 +1061,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
arr[0] = 3;
fromDB.setContent(arr);
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(fromDB);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(fromDB);
putRequest = new HttpPut(ourServerBase + "/Binary/" + resource.getIdPart());
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
@@ -1081,7 +1079,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
arr[0] = 4;
binary.setId("");
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(binary);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(binary);
putRequest = new HttpPut(ourServerBase + "/Binary/" + resource.getIdPart());
putRequest.setEntity(new StringEntity(encoded, ContentType.parse("application/json+fhir")));
resp = ourHttpClient.execute(putRequest);
@@ -1147,14 +1145,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
obs.addIdentifier().setSystem("urn:foo").setValue("bar");
IBaseResource outcome = myClient.create().resource(obs).execute().getOperationOutcome();
- String encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
+ String encodedOo = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
ourLog.info(encodedOo);
assertThat(encodedOo, containsString("cvc-complex-type.2.4.b"));
assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/"));
interceptor.setAddValidationResultsToResponseOperationOutcome(false);
outcome = myClient.create().resource(obs).execute().getOperationOutcome();
- encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
+ encodedOo = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome);
ourLog.info(encodedOo);
assertThat(encodedOo, not(containsString("cvc-complex-type.2.4.b")));
assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/"));
@@ -1243,7 +1241,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?name=" + methodName);
@@ -1277,7 +1275,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
public void testCreateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
pt.addIdentifier().setSystem("http://general-hospital.co.uk/Identifiers").setValue("09832345234543876876");
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876");
@@ -1370,7 +1368,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertEquals(Msg.code(365) + "Can not create resource with ID \"2\", ID must not be supplied on a create (POST) operation (use an HTTP PUT / update operation if you wish to supply an ID)",
oo.getIssue().get(0).getDiagnostics());
@@ -1420,7 +1418,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
assertEquals(3, res.getEntry().size());
assertEquals(1, genResourcesOfType(res, Encounter.class).size());
@@ -1446,7 +1444,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
assertEquals(1, res.getEntry().size());
assertEquals(1, genResourcesOfType(res, Encounter.class).size());
@@ -1459,7 +1457,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(res));
assertEquals(2, res.getEntry().size());
assertEquals(1, genResourcesOfType(res, Encounter.class).size());
@@ -1509,7 +1507,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.where(Patient.IDENTIFIER.exactly().code(methodName))
.execute();
- String encoded = myFhirCtx.newXmlParser().encodeResourceToString(response.getOperationOutcome());
+ String encoded = myFhirContext.newXmlParser().encodeResourceToString(response.getOperationOutcome());
ourLog.info(encoded);
assertThat(encoded, containsString(
" ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pId, cId, oId));
} finally {
@@ -2399,7 +2397,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pId, cId, oId));
} finally {
@@ -2449,7 +2447,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
public void testEverythingWithLargeSet() throws Exception {
String inputString = IOUtils.toString(getClass().getResourceAsStream("/david_big_bundle.json"), StandardCharsets.UTF_8);
- Bundle inputBundle = myFhirCtx.newJsonParser().parseResource(Bundle.class, inputString);
+ Bundle inputBundle = myFhirContext.newJsonParser().parseResource(Bundle.class, inputString);
inputBundle.setType(BundleType.TRANSACTION);
assertEquals(53, inputBundle.getEntry().size());
@@ -2474,7 +2472,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnResourceType(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(responseBundle));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(responseBundle));
List ids = new ArrayList<>();
for (BundleEntryComponent nextEntry : responseBundle.getEntry()) {
@@ -2585,7 +2583,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
p.setActive(true);
IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless();
- myFhirCtx.getRestfulClientFactory().setSocketTimeout(300 * 1000);
+ myFhirContext.getRestfulClientFactory().setSocketTimeout(300 * 1000);
Bundle response = myClient
.operation()
@@ -2675,7 +2673,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
input.setStatus(ObservationStatus.FINAL);
HttpPost post = new HttpPost(ourServerBase + "/Observation/$validate?_pretty=true");
- post.setEntity(new ResourceEntity(myFhirCtx, input));
+ post.setEntity(new ResourceEntity(myFhirContext, input));
try (CloseableHttpResponse resp = ourHttpClient.execute(post)) {
String respString = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
@@ -2902,12 +2900,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(id.withVersion("1").getValue(), history.getEntry().get(2).getResource().getId());
assertEquals(1, ((Patient) history.getEntry().get(2).getResource()).getName().size());
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(history));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(history));
try {
myBundleDao.validate(history, null, null, null, null, null, mySrd);
} catch (PreconditionFailedException e) {
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()));
throw e;
}
}
@@ -3044,7 +3042,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.setId("Patient/AAA/_history/4");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
ourLog.info("Input: {}", resource);
@@ -3086,7 +3084,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.setId("Patient/AAA/_history/4");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(pt);
ourLog.info("Input: {}", resource);
@@ -3115,7 +3113,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String respString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info("Response: {}", respString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, respString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, respString);
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"AAA\" does not match URL ID of \""
+ id.getIdPart() + "\"",
@@ -3168,7 +3166,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnBundle(Bundle.class)
.execute();
- ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info(myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle));
assertEquals(3, bundle.getEntry().size());
assertEquals("Patient", bundle.getEntry().get(0).getResource().getIdElement().getResourceType());
@@ -3655,7 +3653,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myCaptureQueriesListener.logAllQueriesForCurrentThread();
Bundle bundle = myClient.search().forResource("Patient").returnBundle(Bundle.class).execute();
- ourLog.info("Result: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Result: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
assertEquals(2, bundle.getTotal());
assertEquals(1, bundle.getEntry().size());
assertEquals(id2.getIdPart(), bundle.getEntry().get(0).getResource().getIdElement().getIdPart());
@@ -3700,7 +3698,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient p = myClient.read().resource(Patient.class).withId("B").execute();
- String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p);
+ String encoded = myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(p);
ourLog.info(encoded);
assertThat(encoded, containsString("http://foo"));
@@ -3885,7 +3883,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(resp.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
- Bundle b = myFhirCtx.newXmlParser().parseResource(Bundle.class, output);
+ Bundle b = myFhirContext.newXmlParser().parseResource(Bundle.class, output);
assertEquals("http://localhost:" + ourPort + "/fhir/context/Patient?_count=5&_pretty=true&name=Jernel%C3%B6v", b.getLink("self").getUrl());
@@ -4058,7 +4056,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pid1));
} finally {
@@ -4074,7 +4072,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIds(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIds(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder(pid2));
} finally {
@@ -4113,7 +4111,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIdValues(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIdValues(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, containsInAnyOrder("Practitioner/PRAC", "Encounter/E2"));
} finally {
@@ -4127,7 +4125,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(output);
- List ids = toUnqualifiedVersionlessIdValues(myFhirCtx.newXmlParser().parseResource(Bundle.class, output));
+ List ids = toUnqualifiedVersionlessIdValues(myFhirContext.newXmlParser().parseResource(Bundle.class, output));
ourLog.info(ids.toString());
assertThat(ids, empty());
} finally {
@@ -4363,7 +4361,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
HttpGet get = new HttpGet(ourServerBase + "/Observation?value-quantity=gt-15");
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
assertEquals(200, resp.getStatusLine().getStatusCode());
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(oid1));
@@ -4414,7 +4412,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
matches = bundle.getEntry().size();
assertThat(matches, greaterThan(0));
@@ -4468,7 +4466,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4481,7 +4479,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4494,7 +4492,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4507,7 +4505,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
// > 1m
@@ -4549,7 +4547,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4560,7 +4558,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4571,7 +4569,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4583,7 +4581,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
String uri;
@@ -4621,7 +4619,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4632,7 +4630,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -4645,7 +4643,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
myCaptureQueriesListener.clear();
@@ -5082,7 +5080,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
assertEquals(200, resp.getStatusLine().getStatusCode());
String respString = IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, respString);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, respString);
assertEquals(1, bundle.getEntry().size());
}
}
@@ -5216,7 +5214,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5228,7 +5226,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid2 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5240,7 +5238,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid3 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5252,7 +5250,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid4 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
String uri = ourServerBase + "/Observation?_sort=code-value-quantity";
@@ -5261,10 +5259,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
HttpGet get = new HttpGet(uri);
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
String output = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
- found = myFhirCtx.newXmlParser().parseResource(Bundle.class, output);
+ found = myFhirContext.newXmlParser().parseResource(Bundle.class, output);
}
- ourLog.info("Bundle: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
+ ourLog.info("Bundle: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
List list = toUnqualifiedVersionlessIds(found);
assertEquals(4, found.getEntry().size());
@@ -5301,7 +5299,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid1 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5317,7 +5315,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid2 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5333,7 +5331,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
oid3 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -5348,7 +5346,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
comp.setValue(new Quantity().setValue(250));
oid4 = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
String uri = ourServerBase + "/Observation?_sort=combo-code-value-quantity";
@@ -5357,10 +5355,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
HttpGet get = new HttpGet(uri);
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
String output = IOUtils.toString(resp.getEntity().getContent(), Charsets.UTF_8);
- found = myFhirCtx.newXmlParser().parseResource(Bundle.class, output);
+ found = myFhirContext.newXmlParser().parseResource(Bundle.class, output);
}
- ourLog.info("Bundle: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
+ ourLog.info("Bundle: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(found));
List list = toUnqualifiedVersionlessIds(found);
assertEquals(4, found.getEntry().size());
@@ -5468,7 +5466,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
HttpGet get = new HttpGet(ourServerBase + "/MedicationRequest?date:missing=false");
try (CloseableHttpResponse resp = ourHttpClient.execute(get)) {
assertEquals(200, resp.getStatusLine().getStatusCode());
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(id1.getValue()));
@@ -5751,14 +5749,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
// Read back directly from the DAO
{
Organization returned = myOrganizationDao.read(orgId, mySrd);
- String val = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
+ String val = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
ourLog.info(val);
assertThat(val, containsString(""));
}
// Read back through the HTTP API
{
Organization returned = myClient.read(Organization.class, orgId.getIdPart());
- String val = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
+ String val = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
ourLog.info(val);
assertThat(val, containsString(""));
}
@@ -5798,7 +5796,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -5806,7 +5804,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssue().get(0).getDiagnostics(),
containsString("Can not update resource, request URL must contain an ID element for update (PUT) operation (it must be of the form [base]/[resource type]/[id])"));
}
@@ -5819,7 +5817,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.setId("2");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -5842,7 +5840,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient/FOO");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -5867,7 +5865,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
p1.setId("FOO");
p1.addAddress().addLine("NEWLINE");
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
ourLog.info(encoded);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
@@ -5876,7 +5874,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
CloseableHttpResponse response = ourHttpClient.execute(put);
try {
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"FOO\" does not match URL ID of \""
+ p1id.getIdPart() + "\"",
@@ -5888,14 +5886,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
// Try to update with the no ID in the resource body
p1.setId((String) null);
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
put.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8")));
put.addHeader("Accept", Constants.CT_FHIR_JSON);
response = ourHttpClient.execute(put);
try {
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
+ OperationOutcome oo = myFhirContext.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent()));
assertEquals(Msg.code(419) + "Can not update resource, resource body must contain an ID element for update (PUT) operation", oo.getIssue().get(0).getDiagnostics());
} finally {
response.close();
@@ -5904,7 +5902,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
// Try to update with the to correct ID in the resource body
p1.setId(p1id.getIdPart());
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p1);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p1);
put = new HttpPut(ourServerBase + "/Patient/" + p1id.getIdPart());
put.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8")));
response = ourHttpClient.execute(put);
@@ -5949,7 +5947,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient?name=" + methodName);
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -5965,7 +5963,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
pt.addAddress().addLine("AAAAAAAAAAAAAAAAAAA");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?name=" + methodName);
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
response = ourHttpClient.execute(put);
@@ -5984,7 +5982,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
public void testUpdateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
pt.addIdentifier().setSystem("http://general-hospital.co.uk/Identifiers").setValue("09832345234543876876");
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876");
@@ -6002,7 +6000,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
pt.addName().setFamily("FOO");
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient?identifier=" + ("http://general-hospital.co.uk/Identifiers|09832345234543876876".replace("|", UrlUtil.escapeUrlParam("|"))));
put.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6028,7 +6026,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPost post = new HttpPost(ourServerBase + "/Patient");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6048,7 +6046,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
pt = new Patient();
pt.setId(id.getIdPart());
- resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id.getIdPart());
put.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_REPRESENTATION);
@@ -6059,7 +6057,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
response.getEntity().getContent().close();
- Patient respPt = myFhirCtx.newXmlParser().parseResource(Patient.class, responseString);
+ Patient respPt = myFhirContext.newXmlParser().parseResource(Patient.class, responseString);
assertEquals("2", respPt.getIdElement().getVersionIdPart());
InstantType updateTime = respPt.getMeta().getLastUpdatedElement();
@@ -6077,7 +6075,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient p = new Patient();
p.setId("A");
p.setActive(true);
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(p);
HttpPut put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, ContentType.create("application/fhir+json", "UTF-8")));
@@ -6092,7 +6090,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
p = new Patient();
p.setId("A");
p.setActive(false);
- encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
+ encoded = myFhirContext.newJsonParser().encodeResourceToString(p);
put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, ContentType.create("application/fhir+json", "UTF-8")));
@@ -6121,7 +6119,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient p = new Patient();
p.setId(id);
- String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
+ String encoded = myFhirContext.newJsonParser().encodeResourceToString(p);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id);
put.setEntity(new StringEntity(encoded, ContentType.create("application/fhir+json", "UTF-8")));
@@ -6202,7 +6200,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
pt.addName().setFamily("FAM2");
pt.setId(id.toUnqualifiedVersionless());
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut put = new HttpPut(ourServerBase + "/Patient/" + id.getIdPart());
put.addHeader(Constants.HEADER_IF_MATCH, "W/\"44\"");
@@ -6212,7 +6210,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(409, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertThat(oo.getIssue().get(0).getDiagnostics(), containsString("Trying to update Patient/" + id.getIdPart() + "/_history/44 but this is not the current version"));
} finally {
response.close();
@@ -6240,7 +6238,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Patient pt = new Patient();
pt.setId("333");
pt.addName().setFamily(methodName);
- String resource = myFhirCtx.newXmlParser().encodeResourceToString(pt);
+ String resource = myFhirContext.newXmlParser().encodeResourceToString(pt);
HttpPut post = new HttpPut(ourServerBase + "/Patient/A2");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6248,7 +6246,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(responseString);
assertEquals(400, response.getStatusLine().getStatusCode());
- OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString);
+ OperationOutcome oo = myFhirContext.newXmlParser().parseResource(OperationOutcome.class, responseString);
assertEquals(
Msg.code(420) + "Can not update resource, resource body must contain an ID element which matches the request URL for update (PUT) operation - Resource body ID of \"333\" does not match URL ID of \"A2\"",
oo.getIssue().get(0).getDiagnostics());
@@ -6291,7 +6289,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Parameters input = new Parameters();
input.addParameter().setName("mode").setValue(new CodeType("create"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -6316,7 +6314,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
patient.addName().addGiven("James");
patient.setBirthDateElement(new DateType("2011-02-02"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(patient);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(patient);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6362,7 +6360,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.debug(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
@@ -6415,7 +6413,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
ourLog.info(inputStr);
HttpPost post = new HttpPost(ourServerBase + "/Patient/A123/$validate");
@@ -6442,7 +6440,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
Parameters input = new Parameters();
input.addParameter().setName("resource").setResource(patient);
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(input);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(input);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate?_pretty=true");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6467,7 +6465,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
patient.addName().addGiven("James");
patient.setBirthDateElement(new DateType("2011-02-02"));
- String inputStr = myFhirCtx.newXmlParser().encodeResourceToString(patient);
+ String inputStr = myFhirContext.newXmlParser().encodeResourceToString(patient);
HttpPost post = new HttpPost(ourServerBase + "/Patient/$validate");
post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
@@ -6489,10 +6487,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
@Test
public void testValueSetExpandOperation() throws IOException {
- CodeSystem cs = myFhirCtx.newXmlParser().parseResource(CodeSystem.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/extensional-case-3-cs.xml")));
+ CodeSystem cs = myFhirContext.newXmlParser().parseResource(CodeSystem.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/extensional-case-3-cs.xml")));
myClient.create().resource(cs).execute();
- ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/extensional-case-3-vs.xml")));
+ ValueSet upload = myFhirContext.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/extensional-case-3-vs.xml")));
IIdType vsid = myClient.create().resource(upload).execute().getId().toUnqualifiedVersionless();
HttpGet get = new HttpGet(ourServerBase + "/ValueSet/" + vsid.getIdPart() + "/$expand");
@@ -6567,7 +6565,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
cc.addCoding().setCode("2345-7").setSystem("http://loinc.org");
obs.setValue(new Quantity().setValueElement(new DecimalType(125.12)).setUnit("CM").setSystem(UcumServiceUtil.UCUM_CODESYSTEM_URL).setCode("cm"));
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
IIdType opid1 = myObservationDao.create(obs, mySrd).getId();
@@ -6580,7 +6578,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
cc.addCoding().setCode("2345-7").setSystem("http://loinc.org");
obs.setValue(new Quantity().setValueElement(new DecimalType(24.12)).setUnit("CM").setSystem(UcumServiceUtil.UCUM_CODESYSTEM_URL).setCode("cm"));
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
myObservationDao.update(obs, mySrd);
}
@@ -6596,7 +6594,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -6609,7 +6607,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
{
@@ -6622,7 +6620,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
myObservationDao.create(obs, mySrd);
- ourLog.info("Observation: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
+ ourLog.info("Observation: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(obs));
}
// > 1m
@@ -6657,7 +6655,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
patient.setBirthDateElement(new DateType("2073"));
pid0 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless();
- ourLog.info("Patient: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient));
+ ourLog.info("Patient: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient));
System.out.println("pid0 " + pid0);
}
@@ -6670,9 +6668,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
- ourLog.info("Patient: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Patient: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}
uri = ourServerBase + "/Patient?_total=accurate&birthdate=gt2072-01-01";
@@ -6682,9 +6680,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
- Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, resp);
+ Bundle bundle = myFhirContext.newXmlParser().parseResource(Bundle.class, resp);
ids = toUnqualifiedVersionlessIdValues(bundle);
- ourLog.info("Patient: \n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Patient: \n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetLuceneDisabledTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetLuceneDisabledTest.java
index e88bead5b55..880937138f0 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetLuceneDisabledTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetLuceneDisabledTest.java
@@ -140,7 +140,7 @@ public class ResourceProviderR4ValueSetLuceneDisabledTest extends BaseJpaTest {
}
@Override
- protected FhirContext getContext() {
+ protected FhirContext getFhirContext() {
return myFhirCtx;
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java
index ae93c93111f..d55832612db 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java
@@ -235,7 +235,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -273,7 +273,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -303,7 +303,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -331,7 +331,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -359,7 +359,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -384,7 +384,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, not(containsString("")));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -403,7 +403,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -424,7 +424,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -469,7 +469,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -511,7 +511,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -536,7 +536,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -557,7 +557,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, is(containsStringIgnoringCase("")));
@@ -577,7 +577,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -668,7 +668,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -687,7 +687,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -707,7 +707,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -727,7 +727,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -776,7 +776,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.withNoParameters(Parameters.class)
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info("Expanded: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
+ ourLog.info("Expanded: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
assertEquals(1, expanded.getExpansion().getContains().size());
// Update the CodeSystem URL and Codes
@@ -800,7 +800,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.withNoParameters(Parameters.class)
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info("Expanded: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
+ ourLog.info("Expanded: {}", myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expanded));
assertEquals(1, expanded.getExpansion().getContains().size());
}
@@ -834,10 +834,10 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
loadAndPersistCodeSystemAndValueSetWithDesignations();
CodeSystem codeSystem = myCodeSystemDao.read(myExtensionalCsId);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
ValueSet valueSet = myValueSetDao.read(myExtensionalVsId);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet));
String initialValueSetName = valueSet.getName();
validateTermValueSetNotExpanded(initialValueSetName);
@@ -849,7 +849,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
updatedValueSet.setName(valueSet.getName().concat(" - MODIFIED"));
persistValueSet(updatedValueSet, HttpVerb.PUT);
updatedValueSet = myValueSetDao.read(myExtensionalVsId);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet));
String updatedValueSetName = valueSet.getName();
validateTermValueSetNotExpanded(updatedValueSetName);
@@ -864,10 +864,10 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
loadAndPersistCodeSystemAndValueSetWithDesignations();
CodeSystem codeSystem = myCodeSystemDao.read(myExtensionalCsId);
- ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
+ ourLog.info("CodeSystem:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
ValueSet valueSet = myValueSetDao.read(myExtensionalVsId);
- ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet));
+ ourLog.info("ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet));
String initialValueSetName = valueSet.getName();
validateTermValueSetNotExpanded(initialValueSetName);
@@ -888,11 +888,11 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.getRequest()
.setMethod(Bundle.HTTPVerb.PUT)
.setUrl(myExtensionalVsId.getValueAsString());
- ourLog.info("Transaction Bundle:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
+ ourLog.info("Transaction Bundle:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
myClient.transaction().withBundle(bundle).execute();
updatedValueSet = myValueSetDao.read(myExtensionalVsId);
- ourLog.info("Updated ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet));
+ ourLog.info("Updated ValueSet:\n" + myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(updatedValueSet));
String updatedValueSetName = valueSet.getName();
validateTermValueSetNotExpanded(updatedValueSetName);
@@ -972,7 +972,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1001,7 +1001,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter("url", new UriType("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1034,7 +1034,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
String respString = IOUtils.toString(response.getEntity().getContent(), Charsets.UTF_8);
ourLog.info(respString);
- Parameters respParam = myFhirCtx.newJsonParser().parseResource(Parameters.class, respString);
+ Parameters respParam = myFhirContext.newJsonParser().parseResource(Parameters.class, respString);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
}
}
@@ -1073,7 +1073,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.withParameter(Parameters.class, "url", new UrlType(URL_MY_VALUE_SET))
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A", "AA", "AB", "AAA"));
assertEquals(11, myCaptureQueriesListener.getSelectQueries().size());
assertEquals("ValueSet \"ValueSet.url[http://example.com/my_value_set]\" has not yet been pre-expanded. Performing in-memory expansion without parameters. Current status: NOT_EXPANDED | The ValueSet is waiting to be picked up and pre-expanded by a scheduled task.", expansion.getMeta().getExtensionString(EXT_VALUESET_EXPANSION_MESSAGE));
@@ -1088,7 +1088,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter(JpaConstants.OPERATION_EXPAND_PARAM_INCLUDE_HIERARCHY, new BooleanType("true"))
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains()), containsInAnyOrder("AA", "AB"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains().stream().filter(t -> t.getCode().equals("AA")).findFirst().orElseThrow(() -> new IllegalArgumentException()).getContains()), containsInAnyOrder("AAA"));
@@ -1113,7 +1113,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.withParameter(Parameters.class, "valueSet", myLocalVs)
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A", "AA", "AB", "AAA"));
assertEquals(7, myCaptureQueriesListener.getSelectQueries().size());
assertEquals("ValueSet with URL \"Unidentified ValueSet\" was expanded using an in-memory expansion", expansion.getMeta().getExtensionString(EXT_VALUESET_EXPANSION_MESSAGE));
@@ -1128,7 +1128,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter(JpaConstants.OPERATION_EXPAND_PARAM_INCLUDE_HIERARCHY, new BooleanType("true"))
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains()), containsInAnyOrder("AA", "AB"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains().stream().filter(t -> t.getCode().equals("AA")).findFirst().orElseThrow(() -> new IllegalArgumentException()).getContains()), containsInAnyOrder("AAA"));
@@ -1167,7 +1167,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.withParameter(Parameters.class, "url", new UrlType(URL_MY_VALUE_SET))
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A", "AA", "AB", "AAA"));
assertEquals(0, myCaptureQueriesListener.getSelectQueries().size());
assertThat(expansion.getMeta().getExtensionString(EXT_VALUESET_EXPANSION_MESSAGE), containsString("ValueSet was expanded using an expansion that was pre-calculated"));
@@ -1182,7 +1182,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter(JpaConstants.OPERATION_EXPAND_PARAM_INCLUDE_HIERARCHY, new BooleanType("true"))
.returnResourceType(ValueSet.class)
.execute();
- ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
+ ourLog.info(myFhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(expansion));
assertThat(toDirectCodes(expansion.getExpansion().getContains()), containsInAnyOrder("A"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains()), containsInAnyOrder("AA", "AB"));
assertThat(toDirectCodes(expansion.getExpansion().getContains().get(0).getContains().stream().filter(t -> t.getCode().equals("AA")).findFirst().orElseThrow(() -> new IllegalArgumentException()).getContains()), containsInAnyOrder("AAA"));
@@ -1229,7 +1229,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
String respString = IOUtils.toString(response.getEntity().getContent(), Charsets.UTF_8);
ourLog.info(respString);
- Parameters respParam = myFhirCtx.newJsonParser().parseResource(Parameters.class, respString);
+ Parameters respParam = myFhirContext.newJsonParser().parseResource(Parameters.class, respString);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
}
}
@@ -1256,7 +1256,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter("system", new UriType("http://acme.org"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals(true, ((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
@@ -1292,7 +1292,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.useHttpGet()
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("result", respParam.getParameter().get(0).getName());
@@ -1337,7 +1337,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
try (CloseableHttpResponse status = ourHttpClient.execute(validateCodeGet)) {
String response = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8);
ourLog.info("Response: {}", response);
- Parameters output = myFhirCtx.newXmlParser().parseResource(Parameters.class, response);
+ Parameters output = myFhirContext.newXmlParser().parseResource(Parameters.class, response);
assertEquals(true, output.getParameterBool("result"));
}
@@ -1345,7 +1345,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
try (CloseableHttpResponse status = ourHttpClient.execute(validateCodeGet2)) {
String response = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8);
ourLog.info("Response: {}", response);
- Parameters output = myFhirCtx.newXmlParser().parseResource(Parameters.class, response);
+ Parameters output = myFhirContext.newXmlParser().parseResource(Parameters.class, response);
assertEquals(false, output.getParameterBool("result"));
}
@@ -1379,7 +1379,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -1444,7 +1444,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder("", ""));
}
@@ -1464,7 +1464,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, not(stringContainsInOrder("", "")));
@@ -1485,7 +1485,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, not(stringContainsInOrder("", "")));
@@ -1504,7 +1504,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -1524,7 +1524,7 @@ public class ResourceProviderR4ValueSetNoVerCSNoVerTest extends BaseResourceProv
.andParameter("url", new UriType("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2"))
.execute();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertTrue(((BooleanType) respParam.getParameter().get(0).getValue()).booleanValue());
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java
index c2e1178e3cf..29ee809aea6 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java
@@ -201,7 +201,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -239,7 +239,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, containsString(""));
@@ -269,7 +269,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -296,7 +296,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString(""));
assertThat(resp, not(containsString("\"Foo Code\"")));
@@ -315,7 +315,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -336,7 +336,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -381,7 +381,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -423,7 +423,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -448,7 +448,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, stringContainsInOrder(
"",
@@ -469,7 +469,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -489,7 +489,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase(""));
@@ -580,7 +580,7 @@ public class ResourceProviderR4ValueSetVerCSNoVerTest extends BaseResourceProvid
.execute();
ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
- String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
+ String resp = myFhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsStringIgnoringCase("