From c6ddf89557b6026f9af38aab26d225960a7c3a4a Mon Sep 17 00:00:00 2001 From: James Agnew Date: Thu, 31 Aug 2017 22:40:53 -0400 Subject: [PATCH] Allow validation of subscriptions to be overridden --- .../FhirResourceDaoSubscriptionDstu3.java | 91 ++++++++++++------- .../dao/r4/FhirResourceDaoSubscriptionR4.java | 91 ++++++++++++------- 2 files changed, 114 insertions(+), 68 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoSubscriptionDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoSubscriptionDstu3.java index 2fe2d88aabb..8c4b25061fb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoSubscriptionDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoSubscriptionDstu3.java @@ -20,40 +20,55 @@ package ca.uhn.fhir.jpa.dao.dstu3; * #L% */ -import static org.apache.commons.lang3.StringUtils.isBlank; - -import java.util.*; - -import javax.persistence.Query; - +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.jpa.dao.IDao; +import ca.uhn.fhir.jpa.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.dao.IFhirResourceDaoSubscription; +import ca.uhn.fhir.jpa.dao.SearchParameterMap; +import ca.uhn.fhir.jpa.dao.data.ISubscriptionFlaggedResourceDataDao; +import ca.uhn.fhir.jpa.dao.data.ISubscriptionTableDao; +import ca.uhn.fhir.jpa.entity.ResourceTable; +import ca.uhn.fhir.jpa.entity.SubscriptionFlaggedResource; +import ca.uhn.fhir.jpa.entity.SubscriptionTable; +import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.rest.api.Constants; +import ca.uhn.fhir.rest.api.EncodingEnum; +import ca.uhn.fhir.rest.api.SortOrderEnum; +import ca.uhn.fhir.rest.api.SortSpec; +import ca.uhn.fhir.rest.api.server.IBundleProvider; +import ca.uhn.fhir.rest.param.DateParam; +import ca.uhn.fhir.rest.param.DateRangeParam; +import ca.uhn.fhir.rest.param.ParamPrefixEnum; +import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import org.apache.commons.lang3.time.DateUtils; import org.hl7.fhir.dstu3.model.Subscription; import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType; import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus; -import org.hl7.fhir.instance.model.api.*; +import org.hl7.fhir.instance.model.api.IAnyResource; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.transaction.*; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionDefinition; +import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; -import ca.uhn.fhir.context.RuntimeResourceDefinition; -import ca.uhn.fhir.jpa.dao.*; -import ca.uhn.fhir.jpa.dao.data.ISubscriptionFlaggedResourceDataDao; -import ca.uhn.fhir.jpa.dao.data.ISubscriptionTableDao; -import ca.uhn.fhir.jpa.entity.*; -import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.parser.DataFormatException; -import ca.uhn.fhir.rest.api.*; -import ca.uhn.fhir.rest.api.server.IBundleProvider; -import ca.uhn.fhir.rest.param.*; -import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; +import javax.persistence.Query; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import static org.apache.commons.lang3.StringUtils.isBlank; public class FhirResourceDaoSubscriptionDstu3 extends FhirResourceDaoDstu3 implements IFhirResourceDaoSubscription { @@ -168,7 +183,7 @@ public class FhirResourceDaoSubscriptionDstu3 extends FhirResourceDaoDstu3() { @Override public Void doInTransaction(TransactionStatus theStatus) { @@ -280,7 +295,7 @@ public class FhirResourceDaoSubscriptionDstu3 extends FhirResourceDaoDstu3 implements IFhirResourceDaoSubscription { @@ -167,7 +182,7 @@ public class FhirResourceDaoSubscriptionR4 extends FhirResourceDaoR4() { @Override public Void doInTransaction(TransactionStatus theStatus) { @@ -279,7 +294,7 @@ public class FhirResourceDaoSubscriptionR4 extends FhirResourceDaoR4