From a5e7ea16aecc719f9579a6191d64697280fe5b89 Mon Sep 17 00:00:00 2001 From: patrick-werner Date: Fri, 26 Apr 2019 10:47:58 +0200 Subject: [PATCH 1/4] added all fetchValueSet Implementations --- hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java index e6284b22148..9c29eb20df3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java @@ -24,6 +24,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import org.apache.commons.lang3.tuple.Pair; import org.hl7.fhir.instance.model.api.*; @@ -197,6 +198,7 @@ public class BundleUtil { */ @SuppressWarnings("unchecked") public static List toListOfResourcesOfType(FhirContext theContext, IBaseBundle theBundle, Class theTypeToInclude) { + Objects.requireNonNull(theTypeToInclude, "ResourceType must not be null"); List retVal = new ArrayList<>(); RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle); @@ -207,7 +209,7 @@ public class BundleUtil { BaseRuntimeChildDefinition resourceChild = entryChildElem.getChildByName("resource"); for (IBase nextEntry : entries) { for (IBase next : resourceChild.getAccessor().getValues(nextEntry)) { - if (theTypeToInclude != null && !theTypeToInclude.isAssignableFrom(next.getClass())) { + if (!theTypeToInclude.isAssignableFrom(next.getClass())) { continue; } retVal.add((T) next); From 7f45660a150dd3a26527d55f002e188f4ef66037 Mon Sep 17 00:00:00 2001 From: patrick-werner Date: Fri, 26 Apr 2019 12:55:18 +0200 Subject: [PATCH 2/4] changed toListOfResources to send IBaseResource as Type instead of null --- .../java/ca/uhn/fhir/util/BundleUtil.java | 62 +++++++++---------- .../java/ca/uhn/fhir/util/BundleUtilTest.java | 14 +++++ 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java index 9c29eb20df3..3e39a96ba8e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java @@ -11,9 +11,9 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank; * 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. @@ -51,7 +51,7 @@ public class BundleUtil { BaseRuntimeChildDefinition relChild = relDef.getChildByName("relation"); List relValues = relChild.getAccessor().getValues(nextLink); for (IBase next : relValues) { - IPrimitiveType nextValue = (IPrimitiveType)next; + IPrimitiveType nextValue = (IPrimitiveType) next; if (theLinkRelation.equals(nextValue.getValueAsString())) { isRightRel = true; } @@ -65,7 +65,7 @@ public class BundleUtil { BaseRuntimeChildDefinition urlChild = linkDef.getChildByName("url"); List values = urlChild.getAccessor().getValues(nextLink); for (IBase nextUrl : values) { - IPrimitiveType nextValue = (IPrimitiveType)nextUrl; + IPrimitiveType nextValue = (IPrimitiveType) nextUrl; if (isNotBlank(nextValue.getValueAsString())) { return nextValue.getValueAsString(); } @@ -84,35 +84,35 @@ public class BundleUtil { BaseRuntimeElementCompositeDefinition entryChildElem = (BaseRuntimeElementCompositeDefinition) entryChild.getChildByName("entry"); BaseRuntimeChildDefinition resourceChild = entryChildElem.getChildByName("resource"); - + BaseRuntimeChildDefinition requestChild = entryChildElem.getChildByName("request"); BaseRuntimeElementCompositeDefinition requestDef = (BaseRuntimeElementCompositeDefinition) requestChild.getChildByName("request"); - + BaseRuntimeChildDefinition urlChild = requestDef.getChildByName("url"); List> retVal = new ArrayList<>(entries.size()); for (IBase nextEntry : entries) { - + String url = null; IBaseResource resource = null; - + for (IBase nextEntryValue : requestChild.getAccessor().getValues(nextEntry)) { for (IBase nextUrlValue : urlChild.getAccessor().getValues(nextEntryValue)) { - url = ((IPrimitiveType)nextUrlValue).getValue(); + url = ((IPrimitiveType) nextUrlValue).getValue(); } } - + // Should return 0..1 only for (IBase nextValue : resourceChild.getAccessor().getValues(nextEntry)) { resource = (IBaseResource) nextValue; } - + retVal.add(Pair.of(url, resource)); } - - return retVal; + + return retVal; } - + public static String getBundleType(FhirContext theContext, IBaseBundle theBundle) { RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle); BaseRuntimeChildDefinition entryChild = def.getChildByName("type"); @@ -148,13 +148,13 @@ public class BundleUtil { List entries = entryChild.getAccessor().getValues(theBundle); BaseRuntimeElementCompositeDefinition entryChildElem = (BaseRuntimeElementCompositeDefinition) entryChild.getChildByName("entry"); - + BaseRuntimeChildDefinition resourceChild = entryChildElem.getChildByName("resource"); BaseRuntimeChildDefinition requestChild = entryChildElem.getChildByName("request"); - BaseRuntimeElementCompositeDefinition requestElem = (BaseRuntimeElementCompositeDefinition) requestChild.getChildByName("request"); + BaseRuntimeElementCompositeDefinition requestElem = (BaseRuntimeElementCompositeDefinition) requestChild.getChildByName("request"); BaseRuntimeChildDefinition urlChild = requestElem.getChildByName("url"); BaseRuntimeChildDefinition methodChild = requestElem.getChildByName("method"); - + for (IBase nextEntry : entries) { IBaseResource resource = null; String url = null; @@ -165,36 +165,36 @@ public class BundleUtil { } for (IBase nextRequest : requestChild.getAccessor().getValues(nextEntry)) { for (IBase nextUrl : urlChild.getAccessor().getValues(nextRequest)) { - url = ((IPrimitiveType)nextUrl).getValueAsString(); + url = ((IPrimitiveType) nextUrl).getValueAsString(); } for (IBase nextUrl : methodChild.getAccessor().getValues(nextRequest)) { - String methodString = ((IPrimitiveType)nextUrl).getValueAsString(); + String methodString = ((IPrimitiveType) nextUrl).getValueAsString(); if (isNotBlank(methodString)) { requestType = RequestTypeEnum.valueOf(methodString); } } } - /* + /* * All 3 might be null - That's ok because we still want to know the * order in the original bundle. */ retVal.add(new BundleEntryParts(requestType, url, resource)); } - + return retVal; } - + /** * Extract all of the resources from a given bundle */ public static List toListOfResources(FhirContext theContext, IBaseBundle theBundle) { - return toListOfResourcesOfType(theContext, theBundle, null); + return toListOfResourcesOfType(theContext, theBundle, IBaseResource.class); } /** - * Extract all of the resources of a given type from a given bundle + * Extract all of the resources of a given type from a given bundle */ @SuppressWarnings("unchecked") public static List toListOfResourcesOfType(FhirContext theContext, IBaseBundle theBundle, Class theTypeToInclude) { @@ -209,36 +209,36 @@ public class BundleUtil { BaseRuntimeChildDefinition resourceChild = entryChildElem.getChildByName("resource"); for (IBase nextEntry : entries) { for (IBase next : resourceChild.getAccessor().getValues(nextEntry)) { - if (!theTypeToInclude.isAssignableFrom(next.getClass())) { - continue; + if (theTypeToInclude.isAssignableFrom(next.getClass())) { + retVal.add((T) next); } - retVal.add((T) next); } } - return retVal; } - public static class BundleEntryParts - { + public static class BundleEntryParts { private final RequestTypeEnum myRequestType; private final IBaseResource myResource; private final String myUrl; + BundleEntryParts(RequestTypeEnum theRequestType, String theUrl, IBaseResource theResource) { super(); myRequestType = theRequestType; myUrl = theUrl; myResource = theResource; } + public RequestTypeEnum getRequestType() { return myRequestType; } + public IBaseResource getResource() { return myResource; } + public String getUrl() { return myUrl; } } - } diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/BundleUtilTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/BundleUtilTest.java index b203eef8fdb..278889043dc 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/BundleUtilTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/BundleUtilTest.java @@ -2,10 +2,13 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.context.FhirContext; import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Patient; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Test; +import java.util.List; + public class BundleUtilTest { private static FhirContext ourCtx = FhirContext.forR4(); @@ -38,6 +41,17 @@ public class BundleUtilTest { Assert.assertEquals(null, BundleUtil.getTotal(ourCtx, b)); } + @Test + public void toListOfResourcesOfTypeTest() { + Bundle bundle = new Bundle(); + for (int i = 0; i < 5; i++) { + bundle.addEntry(new Bundle.BundleEntryComponent().setResource(new Patient())); + } + List list = BundleUtil.toListOfResourcesOfType(ourCtx, bundle, Patient.class); + Assert.assertEquals(5, list.size()); + } + + @AfterClass public static void afterClassClearContext() { TestUtil.clearAllStaticFieldsForUnitTest(); From 685adf7754a5046d45075bc991ac8b151443d2bb Mon Sep 17 00:00:00 2001 From: James Agnew Date: Fri, 26 Apr 2019 11:21:42 -0400 Subject: [PATCH 3/4] Revert Jetty upgrade, and improve patch error messages --- .../ca/uhn/fhir/i18n/hapi-messages.properties | 2 + hapi-fhir-jpaserver-base/pom.xml | 6 ++ .../jpa/util/jsonpatch/JsonPatchUtils.java | 25 +++++++- .../jpa/provider/r4/PatchProviderR4Test.java | 50 ++++++++++++++- .../util/jsonpatch/JsonPatchUtilsTest.java | 61 ++++++++++++++++--- pom.xml | 3 +- src/changes/changes.xml | 7 ++- 7 files changed, 140 insertions(+), 14 deletions(-) diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties index 14644b67b34..d3c97083bf9 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties @@ -114,3 +114,5 @@ ca.uhn.fhir.jpa.dao.dstu3.FhirResourceDaoConceptMapDstu3.matchesFound=Matches fo ca.uhn.fhir.jpa.dao.dstu3.FhirResourceDaoConceptMapDstu3.noMatchesFound=No matches found! ca.uhn.fhir.jpa.dao.r4.FhirResourceDaoConceptMapR4.matchesFound=Matches found! ca.uhn.fhir.jpa.dao.r4.FhirResourceDaoConceptMapR4.noMatchesFound=No matches found! + +ca.uhn.fhir.jpa.util.jsonpatch.JsonPatchUtils.failedToApplyPatch=Failed to apply JSON patch to {0}: {1} diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 947ea4de6e8..23a633eb21f 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -529,6 +529,12 @@ guava-testlib test + + org.jetbrains + annotations + 16.0.3 + compile + diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtils.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtils.java index 8a1c0a2e64d..d1125eca149 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtils.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtils.java @@ -21,6 +21,9 @@ package ca.uhn.fhir.jpa.util.jsonpatch; */ import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.parser.StrictErrorHandler; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; @@ -29,13 +32,15 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.github.fge.jsonpatch.JsonPatch; import com.github.fge.jsonpatch.JsonPatchException; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.intellij.lang.annotations.Language; import java.io.IOException; -import java.io.StringReader; + +import static org.apache.commons.lang3.StringUtils.defaultString; public class JsonPatchUtils { - public static T apply(FhirContext theCtx, T theResourceToUpdate, String thePatchBody) { + public static T apply(FhirContext theCtx, T theResourceToUpdate, @Language("JSON") String thePatchBody) { // Parse the patch ObjectMapper mapper = new ObjectMapper(); mapper.configure(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, false); @@ -54,7 +59,21 @@ public class JsonPatchUtils { @SuppressWarnings("unchecked") Class clazz = (Class) theResourceToUpdate.getClass(); - T retVal = theCtx.newJsonParser().parseResource(clazz, mapper.writeValueAsString(after)); + String postPatchedContent = mapper.writeValueAsString(after); + + IParser fhirJsonParser = theCtx.newJsonParser(); + fhirJsonParser.setParserErrorHandler(new StrictErrorHandler()); + + T retVal; + try { + retVal = fhirJsonParser.parseResource(clazz, postPatchedContent); + } catch (DataFormatException e) { + String resourceId = theResourceToUpdate.getIdElement().toUnqualifiedVersionless().getValue(); + String resourceType = theCtx.getResourceDefinition(theResourceToUpdate).getName(); + resourceId = defaultString(resourceId, resourceType); + String msg = theCtx.getLocalizer().getMessage(JsonPatchUtils.class, "failedToApplyPatch", resourceId, e.getMessage()); + throw new InvalidRequestException(msg); + } return retVal; } catch (IOException | JsonPatchException theE) { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java index fd7c70dddcd..6311dd10e29 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatchProviderR4Test.java @@ -7,10 +7,14 @@ import org.apache.http.client.methods.HttpPatch; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.r4.model.Media; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.IOException; import java.nio.charset.StandardCharsets; import static org.hamcrest.CoreMatchers.containsString; @@ -19,6 +23,51 @@ import static org.junit.Assert.assertThat; public class PatchProviderR4Test extends BaseResourceProviderR4Test { + + private static final Logger ourLog = LoggerFactory.getLogger(PatchProviderR4Test.class); + + @Test + public void testPatchAddArray() throws IOException { + IIdType id; + { + Media media = new Media(); + media.setId("465eb73a-bce3-423a-b86e-5d0d267638f4"); + media.setDuration(100L); + myMediaDao.update(media); + + Observation obs = new Observation(); + obs.addIdentifier().setSystem("urn:system").setValue("0"); + id = myObservationDao.create(obs, mySrd).getId().toUnqualifiedVersionless(); + } + + + String patchText = "[ " + + " {" + + " \"op\": \"add\"," + + " \"path\": \"/derivedFrom\"," + + " \"value\": [" + + " {\"reference\": \"/Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}" + + " ]" + + " } " + + "]"; + + HttpPatch patch = new HttpPatch(ourServerBase + "/Observation/" + id.getIdPart()); + patch.setEntity(new StringEntity(patchText, ContentType.parse(Constants.CT_JSON_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); + patch.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + "=" + Constants.HEADER_PREFER_RETURN_REPRESENTATION); + patch.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_JSON); + + CloseableHttpResponse response = ourHttpClient.execute(patch); + try { + assertEquals(200, response.getStatusLine().getStatusCode()); + String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); + ourLog.info("Response:\n{}", responseString); + assertThat(responseString, containsString("\"derivedFrom\":[{\"reference\":\"Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}]")); + } finally { + response.close(); + } + + } + @Test public void testPatchUsingJsonPatch() throws Exception { String methodName = "testPatchUsingJsonPatch"; @@ -186,5 +235,4 @@ public class PatchProviderR4Test extends BaseResourceProviderR4Test { } - } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtilsTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtilsTest.java index 96c0b92bf4f..a09fbcb2dc9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtilsTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/util/jsonpatch/JsonPatchUtilsTest.java @@ -11,8 +11,7 @@ import org.springframework.transaction.PlatformTransactionManager; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; public class JsonPatchUtilsTest extends BaseJpaTest { @@ -48,12 +47,12 @@ public class JsonPatchUtilsTest extends BaseJpaTest { public void testInvalidPatchSyntaxError() { // Quotes are incorrect in the "value" body - String patchText = "[ {\n" + - " \"comment\": \"add image to examination\",\n" + - " \"patch\": [ {\n" + - " \"op\": \"foo\",\n" + - " \"path\": \"/derivedFrom/-\",\n" + - " \"value\": [{\"reference\": \"/Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}]\n" + + String patchText = "[ {" + + " \"comment\": \"add image to examination\"," + + " \"patch\": [ {" + + " \"op\": \"foo\"," + + " \"path\": \"/derivedFrom/-\"," + + " \"value\": [{\"reference\": \"/Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}]" + " } ]\n" + " } ]"; @@ -69,6 +68,52 @@ public class JsonPatchUtilsTest extends BaseJpaTest { } + + @Test + public void testPatchAddArray() { + + String patchText = "[ " + + " {" + + " \"op\": \"add\"," + + " \"path\": \"/derivedFrom\"," + + " \"value\": [" + + " {\"reference\": \"/Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}" + + " ]" + + " } " + + "]"; + + Observation toUpdate = new Observation(); + toUpdate = JsonPatchUtils.apply(ourCtx, toUpdate, patchText); + + String outcome = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(toUpdate); + ourLog.info(outcome); + + assertThat(outcome, containsString("\"reference\": \"Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"")); + } + + @Test + public void testPatchAddInvalidElement() { + + String patchText = "[ " + + " {" + + " \"op\": \"add\"," + + " \"path\": \"/derivedFromXXX\"," + + " \"value\": [" + + " {\"reference\": \"/Media/465eb73a-bce3-423a-b86e-5d0d267638f4\"}" + + " ]" + + " } " + + "]"; + + Observation toUpdate = new Observation(); + try { + JsonPatchUtils.apply(ourCtx, toUpdate, patchText); + fail(); + } catch (InvalidRequestException e) { + assertEquals("Failed to apply JSON patch to Observation: Unknown element 'derivedFromXXX' found during parse", e.getMessage()); + } + + } + @Override protected FhirContext getContext() { return ourCtx; diff --git a/pom.xml b/pom.xml index f468c8fe811..cb312c07a82 100755 --- a/pom.xml +++ b/pom.xml @@ -544,7 +544,8 @@ 2.3.0.1 2.3.1 2.25.1 - 9.4.17.v20190418 + + 9.4.14.v20181114 3.0.2 5.4.2.Final diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 446454c1afd..53b90e50369 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -19,7 +19,7 @@
  • Spring-Data (JPA): 2.1.3.RELEASE -> 2.1.6.RELEASE
  • Caffeine (JPA): 2.6.2 -> 2.7.0
  • JANSI (CLI): 1.16 -> 1.17.1
  • -
  • Jetty (CLI): 9.4.14.v20181114 -> 9.4.17.v20190418
  • + ]]> @@ -181,6 +181,11 @@ Ensure that database cursors are closed immediately after performing a FHIR search. + + When performing a JSON Patch in JPA server, the post-patched document is now validated to + ensure that the patch was valid for the candidate resource. This means that invalid patches + are caught and not just silently ignored. + From c1bf6d0b3c5a3179faf170e7c76d69191bdafeac Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Sun, 28 Apr 2019 10:46:52 -0400 Subject: [PATCH 4/4] License headers --- .../dao/expunge/ExpungeEverythingService.java | 20 +++++++++++++++++++ .../uhn/fhir/jpa/dao/expunge/ExpungeRun.java | 20 +++++++++++++++++++ .../fhir/jpa/dao/expunge/ExpungeService.java | 20 +++++++++++++++++++ .../dao/expunge/IResourceExpungeService.java | 20 +++++++++++++++++++ .../fhir/jpa/dao/expunge/PartitionRunner.java | 20 +++++++++++++++++++ .../dao/expunge/ResourceExpungeService.java | 20 +++++++++++++++++++ .../model/concurrency/FhirObjectPrinter.java | 20 +++++++++++++++++++ .../jpa/model/concurrency/IPointcutLatch.java | 2 +- .../jpa/model/concurrency/PointcutLatch.java | 20 +++++++++++++++++++ 9 files changed, 161 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java index b6726a093b0..5aeaf8eb4cd 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.entity.*; import ca.uhn.fhir.jpa.model.entity.*; import ca.uhn.fhir.util.StopWatch; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeRun.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeRun.java index 47409d3e9a3..e351867af23 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeRun.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeRun.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.util.ExpungeOptions; import ca.uhn.fhir.jpa.util.ExpungeOutcome; import org.slf4j.Logger; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeService.java index aa5460068bd..d9aaaa5afea 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeService.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.util.ExpungeOptions; import ca.uhn.fhir.jpa.util.ExpungeOutcome; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IResourceExpungeService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IResourceExpungeService.java index df31e42d73f..ae13382f5f7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IResourceExpungeService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IResourceExpungeService.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import org.springframework.data.domain.Slice; import java.util.List; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java index eedf9be9b28..df30f0e814a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.StopWatch; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java index 05e8e2796fc..360c585c3e8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.dao.expunge; +/*- + * #%L + * HAPI FHIR JPA Server + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.dao.data.*; import ca.uhn.fhir.jpa.dao.index.IdHelperService; import ca.uhn.fhir.jpa.model.entity.ForcedId; diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/FhirObjectPrinter.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/FhirObjectPrinter.java index 2534e39d79e..20d221c3d6d 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/FhirObjectPrinter.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/FhirObjectPrinter.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.model.concurrency; +/*- + * #%L + * HAPI FHIR Model + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.function.Function; diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/IPointcutLatch.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/IPointcutLatch.java index c4059838565..916c60dde5e 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/IPointcutLatch.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/IPointcutLatch.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.concurrency; /*- * #%L - * HAPI FHIR Subscription Server + * HAPI FHIR Model * %% * Copyright (C) 2014 - 2019 University Health Network * %% diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/PointcutLatch.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/PointcutLatch.java index 31f22c12a23..933597dfe24 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/PointcutLatch.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/concurrency/PointcutLatch.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.model.concurrency; +/*- + * #%L + * HAPI FHIR Model + * %% + * Copyright (C) 2014 - 2019 University Health Network + * %% + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.interceptor.api.HookParams; import ca.uhn.fhir.interceptor.api.IAnonymousInterceptor;