diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java index a7979f2412e..c4562a39048 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java @@ -33,9 +33,9 @@ import static org.apache.commons.lang3.StringUtils.isBlank; * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java index a20b33a5207..b598c1b47ce 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java @@ -184,6 +184,8 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc { StopWatch w = new StopWatch(); final String searchUuid = UUID.randomUUID().toString(); + ourLog.info("Registering new search {}", searchUuid); + Class resourceTypeClass = myContext.getResourceDefinition(theResourceType).getImplementingClass(); final ISearchBuilder sb = theCallingDao.newSearchBuilder(); sb.setType(resourceTypeClass, theResourceType); @@ -204,6 +206,8 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc { if (theParams.isLoadSynchronous() || loadSynchronousUpTo != null) { + ourLog.info("Search {} is loading in synchronous mode", searchUuid); + // Execute the query and make sure we return distinct results TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager); txTemplate.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRED); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorResourceProviderR4Test.java index 758c6daf735..6db477c0020 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorResourceProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/AuthorizationInterceptorResourceProviderR4Test.java @@ -69,16 +69,16 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - IIdType id = ourClient.create().resource(patient).execute().getId(); + IIdType id = myClient.create().resource(patient).execute().getId(); try { - ourClient.delete().resourceById(id.toUnqualifiedVersionless()).execute(); + myClient.delete().resourceById(id.toUnqualifiedVersionless()).execute(); fail(); } catch (ForbiddenOperationException e) { // good } - patient = ourClient.read().resource(Patient.class).withId(id.toUnqualifiedVersionless()).execute(); + patient = myClient.read().resource(Patient.class).withId(id.toUnqualifiedVersionless()).execute(); assertEquals(id.getValue(), patient.getId()); } @@ -92,16 +92,16 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - final IIdType id = ourClient.create().resource(patient).execute().getId(); + final IIdType id = myClient.create().resource(patient).execute().getId(); Observation obsInCompartment = new Observation(); obsInCompartment.setStatus(ObservationStatus.FINAL); obsInCompartment.getSubject().setReferenceElement(id.toUnqualifiedVersionless()); - IIdType obsInCompartmentId = ourClient.create().resource(obsInCompartment).execute().getId().toUnqualifiedVersionless(); + IIdType obsInCompartmentId = myClient.create().resource(obsInCompartment).execute().getId().toUnqualifiedVersionless(); Observation obsNotInCompartment = new Observation(); obsNotInCompartment.setStatus(ObservationStatus.FINAL); - IIdType obsNotInCompartmentId = ourClient.create().resource(obsNotInCompartment).execute().getId().toUnqualifiedVersionless(); + IIdType obsNotInCompartmentId = myClient.create().resource(obsNotInCompartment).execute().getId().toUnqualifiedVersionless(); ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { @Override @@ -114,10 +114,10 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource } }); - ourClient.delete().resourceById(obsInCompartmentId.toUnqualifiedVersionless()).execute(); + myClient.delete().resourceById(obsInCompartmentId.toUnqualifiedVersionless()).execute(); try { - ourClient.delete().resourceById(obsNotInCompartmentId.toUnqualifiedVersionless()).execute(); + myClient.delete().resourceById(obsNotInCompartmentId.toUnqualifiedVersionless()).execute(); fail(); } catch (ForbiddenOperationException e) { // good @@ -130,7 +130,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - final MethodOutcome output1 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); + final MethodOutcome output1 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { @Override @@ -148,7 +148,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource patient.setId(output1.getId().toUnqualifiedVersionless()); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - MethodOutcome output2 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); + MethodOutcome output2 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); assertEquals(output1.getId().getIdPart(), output2.getId().getIdPart()); @@ -156,7 +156,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); try { - ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|101").execute(); + myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|101").execute(); fail(); } catch (ForbiddenOperationException e) { assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage()); @@ -167,7 +167,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); try { - ourClient.update().resource(patient).execute(); + myClient.update().resource(patient).execute(); fail(); } catch (ForbiddenOperationException e) { assertEquals("HTTP 403 Forbidden: Access denied by default policy (no applicable rules)", e.getMessage()); @@ -182,11 +182,11 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource public void testBlockUpdatingPatientUserDoesnNotHaveAccessTo() throws IOException { Patient pt1 = new Patient(); pt1.setActive(true); - final IIdType pid1 = ourClient.create().resource(pt1).execute().getId().toUnqualifiedVersionless(); + final IIdType pid1 = myClient.create().resource(pt1).execute().getId().toUnqualifiedVersionless(); Patient pt2 = new Patient(); pt2.setActive(false); - final IIdType pid2 = ourClient.create().resource(pt2).execute().getId().toUnqualifiedVersionless(); + final IIdType pid2 = myClient.create().resource(pt2).execute().getId().toUnqualifiedVersionless(); ourRestServer.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) { @Override @@ -200,7 +200,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource Observation obs = new Observation(); obs.setStatus(ObservationStatus.FINAL); obs.setSubject(new Reference(pid1)); - IIdType oid = ourClient.create().resource(obs).execute().getId().toUnqualified(); + IIdType oid = myClient.create().resource(obs).execute().getId().toUnqualified(); unregisterInterceptors(); @@ -224,7 +224,7 @@ public class AuthorizationInterceptorResourceProviderR4Test extends BaseResource obs.setSubject(new Reference(pid2)); try { - ourClient.update().resource(obs).execute(); + myClient.update().resource(obs).execute(); fail(); } catch (ForbiddenOperationException e) { // good 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 b051b94e155..12e8f7f0967 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 @@ -47,7 +47,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank; public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test { protected static JpaValidationSupportChainR4 myValidationSupport; - protected static IGenericClient ourClient; + protected IGenericClient myClient; protected static CloseableHttpClient ourHttpClient; protected static int ourPort; protected static RestfulServer ourRestServer; @@ -150,10 +150,6 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test { ourSearchParamRegistry = wac.getBean(SearchParamRegistryR4.class); myFhirCtx.getRestfulClientFactory().setSocketTimeout(5000000); - ourClient = myFhirCtx.newRestfulGenericClient(ourServerBase); - if (shouldLogClient()) { - ourClient.registerInterceptor(new LoggingInterceptor()); - } PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); HttpClientBuilder builder = HttpClientBuilder.create(); @@ -165,6 +161,11 @@ public abstract class BaseResourceProviderR4Test extends BaseJpaR4Test { } ourRestServer.setPagingProvider(ourPagingProvider); + + myClient = myFhirCtx.newRestfulGenericClient(ourServerBase); + if (shouldLogClient()) { + myClient.registerInterceptor(new LoggingInterceptor()); + } } /** diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/GraphQLProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/GraphQLProviderR4Test.java index 2a554e36963..eb3a24a687f 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/GraphQLProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/GraphQLProviderR4Test.java @@ -5,7 +5,6 @@ import org.apache.commons.io.IOUtils; 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.Patient; import org.junit.Test; import org.slf4j.Logger; @@ -85,13 +84,13 @@ public class GraphQLProviderR4Test extends BaseResourceProviderR4Test { p.addName() .addGiven("GivenOnly1") .addGiven("GivenOnly2"); - myPatientId0 = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + myPatientId0 = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); p = new Patient(); p.addName() .addGiven("GivenOnlyB1") .addGiven("GivenOnlyB2"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); } 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 ba0db38b0e9..37b45783b2b 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 @@ -57,41 +57,41 @@ public class PatientEverythingR4Test extends BaseResourceProviderR4Test { Organization org = new Organization(); org.setName("an org"); - orgId = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless().getValue(); + orgId = myClient.create().resource(org).execute().getId().toUnqualifiedVersionless().getValue(); ourLog.info("OrgId: {}", orgId); Patient patient = new Patient(); patient.getManagingOrganization().setReference(orgId); - patId = ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless().getValue(); + patId = myClient.create().resource(patient).execute().getId().toUnqualifiedVersionless().getValue(); Patient patient2 = new Patient(); patient2.getManagingOrganization().setReference(orgId); - myWrongPatId = ourClient.create().resource(patient2).execute().getId().toUnqualifiedVersionless().getValue(); + myWrongPatId = myClient.create().resource(patient2).execute().getId().toUnqualifiedVersionless().getValue(); Encounter enc1 = new Encounter(); enc1.setStatus(EncounterStatus.CANCELLED); enc1.getSubject().setReference(patId); enc1.getServiceProvider().setReference(orgId); - encId1 = ourClient.create().resource(enc1).execute().getId().toUnqualifiedVersionless().getValue(); + encId1 = myClient.create().resource(enc1).execute().getId().toUnqualifiedVersionless().getValue(); Encounter enc2 = new Encounter(); enc2.setStatus(EncounterStatus.ARRIVED); enc2.getSubject().setReference(patId); enc2.getServiceProvider().setReference(orgId); - encId2 = ourClient.create().resource(enc2).execute().getId().toUnqualifiedVersionless().getValue(); + encId2 = myClient.create().resource(enc2).execute().getId().toUnqualifiedVersionless().getValue(); Encounter wrongEnc1 = new Encounter(); wrongEnc1.setStatus(EncounterStatus.ARRIVED); wrongEnc1.getSubject().setReference(myWrongPatId); wrongEnc1.getServiceProvider().setReference(orgId); - myWrongEnc1 = ourClient.create().resource(wrongEnc1).execute().getId().toUnqualifiedVersionless().getValue(); + myWrongEnc1 = myClient.create().resource(wrongEnc1).execute().getId().toUnqualifiedVersionless().getValue(); myObsIds = new ArrayList(); for (int i = 0; i < 20; i++) { Observation obs = new Observation(); obs.getSubject().setReference(patId); obs.setStatus(ObservationStatus.FINAL); - String obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless().getValue(); + String obsId = myClient.create().resource(obs).execute().getId().toUnqualifiedVersionless().getValue(); myObsIds.add(obsId); } 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 c0bfdc29769..a46d3cc363f 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 @@ -54,7 +54,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide sp.setTitle("Foo Param"); try { - ourClient.create().resource(sp).execute(); + myClient.create().resource(sp).execute(); fail(); } catch (UnprocessableEntityException e) { assertEquals("HTTP 422 Unprocessable Entity: SearchParameter.status is missing or invalid: null", e.getMessage()); @@ -120,7 +120,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(eyeColourSp)); - ourClient + myClient .create() .resource(eyeColourSp) .execute(); @@ -139,7 +139,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide p2.addExtension().setUrl("http://acme.org/eyecolour").setValue(new CodeType("green")); IIdType p2id = myPatientDao.create(p2).getId().toUnqualifiedVersionless(); - Bundle bundle = ourClient + Bundle bundle = myClient .search() .forResource(Patient.class) .where(new TokenClientParam("eyecolour").exactly().code("blue")) @@ -168,7 +168,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide public void testConformanceOverrideAllowed() { myDaoConfig.setDefaultSearchParamsCanBeOverridden(true); - CapabilityStatement conformance = ourClient + CapabilityStatement conformance = myClient .fetchConformance() .ofType(CapabilityStatement.class) .execute(); @@ -220,7 +220,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide } }); - conformance = ourClient + conformance = myClient .fetchConformance() .ofType(CapabilityStatement.class) .execute(); @@ -238,7 +238,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide public void testConformanceOverrideNotAllowed() { myDaoConfig.setDefaultSearchParamsCanBeOverridden(false); - CapabilityStatement conformance = ourClient + CapabilityStatement conformance = myClient .fetchConformance() .ofType(CapabilityStatement.class) .execute(); @@ -274,7 +274,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide mySearchParamRegsitry.forceRefresh(); - conformance = ourClient + conformance = myClient .fetchConformance() .ofType(CapabilityStatement.class) .execute(); @@ -332,7 +332,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide List foundResources; Bundle result; - result = ourClient + result = myClient .search() .forResource(Patient.class) .where(new TokenClientParam("foo").exactly().code("male")) @@ -409,7 +409,7 @@ public class ResourceProviderCustomSearchParamR4Test extends BaseResourceProvide List foundResources; Bundle result; - result = ourClient + result = myClient .search() .forResource(Observation.class) .where(new ReferenceClientParam("foo").hasChainedProperty(Patient.GENDER.exactly().code("male"))) 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 742e097aad0..781d7040b46 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 @@ -198,7 +198,7 @@ public class ResourceProviderInterceptorR4Test extends BaseResourceProviderR4Tes Organization org = new Organization(); org.setName("orgName"); - IIdType orgId = ourClient.create().resource(org).execute().getId().toUnqualified(); + IIdType orgId = myClient.create().resource(org).execute().getId().toUnqualified(); assertNotNull(orgId.getVersionIdPartAsLong()); resetServerInterceptor(); 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 78423c8552b..a3e9351442f 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 @@ -72,7 +72,7 @@ public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourcePro qr1.setStatus(QuestionnaireResponseStatus.COMPLETED); qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123)); try { - ourClient.create().resource(qr1).execute(); + myClient.create().resource(qr1).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.toString(), containsString("Answer value must be of type string")); @@ -95,7 +95,7 @@ public class ResourceProviderQuestionnaireResponseR4Test extends BaseResourcePro qr1.setStatus(QuestionnaireResponseStatus.COMPLETED); qr1.addItem().setLinkId("link1").addAnswer().setValue(new DecimalType(123)); try { - ourClient.create().resource(qr1).execute(); + myClient.create().resource(qr1).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.toString(), 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 075ed457670..6ea92ae282a 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 @@ -34,9 +34,9 @@ public class ResourceProviderR4BundleTest extends BaseResourceProviderR4Test { composition.setTitle("Visit Summary"); bundle.addEntry().setFullUrl("http://foo").setResource(composition); - IIdType id = ourClient.create().resource(bundle).execute().getId(); + IIdType id = myClient.create().resource(bundle).execute().getId(); - Bundle retBundle = ourClient.read().resource(Bundle.class).withId(id).execute(); + Bundle retBundle = myClient.read().resource(Bundle.class).withId(id).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); 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 1792f9fe300..9ffb2e4c623 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 @@ -35,7 +35,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { myDaoConfig.setReuseCachedSearchResultsForMillis(new DaoConfig().getReuseCachedSearchResultsForMillis()); myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(new DaoConfig().getCacheControlNoStoreMaxResultsUpperLimit()); - ourClient.unregisterInterceptor(myCapturingInterceptor); + myClient.unregisterInterceptor(myCapturingInterceptor); } @Override @@ -45,7 +45,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw = AopTestUtils.getTargetObject(mySearchCoordinatorSvc); myCapturingInterceptor = new CapturingInterceptor(); - ourClient.registerInterceptor(myCapturingInterceptor); + myClient.registerInterceptor(myCapturingInterceptor); } @Test @@ -53,9 +53,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { Patient pt1 = new Patient(); pt1.addName().setFamily("FAM"); - ourClient.create().resource(pt1).execute(); + myClient.create().resource(pt1).execute(); - Bundle results = ourClient + Bundle results = myClient .search() .forResource("Patient") .where(Patient.FAMILY.matches().value("FAM")) @@ -68,9 +68,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { Patient pt2 = new Patient(); pt2.addName().setFamily("FAM"); - ourClient.create().resource(pt2).execute(); + myClient.create().resource(pt2).execute(); - results = ourClient + results = myClient .search() .forResource("Patient") .where(Patient.FAMILY.matches().value("FAM")) @@ -89,10 +89,10 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { for (int i = 0; i < 10; i++) { Patient pt1 = new Patient(); pt1.addName().setFamily("FAM" + i); - ourClient.create().resource(pt1).execute(); + myClient.create().resource(pt1).execute(); } - Bundle results = ourClient + Bundle results = myClient .search() .forResource("Patient") .where(Patient.FAMILY.matches().value("FAM")) @@ -109,7 +109,7 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { public void testCacheNoStoreMaxResultsWithIllegalValue() throws IOException { myDaoConfig.setCacheControlNoStoreMaxResultsUpperLimit(123); try { - ourClient + myClient .search() .forResource("Patient") .where(Patient.FAMILY.matches().value("FAM")) @@ -127,18 +127,18 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { Patient pt1 = new Patient(); pt1.addName().setFamily("FAM"); - ourClient.create().resource(pt1).execute(); + myClient.create().resource(pt1).execute(); - Bundle results = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); + Bundle results = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); assertEquals(1, results.getEntry().size()); assertEquals(1, mySearchEntityDao.count()); assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty()); Patient pt2 = new Patient(); pt2.addName().setFamily("FAM"); - ourClient.create().resource(pt2).execute(); + myClient.create().resource(pt2).execute(); - results = ourClient + results = myClient .search() .forResource("Patient") .where(Patient.FAMILY.matches().value("FAM")) @@ -156,11 +156,11 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { Patient pt1 = new Patient(); pt1.addName().setFamily("FAM"); - ourClient.create().resource(pt1).execute(); + myClient.create().resource(pt1).execute(); Date beforeFirst = new Date(); - Bundle results1 = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); + Bundle results1 = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); assertEquals(1, results1.getEntry().size()); assertEquals(1, mySearchEntityDao.count()); assertThat(myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE), empty()); @@ -170,9 +170,9 @@ public class ResourceProviderR4CacheTest extends BaseResourceProviderR4Test { Patient pt2 = new Patient(); pt2.addName().setFamily("FAM"); - ourClient.create().resource(pt2).execute(); + myClient.create().resource(pt2).execute(); - Bundle results2 = ourClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); + Bundle results2 = myClient.search().forResource("Patient").where(Patient.FAMILY.matches().value("FAM")).returnBundle(Bundle.class).execute(); assertEquals(1, results2.getEntry().size()); assertEquals(1, mySearchEntityDao.count()); assertEquals("HIT from " + ourServerBase, myCapturingInterceptor.getLastResponse().getHeaders(Constants.HEADER_X_CACHE).get(0)); 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 9b04ff87ed2..a54963a5f6f 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 @@ -40,7 +40,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOnExternalCode() { ResourceProviderR4ValueSetTest.createExternalCs(myCodeSystemDao, myResourceTableDao, myTermSvc, mySrd); - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -59,7 +59,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue()); // With HTTP GET - respParam = ourClient + respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -82,7 +82,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test @Test public void testLookupOperationByCodeAndSystemBuiltInCode() { - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -105,7 +105,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOperationByCodeAndSystemBuiltInNonexistantCode() { //@formatter:off try { - ourClient + myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -122,7 +122,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test @Test public void testLookupOperationByCodeAndSystemUserDefinedCode() { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -146,7 +146,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOperationByCodeAndSystemUserDefinedNonExistantCode() { //@formatter:off try { - ourClient + myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -163,7 +163,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test @Test public void testLookupOperationByCoding() { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -186,7 +186,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOperationByInvalidCombination() { //@formatter:off try { - ourClient + myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -205,7 +205,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOperationByInvalidCombination2() { //@formatter:off try { - ourClient + myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -223,7 +223,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test public void testLookupOperationByInvalidCombination3() { //@formatter:off try { - ourClient + myClient .operation() .onType(CodeSystem.class) .named("lookup") @@ -240,7 +240,7 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test // @Ignore public void testLookupOperationForBuiltInCode() { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(CodeSystem.class) .named("lookup") 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 a3d4137fc3b..fd3efb8491c 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 @@ -1,22 +1,28 @@ package ca.uhn.fhir.jpa.provider.r4; -import static org.apache.commons.lang3.StringUtils.isNotBlank; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.*; -import java.math.BigDecimal; -import java.net.*; -import java.nio.charset.StandardCharsets; -import java.util.*; - +import ca.uhn.fhir.jpa.dao.DaoConfig; +import ca.uhn.fhir.jpa.entity.Search; +import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl; +import ca.uhn.fhir.jpa.util.StopWatch; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.parser.StrictErrorHandler; import ca.uhn.fhir.rest.api.Constants; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.SummaryEnum; +import ca.uhn.fhir.rest.client.api.IGenericClient; +import ca.uhn.fhir.rest.gclient.StringClientParam; +import ca.uhn.fhir.rest.param.*; +import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; +import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; +import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; +import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; +import ca.uhn.fhir.util.TestUtil; +import ca.uhn.fhir.util.UrlUtil; +import com.google.common.collect.Lists; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -24,8 +30,13 @@ import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.*; -import org.apache.http.entity.*; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicNameValuePair; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.*; import org.hl7.fhir.r4.model.Bundle.*; import org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent; @@ -36,31 +47,25 @@ import org.hl7.fhir.r4.model.Observation.ObservationStatus; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType; import org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType; import org.hl7.fhir.r4.model.Subscription.SubscriptionStatus; -import org.hl7.fhir.instance.model.api.*; import org.junit.*; import org.springframework.test.util.AopTestUtils; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; -import com.google.common.collect.Lists; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.math.BigDecimal; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.*; -import ca.uhn.fhir.jpa.dao.DaoConfig; -import ca.uhn.fhir.jpa.entity.Search; -import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.UriDt; -import ca.uhn.fhir.parser.IParser; -import ca.uhn.fhir.parser.StrictErrorHandler; -import ca.uhn.fhir.rest.api.MethodOutcome; -import ca.uhn.fhir.rest.api.SummaryEnum; -import ca.uhn.fhir.rest.client.api.IGenericClient; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.param.*; -import ca.uhn.fhir.rest.server.exceptions.*; -import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; -import ca.uhn.fhir.util.TestUtil; -import ca.uhn.fhir.util.UrlUtil; +import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; public class ResourceProviderR4Test extends BaseResourceProviderR4Test { @@ -80,6 +85,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(null); mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(SearchCoordinatorSvcImpl.DEFAULT_SYNC_SIZE); mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(false); + mySearchCoordinatorSvcRaw.cancelAllActiveSearches(); } @@ -103,8 +109,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { IOUtils.closeQuietly(resp.getEntity().getContent()); assertEquals(200, resp.getStatusLine().getStatusCode()); } - - + + private ArrayList genResourcesOfType(Bundle theRes, Class theClass) { ArrayList retVal = new ArrayList(); for (BundleEntryComponent next : theRes.getEntry()) { @@ -124,12 +130,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void saveAndRetrieveBasicResource() throws IOException { String input = IOUtils.toString(getClass().getResourceAsStream("/basic-stu3.xml"), StandardCharsets.UTF_8); - String respString = ourClient.transaction().withBundle(input).prettyPrint().execute(); + String respString = myClient.transaction().withBundle(input).prettyPrint().execute(); ourLog.info(respString); Bundle bundle = myFhirCtx.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(); + Basic basic = myClient.read().resource(Basic.class).withId(id).execute(); List exts = basic.getExtensionsByUrl("http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/DateID"); assertEquals(1, exts.size()); } @@ -169,7 +175,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { // Y @Test public void testBundleCreate() throws Exception { - IGenericClient client = ourClient; + IGenericClient client = myClient; String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/r4/document-father.json"), StandardCharsets.UTF_8); IIdType id = client.create().resource(resBody).execute().getId(); @@ -183,7 +189,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { @Test public void testBundleCreateWithTypeTransaction() throws Exception { - IGenericClient client = ourClient; + IGenericClient client = myClient; String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/r4/document-father.json"), StandardCharsets.UTF_8); resBody = resBody.replace("\"type\": \"document\"", "\"type\": \"transaction\""); @@ -201,10 +207,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { subs.setStatus(SubscriptionStatus.ACTIVE); subs.getChannel().setType(SubscriptionChannelType.WEBSOCKET); subs.setCriteria("Observation?"); - IIdType id = ourClient.create().resource(subs).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(subs).execute().getId().toUnqualifiedVersionless(); //@formatter:off - Bundle resp = ourClient + Bundle resp = myClient .search() .forResource(Subscription.class) .where(Subscription.TYPE.exactly().code(SubscriptionChannelType.WEBSOCKET.toCode())) @@ -216,7 +222,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertThat(toUnqualifiedVersionlessIds(resp), contains(id)); //@formatter:off - resp = ourClient + resp = myClient .search() .forResource(Subscription.class) .where(Subscription.TYPE.exactly().systemAndCode(SubscriptionChannelType.WEBSOCKET.getSystem(), SubscriptionChannelType.WEBSOCKET.toCode())) @@ -228,7 +234,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertThat(toUnqualifiedVersionlessIds(resp), contains(id)); //@formatter:off - resp = ourClient + resp = myClient .search() .forResource(Subscription.class) .where(Subscription.TYPE.exactly().systemAndCode(SubscriptionChannelType.WEBSOCKET.getSystem(), SubscriptionChannelType.WEBSOCKET.toCode())) @@ -249,13 +255,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName("rpdstu2_testCountParam_01"); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); - Bundle found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).count(10).returnBundle(Bundle.class).execute(); + Bundle found = myClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).count(10).returnBundle(Bundle.class).execute(); assertEquals(100, found.getTotal()); assertEquals(10, found.getEntry().size()); - found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).count(999).returnBundle(Bundle.class).execute(); + found = myClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).count(999).returnBundle(Bundle.class).execute(); assertEquals(100, found.getTotal()); assertEquals(50, found.getEntry().size()); @@ -266,14 +272,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { */ @Test public void testCreateAndUpdateBinary() throws ClientProtocolException, Exception { - byte[] arr = { 1, 21, 74, 123, -44 }; + byte[] arr = {1, 21, 74, 123, -44}; Binary binary = new Binary(); binary.setContent(arr); binary.setContentType("dansk"); - IIdType resource = ourClient.create().resource(binary).execute().getId(); + IIdType resource = myClient.create().resource(binary).execute().getId(); - Binary fromDB = ourClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); + Binary fromDB = myClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); assertEquals("1", fromDB.getIdElement().getVersionIdPart()); arr[0] = 2; @@ -287,7 +293,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { IOUtils.closeQuietly(resp); } - fromDB = ourClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); + fromDB = myClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); assertEquals("2", fromDB.getIdElement().getVersionIdPart()); arr[0] = 3; @@ -303,7 +309,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { IOUtils.closeQuietly(resp); } - fromDB = ourClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); + fromDB = myClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); assertEquals("3", fromDB.getIdElement().getVersionIdPart()); // Now an update with the wrong ID in the body @@ -320,7 +326,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { IOUtils.closeQuietly(resp); } - fromDB = ourClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); + fromDB = myClient.read().resource(Binary.class).withId(resource.toVersionless()).execute(); assertEquals("3", fromDB.getIdElement().getVersionIdPart()); } @@ -332,7 +338,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testCreateBundle() throws IOException { String input = IOUtils.toString(getClass().getResourceAsStream("/bryn-bundle.json"), StandardCharsets.UTF_8); Validate.notNull(input); - ourClient.create().resource(input).execute().getResource(); + myClient.create().resource(input).execute().getResource(); } @Test @@ -341,13 +347,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - MethodOutcome output1 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); + MethodOutcome output1 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.addName().setFamily("Tester").addGiven("Raghad"); - MethodOutcome output2 = ourClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); + MethodOutcome output2 = myClient.update().resource(patient).conditionalByUrl("Patient?identifier=http://uhn.ca/mrns|100").execute(); assertEquals(output1.getId().getIdPart(), output2.getId().getIdPart()); } @@ -363,7 +369,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { // Missing status, which is mandatory Observation obs = new Observation(); obs.addIdentifier().setSystem("urn:foo").setValue("bar"); - IBaseResource outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); + IBaseResource outcome = myClient.create().resource(obs).execute().getOperationOutcome(); String encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); @@ -371,7 +377,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertThat(encodedOo, containsString("Successfully created resource \\\"Observation/")); interceptor.setAddValidationResultsToResponseOperationOutcome(false); - outcome = ourClient.create().resource(obs).execute().getOperationOutcome(); + outcome = myClient.create().resource(obs).execute().getOperationOutcome(); encodedOo = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(outcome); ourLog.info(encodedOo); assertThat(encodedOo, not(containsString("cvc-complex-type.2.4.b"))); @@ -388,15 +394,15 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { CodeSystem cs = new CodeSystem(); cs.setUrl("http://urn/system"); cs.addConcept().setCode("code0"); - ourClient.create().resource(cs).execute(); + myClient.create().resource(cs).execute(); ValueSet options = new ValueSet(); options.getCompose().addInclude().setSystem("http://urn/system"); - IIdType optId = ourClient.create().resource(options).execute().getId(); + IIdType optId = myClient.create().resource(options).execute().getId(); Questionnaire q = new Questionnaire(); q.addItem().setLinkId("link0").setRequired(false).setType(QuestionnaireItemType.CHOICE).setOptions(new Reference(optId)); - IIdType qId = ourClient.create().resource(q).execute().getId(); + IIdType qId = myClient.create().resource(q).execute().getId(); QuestionnaireResponse qa; @@ -405,7 +411,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { qa = new QuestionnaireResponse(); qa.getQuestionnaire().setReference(qId.toUnqualifiedVersionless().getValue()); qa.addItem().setLinkId("link0").addAnswer().setValue(new Coding().setSystem("urn:system").setCode("code0")); - ourClient.create().resource(qa).execute(); + myClient.create().resource(qa).execute(); // Bad code @@ -413,7 +419,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { qa.getQuestionnaire().setReference(qId.toUnqualifiedVersionless().getValue()); qa.addItem().setLinkId("link0").addAnswer().setValue(new Coding().setSystem("urn:system").setCode("code1")); try { - ourClient.create().resource(qa).execute(); + myClient.create().resource(qa).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.getMessage(), containsString("Question with linkId[link0]")); @@ -489,7 +495,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } // //@formatter:off -// IIdType id3 = ourClient +// IIdType id3 = myClient // .update() // .resource(pt) // .conditionalByUrl("Patient?identifier=http://general-hospital.co.uk/Identifiers|09832345234543876876") @@ -533,7 +539,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(400, response.getStatusLine().getStatusCode()); OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString); assertEquals("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()); + oo.getIssue().get(0).getDiagnostics()); } finally { response.getEntity().getContent().close(); @@ -549,21 +555,21 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p.addName().setFamily(methodName); p.setId(methodName); - IIdType optId = ourClient.update().resource(p).execute().getId(); + IIdType optId = myClient.update().resource(p).execute().getId(); assertEquals(methodName, optId.getIdPart()); assertEquals("1", optId.getVersionIdPart()); } - + @Test public void testDeepChaining() { Location l1 = new Location(); l1.getNameElement().setValue("testDeepChainingL1"); - IIdType l1id = ourClient.create().resource(l1).execute().getId(); + IIdType l1id = myClient.create().resource(l1).execute().getId(); Location l2 = new Location(); l2.getNameElement().setValue("testDeepChainingL2"); l2.getPartOf().setReferenceElement(l1id.toVersionless().toUnqualified()); - IIdType l2id = ourClient.create().resource(l2).execute().getId(); + IIdType l2id = myClient.create().resource(l2).execute().getId(); Encounter e1 = new Encounter(); e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1"); @@ -571,10 +577,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { EncounterLocationComponent location = e1.addLocation(); location.getLocation().setReferenceElement(l2id.toUnqualifiedVersionless()); location.setPeriod(new Period().setStart(new Date(), TemporalPrecisionEnum.SECOND).setEnd(new Date(), TemporalPrecisionEnum.SECOND)); - IIdType e1id = ourClient.create().resource(e1).execute().getId(); + IIdType e1id = myClient.create().resource(e1).execute().getId(); //@formatter:off - Bundle res = ourClient.search() + Bundle res = myClient.search() .forResource(Encounter.class) .where(Encounter.IDENTIFIER.exactly().systemAndCode("urn:foo", "testDeepChainingE1")) .include(Encounter.INCLUDE_LOCATION.asRecursive()) @@ -607,7 +613,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { try { //@formatter:off - ourClient + myClient .delete() .resourceConditionalByType(Patient.class) .where(Patient.IDENTIFIER.exactly().code(methodName)) @@ -616,17 +622,17 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { fail(); } catch (PreconditionFailedException e) { assertEquals("HTTP 412 Precondition Failed: Failed to DELETE resource with match URL \"Patient?identifier=testDeleteConditionalMultiple\" because this search matched 2 resources", - e.getMessage()); + e.getMessage()); } // Not deleted yet.. - ourClient.read().resource("Patient").withId(id1).execute(); - ourClient.read().resource("Patient").withId(id2).execute(); + myClient.read().resource("Patient").withId(id1).execute(); + myClient.read().resource("Patient").withId(id2).execute(); myDaoConfig.setAllowMultipleDelete(true); //@formatter:off - IBaseOperationOutcome response = ourClient + IBaseOperationOutcome response = myClient .delete() .resourceConditionalByType(Patient.class) .where(Patient.IDENTIFIER.exactly().code(methodName)) @@ -636,15 +642,15 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { String encoded = myFhirCtx.newXmlParser().encodeResourceToString(response); ourLog.info(encoded); assertThat(encoded, containsString( - "")); + "")); } finally { IOUtils.closeQuietly(resp); } @@ -691,14 +697,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testDeleteNormal() { Patient p = new Patient(); p.addName().setFamily("FAM"); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); - ourClient.read().resource(Patient.class).withId(id).execute(); + myClient.read().resource(Patient.class).withId(id).execute(); - ourClient.delete().resourceById(id).execute(); + myClient.delete().resourceById(id).execute(); try { - ourClient.read().resource(Patient.class).withId(id).execute(); + myClient.read().resource(Patient.class).withId(id).execute(); fail(); } catch (ResourceGoneException e) { // good @@ -837,9 +843,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testDeleteReturnsOperationOutcome() { Patient p = new Patient(); p.addName().setFamily("FAM"); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); - IBaseOperationOutcome resp = ourClient.delete().resourceById(id).execute(); + IBaseOperationOutcome resp = myClient.delete().resourceById(id).execute(); OperationOutcome oo = (OperationOutcome) resp; assertThat(oo.getIssueFirstRep().getDiagnostics(), startsWith("Successfully deleted 1 resource(s) in ")); } @@ -852,7 +858,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { myFhirCtx.getResourceDefinition(Practitioner.class); myFhirCtx.getResourceDefinition(DocumentManifest.class); - IGenericClient client = ourClient; + IGenericClient client = myClient; int initialSize = client.search().forResource(DocumentManifest.class).returnBundle(Bundle.class).execute().getEntry().size(); @@ -870,7 +876,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { */ @Test public void testDocumentReferenceResources() throws Exception { - IGenericClient client = ourClient; + IGenericClient client = myClient; int initialSize = client.search().forResource(DocumentReference.class).returnBundle(Bundle.class).execute().getEntry().size(); @@ -887,13 +893,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testEmptySearch() throws Exception { Bundle responseBundle; - responseBundle = ourClient.search().forResource(Patient.class).returnBundle(Bundle.class).execute(); + responseBundle = myClient.search().forResource(Patient.class).returnBundle(Bundle.class).execute(); assertEquals(0, responseBundle.getTotal()); - responseBundle = ourClient.search().forResource(Patient.class).where(Patient.NAME.matches().value("AAA")).returnBundle(Bundle.class).execute(); + responseBundle = myClient.search().forResource(Patient.class).where(Patient.NAME.matches().value("AAA")).returnBundle(Bundle.class).execute(); assertEquals(0, responseBundle.getTotal()); - responseBundle = ourClient.search().forResource(Patient.class).where(new StringClientParam("_content").matches().value("AAA")).returnBundle(Bundle.class).execute(); + responseBundle = myClient.search().forResource(Patient.class).where(new StringClientParam("_content").matches().value("AAA")).returnBundle(Bundle.class).execute(); assertEquals(0, responseBundle.getTotal()); } @@ -905,55 +911,55 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization org1parent = new Organization(); org1parent.setId("org1parent"); org1parent.setName(methodName + "1parent"); - IIdType orgId1parent = ourClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1parent = myClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); Organization org1 = new Organization(); org1.setName(methodName + "1"); org1.getPartOf().setReferenceElement(orgId1parent); - IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1 = myClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); - IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType patientId = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); Organization org2 = new Organization(); org2.setName(methodName + "1"); - IIdType orgId2 = ourClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); + IIdType orgId2 = myClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); Device dev = new Device(); dev.setModel(methodName); dev.getOwner().setReferenceElement(orgId2); - IIdType devId = ourClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); + IIdType devId = myClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); Location locParent = new Location(); locParent.setName(methodName + "Parent"); - IIdType locPId = ourClient.create().resource(locParent).execute().getId().toUnqualifiedVersionless(); + IIdType locPId = myClient.create().resource(locParent).execute().getId().toUnqualifiedVersionless(); Location locChild = new Location(); locChild.setName(methodName); locChild.getPartOf().setReferenceElement(locPId); - IIdType locCId = ourClient.create().resource(locChild).execute().getId().toUnqualifiedVersionless(); + IIdType locCId = myClient.create().resource(locChild).execute().getId().toUnqualifiedVersionless(); Encounter encU = new Encounter(); encU.getSubject().setReferenceElement(patientId); encU.addLocation().getLocation().setReferenceElement(locCId); - IIdType encUId = ourClient.create().resource(encU).execute().getId().toUnqualifiedVersionless(); + IIdType encUId = myClient.create().resource(encU).execute().getId().toUnqualifiedVersionless(); Encounter enc = new Encounter(); enc.getSubject().setReferenceElement(patientId); enc.addLocation().getLocation().setReferenceElement(locCId); - IIdType encId = ourClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); + IIdType encId = myClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); Observation obs = new Observation(); obs.getSubject().setReferenceElement(patientId); obs.getDevice().setReferenceElement(devId); obs.getContext().setReferenceElement(encId); - IIdType obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); + IIdType obsId = myClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); ourLog.info("IDs: EncU:" + encUId.getIdPart() + " Enc:" + encId.getIdPart() + " " + patientId.toUnqualifiedVersionless()); - Parameters output = ourClient.operation().onInstance(encId).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onInstance(encId).named("everything").withNoParameters(Parameters.class).execute(); Bundle b = (Bundle) output.getParameter().get(0).getResource(); List ids = toUnqualifiedVersionlessIds(b); assertThat(ids, containsInAnyOrder(patientId, encId, orgId1, orgId2, orgId1parent, locPId, locCId, obsId, devId)); @@ -969,52 +975,52 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization org1parent = new Organization(); org1parent.setId("org1parent"); org1parent.setName(methodName + "1parent"); - IIdType orgId1parent = ourClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1parent = myClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); Organization org1 = new Organization(); org1.setName(methodName + "1"); org1.getPartOf().setReferenceElement(orgId1parent); - IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1 = myClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); - IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType patientId = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); Organization org2 = new Organization(); org2.setName(methodName + "1"); - IIdType orgId2 = ourClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); + IIdType orgId2 = myClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); Device dev = new Device(); dev.setModel(methodName); dev.getOwner().setReferenceElement(orgId2); - IIdType devId = ourClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); + IIdType devId = myClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); Location locParent = new Location(); locParent.setName(methodName + "Parent"); - IIdType locPId = ourClient.create().resource(locParent).execute().getId().toUnqualifiedVersionless(); + IIdType locPId = myClient.create().resource(locParent).execute().getId().toUnqualifiedVersionless(); Location locChild = new Location(); locChild.setName(methodName); locChild.getPartOf().setReferenceElement(locPId); - IIdType locCId = ourClient.create().resource(locChild).execute().getId().toUnqualifiedVersionless(); + IIdType locCId = myClient.create().resource(locChild).execute().getId().toUnqualifiedVersionless(); Encounter encU = new Encounter(); encU.addIdentifier().setValue(methodName); - IIdType encUId = ourClient.create().resource(encU).execute().getId().toUnqualifiedVersionless(); + IIdType encUId = myClient.create().resource(encU).execute().getId().toUnqualifiedVersionless(); Encounter enc = new Encounter(); enc.getSubject().setReferenceElement(patientId); enc.addLocation().getLocation().setReferenceElement(locCId); - IIdType encId = ourClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); + IIdType encId = myClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); Observation obs = new Observation(); obs.getSubject().setReferenceElement(patientId); obs.getDevice().setReferenceElement(devId); obs.getContext().setReferenceElement(encId); - IIdType obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); + IIdType obsId = myClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); - Parameters output = ourClient.operation().onType(Encounter.class).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onType(Encounter.class).named("everything").withNoParameters(Parameters.class).execute(); Bundle b = (Bundle) output.getParameter().get(0).getResource(); List ids = toUnqualifiedVersionlessIds(b); assertThat(ids, containsInAnyOrder(patientId, encUId, encId, orgId1, orgId2, orgId1parent, locPId, locCId, obsId, devId)); @@ -1063,13 +1069,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { List actual; StringAndListParam param; - ourLog.info("Pt1:{} Pt2:{} Obs1:{} Obs2:{} Obs3:{}", new Object[] { ptId1.getIdPart(), ptId2.getIdPart(), obsId1.getIdPart(), obsId2.getIdPart(), obsId3.getIdPart() }); + ourLog.info("Pt1:{} Pt2:{} Obs1:{} Obs2:{} Obs3:{}", new Object[]{ptId1.getIdPart(), ptId2.getIdPart(), obsId1.getIdPart(), obsId2.getIdPart(), obsId3.getIdPart()}); param = new StringAndListParam(); param.addAnd(new StringOrListParam().addOr(new StringParam("obsvalue1"))); //@formatter:off - Parameters response = ourClient + Parameters response = myClient .operation() .onInstance(ptId1) .named("everything") @@ -1091,7 +1097,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { IParser parser = myFhirCtx.newJsonParser(); b = parser.parseResource(Bundle.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/r4/bug147-bundle.json"))); - Bundle resp = ourClient.transaction().withBundle(b).execute(); + Bundle resp = myClient.transaction().withBundle(b).execute(); List ids = new ArrayList(); for (BundleEntryComponent next : resp.getEntry()) { IdType toAdd = new IdType(next.getResponse().getLocation()).toUnqualifiedVersionless(); @@ -1103,7 +1109,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals("Patient", patientId.getResourceType()); { - Parameters output = ourClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); b = (Bundle) output.getParameter().get(0).getResource(); ids = new ArrayList(); @@ -1124,7 +1130,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { { Parameters input = new Parameters(); input.addParameter().setName(Constants.PARAM_COUNT).setValue(new UnsignedIntType(100)); - Parameters output = ourClient.operation().onInstance(patientId).named("everything").withParameters(input).execute(); + Parameters output = myClient.operation().onInstance(patientId).named("everything").withParameters(input).execute(); b = (Bundle) output.getParameter().get(0).getResource(); ids = new ArrayList(); @@ -1162,7 +1168,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mo.setMedication(new Reference(medId)); IIdType moId = myMedicationRequestDao.create(mo, mySrd).getId().toUnqualifiedVersionless(); - Parameters output = ourClient.operation().onInstance(patId).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onInstance(patId).named("everything").withNoParameters(Parameters.class).execute(); Bundle b = (Bundle) output.getParameter().get(0).getResource(); List ids = toUnqualifiedVersionlessIds(b); ourLog.info(ids.toString()); @@ -1183,14 +1189,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { c.getSubject().setReference("Patient/1"); b.addEntry().setResource(c).getRequest().setMethod(HTTPVerb.POST); - Bundle resp = ourClient.transaction().withBundle(b).execute(); + Bundle resp = myClient.transaction().withBundle(b).execute(); ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(resp)); IdType patientId = new IdType(resp.getEntry().get(0).getResponse().getLocation()); assertEquals("Patient", patientId.getResourceType()); - Parameters output = ourClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); b = (Bundle) output.getParameter().get(0).getResource(); List ids = new ArrayList(); @@ -1211,37 +1217,37 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization org1parent = new Organization(); org1parent.setId("org1parent"); org1parent.setName(methodName + "1parent"); - IIdType orgId1parent = ourClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1parent = myClient.update().resource(org1parent).execute().getId().toUnqualifiedVersionless(); Organization org1 = new Organization(); org1.setName(methodName + "1"); org1.getPartOf().setReferenceElement(orgId1parent); - IIdType orgId1 = ourClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); + IIdType orgId1 = myClient.create().resource(org1).execute().getId().toUnqualifiedVersionless(); Patient p = new Patient(); p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(orgId1); - IIdType patientId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType patientId = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); Organization org2 = new Organization(); org2.setName(methodName + "1"); - IIdType orgId2 = ourClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); + IIdType orgId2 = myClient.create().resource(org2).execute().getId().toUnqualifiedVersionless(); Device dev = new Device(); dev.setModel(methodName); dev.getOwner().setReferenceElement(orgId2); - IIdType devId = ourClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); + IIdType devId = myClient.create().resource(dev).execute().getId().toUnqualifiedVersionless(); Observation obs = new Observation(); obs.getSubject().setReferenceElement(patientId); obs.getDevice().setReferenceElement(devId); - IIdType obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); + IIdType obsId = myClient.create().resource(obs).execute().getId().toUnqualifiedVersionless(); Encounter enc = new Encounter(); enc.getSubject().setReferenceElement(patientId); - IIdType encId = ourClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); + IIdType encId = myClient.create().resource(enc).execute().getId().toUnqualifiedVersionless(); - Parameters output = ourClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); Bundle b = (Bundle) output.getParameter().get(0).getResource(); List ids = toUnqualifiedVersionlessIds(b); assertThat(ids, containsInAnyOrder(patientId, devId, obsId, encId, orgId1, orgId2, orgId1parent)); @@ -1255,32 +1261,32 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization o1 = new Organization(); o1.setName(methodName + "1"); - IIdType o1Id = ourClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); + IIdType o1Id = myClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); Organization o2 = new Organization(); o2.setName(methodName + "2"); - IIdType o2Id = ourClient.create().resource(o2).execute().getId().toUnqualifiedVersionless(); + IIdType o2Id = myClient.create().resource(o2).execute().getId().toUnqualifiedVersionless(); Patient p1 = new Patient(); p1.addName().setFamily(methodName + "1"); p1.getManagingOrganization().setReferenceElement(o1Id); - IIdType p1Id = ourClient.create().resource(p1).execute().getId().toUnqualifiedVersionless(); + IIdType p1Id = myClient.create().resource(p1).execute().getId().toUnqualifiedVersionless(); Patient p2 = new Patient(); p2.addName().setFamily(methodName + "2"); p2.getManagingOrganization().setReferenceElement(o2Id); - IIdType p2Id = ourClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); + IIdType p2Id = myClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); Condition c1 = new Condition(); c1.getSubject().setReferenceElement(p1Id); - IIdType c1Id = ourClient.create().resource(c1).execute().getId().toUnqualifiedVersionless(); + IIdType c1Id = myClient.create().resource(c1).execute().getId().toUnqualifiedVersionless(); Condition c2 = new Condition(); c2.getSubject().setReferenceElement(p2Id); - IIdType c2Id = ourClient.create().resource(c2).execute().getId().toUnqualifiedVersionless(); + IIdType c2Id = myClient.create().resource(c2).execute().getId().toUnqualifiedVersionless(); Condition c3 = new Condition(); c3.addIdentifier().setValue(methodName + "3"); - IIdType c3Id = ourClient.create().resource(c3).execute().getId().toUnqualifiedVersionless(); + IIdType c3Id = myClient.create().resource(c3).execute().getId().toUnqualifiedVersionless(); - Parameters output = ourClient.operation().onType(Patient.class).named("everything").withNoParameters(Parameters.class).execute(); + Parameters output = myClient.operation().onType(Patient.class).named("everything").withNoParameters(Parameters.class).execute(); Bundle b = (Bundle) output.getParameter().get(0).getResource(); assertEquals(BundleType.SEARCHSET, b.getType()); @@ -1297,7 +1303,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization org = new Organization(); org.setName(methodName); - IIdType oId = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); + IIdType oId = myClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); long time1 = System.currentTimeMillis(); Thread.sleep(10); @@ -1305,7 +1311,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p = new Patient(); p.addName().setFamily(methodName); p.getManagingOrganization().setReferenceElement(oId); - IIdType pId = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType pId = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); long time2 = System.currentTimeMillis(); Thread.sleep(10); @@ -1313,7 +1319,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Condition c = new Condition(); c.getCode().setText(methodName); c.getSubject().setReferenceElement(pId); - IIdType cId = ourClient.create().resource(c).execute().getId().toUnqualifiedVersionless(); + IIdType cId = myClient.create().resource(c).execute().getId().toUnqualifiedVersionless(); Thread.sleep(10); long time3 = System.currentTimeMillis(); @@ -1335,7 +1341,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } get = new HttpGet(ourServerBase + "/Patient/" + pId.getIdPart() + "/$everything?_lastUpdated=%3E" + new InstantType(new Date(time2)).getValueAsString() + "&_lastUpdated=%3C" - + new InstantType(new Date(time3)).getValueAsString()); + + new InstantType(new Date(time3)).getValueAsString()); response = ourHttpClient.execute(get); try { assertEquals(200, response.getStatusLine().getStatusCode()); @@ -1407,14 +1413,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mySystemDao.transaction(mySrd, inputBundle); - Bundle responseBundle = ourClient - .operation() - .onInstance(new IdType("Patient/A161443")) - .named("everything") - .withParameter(Parameters.class, "_count", new IntegerType(20)) - .useHttpGet() - .returnResourceType(Bundle.class) - .execute(); + Bundle responseBundle = myClient + .operation() + .onInstance(new IdType("Patient/A161443")) + .named("everything") + .withParameter(Parameters.class, "_count", new IntegerType(20)) + .useHttpGet() + .returnResourceType(Bundle.class) + .execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(responseBundle)); @@ -1435,7 +1441,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } String nextUrl = responseBundle.getLink("next").getUrl(); - responseBundle = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl); + responseBundle = myClient.fetchResourceFromUrl(Bundle.class, nextUrl); for (int i = 0; i < responseBundle.getEntry().size(); i++) { for (BundleEntryComponent nextEntry : responseBundle.getEntry()) { idsSet.add(nextEntry.getResource().getIdElement().toUnqualifiedVersionless().getValue()); @@ -1443,7 +1449,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } nextUrl = responseBundle.getLink("next").getUrl(); - responseBundle = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl); + responseBundle = myClient.fetchResourceFromUrl(Bundle.class, nextUrl); for (int i = 0; i < responseBundle.getEntry().size(); i++) { for (BundleEntryComponent nextEntry : responseBundle.getEntry()) { idsSet.add(nextEntry.getResource().getIdElement().toUnqualifiedVersionless().getValue()); @@ -1469,17 +1475,17 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testEverythingWithLargeSet2() throws Exception { Patient p = new Patient(); p.setActive(true); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); for (int i = 1; i < 77; i++) { Observation obs = new Observation(); obs.setId("A" + StringUtils.leftPad(Integer.toString(i), 2, '0')); obs.setSubject(new Reference(id)); - ourClient.update().resource(obs).execute(); + myClient.update().resource(obs).execute(); } - Bundle responseBundle = ourClient.operation().onInstance(id).named("everything").withParameter(Parameters.class, "_count", new IntegerType(50)).useHttpGet().returnResourceType(Bundle.class) - .execute(); + Bundle responseBundle = myClient.operation().onInstance(id).named("everything").withParameter(Parameters.class, "_count", new IntegerType(50)).useHttpGet().returnResourceType(Bundle.class) + .execute(); TreeSet ids = new TreeSet(); for (int i = 0; i < responseBundle.getEntry().size(); i++) { @@ -1493,7 +1499,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { BundleLinkComponent nextLink = responseBundle.getLink("next"); while (nextLink != null) { String nextUrl = nextLink.getUrl(); - responseBundle = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl); + responseBundle = myClient.fetchResourceFromUrl(Bundle.class, nextUrl); for (int i = 0; i < responseBundle.getEntry().size(); i++) { for (BundleEntryComponent nextEntry : responseBundle.getEntry()) { ids.add(nextEntry.getResource().getIdElement().getIdPart()); @@ -1515,17 +1521,17 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testEverythingWithOnlyPatient() { Patient p = new Patient(); p.setActive(true); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); myFhirCtx.getRestfulClientFactory().setSocketTimeout(300 * 1000); - Bundle response = ourClient - .operation() - .onInstance(id) - .named("everything") - .withNoParameters(Parameters.class) - .returnResourceType(Bundle.class) - .execute(); + Bundle response = myClient + .operation() + .onInstance(id) + .named("everything") + .withNoParameters(Parameters.class) + .returnResourceType(Bundle.class) + .execute(); assertEquals(1, response.getEntry().size()); } @@ -1564,7 +1570,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient pt = new Patient(); pt.addName().setFamily(methodName); - ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); + myClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); HttpGet get = new HttpGet(ourServerBase + "/$get-resource-counts"); CloseableHttpResponse response = ourHttpClient.execute(get); @@ -1582,25 +1588,25 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { // private void delete(String theResourceType, String theParamName, String theParamValue) { // Bundle resources; // do { - // IQuery forResource = ourClient.search().forResource(theResourceType); + // IQuery forResource = myClient.search().forResource(theResourceType); // if (theParamName != null) { // forResource = forResource.where(new StringClientParam(theParamName).matches().value(theParamValue)); // } // resources = forResource.execute(); // for (IResource next : resources.toListOfResources()) { // ourLog.info("Deleting resource: {}", next.getId()); - // ourClient.delete().resource(next).execute(); + // myClient.delete().resource(next).execute(); // } // } while (resources.size() > 0); // } // // private void deleteToken(String theResourceType, String theParamName, String theParamSystem, String theParamValue) // { - // Bundle resources = ourClient.search().forResource(theResourceType).where(new + // Bundle resources = myClient.search().forResource(theResourceType).where(new // TokenClientParam(theParamName).exactly().systemAndCode(theParamSystem, theParamValue)).execute(); // for (IResource next : resources.toListOfResources()) { // ourLog.info("Deleting resource: {}", next.getId()); - // ourClient.delete().resource(next).execute(); + // myClient.delete().resource(next).execute(); // } // } @@ -1655,7 +1661,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } } - + @Test public void testHistoryWithAtParameter() throws Exception { String methodName = "testHistoryWithFromAndTo"; @@ -1705,12 +1711,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient patient = new Patient(); patient.addName().setFamily(methodName); - IIdType id = ourClient.create().resource(patient).execute().getId().toVersionless(); - ourClient.delete().resourceById(id).execute(); + IIdType id = myClient.create().resource(patient).execute().getId().toVersionless(); + myClient.delete().resourceById(id).execute(); patient.setId(id); - ourClient.update().resource(patient).execute(); + myClient.update().resource(patient).execute(); - Bundle history = ourClient.history().onInstance(id).andReturnBundle(Bundle.class).prettyPrint().summaryMode(SummaryEnum.DATA).execute(); + Bundle history = myClient.history().onInstance(id).andReturnBundle(Bundle.class).prettyPrint().summaryMode(SummaryEnum.DATA).execute(); assertEquals(3, history.getEntry().size()); assertEquals(id.withVersion("3").getValue(), history.getEntry().get(0).getResource().getId()); assertEquals(1, ((Patient) history.getEntry().get(0).getResource()).getName().size()); @@ -1811,9 +1817,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(400, response.getStatusLine().getStatusCode()); OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, respString); assertEquals( - "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() + "\"", - oo.getIssue().get(0).getDiagnostics()); + "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() + "\"", + oo.getIssue().get(0).getDiagnostics()); } finally { response.close(); } @@ -1825,7 +1831,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { */ @Test public void testImagingStudyResources() throws Exception { - IGenericClient client = ourClient; + IGenericClient client = myClient; int initialSize = client.search().forResource(ImagingStudy.class).returnBundle(Bundle.class).execute().getEntry().size(); @@ -1844,9 +1850,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p = new Patient(); p.getManagingOrganization().setReference("http://example.com/Organization/123"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); - Bundle b = ourClient.search().forResource("Patient").include(Patient.INCLUDE_ORGANIZATION).returnBundle(Bundle.class).execute(); + Bundle b = myClient.search().forResource("Patient").include(Patient.INCLUDE_ORGANIZATION).returnBundle(Bundle.class).execute(); assertEquals(1, b.getEntry().size()); } @@ -1854,18 +1860,18 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testMetaOperationWithNoMetaParameter() throws Exception { Patient p = new Patient(); p.addName().setFamily("testMetaAddInvalid"); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); //@formatter:off String input = "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - ""; + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; //@formatter:on HttpPost post = new HttpPost(ourServerBase + "/Patient/" + id.getIdPart() + "/$meta-add"); @@ -1900,19 +1906,19 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient pt = new Patient(); pt.addName().setFamily(methodName); - IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); - Meta meta = ourClient.meta().get(Meta.class).fromResource(id).execute(); + Meta meta = myClient.meta().get(Meta.class).fromResource(id).execute(); assertEquals(0, meta.getTag().size()); Meta inMeta = new Meta(); inMeta.addTag().setSystem("urn:system1").setCode("urn:code1"); - meta = ourClient.meta().add().onResource(id).meta(inMeta).execute(); + meta = myClient.meta().add().onResource(id).meta(inMeta).execute(); assertEquals(1, meta.getTag().size()); inMeta = new Meta(); inMeta.addTag().setSystem("urn:system1").setCode("urn:code1"); - meta = ourClient.meta().delete().onResource(id).meta(inMeta).execute(); + meta = myClient.meta().delete().onResource(id).meta(inMeta).execute(); assertEquals(0, meta.getTag().size()); } @@ -1938,14 +1944,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { StructureDefinition p = new StructureDefinition(); p.setAbstract(true); p.setUrl("http://example.com/foo"); - IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); - Bundle resp = ourClient - .search() - .forResource(StructureDefinition.class) - .where(StructureDefinition.URL.matches().value("http://example.com/foo")) - .returnBundle(Bundle.class) - .execute(); + Bundle resp = myClient + .search() + .forResource(StructureDefinition.class) + .where(StructureDefinition.URL.matches().value("http://example.com/foo")) + .returnBundle(Bundle.class) + .execute(); assertEquals(1, resp.getTotal()); } @@ -1967,7 +1973,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10); mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true); - Bundle response = ourClient + Bundle response = myClient .operation() .onInstance(new IdType(pid)) .named("everything") @@ -1985,7 +1991,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { // Load page 2 String nextUrl = response.getLink("next").getUrl(); - response = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl); + response = myClient.fetchResourceFromUrl(Bundle.class, nextUrl); assertEquals(10, response.getEntry().size()); if (response.getTotalElement().getValueAsString() != null) { @@ -1997,7 +2003,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Thread.sleep(2000); nextUrl = response.getLink("next").getUrl(); - response = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl); + response = myClient.fetchResourceFromUrl(Bundle.class, nextUrl); assertEquals(1, response.getEntry().size()); assertEquals("21", response.getTotalElement().getValueAsString()); @@ -2024,7 +2030,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10); mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true); - Bundle response = ourClient + Bundle response = myClient .operation() .onInstance(new IdType(pid)) .named("everything") @@ -2064,7 +2070,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { response.close(); } - Patient newPt = ourClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); + Patient newPt = myClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); assertEquals("2", newPt.getIdElement().getVersionIdPart()); assertEquals(false, newPt.getActive()); } @@ -2095,7 +2101,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { response.close(); } - Patient newPt = ourClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); + Patient newPt = myClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); assertEquals("1", newPt.getIdElement().getVersionIdPart()); assertEquals(true, newPt.getActive()); } @@ -2126,7 +2132,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { response.close(); } - Patient newPt = ourClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); + Patient newPt = myClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); assertEquals("2", newPt.getIdElement().getVersionIdPart()); assertEquals(false, newPt.getActive()); } @@ -2157,7 +2163,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { response.close(); } - Patient newPt = ourClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); + Patient newPt = myClient.read().resource(Patient.class).withId(pid1.getIdPart()).execute(); assertEquals("2", newPt.getIdElement().getVersionIdPart()); assertEquals(false, newPt.getActive()); } @@ -2166,25 +2172,25 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testPreserveVersionsOnAuditEvent() { Organization org = new Organization(); org.setName("ORG"); - IIdType orgId = ourClient.create().resource(org).execute().getId(); + IIdType orgId = myClient.create().resource(org).execute().getId(); assertEquals("1", orgId.getVersionIdPart()); Patient patient = new Patient(); patient.addIdentifier().setSystem("http://uhn.ca/mrns").setValue("100"); patient.getManagingOrganization().setReference(orgId.toUnqualified().getValue()); - IIdType patientId = ourClient.create().resource(patient).execute().getId(); + IIdType patientId = myClient.create().resource(patient).execute().getId(); assertEquals("1", patientId.getVersionIdPart()); AuditEvent ae = new org.hl7.fhir.r4.model.AuditEvent(); ae.addEntity().getReference().setReference(patientId.toUnqualified().getValue()); - IIdType aeId = ourClient.create().resource(ae).execute().getId(); + IIdType aeId = myClient.create().resource(ae).execute().getId(); assertEquals("1", aeId.getVersionIdPart()); - patient = ourClient.read().resource(Patient.class).withId(patientId).execute(); + patient = myClient.read().resource(Patient.class).withId(patientId).execute(); assertTrue(patient.getManagingOrganization().getReferenceElement().hasIdPart()); assertFalse(patient.getManagingOrganization().getReferenceElement().hasVersionIdPart()); - ae = ourClient.read().resource(AuditEvent.class).withId(aeId).execute(); + ae = myClient.read().resource(AuditEvent.class).withId(aeId).execute(); assertTrue(ae.getEntityFirstRep().getReference().getReferenceElement().hasIdPart()); assertTrue(ae.getEntityFirstRep().getReference().getReferenceElement().hasVersionIdPart()); @@ -2195,7 +2201,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { */ @Test public void testProcedureRequestResources() throws Exception { - IGenericClient client = ourClient; + IGenericClient client = myClient; int initialSize = client.search().forResource(ProcedureRequest.class).returnBundle(Bundle.class).execute().getEntry().size(); @@ -2219,19 +2225,19 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { pat = new Patient(); pat.addIdentifier().setSystem("urn:system").setValue("testReadAllInstancesOfType_01"); - ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); + myClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); pat = new Patient(); pat.addIdentifier().setSystem("urn:system").setValue("testReadAllInstancesOfType_02"); - ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); + myClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); { - Bundle returned = ourClient.search().forResource(Patient.class).encodedXml().returnBundle(Bundle.class).execute(); + Bundle returned = myClient.search().forResource(Patient.class).encodedXml().returnBundle(Bundle.class).execute(); assertThat(returned.getEntry().size(), greaterThan(1)); assertEquals(BundleType.SEARCHSET, returned.getType()); } { - Bundle returned = ourClient.search().forResource(Patient.class).encodedJson().returnBundle(Bundle.class).execute(); + Bundle returned = myClient.search().forResource(Patient.class).encodedJson().returnBundle(Bundle.class).execute(); assertThat(returned.getEntry().size(), greaterThan(1)); } } @@ -2243,9 +2249,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p1.getText().getDiv().setValueAsString("
HELLO WORLD
"); p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01"); - IIdType newId = ourClient.create().resource(p1).encodedJson().execute().getId(); + IIdType newId = myClient.create().resource(p1).encodedJson().execute().getId(); - Patient actual = ourClient.read().resource(Patient.class).withId(newId).encodedJson().execute(); + Patient actual = myClient.read().resource(Patient.class).withId(newId).encodedJson().execute(); assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString()); } @@ -2256,9 +2262,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p1.getText().getDiv().setValueAsString("
HELLO WORLD
"); p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01"); - IIdType newId = ourClient.create().resource(p1).encodedXml().execute().getId(); + IIdType newId = myClient.create().resource(p1).encodedXml().execute().getId(); - Patient actual = ourClient.read().resource(Patient.class).withId(newId).encodedXml().execute(); + Patient actual = myClient.read().resource(Patient.class).withId(newId).encodedXml().execute(); assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString()); } @@ -2267,13 +2273,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient nextPatient = new Patient(); nextPatient.setId("Patient/B"); nextPatient - .addExtension() - .setUrl("http://foo") - .setValue(new Reference("Practitioner/A")); + .addExtension() + .setUrl("http://foo") + .setValue(new Reference("Practitioner/A")); - ourClient.update().resource(nextPatient).execute(); + myClient.update().resource(nextPatient).execute(); - Patient p = ourClient.read().resource(Patient.class).withId("B").execute(); + Patient p = myClient.read().resource(Patient.class).withId("B").execute(); String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); ourLog.info(encoded); @@ -2291,19 +2297,19 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p1.getManagingOrganization().setResource(o1); - IIdType newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = myClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, new UriDt(newId.getValue())); + Patient actual = myClient.read(Patient.class, new UriDt(newId.getValue())); assertEquals(1, actual.getContained().size()); //@formatter:off - Bundle b = ourClient - .search() - .forResource("Patient") - .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system:rpdstu2", "testSaveAndRetrieveWithContained01")) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle b = myClient + .search() + .forResource("Patient") + .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system:rpdstu2", "testSaveAndRetrieveWithContained01")) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on assertEquals(1, b.getEntry().size()); @@ -2315,9 +2321,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p1.getText().setDivAsString("
IdentifiertestSearchByResourceChain01
"); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); - IdType newId = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType newId = (IdType) myClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId.getIdPart()); + Patient actual = myClient.read(Patient.class, newId.getIdPart()); assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSearchByResourceChain01")); } @@ -2383,68 +2389,68 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Bundle found; - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().systemAndValues(null, id1.getIdPart(), id2.getIdPart())) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().systemAndValues(null, id1.getIdPart(), id2.getIdPart())) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1, id2)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().systemAndValues(null, Arrays.asList(id1.getIdPart(), id2.getIdPart(), "FOOOOO"))) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().systemAndValues(null, Arrays.asList(id1.getIdPart(), id2.getIdPart(), "FOOOOO"))) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1, id2)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().systemAndCode(null, id1.getIdPart())) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().systemAndCode(null, id1.getIdPart())) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().codes(id1.getIdPart(), id2.getIdPart())) - .and(BaseResource.RES_ID.exactly().code(id1.getIdPart())) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().codes(id1.getIdPart(), id2.getIdPart())) + .and(BaseResource.RES_ID.exactly().code(id1.getIdPart())) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().codes(Arrays.asList(id1.getIdPart(), id2.getIdPart(), "FOOOOO"))) - .and(BaseResource.RES_ID.exactly().code(id1.getIdPart())) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().codes(Arrays.asList(id1.getIdPart(), id2.getIdPart(), "FOOOOO"))) + .and(BaseResource.RES_ID.exactly().code(id1.getIdPart())) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().codes(id1.getIdPart(), id2.getIdPart(), "FOOO")) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().codes(id1.getIdPart(), id2.getIdPart(), "FOOO")) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), containsInAnyOrder(id1, id2)); - found = ourClient - .search() - .forResource(Patient.class) - .where(BaseResource.RES_ID.exactly().codes("FOOO")) - .returnBundle(Bundle.class) - .execute(); + found = myClient + .search() + .forResource(Patient.class) + .where(BaseResource.RES_ID.exactly().codes("FOOO")) + .returnBundle(Bundle.class) + .execute(); assertThat(toUnqualifiedVersionlessIds(found), empty()); @@ -2455,22 +2461,22 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01"); p1.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); - IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType p1Id = (IdType) myClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02"); p2.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02"); - ourClient.create().resource(p2).execute().getId(); + myClient.create().resource(p2).execute().getId(); //@formatter:off - Bundle actual = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")) - .encodedJson() - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle actual = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")) + .encodedJson() + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on assertEquals(1, actual.getEntry().size()); @@ -2484,17 +2490,17 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p1 = new Patient(); p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01"); - IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType p1Id = (IdType) myClient.create().resource(p1).execute().getId(); //@formatter:off - Bundle actual = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")) - .encodedJson() - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle actual = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")) + .encodedJson() + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on assertEquals(1, actual.getEntry().size()); assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart()); @@ -2506,16 +2512,16 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { String methodName = "testSearchByLastUpdated"; Patient p = new Patient(); - p.addName().setFamily(methodName+"1"); - IIdType pid1 = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); + p.addName().setFamily(methodName + "1"); + IIdType pid1 = myClient.create().resource(p).execute().getId().toUnqualifiedVersionless(); Thread.sleep(10); long time1 = System.currentTimeMillis(); Thread.sleep(10); Patient p2 = new Patient(); - p2.addName().setFamily(methodName+"2"); - IIdType pid2 = ourClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); + p2.addName().setFamily(methodName + "2"); + IIdType pid2 = myClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); HttpGet get = new HttpGet(ourServerBase + "/Patient?_lastUpdated=lt" + new InstantType(new Date(time1)).getValueAsString()); CloseableHttpResponse response = ourHttpClient.execute(get); @@ -2551,28 +2557,28 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testSearchByReferenceIds() { Organization o1 = new Organization(); o1.setName("testSearchByResourceChainName01"); - IIdType o1id = ourClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); + IIdType o1id = myClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); Organization o2 = new Organization(); o2.setName("testSearchByResourceChainName02"); - IIdType o2id = ourClient.create().resource(o2).execute().getId().toUnqualifiedVersionless(); + IIdType o2id = myClient.create().resource(o2).execute().getId().toUnqualifiedVersionless(); Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByReferenceIds01"); p1.addName().setFamily("testSearchByReferenceIdsFamily01").addGiven("testSearchByReferenceIdsGiven01"); p1.setManagingOrganization(new Reference(o1id.toUnqualifiedVersionless())); - IIdType p1Id = ourClient.create().resource(p1).execute().getId(); + IIdType p1Id = myClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByReferenceIds02"); p2.addName().setFamily("testSearchByReferenceIdsFamily02").addGiven("testSearchByReferenceIdsGiven02"); p2.setManagingOrganization(new Reference(o2id.toUnqualifiedVersionless())); - IIdType p2Id = ourClient.create().resource(p2).execute().getId(); + IIdType p2Id = myClient.create().resource(p2).execute().getId(); //@formatter:off - Bundle actual = ourClient.search() - .forResource(Patient.class) - .where(Patient.ORGANIZATION.hasAnyOfIds(Arrays.asList(o1id.getIdPart(), o2id.getIdPart()))) - .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); + Bundle actual = myClient.search() + .forResource(Patient.class) + .where(Patient.ORGANIZATION.hasAnyOfIds(Arrays.asList(o1id.getIdPart(), o2id.getIdPart()))) + .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); //@formatter:on Set expectedIds = new HashSet(); expectedIds.add(p1Id.getIdPart()); @@ -2589,28 +2595,28 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization o1 = new Organization(); o1.setName("testSearchByResourceChainName01"); - IdType o1id = (IdType) ourClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); + IdType o1id = (IdType) myClient.create().resource(o1).execute().getId().toUnqualifiedVersionless(); Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); p1.addName().setFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); p1.setManagingOrganization(new Reference(o1id.toUnqualifiedVersionless())); - IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType p1Id = (IdType) myClient.create().resource(p1).execute().getId(); //@formatter:off - Bundle actual = ourClient.search() - .forResource(Patient.class) - .where(Patient.ORGANIZATION.hasId(o1id.getIdPart())) - .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); + Bundle actual = myClient.search() + .forResource(Patient.class) + .where(Patient.ORGANIZATION.hasId(o1id.getIdPart())) + .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); //@formatter:on assertEquals(1, actual.getEntry().size()); assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart()); //@formatter:off - actual = ourClient.search() - .forResource(Patient.class) - .where(Patient.ORGANIZATION.hasId(o1id.getValue())) - .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); + actual = myClient.search() + .forResource(Patient.class) + .where(Patient.ORGANIZATION.hasId(o1id.getValue())) + .encodedJson().prettyPrint().returnBundle(Bundle.class).execute(); //@formatter:on assertEquals(1, actual.getEntry().size()); assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart()); @@ -2652,14 +2658,14 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().setFamily(methodName).addGiven("Joe"); - id1a = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id1a = (IdType) myClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } IIdType id1b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); patient.addName().setFamily(methodName + "XXXX").addGiven("Joe"); - id1b = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id1b = (IdType) myClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } Thread.sleep(1100); @@ -2671,40 +2677,40 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); patient.addName().setFamily(methodName).addGiven("John"); - id2 = (IdType) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id2 = (IdType) myClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } { //@formatter:off - Bundle found = ourClient.search() - .forResource(Patient.class) - .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient.search() + .forResource(Patient.class) + .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) + .returnBundle(Bundle.class) + .execute(); //@formatter:on List patients = toUnqualifiedVersionlessIds(found); assertThat(patients, hasItems(id1a, id1b, id2)); } { //@formatter:off - Bundle found = ourClient.search() - .forResource(Patient.class) - .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) - .lastUpdated(new DateRangeParam(beforeAny, null)) - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient.search() + .forResource(Patient.class) + .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) + .lastUpdated(new DateRangeParam(beforeAny, null)) + .returnBundle(Bundle.class) + .execute(); //@formatter:on List patients = toUnqualifiedVersionlessIds(found); assertThat(patients, hasItems(id1a, id1b, id2)); } { //@formatter:off - Bundle found = ourClient.search() - .forResource(Patient.class) - .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) - .lastUpdated(new DateRangeParam(beforeR2, null)) - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient.search() + .forResource(Patient.class) + .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) + .lastUpdated(new DateRangeParam(beforeR2, null)) + .returnBundle(Bundle.class) + .execute(); //@formatter:on List patients = toUnqualifiedVersionlessIds(found); assertThat(patients, hasItems(id2)); @@ -2712,12 +2718,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } { //@formatter:off - Bundle found = ourClient.search() - .forResource(Patient.class) - .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) - .lastUpdated(new DateRangeParam(beforeAny, beforeR2)) - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient.search() + .forResource(Patient.class) + .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) + .lastUpdated(new DateRangeParam(beforeAny, beforeR2)) + .returnBundle(Bundle.class) + .execute(); //@formatter:on List patients = toUnqualifiedVersionlessIds(found); assertThat(patients.toString(), patients, not(hasItems(id2))); @@ -2725,12 +2731,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } { //@formatter:off - Bundle found = ourClient.search() - .forResource(Patient.class) - .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) - .lastUpdated(new DateRangeParam(null, beforeR2)) - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient.search() + .forResource(Patient.class) + .where(Patient.NAME.matches().value("testSearchLastUpdatedParamRp")) + .lastUpdated(new DateRangeParam(null, beforeR2)) + .returnBundle(Bundle.class) + .execute(); //@formatter:on List patients = toUnqualifiedVersionlessIds(found); assertThat(patients, (hasItems(id1a, id1b))); @@ -2810,7 +2816,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { List linkNext = Lists.newArrayList(); for (int i = 0; i < 100; i++) { - Bundle bundle = ourClient.search().forResource(Patient.class).where(Patient.NAME.matches().value("testSearchPagingKeepsOldSearches")).count(5).returnBundle(Bundle.class).execute(); + Bundle bundle = myClient.search().forResource(Patient.class).where(Patient.NAME.matches().value("testSearchPagingKeepsOldSearches")).count(5).returnBundle(Bundle.class).execute(); assertTrue(isNotBlank(bundle.getLink("next").getUrl())); assertEquals(5, bundle.getEntry().size()); linkNext.add(bundle.getLink("next").getUrl()); @@ -2819,7 +2825,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { int index = 0; for (String nextLink : linkNext) { ourLog.info("Fetching index {}", index++); - Bundle b = ourClient.fetchResourceFromUrl(Bundle.class, nextLink); + Bundle b = myClient.fetchResourceFromUrl(Bundle.class, nextLink); assertEquals(5, b.getEntry().size()); } } @@ -2843,12 +2849,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Thread.sleep(1); //@formatter:off - Bundle found = ourClient - .search() - .forResource(Patient.class) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient + .search() + .forResource(Patient.class) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on Thread.sleep(1); @@ -2872,23 +2878,23 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName("HELLO"); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); myDaoConfig.setReuseCachedSearchResultsForMillis(1000L); - Bundle result1 = ourClient - .search() - .forResource("Organization") - .returnBundle(Bundle.class) - .execute(); + Bundle result1 = myClient + .search() + .forResource("Organization") + .returnBundle(Bundle.class) + .execute(); final String uuid1 = toSearchUuidFromLinkNext(result1); - Bundle result2 = ourClient - .search() - .forResource("Organization") - .returnBundle(Bundle.class) - .execute(); + Bundle result2 = myClient + .search() + .forResource("Organization") + .returnBundle(Bundle.class) + .execute(); final String uuid2 = toSearchUuidFromLinkNext(result2); @@ -2903,37 +2909,37 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName("HELLO"); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); myDaoConfig.setReuseCachedSearchResultsForMillis(null); - Bundle result1 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result1 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); final String uuid1 = toSearchUuidFromLinkNext(result1); - Bundle result2 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result2 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); final String uuid2 = toSearchUuidFromLinkNext(result2); - Bundle result3 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result3 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); String uuid3 = toSearchUuidFromLinkNext(result3); @@ -2949,17 +2955,17 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName("HELLO"); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); myDaoConfig.setReuseCachedSearchResultsForMillis(1000L); - Bundle result1 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result1 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); final String uuid1 = toSearchUuidFromLinkNext(result1); Search search1 = newTxTemplate().execute(new TransactionCallback() { @@ -2970,13 +2976,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { }); Date lastReturned1 = search1.getSearchLastReturned(); - Bundle result2 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result2 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); final String uuid2 = toSearchUuidFromLinkNext(result2); Search search2 = newTxTemplate().execute(new TransactionCallback() { @@ -2991,13 +2997,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Thread.sleep(1500); - Bundle result3 = ourClient - .search() - .forResource("Organization") - .where(Organization.NAME.matches().value("HELLO")) - .count(5) - .returnBundle(Bundle.class) - .execute(); + Bundle result3 = myClient + .search() + .forResource("Organization") + .where(Organization.NAME.matches().value("HELLO")) + .count(5) + .returnBundle(Bundle.class) + .execute(); String uuid3 = toSearchUuidFromLinkNext(result3); @@ -3013,15 +3019,15 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName("HELLO"); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); myDaoConfig.setReuseCachedSearchResultsForMillis(100000L); - Bundle result1 = ourClient - .search() - .forResource("Organization") - .returnBundle(Bundle.class) - .execute(); + Bundle result1 = myClient + .search() + .forResource("Organization") + .returnBundle(Bundle.class) + .execute(); final String uuid1 = toSearchUuidFromLinkNext(result1); Search search1 = newTxTemplate().execute(new TransactionCallback() { @@ -3032,11 +3038,11 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { }); Date lastReturned1 = search1.getSearchLastReturned(); - Bundle result2 = ourClient - .search() - .forResource("Organization") - .returnBundle(Bundle.class) - .execute(); + Bundle result2 = myClient + .search() + .forResource("Organization") + .returnBundle(Bundle.class) + .execute(); final String uuid2 = toSearchUuidFromLinkNext(result2); Search search2 = newTxTemplate().execute(new TransactionCallback() { @@ -3060,34 +3066,28 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system2").setValue("testSearchTokenParam002"); patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); - ourClient.create().resource(patient).execute(); + myClient.create().resource(patient).execute(); - //@formatter:off - Bundle response = ourClient - .search() - .forResource(Patient.class) - .returnBundle(Bundle.class) - .execute(); - //@formatter:on + Bundle response = myClient + .search() + .forResource(Patient.class) + .returnBundle(Bundle.class) + .execute(); patient = (Patient) response.getEntry().get(0).getResource(); - //@formatter:off - ourClient + myClient .meta() .add() .onResource(patient.getIdElement()) .meta(new Meta().addTag("http://system", "tag1", "display")) .execute(); - //@formatter:on - //@formatter:off - response = ourClient - .search() - .forResource(Patient.class) - .returnBundle(Bundle.class) - .execute(); - //@formatter:on + response = myClient + .search() + .forResource(Patient.class) + .returnBundle(Bundle.class) + .execute(); patient = (Patient) response.getEntry().get(0).getResource(); assertEquals(1, patient.getMeta().getTag().size()); @@ -3099,7 +3099,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { patient.addIdentifier().setSystem("urn:system").setValue("testSearchTokenParam001"); patient.addName().setFamily("Tester").addGiven("testSearchTokenParam1"); patient.addCommunication().getLanguage().setText("testSearchTokenParamComText").addCoding().setCode("testSearchTokenParamCode").setSystem("testSearchTokenParamSystem") - .setDisplay("testSearchTokenParamDisplay"); + .setDisplay("testSearchTokenParamDisplay"); myPatientDao.create(patient, mySrd); patient = new Patient(); @@ -3112,14 +3112,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { patient.addName().setFamily("Tester").addGiven("testSearchTokenParam2"); myPatientDao.create(patient, mySrd); - //@formatter:off - Bundle response = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.hasSystemWithAnyCode("urn:system")) - .returnBundle(Bundle.class) - .execute(); - //@formatter:on + Bundle response = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.hasSystemWithAnyCode("urn:system")) + .returnBundle(Bundle.class) + .execute(); assertEquals(2, response.getEntry().size()); } @@ -3127,21 +3125,29 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { @Test public void testSearchWithCountNotSet() throws Exception { mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(1); - mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(300); + mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(200); - for (int i =0; i < 10; i++) { + for (int i = 0; i < 10; i++) { Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("test" + i); - ourClient.create().resource(pat).execute(); + myClient.create().resource(pat).execute(); } - Bundle found = ourClient + StopWatch sw = new StopWatch(); + + ourLog.info("** About to search with count of 1"); + + Bundle found = myClient .search() .forResource(Patient.class) .returnBundle(Bundle.class) .count(1) .execute(); + ourLog.info("** Done searching with count of 1"); + + assertThat(sw.getMillis(), lessThan(1000L)); + // If this fails under load, try increasing the throttle above assertEquals(null, found.getTotalElement().getValue()); assertEquals(1, found.getEntry().size()); @@ -3153,19 +3159,23 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(200); myDaoConfig.setCountSearchResultsUpTo(20); - for (int i =0; i < 10; i++) { + for (int i = 0; i < 10; i++) { Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("test" + i); - ourClient.create().resource(pat).execute(); + myClient.create().resource(pat).execute(); } - Bundle found = ourClient + StopWatch sw = new StopWatch(); + + Bundle found = myClient .search() .forResource(Patient.class) .returnBundle(Bundle.class) .count(1) .execute(); + assertThat(sw.getMillis(), not(lessThan(1000L))); + // If this fails under load, try increasing the throttle above assertEquals(10, found.getTotalElement().getValue().intValue()); assertEquals(1, found.getEntry().size()); @@ -3174,22 +3184,26 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { @Test public void testSearchWithCountSearchResultsUpTo5() throws Exception { mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(1); - mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(300); + mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(200); myDaoConfig.setCountSearchResultsUpTo(5); - for (int i =0; i < 10; i++) { + for (int i = 0; i < 10; i++) { Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("test" + i); - ourClient.create().resource(pat).execute(); + myClient.create().resource(pat).execute(); } - Bundle found = ourClient + StopWatch sw = new StopWatch(); + + Bundle found = myClient .search() .forResource(Patient.class) .returnBundle(Bundle.class) .count(1) .execute(); + assertThat(sw.getMillis(), lessThan(1000L)); + // If this fails under load, try increasing the throttle above assertEquals(null, found.getTotalElement().getValue()); assertEquals(1, found.getEntry().size()); @@ -3197,10 +3211,10 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { @Test public void testSearchWithEmptyParameter() throws Exception { - Observation obs= new Observation(); + Observation obs = new Observation(); obs.setStatus(ObservationStatus.FINAL); obs.getCode().addCoding().setSystem("foo").setCode("bar"); - ourClient.create().resource(obs).execute(); + myClient.create().resource(obs).execute(); testSearchWithEmptyParameter("/Observation?value-quantity="); testSearchWithEmptyParameter("/Observation?code=bar&value-quantity="); @@ -3227,23 +3241,21 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testSearchWithInclude() throws Exception { Organization org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude01"); - IdType orgId = (IdType) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IdType orgId = (IdType) myClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude02"); pat.getManagingOrganization().setReferenceElement(orgId.toUnqualifiedVersionless()); - ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); + myClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); - //@formatter:off - Bundle found = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system:rpdstu2","testSearchWithInclude02")) - .include(Patient.INCLUDE_ORGANIZATION) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); - //@formatter:on + Bundle found = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system:rpdstu2", "testSearchWithInclude02")) + .include(Patient.INCLUDE_ORGANIZATION) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); assertEquals(2, found.getEntry().size()); assertEquals(Patient.class, found.getEntry().get(0).getResource().getClass()); @@ -3256,13 +3268,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { public void testSearchWithInvalidNumberPrefix() throws Exception { try { //@formatter:off - ourClient - .search() - .forResource(Encounter.class) - .where(Encounter.LENGTH.withPrefix(ParamPrefixEnum.ENDS_BEFORE).number(100)) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + myClient + .search() + .forResource(Encounter.class) + .where(Encounter.LENGTH.withPrefix(ParamPrefixEnum.ENDS_BEFORE).number(100)) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on fail(); } catch (InvalidRequestException e) { @@ -3277,13 +3289,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { myObservationDao.create(o, mySrd); try { //@formatter:off - ourClient - .search() - .forResource(Observation.class) - .where(Observation.VALUE_QUANTITY.withPrefix(ParamPrefixEnum.ENDS_BEFORE).number(100).andNoUnits()) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + myClient + .search() + .forResource(Observation.class) + .where(Observation.VALUE_QUANTITY.withPrefix(ParamPrefixEnum.ENDS_BEFORE).number(100).andNoUnits()) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on fail(); } catch (InvalidRequestException e) { @@ -3297,13 +3309,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { o.getCode().setText("testSearchWithInvalidSort"); myObservationDao.create(o, mySrd); //@formatter:off - ourClient - .search() - .forResource(Observation.class) - .sort().ascending(Observation.CODE_VALUE_QUANTITY) // composite sort not supported yet - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + myClient + .search() + .forResource(Observation.class) + .sort().ascending(Observation.CODE_VALUE_QUANTITY) // composite sort not supported yet + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on } @@ -3314,13 +3326,13 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { String methodName = "testSearchWithMissing"; Organization org = new Organization(); - IIdType deletedIdMissingTrue = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); - ourClient.delete().resourceById(deletedIdMissingTrue).execute(); + IIdType deletedIdMissingTrue = myClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); + myClient.delete().resourceById(deletedIdMissingTrue).execute(); org = new Organization(); org.setName("Help I'm a Bug"); - IIdType deletedIdMissingFalse = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); - ourClient.delete().resourceById(deletedIdMissingFalse).execute(); + IIdType deletedIdMissingFalse = myClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); + myClient.delete().resourceById(deletedIdMissingFalse).execute(); List resources = new ArrayList(); for (int i = 0; i < 20; i++) { @@ -3328,27 +3340,27 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { org.setName(methodName + "_0" + i); resources.add(org); } - ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + myClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue(methodName + "01"); org.setName(methodName + "name"); - IIdType orgNotMissing = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); + IIdType orgNotMissing = myClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue(methodName + "01"); - IIdType orgMissing = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); + IIdType orgMissing = myClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); { //@formatter:off - Bundle found = ourClient - .search() - .forResource(Organization.class) - .where(Organization.NAME.isMissing(false)) - .count(100) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle found = myClient + .search() + .forResource(Organization.class) + .where(Organization.NAME.isMissing(false)) + .count(100) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on List list = toUnqualifiedVersionlessIds(found); @@ -3360,15 +3372,15 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } //@formatter:off - Bundle found = ourClient - .search() - .forResource(Organization.class) - .where(Organization.NAME.isMissing(true)) - .count(100) - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); - //@formatter:on + Bundle found = myClient + .search() + .forResource(Organization.class) + .where(Organization.NAME.isMissing(true)) + .count(100) + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); + //@formatter:on List list = toUnqualifiedVersionlessIds(found); ourLog.info(methodName + " found: " + list.toString() + " - Wanted " + orgMissing + " but not " + orgNotMissing); @@ -3414,7 +3426,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { /** * See #411 - * + *

* Let's see if we can reproduce this issue in JPA */ @Test @@ -3448,7 +3460,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Observation obs = new Observation(); obs.getCode().setText("THIS_IS_THE_TEXT"); obs.getCode().addCoding().setSystem("SYSTEM").setCode("CODE").setDisplay("THIS_IS_THE_DISPLAY"); - ourClient.create().resource(obs).execute(); + myClient.create().resource(obs).execute(); testSearchReturnsResults("/Observation?code%3Atext=THIS_IS_THE_TEXT"); testSearchReturnsResults("/Observation?code%3Atext=THIS_IS_THE_"); @@ -3467,119 +3479,119 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Daniel").setFamily("Adams"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Aaron").setFamily("Alexis"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Carol").setFamily("Allen"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Ruth").setFamily("Black"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Brian").setFamily("Brooks"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Susan").setFamily("Clark"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Amy").setFamily("Clark"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Anthony").setFamily("Coleman"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Steven").setFamily("Coleman"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Lisa").setFamily("Coleman"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Ruth").setFamily("Cook"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Betty").setFamily("Davis"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Joshua").setFamily("Diaz"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Brian").setFamily("Gracia"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Stephan").setFamily("Graham"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addGiven("Sarah").setFamily("Graham"); - ourClient.create().resource(p).execute(); + myClient.create().resource(p).execute(); - Bundle resp = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", methodName)) - .sort().ascending(Patient.FAMILY) - .sort().ascending(Patient.GIVEN) - .count(100) - .returnBundle(Bundle.class) - .execute(); + Bundle resp = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", methodName)) + .sort().ascending(Patient.FAMILY) + .sort().ascending(Patient.GIVEN) + .count(100) + .returnBundle(Bundle.class) + .execute(); List names = toNameList(resp); ourLog.info(StringUtils.join(names, '\n')); assertThat(names, contains( // this matches in order only - "Daniel Adams", - "Aaron Alexis", - "Carol Allen", - "Ruth Black", - "Brian Brooks", - "Amy Clark", - "Susan Clark", - "Anthony Coleman", - "Lisa Coleman", - "Steven Coleman", - "Ruth Cook", - "Betty Davis", - "Joshua Diaz", - "Brian Gracia", - "Sarah Graham", - "Stephan Graham")); + "Daniel Adams", + "Aaron Alexis", + "Carol Allen", + "Ruth Black", + "Brian Brooks", + "Amy Clark", + "Susan Clark", + "Anthony Coleman", + "Lisa Coleman", + "Steven Coleman", + "Ruth Cook", + "Betty Davis", + "Joshua Diaz", + "Brian Gracia", + "Sarah Graham", + "Stephan Graham")); } @@ -3591,7 +3603,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Organization org = new Organization(); org.setName("測試醫院"); org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); - IdType orgId = (IdType) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IdType orgId = (IdType) myClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); // Read back directly from the DAO { @@ -3602,7 +3614,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } // Read back through the HTTP API { - Organization returned = ourClient.read(Organization.class, orgId.getIdPart()); + Organization returned = myClient.read(Organization.class, orgId.getIdPart()); String val = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned); ourLog.info(val); assertThat(val, containsString("")); @@ -3632,7 +3644,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { p1.setManagingOrganization(new Reference("Organization/99999999999")); try { - ourClient.create().resource(p1).execute().getId(); + myClient.create().resource(p1).execute().getId(); fail(); } catch (InvalidRequestException e) { assertThat(e.getMessage(), containsString("Organization/99999999999")); @@ -3657,7 +3669,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(400, response.getStatusLine().getStatusCode()); OperationOutcome oo = myFhirCtx.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])")); + 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(); } @@ -3718,7 +3730,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().setFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); - IdType p1id = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType p1id = (IdType) myClient.create().resource(p1).execute().getId(); // Try to update with the wrong ID in the resource body p1.setId("FOO"); @@ -3735,9 +3747,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(400, response.getStatusLine().getStatusCode()); OperationOutcome oo = myFhirCtx.newJsonParser().parseResource(OperationOutcome.class, new InputStreamReader(response.getEntity().getContent())); assertEquals( - "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() + "\"", - oo.getIssue().get(0).getDiagnostics()); + "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() + "\"", + oo.getIssue().get(0).getDiagnostics()); } finally { response.close(); } @@ -3779,20 +3791,20 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().setFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); - IdType p1id = (IdType) ourClient.create().resource(p1).execute().getId(); + IdType p1id = (IdType) myClient.create().resource(p1).execute().getId(); Organization p2 = new Organization(); p2.setId(p1id.getIdPart()); p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); try { - ourClient.update().resource(p2).withId("Organization/" + p1id.getIdPart()).execute(); + myClient.update().resource(p2).withId("Organization/" + p1id.getIdPart()).execute(); fail(); } catch (UnprocessableEntityException e) { // good } try { - ourClient.update().resource(p2).withId("Patient/" + p1id.getIdPart()).execute(); + myClient.update().resource(p2).withId("Patient/" + p1id.getIdPart()).execute(); fail(); } catch (UnprocessableEntityException e) { // good @@ -3968,21 +3980,21 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2"); - MethodOutcome outcome = ourClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2").execute(); + MethodOutcome outcome = myClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2").execute(); assertEquals(true, outcome.getCreated().booleanValue()); IdType p1Id = (IdType) outcome.getId(); assertThat(p1Id.getValue(), containsString("Patient/testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2/_history")); //@formatter:off - Bundle actual = ourClient - .search() - .forResource(Patient.class) - .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2")) - .encodedJson() - .prettyPrint() - .returnBundle(Bundle.class) - .execute(); + Bundle actual = myClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2")) + .encodedJson() + .prettyPrint() + .returnBundle(Bundle.class) + .execute(); //@formatter:on assertEquals(1, actual.getEntry().size()); @@ -3996,7 +4008,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { Patient pt = new Patient(); pt.addName().setFamily(methodName); - IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(pt).execute().getId().toUnqualifiedVersionless(); pt.addName().setFamily("FAM2"); pt.setId(id.toUnqualifiedVersionless()); @@ -4049,8 +4061,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(400, response.getStatusLine().getStatusCode()); OperationOutcome oo = myFhirCtx.newXmlParser().parseResource(OperationOutcome.class, responseString); assertEquals( - "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()); + "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()); } finally { response.close(); } @@ -4061,12 +4073,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { String input = IOUtils.toString(getClass().getResourceAsStream("/dstu3-person.json"), StandardCharsets.UTF_8); try { - MethodOutcome resp = ourClient.update().resource(input).withId("Patient/PERSON1").execute(); + MethodOutcome resp = myClient.update().resource(input).withId("Patient/PERSON1").execute(); } catch (InvalidRequestException e) { assertEquals("", e.getMessage()); } - MethodOutcome resp = ourClient.update().resource(input).withId("Person/PERSON1").execute(); + MethodOutcome resp = myClient.update().resource(input).withId("Person/PERSON1").execute(); assertEquals("Person/PERSON1/_history/1", resp.getId().toUnqualified().getValue()); } @@ -4129,7 +4141,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(412, response.getStatusLine().getStatusCode()); assertThat(resp, not(containsString("Resource has no id"))); assertThat(resp, - stringContainsInOrder(">ERROR<", "[Patient.contact]", "

SHALL at least contain a contact's details or a reference to an organization", ""));
+				stringContainsInOrder(">ERROR<", "[Patient.contact]", "
SHALL at least contain a contact's details or a reference to an organization", ""));
 		} finally {
 			IOUtils.closeQuietly(response.getEntity().getContent());
 			response.close();
@@ -4241,8 +4253,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
 			assertThat(resp, not(containsString("Resource has no id")));
 			assertThat(resp, containsString("
No issues detected during validation
")); assertThat(resp, - stringContainsInOrder("", "", "", "", - "")); + stringContainsInOrder("", "", "", "", + "")); } finally { IOUtils.closeQuietly(response.getEntity().getContent()); response.close(); @@ -4268,8 +4280,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertThat(resp, not(containsString("Resource has no id"))); assertThat(resp, containsString("
No issues detected during validation
")); assertThat(resp, - stringContainsInOrder("", "", "", "", - "")); + stringContainsInOrder("", "", "", "", + "")); } finally { IOUtils.closeQuietly(response.getEntity().getContent()); response.close(); @@ -4279,10 +4291,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"))); - ourClient.create().resource(cs).execute(); + myClient.create().resource(cs).execute(); ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderR4Test.class.getResourceAsStream("/extensional-case-3-vs.xml"))); - IIdType vsid = ourClient.create().resource(upload).execute().getId().toUnqualifiedVersionless(); + IIdType vsid = myClient.create().resource(upload).execute().getId().toUnqualifiedVersionless(); HttpGet get = new HttpGet(ourServerBase + "/ValueSet/" + vsid.getIdPart() + "/$expand"); CloseableHttpResponse response = ourHttpClient.execute(get); @@ -4320,8 +4332,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { assertEquals(200, response.getStatusLine().getStatusCode()); //@formatter:off assertThat(resp, stringContainsInOrder( - "", - "")); + "", + "")); //@formatter:on } finally { IOUtils.closeQuietly(response.getEntity().getContent()); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetTest.java index b8cb2a801bc..216e3c168e0 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetTest.java @@ -121,7 +121,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { @Test public void testExpandById() throws IOException { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onInstance(myExtensionalVsId) .named("expand") @@ -152,7 +152,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { public void testExpandByIdWithFilter() throws IOException { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onInstance(myExtensionalVsId) .named("expand") @@ -170,7 +170,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { @Test public void testExpandByUrl() { - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("expand") @@ -190,7 +190,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { public void testExpandByValueSet() throws IOException { ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml"); - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("expand") @@ -213,7 +213,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { assertNotNull(myLocalValueSetId); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("expand") @@ -235,7 +235,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { myLocalVs.setId(""); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("expand") @@ -257,7 +257,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { public void testExpandInvalidParams() throws IOException { //@formatter:off try { - ourClient + myClient .operation() .onType(ValueSet.class) .named("expand") @@ -272,7 +272,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { //@formatter:off try { ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case-r4.xml"); - ourClient + myClient .operation() .onType(ValueSet.class) .named("expand") @@ -288,7 +288,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { //@formatter:off try { ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/r4/extensional-case.xml"); - ourClient + myClient .operation() .onInstance(myExtensionalVsId) .named("expand") @@ -309,7 +309,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { assertNotNull(myLocalValueSetId); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onInstance(myLocalValueSetId) .named("expand") @@ -330,7 +330,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { assertNotNull(myLocalValueSetId); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onInstance(myLocalValueSetId) .named("expand") @@ -354,7 +354,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { assertNotNull(myLocalValueSetId); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("expand") @@ -379,7 +379,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { //@formatter:off try { - ourClient + myClient .operation() .onInstance(myLocalValueSetId) .named("expand") @@ -419,7 +419,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { @Test public void testValidateCodeOperationByCodeAndSystemInstance() { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onInstance(myExtensionalVsId) .named("validate-code") @@ -437,7 +437,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { @Test public void testValidateCodeOperationByCodeAndSystemType() { //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("validate-code") @@ -454,7 +454,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test { @Test public void testValiedateCodeAgainstBuiltInSystem() { - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onType(ValueSet.class) .named("validate-code") diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/StaleSearchDeletingSvcR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/StaleSearchDeletingSvcR4Test.java index 8334a1d3bd8..998e8250a57 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/StaleSearchDeletingSvcR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/StaleSearchDeletingSvcR4Test.java @@ -56,7 +56,7 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test { } //@formatter:off - IClientExecutable, Bundle> search = ourClient + IClientExecutable, Bundle> search = myClient .search() .forResource(Patient.class) .where(Patient.NAME.matches().value("Everything")) @@ -74,12 +74,12 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test { String nextLinkUrl = nextLink.getUrl(); assertThat(nextLinkUrl, not(blankOrNullString())); - Bundle resp2 = ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); + Bundle resp2 = myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(resp2)); myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem(); - ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); + myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); Thread.sleep(20); myDaoConfig.setExpireSearchResultsAfterMillis(10); @@ -87,7 +87,7 @@ public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test { myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem(); try { - ourClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); + myClient.search().byUrl(nextLinkUrl).returnBundle(Bundle.class).execute(); fail(); } catch (ResourceGoneException e) { assertThat(e.getMessage(), containsString("does not exist and may have expired")); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SubscriptionsR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SubscriptionsR4Test.java index eac3edd6280..8724c3fdffa 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SubscriptionsR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SubscriptionsR4Test.java @@ -57,7 +57,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.getChannel().setEndpoint("http://localhost:8888"); subs.setCriteria("Observation?identifier=123"); try { - ourClient.create().resource(subs).execute(); + myClient.create().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); @@ -65,14 +65,14 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.setId("ABC"); try { - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); } subs.setStatus(SubscriptionStatus.REQUESTED); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); } @Test @@ -84,7 +84,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.setStatus(SubscriptionStatus.ACTIVE); subs.setCriteria("Observation?identifier=123"); try { - ourClient.create().resource(subs).execute(); + myClient.create().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage()); @@ -92,7 +92,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.setId("ABC"); try { - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertEquals("HTTP 422 Unprocessable Entity: Subscription.status must be 'off' or 'requested' on a newly created subscription", e.getMessage()); @@ -109,13 +109,13 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.getChannel().setEndpoint("http://localhost:8888"); subs.setStatus(SubscriptionStatus.REQUESTED); subs.setCriteria("Observation?identifier=123"); - IIdType id = ourClient.create().resource(subs).execute().getId().toUnqualifiedVersionless(); + IIdType id = myClient.create().resource(subs).execute().getId().toUnqualifiedVersionless(); subs.setId(id); try { subs.setStatus(SubscriptionStatus.ACTIVE); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage()); @@ -123,7 +123,7 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { try { subs.setStatus((SubscriptionStatus) null); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); @@ -141,12 +141,12 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { subs.getChannel().setEndpoint("http://localhost:8888"); subs.setCriteria("Observation?identifier=123"); subs.setStatus(SubscriptionStatus.REQUESTED); - IIdType id = ourClient.create().resource(subs).execute().getId(); + IIdType id = myClient.create().resource(subs).execute().getId(); subs.setId(id); try { subs.setStatus(SubscriptionStatus.ACTIVE); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertEquals("HTTP 422 Unprocessable Entity: Subscription.status can not be changed from 'requested' to 'active'", e.getMessage()); @@ -154,14 +154,14 @@ public class SubscriptionsR4Test extends BaseResourceProviderR4Test { try { subs.setStatus((SubscriptionStatus) null); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); fail(); } catch (UnprocessableEntityException e) { assertThat(e.getMessage(), containsString("Subscription.status must be populated on this server")); } subs.setStatus(SubscriptionStatus.OFF); - ourClient.update().resource(subs).execute(); + myClient.update().resource(subs).execute(); } @AfterClass diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/TerminologyUploaderProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/TerminologyUploaderProviderR4Test.java index 708d05d6ac6..e15dee56274 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/TerminologyUploaderProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/TerminologyUploaderProviderR4Test.java @@ -43,7 +43,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes byte[] packageBytes = createSctZip(); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onServer() .named("upload-external-code-system") @@ -63,7 +63,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes byte[] packageBytes = createLoincZip(); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onServer() .named("upload-external-code-system") @@ -82,7 +82,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes */ //@formatter:off - respParam = ourClient + respParam = myClient .operation() .onServer() .named("upload-external-code-system") @@ -107,7 +107,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes fos.close(); //@formatter:off - Parameters respParam = ourClient + Parameters respParam = myClient .operation() .onServer() .named("upload-external-code-system") @@ -128,7 +128,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes //@formatter:off try { - ourClient + myClient .operation() .onServer() .named("upload-external-code-system") @@ -148,7 +148,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes //@formatter:off try { - ourClient + myClient .operation() .onServer() .named("upload-external-code-system") @@ -165,7 +165,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes public void testUploadMissingPackage() throws Exception { //@formatter:off try { - ourClient + myClient .operation() .onServer() .named("upload-external-code-system") diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/search/r4/PagingMultinodeProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/search/r4/PagingMultinodeProviderR4Test.java index 851f28a3dbf..121debf6f37 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/search/r4/PagingMultinodeProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/search/r4/PagingMultinodeProviderR4Test.java @@ -61,7 +61,7 @@ public class PagingMultinodeProviderR4Test extends BaseResourceProviderR4Test { mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10); mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true); - found = ourClient + found = myClient .search() .forResource(Patient.class) .sort().ascending(Patient.SP_FAMILY) @@ -70,19 +70,19 @@ public class PagingMultinodeProviderR4Test extends BaseResourceProviderR4Test { .execute(); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A000", "Patient/A001", "Patient/A002", "Patient/A003", "Patient/A004", "Patient/A005", "Patient/A006", "Patient/A007", "Patient/A008", "Patient/A009")); - found = ourClient + found = myClient .loadPage() .next(found) .execute(); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A010", "Patient/A011", "Patient/A012", "Patient/A013", "Patient/A014", "Patient/A015", "Patient/A016", "Patient/A017", "Patient/A018", "Patient/A019")); - found = ourClient + found = myClient .loadPage() .next(found) .execute(); assertThat(toUnqualifiedVersionlessIdValues(found), contains("Patient/A020", "Patient/A021", "Patient/A022", "Patient/A023", "Patient/A024", "Patient/A025", "Patient/A026", "Patient/A027", "Patient/A028", "Patient/A029")); - found = ourClient + found = myClient .loadPage() .next(found) .execute(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookActivatesPreExistingSubscriptionsR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookActivatesPreExistingSubscriptionsR4Test.java index 27b6935593e..9dea424bd06 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookActivatesPreExistingSubscriptionsR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookActivatesPreExistingSubscriptionsR4Test.java @@ -54,7 +54,7 @@ public class RestHookActivatesPreExistingSubscriptionsR4Test extends BaseResourc channel.setPayload(thePayload); channel.setEndpoint(theEndpoint); - MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); + MethodOutcome methodOutcome = myClient.create().resource(subscription).execute(); subscription.setId(methodOutcome.getId().getIdPart()); waitForQueueToDrain(); @@ -71,7 +71,7 @@ public class RestHookActivatesPreExistingSubscriptionsR4Test extends BaseResourc observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome = myClient.create().resource(observation).execute(); String observationId = methodOutcome.getId().getIdPart(); observation.setId(observationId); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestR4Test.java index 78505b03617..a8a5d3a702d 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestR4Test.java @@ -53,14 +53,14 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { for (IIdType next : mySubscriptionIds) { IIdType nextId = next.toUnqualifiedVersionless(); ourLog.info("Deleting: {}", nextId); - ourClient.delete().resourceById(nextId).execute(); + myClient.delete().resourceById(nextId).execute(); } mySubscriptionIds.clear(); myDaoConfig.setAllowMultipleDelete(true); ourLog.info("Deleting all subscriptions"); - ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); - ourClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); + myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); + myClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); ourLog.info("Done deleting all subscriptions"); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); @@ -91,7 +91,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { channel.setPayload(thePayload); channel.setEndpoint(theEndpoint); - MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); + MethodOutcome methodOutcome = myClient.create().resource(subscription).execute(); subscription.setId(methodOutcome.getId().getIdPart()); mySubscriptionIds.add(methodOutcome.getId()); @@ -109,7 +109,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome = myClient.create().resource(observation).execute(); String observationId = methodOutcome.getId().getIdPart(); observation.setId(observationId); @@ -156,11 +156,11 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(1, ourUpdatedObservations); assertEquals(Constants.CT_FHIR_JSON_NEW, ourContentTypes.get(0)); - Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); + Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId()); Assert.assertNotNull(subscriptionTemp); subscriptionTemp.setCriteria(criteria1); - ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); + myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); waitForQueueToDrain(); Observation observation2 = sendObservation(code, "SNOMED-CT"); @@ -170,7 +170,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(0, ourCreatedObservations); waitForSize(3, ourUpdatedObservations); - ourClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); + myClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); waitForQueueToDrain(); Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); @@ -180,27 +180,27 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3 = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept = new CodeableConcept(); observation3.setCode(codeableConcept); Coding coding = codeableConcept.addCoding(); coding.setCode(code + "111"); coding.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); + myClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); // Should see no subscription notification waitForQueueToDrain(); waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3a = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept1 = new CodeableConcept(); observation3a.setCode(codeableConcept1); Coding coding1 = codeableConcept1.addCoding(); coding1.setCode(code); coding1.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); + myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); // Should see only one subscription notification waitForQueueToDrain(); @@ -231,10 +231,10 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(1, ourUpdatedObservations); assertEquals(Constants.CT_FHIR_XML_NEW, ourContentTypes.get(0)); - Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); + Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId()); Assert.assertNotNull(subscriptionTemp); subscriptionTemp.setCriteria(criteria1); - ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); + myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); waitForQueueToDrain(); Observation observation2 = sendObservation(code, "SNOMED-CT"); @@ -244,7 +244,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(0, ourCreatedObservations); waitForSize(3, ourUpdatedObservations); - ourClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); + myClient.delete().resourceById(new IdType("Subscription/" + subscription2.getId())).execute(); Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); @@ -253,27 +253,27 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3 = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept = new CodeableConcept(); observation3.setCode(codeableConcept); Coding coding = codeableConcept.addCoding(); coding.setCode(code + "111"); coding.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); + myClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); // Should see no subscription notification waitForQueueToDrain(); waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3a = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept1 = new CodeableConcept(); observation3a.setCode(codeableConcept1); Coding coding1 = codeableConcept1.addCoding(); coding1.setCode(code); coding1.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); + myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); // Should see only one subscription notification waitForQueueToDrain(); @@ -333,7 +333,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { subscription.getChannel().addHeader("X-Foo: FOO"); subscription.getChannel().addHeader("X-Bar: BAR"); subscription.setStatus(Subscription.SubscriptionStatus.REQUESTED); - ourClient.update().resource(subscription).execute(); + myClient.update().resource(subscription).execute(); waitForQueueToDrain(); sendObservation(code, "SNOMED-CT"); @@ -364,7 +364,7 @@ public class RestHookTestR4Test extends BaseResourceProviderR4Test { // Disable subscription.setStatus(Subscription.SubscriptionStatus.OFF); - ourClient.update().resource(subscription).execute(); + myClient.update().resource(subscription).execute(); waitForQueueToDrain(); // Send another object diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestWithInterceptorRegisteredToDaoConfigR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestWithInterceptorRegisteredToDaoConfigR4Test.java index 48c54cdedee..32e418e82a8 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestWithInterceptorRegisteredToDaoConfigR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookTestWithInterceptorRegisteredToDaoConfigR4Test.java @@ -1,8 +1,6 @@ package ca.uhn.fhir.jpa.subscription.r4; -import static org.junit.Assert.*; - import java.util.List; import org.eclipse.jetty.server.Server; @@ -46,7 +44,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base public void afterUnregisterRestHookListener() { myDaoConfig.setAllowMultipleDelete(true); ourLog.info("Deleting all subscriptions"); - ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); + myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); ourLog.info("Done deleting all subscriptions"); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); @@ -76,7 +74,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base channel.setEndpoint(endpoint); subscription.setChannel(channel); - MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute(); + MethodOutcome methodOutcome = myClient.create().resource(subscription).execute(); subscription.setId(methodOutcome.getId().getIdPart()); waitForQueueToDrain(); @@ -101,7 +99,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome = myClient.create().resource(observation).execute(); String observationId = methodOutcome.getId().getIdPart(); observation.setId(observationId); @@ -129,11 +127,11 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(1, ourUpdatedObservations); - Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); + Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId()); Assert.assertNotNull(subscriptionTemp); subscriptionTemp.setCriteria(criteria1); - ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); + myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); Observation observation2 = sendObservation(code, "SNOMED-CT"); @@ -143,7 +141,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(3, ourUpdatedObservations); - ourClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); + myClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); @@ -152,27 +150,27 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3 = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept = new CodeableConcept(); observation3.setCode(codeableConcept); Coding coding = codeableConcept.addCoding(); coding.setCode(code + "111"); coding.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); + myClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); // Should see no subscription notification Thread.sleep(500); waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3a = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept1 = new CodeableConcept(); observation3a.setCode(codeableConcept1); Coding coding1 = codeableConcept1.addCoding(); coding1.setCode(code); coding1.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); + myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); // Should see only one subscription notification Thread.sleep(500); @@ -202,11 +200,11 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(1, ourUpdatedObservations); - Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId()); + Subscription subscriptionTemp = myClient.read(Subscription.class, subscription2.getId()); Assert.assertNotNull(subscriptionTemp); subscriptionTemp.setCriteria(criteria1); - ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); + myClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute(); Observation observation2 = sendObservation(code, "SNOMED-CT"); @@ -216,7 +214,7 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(3, ourUpdatedObservations); - ourClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); + myClient.delete().resourceById(new IdDt("Subscription", subscription2.getId())).execute(); Observation observationTemp3 = sendObservation(code, "SNOMED-CT"); @@ -225,27 +223,27 @@ public class RestHookTestWithInterceptorRegisteredToDaoConfigR4Test extends Base waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3 = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept = new CodeableConcept(); observation3.setCode(codeableConcept); Coding coding = codeableConcept.addCoding(); coding.setCode(code + "111"); coding.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); + myClient.update().resource(observation3).withId(observation3.getIdElement()).execute(); // Should see no subscription notification waitForQueueToDrain(); waitForSize(0, ourCreatedObservations); waitForSize(4, ourUpdatedObservations); - Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId()); + Observation observation3a = myClient.read(Observation.class, observationTemp3.getId()); CodeableConcept codeableConcept1 = new CodeableConcept(); observation3a.setCode(codeableConcept1); Coding coding1 = codeableConcept1.addCoding(); coding1.setCode(code); coding1.setSystem("SNOMED-CT"); - ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); + myClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute(); // Should see only one subscription notification waitForQueueToDrain(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookWithEventDefinitionR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookWithEventDefinitionR4Test.java index 2a0eae5a583..d32b823f680 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookWithEventDefinitionR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/RestHookWithEventDefinitionR4Test.java @@ -52,14 +52,14 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes @After public void afterUnregisterRestHookListener() { for (IIdType next : mySubscriptionIds) { - ourClient.delete().resourceById(next).execute(); + myClient.delete().resourceById(next).execute(); } mySubscriptionIds.clear(); myDaoConfig.setAllowMultipleDelete(true); ourLog.info("Deleting all subscriptions"); - ourClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); - ourClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); + myClient.delete().resourceConditionalByUrl("Subscription?status=active").execute(); + myClient.delete().resourceConditionalByUrl("Observation?code:missing=false").execute(); ourLog.info("Done deleting all subscriptions"); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); @@ -83,7 +83,7 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes */ Patient patient = FhirR4Util.getPatient(); - MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); + MethodOutcome methodOutcome = myClient.create().resource(patient).execute(); myPatientId = methodOutcome.getId().getIdPart(); /* @@ -114,7 +114,7 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes channel.setPayload("application/json"); subscription.setChannel(channel); - methodOutcome = ourClient.create().resource(subscription).execute(); + methodOutcome = myClient.create().resource(subscription).execute(); mySubscriptionId = methodOutcome.getId().getIdPart(); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithCriteriaR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithCriteriaR4Test.java index dfe9b283c9f..316c9caeba3 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithCriteriaR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithCriteriaR4Test.java @@ -49,7 +49,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test { */ Patient patient = FhirR4Util.getPatient(); - MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); + MethodOutcome methodOutcome = myClient.create().resource(patient).execute(); myPatientId = methodOutcome.getId().getIdPart(); /* @@ -66,7 +66,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test { channel.setPayload("application/json"); subscription.setChannel(channel); - methodOutcome = ourClient.create().resource(subscription).execute(); + methodOutcome = myClient.create().resource(subscription).execute(); mySubscriptionId = methodOutcome.getId().getIdPart(); /* @@ -105,7 +105,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test { observation.setSubject(reference); observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute(); String observationId = methodOutcome2.getId().getIdPart(); observation.setId(observationId); @@ -129,7 +129,7 @@ public class WebsocketWithCriteriaR4Test extends BaseResourceProviderR4Test { observation.setSubject(reference); observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute(); String observationId = methodOutcome2.getId().getIdPart(); observation.setId(observationId); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithSubscriptionIdR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithSubscriptionIdR4Test.java index 4aca0fcc419..90a973e69e6 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithSubscriptionIdR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/r4/WebsocketWithSubscriptionIdR4Test.java @@ -72,7 +72,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes */ Patient patient = FhirR4Util.getPatient(); - MethodOutcome methodOutcome = ourClient.create().resource(patient).execute(); + MethodOutcome methodOutcome = myClient.create().resource(patient).execute(); myPatientId = methodOutcome.getId().getIdPart(); /* @@ -89,7 +89,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes channel.setPayload("application/json"); subscription.setChannel(channel); - methodOutcome = ourClient.create().resource(subscription).execute(); + methodOutcome = myClient.create().resource(subscription).execute(); mySubscriptionId = methodOutcome.getId().getIdPart(); /* @@ -122,7 +122,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes observation.setSubject(reference); observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute(); String observationId = methodOutcome2.getId().getIdPart(); observation.setId(observationId); @@ -146,7 +146,7 @@ public class WebsocketWithSubscriptionIdR4Test extends BaseResourceProviderR4Tes observation.setSubject(reference); observation.setStatus(Observation.ObservationStatus.FINAL); - MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute(); + MethodOutcome methodOutcome2 = myClient.create().resource(observation).execute(); String observationId = methodOutcome2.getId().getIdPart(); observation.setId(observationId); diff --git a/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html b/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html index a5dd309286b..891644e7d18 100644 --- a/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html +++ b/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html @@ -64,7 +64,7 @@
  • - CRUD Operations + CRUD Operations
  • diff --git a/pom.xml b/pom.xml index ca0605e2e34..d2866a2c491 100644 --- a/pom.xml +++ b/pom.xml @@ -425,32 +425,32 @@ com.fasterxml.jackson.core jackson-annotations - 2.8.1 + 2.9.2 com.fasterxml.jackson.core jackson-core - 2.8.1 + 2.9.2 com.fasterxml.jackson.core jackson-databind - 2.8.1 + 2.9.2 com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.8.1 + 2.9.2 com.fasterxml.jackson.dataformat jackson-dataformat-yaml - 2.8.1 + 2.9.2 com.fasterxml.jackson.module jackson-module-jaxb-annotations - 2.8.1 + 2.9.2 com.icegreen diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 438b58f5a13..bf3980ee0cf 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -13,6 +13,7 @@
  • Spring (JPA): 4.3.10 -> 5.0.0
  • +
  • Jackson (JPA): 2.8.1 -> 2.9.2
  • ]]>