additionalTypeSearchParamNames);
+
/**
* Rule applies to any resource instances
*
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
index 086797a8ef7..4e1c9b8ecd3 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
@@ -451,6 +451,7 @@ public class RuleBuilder implements IAuthRuleBuilder {
private Collection extends IIdType> myInCompartmentOwners;
private Collection myAppliesToInstances;
private RuleImplOp myRule;
+ private List myAdditionalSearchParamsForCompartmentTypes;
/**
* Constructor
@@ -483,6 +484,7 @@ public class RuleBuilder implements IAuthRuleBuilder {
myRule.setClassifierCompartmentOwners(myInCompartmentOwners);
myRule.setAppliesToDeleteCascade(myOnCascade);
myRule.setAppliesToDeleteExpunge(myOnExpunge);
+ myRule.setAdditionalSearchParamsForCompartmentTypes(myAdditionalSearchParamsForCompartmentTypes);
myRules.add(myRule);
return new RuleBuilderFinished(myRule);
@@ -519,6 +521,26 @@ public class RuleBuilder implements IAuthRuleBuilder {
return finished();
}
+ @Override
+ public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List additionalTypeSearchParamNames) {
+ Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
+ Validate.notNull(theOwner, "theOwner must not be null");
+ validateOwner(theOwner);
+ myClassifierType = ClassifierTypeEnum.IN_COMPARTMENT;
+ myInCompartmentName = theCompartmentName;
+ Optional oRule = findMatchingRule();
+
+ if (oRule.isPresent()) {
+ RuleImplOp rule = oRule.get();
+ rule.setAdditionalSearchParamsForCompartmentTypes(additionalTypeSearchParamNames);
+ rule.addClassifierCompartmentOwner(theOwner);
+ return new RuleBuilderFinished(rule);
+ }
+ myInCompartmentOwners = Collections.singletonList(theOwner);
+ return finished();
+ }
+
+
private Optional findMatchingRule() {
return myRules.stream()
.filter(RuleImplOp.class::isInstance)
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
index 0810235f2ac..73ccec7d447 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
@@ -18,6 +18,7 @@ import ca.uhn.fhir.util.UrlUtil;
import ca.uhn.fhir.util.bundle.BundleEntryParts;
import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hl7.fhir.instance.model.api.IBaseBundle;
@@ -28,6 +29,8 @@ import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -69,6 +72,8 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
private Collection myAppliesToInstances;
private boolean myAppliesToDeleteCascade;
private boolean myAppliesToDeleteExpunge;
+ private boolean myDeviceIncludedInPatientCompartment;
+ private Map> myAdditionalCompartmentSearchParamMap;
/**
* Constructor
@@ -337,7 +342,12 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
for (IIdType next : myClassifierCompartmentOwners) {
if (target.resource != null) {
- if (t.isSourceInCompartmentForTarget(myClassifierCompartmentName, target.resource, next)) {
+
+ Set additionalSearchParamNames = null;
+ if (myAdditionalCompartmentSearchParamMap != null) {
+ additionalSearchParamNames = myAdditionalCompartmentSearchParamMap.get(target.resourceType);
+ }
+ if (t.isSourceInCompartmentForTarget(myClassifierCompartmentName, target.resource, next, additionalSearchParamNames)) {
foundMatch = true;
break;
}
@@ -372,6 +382,12 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
String compartmentOwnerResourceType = next.getResourceType();
if (!StringUtils.equals(target.resourceType, compartmentOwnerResourceType)) {
List params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType);
+ if (target.resourceType.equalsIgnoreCase("Device") && myDeviceIncludedInPatientCompartment) {
+ if (params == null || params.isEmpty()) {
+ params = new ArrayList<>();
+ }
+ params.add(sourceDef.getSearchParam("patient"));
+ }
if (!params.isEmpty()) {
/*
@@ -656,6 +672,10 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
myAppliesToDeleteExpunge = theAppliesToDeleteExpunge;
}
+ void setDeviceIncludedInPatientCompartment(boolean theDeviceIncludedInPatientCompartment) {
+ myDeviceIncludedInPatientCompartment = theDeviceIncludedInPatientCompartment;
+ }
+
public void addClassifierCompartmentOwner(IIdType theOwner) {
List newList = new ArrayList<>(myClassifierCompartmentOwners);
newList.add(theOwner);
@@ -681,4 +701,17 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
return false;
}
}
+
+ public void setAdditionalSearchParamsForCompartmentTypes(List theTypeAndParams) {
+ if (myAdditionalCompartmentSearchParamMap == null) {
+ myAdditionalCompartmentSearchParamMap = new HashMap<>();
+ }
+
+ for (String typeAndParam: theTypeAndParams) {
+ String[] split = typeAndParam.split(",");
+ Validate.isTrue(split.length == 2);
+ myAdditionalCompartmentSearchParamMap.computeIfAbsent(split[0], (v) -> new HashSet<>()).add(split[1]);
+ }
+ this.myAdditionalCompartmentSearchParamMap = myAdditionalCompartmentSearchParamMap;
+ }
}
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
index 3bb305e4211..958005cfa4a 100644
--- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
+++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
@@ -376,7 +376,39 @@ public class AuthorizationInterceptorR4Test {
assertTrue(ourHitMethod);
}
+ @Test
+ public void testDeviceIsPartOfPatientCompartment() throws Exception {
+ ourServlet.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
+ @Override
+ public List buildRuleList(RequestDetails theRequestDetails) {
+ List bonusPatientCompartmentSearchParams = Collections.singletonList("device:patient");
+ return new RuleBuilder()
+ .allow().read().allResources()
+ .inCompartmentWithAdditionalSearchParams("Patient", new IdType("Patient/123"), bonusPatientCompartmentSearchParams)
+ .andThen().denyAll()
+ .build();
+ }
+ });
+ HttpGet httpGet;
+ HttpResponse status;
+
+ Patient patient;
+
+
+ patient = new Patient();
+ patient.setId("Patient/123");
+ Device d = new Device();
+ d.getPatient().setResource(patient);
+
+ ourHitMethod = false;
+ ourReturn = Collections.singletonList(d);
+ httpGet = new HttpGet("http://localhost:" + ourPort + "/Device/124456");
+ status = ourClient.execute(httpGet);
+ extractResponseAndClose(status);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+ assertTrue(ourHitMethod);
+ }
@Test
public void testAllowByCompartmentUsingUnqualifiedIds() throws Exception {
ourServlet.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@@ -437,6 +469,24 @@ public class AuthorizationInterceptorR4Test {
extractResponseAndClose(status);
assertEquals(403, status.getStatusLine().getStatusCode());
assertTrue(ourHitMethod);
+
+
+ patient = new Patient();
+ patient.setId("Patient/123");
+ carePlan = new CarePlan();
+ carePlan.setStatus(CarePlan.CarePlanStatus.ACTIVE);
+ carePlan.getSubject().setResource(patient);
+
+ Device d = new Device();
+ d.getPatient().setResource(patient);
+
+ ourHitMethod = false;
+ ourReturn = Collections.singletonList(d);
+ httpGet = new HttpGet("http://localhost:" + ourPort + "/Device/123456");
+ status = ourClient.execute(httpGet);
+ extractResponseAndClose(status);
+ assertEquals(200, status.getStatusLine().getStatusCode());
+ assertTrue(ourHitMethod);
}
/**
@@ -3619,6 +3669,30 @@ public class AuthorizationInterceptorR4Test {
}
}
+ public static class DummyDeviceResourceProvider implements IResourceProvider {
+
+ @Override
+ public Class extends IBaseResource> getResourceType() {
+ return Device.class;
+ }
+
+ @Read(version = true)
+ public Device read(@IdParam IdType theId) {
+ ourHitMethod = true;
+ if (ourReturn.isEmpty()) {
+ throw new ResourceNotFoundException(theId);
+ }
+ return (Device) ourReturn.get(0);
+ }
+ @Search()
+ public List search(
+ @OptionalParam(name = "patient") ReferenceParam thePatient
+ ) {
+ ourHitMethod = true;
+ return ourReturn;
+ }
+ }
+
@SuppressWarnings("unused")
public static class DummyObservationResourceProvider implements IResourceProvider {
@@ -3953,12 +4027,13 @@ public class AuthorizationInterceptorR4Test {
DummyEncounterResourceProvider encProv = new DummyEncounterResourceProvider();
DummyCarePlanResourceProvider cpProv = new DummyCarePlanResourceProvider();
DummyDiagnosticReportResourceProvider drProv = new DummyDiagnosticReportResourceProvider();
+ DummyDeviceResourceProvider devProv = new DummyDeviceResourceProvider();
PlainProvider plainProvider = new PlainProvider();
ServletHandler proxyHandler = new ServletHandler();
ourServlet = new RestfulServer(ourCtx);
ourServlet.setFhirContext(ourCtx);
- ourServlet.registerProviders(patProvider, obsProv, encProv, cpProv, orgProv, drProv);
+ ourServlet.registerProviders(patProvider, obsProv, encProv, cpProv, orgProv, drProv, devProv);
ourServlet.registerProvider(new DummyServiceRequestResourceProvider());
ourServlet.registerProvider(new DummyConsentResourceProvider());
ourServlet.setPlainProviders(plainProvider);
From 75a16f3b1375f51443e0949258be22386dc763e9 Mon Sep 17 00:00:00 2001
From: Tadgh
Date: Tue, 14 Sep 2021 01:54:59 -0400
Subject: [PATCH 15/30] Add docs and changelog
---
.../fhir/docs/AuthorizationInterceptors.java | 15 +++++-
.../2989-additional-sps-in-compartments.yaml | 5 ++
.../security/authorization_interceptor.md | 11 +++++
.../IAuthRuleBuilderRuleOpClassifier.java | 48 ++++++++++++++++++-
.../server/interceptor/auth/RuleBuilder.java | 26 ++++------
.../server/interceptor/auth/RuleImplOp.java | 22 +++++----
.../auth/AuthorizationInterceptorR4Test.java | 8 +++-
7 files changed, 106 insertions(+), 29 deletions(-)
create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2989-additional-sps-in-compartments.yaml
diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
index 2786aa20375..cdc90c9fb1a 100644
--- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
+++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
@@ -39,6 +39,7 @@ import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.model.Patient;
+import java.util.Collections;
import java.util.List;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
@@ -100,7 +101,7 @@ public class AuthorizationInterceptors {
.denyAll()
.build();
}
-
+
// If the user is an admin, allow everything
if (userIsAdmin) {
return new RuleBuilder()
@@ -205,6 +206,18 @@ public class AuthorizationInterceptors {
};
//END SNIPPET: bulkExport
+ //START SNIPPET: advancedCompartment
+ new AuthorizationInterceptor(PolicyEnum.DENY) {
+ @Override
+ public List buildRuleList(RequestDetails theRequestDetails) {
+ List additionalCompartmentSpNames = Collections.singletonList("device:patient");
+ return new RuleBuilder()
+ .allow().read().allResources().inCompartmentWithAdditionalSearchParams("Patient", new IdType("Patient/123"), additionalCompartmentSpNames)
+ .build();
+ }
+ };
+ //END SNIPPET: advancedCompartment
+
}
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2989-additional-sps-in-compartments.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2989-additional-sps-in-compartments.yaml
new file mode 100644
index 00000000000..54b2733c7a2
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2989-additional-sps-in-compartments.yaml
@@ -0,0 +1,5 @@
+---
+type: add
+jira: SMILE-1118
+title: "Add new RuleBuilder options which allow you to specify additional resources and search parameters which match a given compartment. More explanations of
+the enhancements can be found in [the documentation](/hapi-fhir/docs/security/authorization_interceptor.html#advanced-compartment-authorization)."
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/security/authorization_interceptor.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/security/authorization_interceptor.md
index 5bedf72266f..483fdfc2f14 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/security/authorization_interceptor.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/security/authorization_interceptor.md
@@ -83,3 +83,14 @@ AuthorizationInterceptor can be used to provide nuanced control over the kinds o
```java
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java|bulkExport}}
```
+
+# Advanced Compartment authorization
+
+AuthorizationInterceptor can be used to provide fine-grained control over compartment reads and writes as well. There is a strict FHIR definition
+of which resources and related search parameters fall into a given compartment. However, sometimes the defaults do not suffice. The following is an example
+of an R4 ruleset which allows `device.patient` to be considered in the Patient compartment, on top of all the standard search parameters.
+
+
+```java
+{{snippet:classpath:/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java|advancedCompartment}}
+```
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
index b748fddac74..70342ccd79b 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
@@ -43,6 +43,28 @@ public interface IAuthRuleBuilderRuleOpClassifier {
*/
IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, IIdType theOwner);
+ /**
+ * Rule applies to resources in the given compartment.
+ *
+ * For example, to apply the rule to any observations in the patient compartment
+ * belonging to patient "123", you would invoke this with
+ * inCompartment("Patient", new IdType("Patient", "123"))
+ *
+ * This call also allows you to pass additional search parameters that count as being included in the given compartment,
+ * passed in as a list of `resourceType:search-parameter-name`. For example, if you select a compartment name of "patient",
+ * you could pass in a singleton list consisting of the string "device:patient", which would cause any devices belonging
+ * to the patient to be permitted by the authorization rule.
+ *
+ *
+ *
+ * This call completes the rule and adds the rule to the chain.
+ *
+ *
+ * @param theCompartmentName The name of the compartment (must not be null or blank)
+ * @param theOwner The owner of the compartment. Note that both the resource type and ID must be populated in this ID.
+ * @param theAdditionalTypeSearchParamNames A list of strings for additional resource types and search parameters which count as being in the compartment, in the form "resourcetype:search-parameter-name".
+ */
+ IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List theAdditionalTypeSearchParamNames);
/**
* Rule applies to resources in the given compartment.
*
@@ -59,7 +81,31 @@ public interface IAuthRuleBuilderRuleOpClassifier {
*/
IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, Collection extends IIdType> theOwners);
- IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List additionalTypeSearchParamNames);
+
+ /**
+ * Rule applies to resources in the given compartment.
+ *
+ * For example, to apply the rule to any observations in the patient compartment
+ * belonging to patient "123", you would invoke this with
+ * inCompartment("Patient", new IdType("Patient", "123"))
+ *
+ * This call also allows you to pass additional search parameters that count as being included in the given compartment,
+ * passed in as a list of `resourceType:search-parameter-name`. For example, if you select a compartment name of "patient",
+ * you could pass in a singleton list consisting of the string "device:patient", which would cause any devices belonging
+ * to the patient to be permitted by the authorization rule.
+ *
+ *
+ *
+ * This call completes the rule and adds the rule to the chain.
+ *
+ *
+ * @param theCompartmentName The name of the compartment (must not be null or blank)
+ * @param theOwners The owners of the compartment. Note that both the resource type and ID must be populated in these IDs.
+ * @param theAdditionalTypeSearchParamNames A list of strings for additional resource types and search parameters which count as being in the compartment, in the form "resourcetype:search-parameter-name".
+ *
+ **/
+ IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, List theAdditionalTypeSearchParamNames);
+
/**
* Rule applies to any resource instances
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
index 4e1c9b8ecd3..47ab01ccf34 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
@@ -492,6 +492,11 @@ public class RuleBuilder implements IAuthRuleBuilder {
@Override
public IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, Collection extends IIdType> theOwners) {
+ return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwners, new ArrayList<>());
+ }
+
+ @Override
+ public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, List theAdditionalTypeSearchParamNames) {
Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
Validate.notNull(theOwners, "theOwners must not be null");
Validate.noNullElements(theOwners, "theOwners must not contain any null elements");
@@ -500,39 +505,28 @@ public class RuleBuilder implements IAuthRuleBuilder {
}
myInCompartmentName = theCompartmentName;
myInCompartmentOwners = theOwners;
+ myAdditionalSearchParamsForCompartmentTypes = theAdditionalTypeSearchParamNames;
myClassifierType = ClassifierTypeEnum.IN_COMPARTMENT;
return finished();
}
@Override
public IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, IIdType theOwner) {
- Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
- Validate.notNull(theOwner, "theOwner must not be null");
- validateOwner(theOwner);
- myClassifierType = ClassifierTypeEnum.IN_COMPARTMENT;
- myInCompartmentName = theCompartmentName;
- Optional oRule = findMatchingRule();
- if (oRule.isPresent()) {
- RuleImplOp rule = oRule.get();
- rule.addClassifierCompartmentOwner(theOwner);
- return new RuleBuilderFinished(rule);
- }
- myInCompartmentOwners = Collections.singletonList(theOwner);
- return finished();
+ return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwner, new ArrayList<>());
}
@Override
- public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List additionalTypeSearchParamNames) {
+ public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List theAdditionalTypeSearchParamNames) {
Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
Validate.notNull(theOwner, "theOwner must not be null");
validateOwner(theOwner);
myClassifierType = ClassifierTypeEnum.IN_COMPARTMENT;
myInCompartmentName = theCompartmentName;
+ myAdditionalSearchParamsForCompartmentTypes = theAdditionalTypeSearchParamNames;
Optional oRule = findMatchingRule();
-
if (oRule.isPresent()) {
RuleImplOp rule = oRule.get();
- rule.setAdditionalSearchParamsForCompartmentTypes(additionalTypeSearchParamNames);
+ rule.setAdditionalSearchParamsForCompartmentTypes(myAdditionalSearchParamsForCompartmentTypes);
rule.addClassifierCompartmentOwner(theOwner);
return new RuleBuilderFinished(rule);
}
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
index 73ccec7d447..d834328fce4 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
@@ -34,6 +34,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.defaultString;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
@@ -345,7 +346,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
Set additionalSearchParamNames = null;
if (myAdditionalCompartmentSearchParamMap != null) {
- additionalSearchParamNames = myAdditionalCompartmentSearchParamMap.get(target.resourceType);
+ additionalSearchParamNames = myAdditionalCompartmentSearchParamMap.get(ctx.getResourceType(target.resource).toLowerCase());
}
if (t.isSourceInCompartmentForTarget(myClassifierCompartmentName, target.resource, next, additionalSearchParamNames)) {
foundMatch = true;
@@ -381,13 +382,17 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
RuntimeResourceDefinition sourceDef = theRequestDetails.getFhirContext().getResourceDefinition(target.resourceType);
String compartmentOwnerResourceType = next.getResourceType();
if (!StringUtils.equals(target.resourceType, compartmentOwnerResourceType)) {
+
List params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType);
- if (target.resourceType.equalsIgnoreCase("Device") && myDeviceIncludedInPatientCompartment) {
- if (params == null || params.isEmpty()) {
- params = new ArrayList<>();
- }
- params.add(sourceDef.getSearchParam("patient"));
+
+ Set additionalParamNames = myAdditionalCompartmentSearchParamMap.get(sourceDef.getName().toLowerCase());
+ List additionalParams = additionalParamNames.stream().map(paramName -> sourceDef.getSearchParam(paramName)).collect(Collectors.toList());
+ if (params == null || params.isEmpty()) {
+ params = additionalParams;
+ } else {
+ params.addAll(additionalParams);
}
+
if (!params.isEmpty()) {
/*
@@ -708,10 +713,9 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
}
for (String typeAndParam: theTypeAndParams) {
- String[] split = typeAndParam.split(",");
+ String[] split = typeAndParam.split(":");
Validate.isTrue(split.length == 2);
- myAdditionalCompartmentSearchParamMap.computeIfAbsent(split[0], (v) -> new HashSet<>()).add(split[1]);
+ myAdditionalCompartmentSearchParamMap.computeIfAbsent(split[0].toLowerCase(), (v) -> new HashSet<>()).add(split[1].toLowerCase());
}
- this.myAdditionalCompartmentSearchParamMap = myAdditionalCompartmentSearchParamMap;
}
}
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
index 958005cfa4a..6d60e5fdcd7 100644
--- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
+++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
@@ -376,15 +376,19 @@ public class AuthorizationInterceptorR4Test {
assertTrue(ourHitMethod);
}
+
@Test
- public void testDeviceIsPartOfPatientCompartment() throws Exception {
+ public void testCustomCompartmentSpsOnMultipleInstances() throws Exception {
ourServlet.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override
public List buildRuleList(RequestDetails theRequestDetails) {
List bonusPatientCompartmentSearchParams = Collections.singletonList("device:patient");
+ List relatedIds = new ArrayList<>();
+ relatedIds.add(new IdType("Patient/123"));
+ relatedIds.add(new IdType("Patient/456"));
return new RuleBuilder()
.allow().read().allResources()
- .inCompartmentWithAdditionalSearchParams("Patient", new IdType("Patient/123"), bonusPatientCompartmentSearchParams)
+ .inCompartmentWithAdditionalSearchParams("Patient", relatedIds, bonusPatientCompartmentSearchParams)
.andThen().denyAll()
.build();
}
From fb8def21aecc1372c69cb352ff375750533b8e67 Mon Sep 17 00:00:00 2001
From: Tadgh
Date: Tue, 14 Sep 2021 02:08:42 -0400
Subject: [PATCH 16/30] remove potential NPE
---
.../ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
index 47ab01ccf34..a4447bff1bd 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
@@ -451,7 +451,7 @@ public class RuleBuilder implements IAuthRuleBuilder {
private Collection extends IIdType> myInCompartmentOwners;
private Collection myAppliesToInstances;
private RuleImplOp myRule;
- private List myAdditionalSearchParamsForCompartmentTypes;
+ private List myAdditionalSearchParamsForCompartmentTypes = new ArrayList<>();
/**
* Constructor
From 0a9d5344e329b2e2a94f0fdfdd7a640486b2407c Mon Sep 17 00:00:00 2001
From: Tadgh
Date: Tue, 14 Sep 2021 02:10:34 -0400
Subject: [PATCH 17/30] remove more NPE, fix old test
---
.../fhir/rest/server/interceptor/auth/RuleImplOp.java | 4 ++--
.../auth/AuthorizationInterceptorR4Test.java | 11 -----------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
index d834328fce4..ee9a13ded3f 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
@@ -385,8 +385,8 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
List params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType);
- Set additionalParamNames = myAdditionalCompartmentSearchParamMap.get(sourceDef.getName().toLowerCase());
- List additionalParams = additionalParamNames.stream().map(paramName -> sourceDef.getSearchParam(paramName)).collect(Collectors.toList());
+ Set additionalParamNames = myAdditionalCompartmentSearchParamMap.getOrDefault(sourceDef.getName().toLowerCase(), new HashSet<>());
+ List additionalParams = additionalParamNames.stream().map(sourceDef::getSearchParam).collect(Collectors.toList());
if (params == null || params.isEmpty()) {
params = additionalParams;
} else {
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
index 6d60e5fdcd7..88c2e3cf377 100644
--- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
+++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
@@ -480,17 +480,6 @@ public class AuthorizationInterceptorR4Test {
carePlan = new CarePlan();
carePlan.setStatus(CarePlan.CarePlanStatus.ACTIVE);
carePlan.getSubject().setResource(patient);
-
- Device d = new Device();
- d.getPatient().setResource(patient);
-
- ourHitMethod = false;
- ourReturn = Collections.singletonList(d);
- httpGet = new HttpGet("http://localhost:" + ourPort + "/Device/123456");
- status = ourClient.execute(httpGet);
- extractResponseAndClose(status);
- assertEquals(200, status.getStatusLine().getStatusCode());
- assertTrue(ourHitMethod);
}
/**
From 16e329e40c7374f4485c49cdf784e5de8c48a018 Mon Sep 17 00:00:00 2001
From: "juan.marchionatto"
Date: Wed, 15 Sep 2021 10:29:30 -0400
Subject: [PATCH 18/30] Add version to ValueSet.compose.include when uploading
terminology
---
.../uhn/fhir/jpa/term/TermLoaderSvcImpl.java | 2 +-
.../fhir/jpa/term/loinc/BaseLoincHandler.java | 4 +
.../term/loinc/LoincAnswerListHandler.java | 1 +
.../term/loinc/LoincRsnaPlaybookHandler.java | 1 +
.../jpa/term/loinc/BaseLoincHandlerTest.java | 304 ++++++++++++++++++
5 files changed, 311 insertions(+), 1 deletion(-)
create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandlerTest.java
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java
index 60f2952754c..be31eb190c3 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermLoaderSvcImpl.java
@@ -723,7 +723,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
retVal.setPublisher("Regenstrief Institute, Inc.");
retVal.setDescription("A value set that includes all LOINC codes");
retVal.setCopyright("This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at https://loinc.org/license/");
- retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI);
+ retVal.getCompose().addInclude().setSystem(ITermLoaderSvc.LOINC_URI).setVersion(codeSystemVersionId);
return retVal;
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java
index cba3609fa8b..7cd49e97c45 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandler.java
@@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.term.loinc;
import ca.uhn.fhir.jpa.entity.TermConcept;
import ca.uhn.fhir.jpa.term.IZipContentsHandlerCsv;
+import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.r4.model.ConceptMap;
import org.hl7.fhir.r4.model.ContactPoint;
import org.hl7.fhir.r4.model.Enumerations;
@@ -74,6 +75,9 @@ public abstract class BaseLoincHandler implements IZipContentsHandlerCsv {
if (include == null) {
include = theVs.getCompose().addInclude();
include.setSystem(theCodeSystemUrl);
+ if (StringUtils.isNotBlank(theVs.getVersion())) {
+ include.setVersion(theVs.getVersion());
+ }
}
boolean found = false;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java
index cdb97ca48d8..037a2fb0e6b 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincAnswerListHandler.java
@@ -104,6 +104,7 @@ public class LoincAnswerListHandler extends BaseLoincHandler {
.getCompose()
.getIncludeFirstRep()
.setSystem(ITermLoaderSvc.LOINC_URI)
+ .setVersion(codeSystemVersionId)
.addConcept()
.setCode(answerString)
.setDisplay(displayText);
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java
index d0b03f0acc9..d81466f5380 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincRsnaPlaybookHandler.java
@@ -120,6 +120,7 @@ public class LoincRsnaPlaybookHandler extends BaseLoincHandler implements IZipCo
.getCompose()
.getIncludeFirstRep()
.setSystem(ITermLoaderSvc.LOINC_URI)
+ .setVersion(codeSystemVersionId)
.addConcept()
.setCode(loincNumber)
.setDisplay(longCommonName);
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandlerTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandlerTest.java
new file mode 100644
index 00000000000..9a304b33bbb
--- /dev/null
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/term/loinc/BaseLoincHandlerTest.java
@@ -0,0 +1,304 @@
+package ca.uhn.fhir.jpa.term.loinc;
+
+import com.google.common.collect.Maps;
+import org.apache.commons.compress.utils.Lists;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVRecord;
+import org.apache.commons.lang3.StringUtils;
+import org.hl7.fhir.r4.model.ValueSet;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.StringReader;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class BaseLoincHandlerTest {
+
+ public static final String LOINC_NUMBER = "test-loinc-number";
+ public static final String DISPLAY_NAME = "test-display-name";
+ public static final String TEST_VERSION = "2.69";
+
+ @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+ private ValueSet myValueSet;
+
+ @Mock
+ private ValueSet.ConceptSetComponent myInclude;
+
+ @Mock
+ private ValueSet.ConceptReferenceComponent myConceptReferenceComponent;
+
+ private Map headerMap;
+ private CSVRecord recordWithHeader;
+
+
+ /**
+ * Need to setup a real parser because we can't mock final classes (without PowerMockito)
+ */
+ private void setupCSVParser(Map headerValues) throws Exception {
+ final String[] headers = headerValues.keySet().toArray(new String[0]);
+ final String[] values = headerValues.values().toArray(new String[0]);
+ final String rowData = StringUtils.join(values, ',');
+
+ try (final CSVParser parser = CSVFormat.DEFAULT.parse(new StringReader(rowData))) {
+ parser.iterator().next();
+ }
+ try (final CSVParser parser = CSVFormat.DEFAULT.withHeader(headers).parse(new StringReader(rowData))) {
+ recordWithHeader = parser.iterator().next();
+ headerMap = parser.getHeaderMap();
+ }
+ }
+
+
+ @Nested
+ public class WithVersion {
+
+ @Test
+ void Top2000LabResultsHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC #", "test-loinc-number");
+ recordDataMap.put("Long Common Name", "test-Long-Common-Names");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new BaseLoincTop2000LabResultsHandler(
+ null, Lists.newArrayList(), null, null, null, Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getVersion()).thenReturn(TEST_VERSION);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude).setVersion(Mockito.notNull());
+ }
+
+ @Test
+ void LoincDocumentOntologyHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LoincNumber", "test-LoincNumber");
+ recordDataMap.put("PartNumber", "test-PartNumber");
+ recordDataMap.put("PartTypeName", "Document.Role");
+ recordDataMap.put("PartSequenceOrder", "test-PartSequenceOrder");
+ recordDataMap.put("PartName", "test-PartName");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincDocumentOntologyHandler(
+ Maps.newHashMap(), null, Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getVersion()).thenReturn(TEST_VERSION);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude).setVersion(Mockito.notNull());
+ }
+
+
+ @Test
+ void LoincGroupTermsFileHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LoincNumber", "test-LoincNumber");
+ recordDataMap.put("GroupId", "test-GroupId");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincGroupTermsFileHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getVersion()).thenReturn(TEST_VERSION);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude).setVersion(Mockito.notNull());
+ }
+
+
+ @Test
+ void LoincImagingDocumentCodeHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC_NUM", "test-loinc-number");
+ recordDataMap.put("LONG_COMMON_NAME", "test-Long-Common-Names");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincImagingDocumentCodeHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getVersion()).thenReturn(TEST_VERSION);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude).setVersion(Mockito.notNull());
+ }
+
+
+ @Test
+ void LoincUniversalOrderSetHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC_NUM", "test-loinc-number");
+ recordDataMap.put("LONG_COMMON_NAME", "test-Long-Common-Names");
+ recordDataMap.put("ORDER_OBS", "test-ORDER_OBS");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincUniversalOrderSetHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getVersion()).thenReturn(TEST_VERSION);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude).setVersion(Mockito.notNull());
+ } }
+
+ @Nested
+ public class WithoutVersion {
+
+ @Test
+ void Top2000LabResultsHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC #", "test-loinc-number");
+ recordDataMap.put("Long Common Name", "test-Long-Common-Names");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new BaseLoincTop2000LabResultsHandler(
+ Maps.newHashMap(), Lists.newArrayList(), null, null, null, Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude, never()).setVersion(any());
+ }
+
+ @Test
+ void LoincDocumentOntologyHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LoincNumber", "test-LoincNumber");
+ recordDataMap.put("PartNumber", "test-PartNumber");
+ recordDataMap.put("PartTypeName", "Document.Role");
+ recordDataMap.put("PartSequenceOrder", "test-PartSequenceOrder");
+ recordDataMap.put("PartName", "test-PartName");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincDocumentOntologyHandler(
+ Maps.newHashMap(), null, Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude, never()).setVersion(any());
+ }
+
+ @Test
+ void LoincGroupTermsFileHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LoincNumber", "test-LoincNumber");
+ recordDataMap.put("GroupId", "test-GroupId");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincGroupTermsFileHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude, never()).setVersion(any());
+ }
+
+
+ @Test
+ void LoincImagingDocumentCodeHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC_NUM", "test-loinc-number");
+ recordDataMap.put("LONG_COMMON_NAME", "test-Long-Common-Names");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincImagingDocumentCodeHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude, never()).setVersion(any());
+ }
+
+
+ @Test
+ void LoincUniversalOrderSetHandlerTest() throws Exception {
+ Map recordDataMap = Maps.newHashMap();
+ recordDataMap.put("LOINC_NUM", "test-loinc-number");
+ recordDataMap.put("LONG_COMMON_NAME", "test-Long-Common-Names");
+ recordDataMap.put("ORDER_OBS", "test-ORDER_OBS");
+ setupCSVParser(recordDataMap);
+
+ BaseLoincHandler loincHandler = new LoincUniversalOrderSetHandler(
+ Maps.newHashMap(), Lists.newArrayList(), Lists.newArrayList(), new Properties());
+ BaseLoincHandler spiedLoincHandler = spy(loincHandler);
+
+ when(spiedLoincHandler.getValueSet(any(), any(), any(), any())).thenReturn(myValueSet);
+ when(myValueSet.getCompose().addInclude()).thenReturn(myInclude);
+ when(myInclude.addConcept()).thenReturn(myConceptReferenceComponent);
+ when(myConceptReferenceComponent.setCode(any())).thenReturn(myConceptReferenceComponent);
+
+ spiedLoincHandler.accept(recordWithHeader);
+
+ Mockito.verify(myInclude, never()).setVersion(any());
+ }
+
+ }
+
+
+
+
+}
From 2435d770898c1cfe618e210701b2657e6058e107 Mon Sep 17 00:00:00 2001
From: "juan.marchionatto"
Date: Wed, 15 Sep 2021 14:46:33 -0400
Subject: [PATCH 19/30] Add changelog
---
...nclude-version-is-not-set-when-uploading-terminology.yaml | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2995-valueset-compose-include-version-is-not-set-when-uploading-terminology.yaml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2995-valueset-compose-include-version-is-not-set-when-uploading-terminology.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2995-valueset-compose-include-version-is-not-set-when-uploading-terminology.yaml
new file mode 100644
index 00000000000..8377273cf8c
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2995-valueset-compose-include-version-is-not-set-when-uploading-terminology.yaml
@@ -0,0 +1,5 @@
+---
+type: fix
+issue: 2995
+title: "CodeSystem version is copied to ValueSet.compose.include.version on loinc terminology upload
+ to support versioned ValueSet expansion."
From 5bbe69cd314d6ef2d138a3f2e490fafe57dc3509 Mon Sep 17 00:00:00 2001
From: Tadgh
Date: Wed, 15 Sep 2021 21:17:03 -0400
Subject: [PATCH 20/30] Move into data class
---
.../fhir/docs/AuthorizationInterceptors.java | 5 +--
...AdditionalCompartmentSearchParameters.java | 34 +++++++++++++++++++
.../IAuthRuleBuilderRuleOpClassifier.java | 8 +++--
.../server/interceptor/auth/RuleBuilder.java | 12 +++----
.../server/interceptor/auth/RuleImplOp.java | 26 +++-----------
.../auth/AuthorizationInterceptorR4Test.java | 5 +--
6 files changed, 56 insertions(+), 34 deletions(-)
create mode 100644 hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java
diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
index cdc90c9fb1a..4ce9fd1420a 100644
--- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
+++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/AuthorizationInterceptors.java
@@ -210,9 +210,10 @@ public class AuthorizationInterceptors {
new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override
public List buildRuleList(RequestDetails theRequestDetails) {
- List additionalCompartmentSpNames = Collections.singletonList("device:patient");
+ AdditionalCompartmentSearchParameters additionalSearchParams = new AdditionalCompartmentSearchParameters();
+ additionalSearchParams.addSearchParameters("device", "patient");
return new RuleBuilder()
- .allow().read().allResources().inCompartmentWithAdditionalSearchParams("Patient", new IdType("Patient/123"), additionalCompartmentSpNames)
+ .allow().read().allResources().inCompartmentWithAdditionalSearchParams("Patient", new IdType("Patient/123"), additionalSearchParams)
.build();
}
};
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java
new file mode 100644
index 00000000000..3fd2eaa4369
--- /dev/null
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AdditionalCompartmentSearchParameters.java
@@ -0,0 +1,34 @@
+package ca.uhn.fhir.rest.server.interceptor.auth;
+
+import javax.annotation.Nonnull;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class is used in RuleBuilder, as a way to provide a compartment permission additional resource search params that
+ * are to be included as "in" the given compartment. For example, if you were to populate this map with
+ * [device -> ["patient"]
+ * and apply it to compartment Patient/123, then any device with Patient/123 as its patient would be considered "in"
+ * the compartment, despite the fact that device is technically not part of the compartment definition for patient.
+ */
+public class AdditionalCompartmentSearchParameters {
+ private Map> myResourceTypeToParameterCodeMap;
+
+ public AdditionalCompartmentSearchParameters() {
+ myResourceTypeToParameterCodeMap = new HashMap<>();
+ }
+
+ public void addSearchParameters(@Nonnull String theResourceType, @Nonnull String... theParameterCodes) {
+ Arrays.stream(theParameterCodes).forEach(code -> {
+ myResourceTypeToParameterCodeMap.computeIfAbsent(theResourceType.toLowerCase(), (key) -> new HashSet<>()).add(code.toLowerCase());
+ });
+ }
+
+ public Set getSearchParamNamesForResourceType(@Nonnull String theResourceType) {
+ return myResourceTypeToParameterCodeMap.computeIfAbsent(theResourceType.toLowerCase(), (key) -> new HashSet<>());
+ }
+}
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
index 70342ccd79b..401d281b6ee 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleOpClassifier.java
@@ -64,7 +64,9 @@ public interface IAuthRuleBuilderRuleOpClassifier {
* @param theOwner The owner of the compartment. Note that both the resource type and ID must be populated in this ID.
* @param theAdditionalTypeSearchParamNames A list of strings for additional resource types and search parameters which count as being in the compartment, in the form "resourcetype:search-parameter-name".
*/
- IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List theAdditionalTypeSearchParamNames);
+ IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, AdditionalCompartmentSearchParameters theAdditionalTypeSearchParamNames);
+
+
/**
* Rule applies to resources in the given compartment.
*
@@ -101,10 +103,10 @@ public interface IAuthRuleBuilderRuleOpClassifier {
*
* @param theCompartmentName The name of the compartment (must not be null or blank)
* @param theOwners The owners of the compartment. Note that both the resource type and ID must be populated in these IDs.
- * @param theAdditionalTypeSearchParamNames A list of strings for additional resource types and search parameters which count as being in the compartment, in the form "resourcetype:search-parameter-name".
+ * @param theAdditionalTypeSearchParamNames A {@link AdditionalCompartmentSearchParameters} which allows you to expand the search space for what is considered "in" the compartment.
*
**/
- IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, List theAdditionalTypeSearchParamNames);
+ IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, AdditionalCompartmentSearchParameters theAdditionalTypeSearchParamNames);
/**
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
index a4447bff1bd..92587a062b9 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleBuilder.java
@@ -451,7 +451,7 @@ public class RuleBuilder implements IAuthRuleBuilder {
private Collection extends IIdType> myInCompartmentOwners;
private Collection myAppliesToInstances;
private RuleImplOp myRule;
- private List myAdditionalSearchParamsForCompartmentTypes = new ArrayList<>();
+ private AdditionalCompartmentSearchParameters myAdditionalSearchParamsForCompartmentTypes = new AdditionalCompartmentSearchParameters();
/**
* Constructor
@@ -492,11 +492,11 @@ public class RuleBuilder implements IAuthRuleBuilder {
@Override
public IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, Collection extends IIdType> theOwners) {
- return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwners, new ArrayList<>());
+ return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwners, new AdditionalCompartmentSearchParameters());
}
@Override
- public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, List theAdditionalTypeSearchParamNames) {
+ public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, Collection extends IIdType> theOwners, AdditionalCompartmentSearchParameters theAdditionalTypeSearchParams) {
Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
Validate.notNull(theOwners, "theOwners must not be null");
Validate.noNullElements(theOwners, "theOwners must not contain any null elements");
@@ -505,18 +505,18 @@ public class RuleBuilder implements IAuthRuleBuilder {
}
myInCompartmentName = theCompartmentName;
myInCompartmentOwners = theOwners;
- myAdditionalSearchParamsForCompartmentTypes = theAdditionalTypeSearchParamNames;
+ myAdditionalSearchParamsForCompartmentTypes = theAdditionalTypeSearchParams;
myClassifierType = ClassifierTypeEnum.IN_COMPARTMENT;
return finished();
}
@Override
public IAuthRuleBuilderRuleOpClassifierFinished inCompartment(String theCompartmentName, IIdType theOwner) {
- return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwner, new ArrayList<>());
+ return inCompartmentWithAdditionalSearchParams(theCompartmentName, theOwner, new AdditionalCompartmentSearchParameters());
}
@Override
- public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, List theAdditionalTypeSearchParamNames) {
+ public IAuthRuleBuilderRuleOpClassifierFinished inCompartmentWithAdditionalSearchParams(String theCompartmentName, IIdType theOwner, AdditionalCompartmentSearchParameters theAdditionalTypeSearchParamNames) {
Validate.notBlank(theCompartmentName, "theCompartmentName must not be null");
Validate.notNull(theOwner, "theOwner must not be null");
validateOwner(theOwner);
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
index ee9a13ded3f..697a48c75c9 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/RuleImplOp.java
@@ -18,7 +18,6 @@ import ca.uhn.fhir.util.UrlUtil;
import ca.uhn.fhir.util.bundle.BundleEntryParts;
import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hl7.fhir.instance.model.api.IBaseBundle;
@@ -29,8 +28,6 @@ import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -73,8 +70,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
private Collection myAppliesToInstances;
private boolean myAppliesToDeleteCascade;
private boolean myAppliesToDeleteExpunge;
- private boolean myDeviceIncludedInPatientCompartment;
- private Map> myAdditionalCompartmentSearchParamMap;
+ private AdditionalCompartmentSearchParameters myAdditionalCompartmentSearchParamMap;
/**
* Constructor
@@ -346,7 +342,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
Set additionalSearchParamNames = null;
if (myAdditionalCompartmentSearchParamMap != null) {
- additionalSearchParamNames = myAdditionalCompartmentSearchParamMap.get(ctx.getResourceType(target.resource).toLowerCase());
+ additionalSearchParamNames = myAdditionalCompartmentSearchParamMap.getSearchParamNamesForResourceType(ctx.getResourceType(target.resource));
}
if (t.isSourceInCompartmentForTarget(myClassifierCompartmentName, target.resource, next, additionalSearchParamNames)) {
foundMatch = true;
@@ -385,7 +381,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
List params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType);
- Set additionalParamNames = myAdditionalCompartmentSearchParamMap.getOrDefault(sourceDef.getName().toLowerCase(), new HashSet<>());
+ Set additionalParamNames = myAdditionalCompartmentSearchParamMap.getSearchParamNamesForResourceType(sourceDef.getName());
List additionalParams = additionalParamNames.stream().map(sourceDef::getSearchParam).collect(Collectors.toList());
if (params == null || params.isEmpty()) {
params = additionalParams;
@@ -677,10 +673,6 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
myAppliesToDeleteExpunge = theAppliesToDeleteExpunge;
}
- void setDeviceIncludedInPatientCompartment(boolean theDeviceIncludedInPatientCompartment) {
- myDeviceIncludedInPatientCompartment = theDeviceIncludedInPatientCompartment;
- }
-
public void addClassifierCompartmentOwner(IIdType theOwner) {
List newList = new ArrayList<>(myClassifierCompartmentOwners);
newList.add(theOwner);
@@ -707,15 +699,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
}
}
- public void setAdditionalSearchParamsForCompartmentTypes(List theTypeAndParams) {
- if (myAdditionalCompartmentSearchParamMap == null) {
- myAdditionalCompartmentSearchParamMap = new HashMap<>();
- }
-
- for (String typeAndParam: theTypeAndParams) {
- String[] split = typeAndParam.split(":");
- Validate.isTrue(split.length == 2);
- myAdditionalCompartmentSearchParamMap.computeIfAbsent(split[0].toLowerCase(), (v) -> new HashSet<>()).add(split[1].toLowerCase());
- }
+ public void setAdditionalSearchParamsForCompartmentTypes(AdditionalCompartmentSearchParameters theAdditionalParameters) {
+ myAdditionalCompartmentSearchParamMap = theAdditionalParameters;
}
}
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
index 88c2e3cf377..cda03b1d43f 100644
--- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
+++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorR4Test.java
@@ -382,13 +382,14 @@ public class AuthorizationInterceptorR4Test {
ourServlet.registerInterceptor(new AuthorizationInterceptor(PolicyEnum.DENY) {
@Override
public List buildRuleList(RequestDetails theRequestDetails) {
- List bonusPatientCompartmentSearchParams = Collections.singletonList("device:patient");
+ AdditionalCompartmentSearchParameters additionalCompartmentSearchParameters = new AdditionalCompartmentSearchParameters();
+ additionalCompartmentSearchParameters.addSearchParameters("device", "patient");
List relatedIds = new ArrayList<>();
relatedIds.add(new IdType("Patient/123"));
relatedIds.add(new IdType("Patient/456"));
return new RuleBuilder()
.allow().read().allResources()
- .inCompartmentWithAdditionalSearchParams("Patient", relatedIds, bonusPatientCompartmentSearchParams)
+ .inCompartmentWithAdditionalSearchParams("Patient", relatedIds, additionalCompartmentSearchParameters)
.andThen().denyAll()
.build();
}
From 56920149bc842e1c502965ef1cc95ccb92667e2b Mon Sep 17 00:00:00 2001
From: Jason Roberts
Date: Fri, 17 Sep 2021 09:48:39 -0400
Subject: [PATCH 21/30] add support for OIDC authentication to Swagger API
---
.../uhn/fhir/rest/openapi/OpenApiInterceptor.java | 15 ++++++++++++++-
.../resources/ca/uhn/fhir/rest/openapi/index.css | 2 +-
.../resources/ca/uhn/fhir/rest/openapi/index.html | 4 +++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
index 7caad2dbb78..13a3107cc02 100644
--- a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
+++ b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
@@ -262,6 +262,13 @@ public class OpenApiInterceptor {
return true;
}
+ if (resourcePath.endsWith(".html")) {
+ theResponse.setContentType(Constants.CT_HTML);
+ theResponse.setStatus(200);
+ IOUtils.copy(resource, theResponse.getOutputStream());
+ theResponse.getOutputStream().close();
+ return true;
+ }
}
return false;
}
@@ -336,12 +343,18 @@ public class OpenApiInterceptor {
String page = extractPageName(theRequestDetails, PAGE_SYSTEM);
context.setVariable("PAGE", page);
+ populateOIDCVariables(context);
+
String outcome = myTemplateEngine.process("index.html", context);
theResponse.getWriter().write(outcome);
theResponse.getWriter().close();
}
+ protected void populateOIDCVariables(WebContext context) {
+ context.setVariable("OAUTH2_REDIRECT_URL_PROPERTY", "");
+ }
+
private String extractPageName(ServletRequestDetails theRequestDetails, String theDefault) {
String[] pageValues = theRequestDetails.getParameters().get("page");
String page = null;
@@ -354,7 +367,7 @@ public class OpenApiInterceptor {
return page;
}
- private OpenAPI generateOpenApi(ServletRequestDetails theRequestDetails) {
+ protected OpenAPI generateOpenApi(ServletRequestDetails theRequestDetails) {
String page = extractPageName(theRequestDetails, null);
CapabilityStatement cs = getCapabilityStatement(theRequestDetails);
diff --git a/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.css b/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.css
index a94d230ed3c..b921df6148a 100644
--- a/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.css
+++ b/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.css
@@ -18,7 +18,7 @@ body
background: #fafafa;
}
-.scheme-container, .information-container
+.information-container
{
display: none
}
diff --git a/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.html b/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.html
index a1e0d16659d..f3ff503295f 100644
--- a/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.html
+++ b/hapi-fhir-server-openapi/src/main/resources/ca/uhn/fhir/rest/openapi/index.html
@@ -1,3 +1,4 @@
+
@@ -55,7 +56,8 @@
plugins: [
// SwaggerUIBundle.plugins.DownloadUrl
],
- // layout: "StandaloneLayout"
+ // layout: "StandaloneLayout",
+ oauth2RedirectUrl: "[[${OAUTH2_REDIRECT_URL_PROPERTY}]]"
});
// End Swagger UI call region
From a866feb730945c96d289209a8723a58e206b7f6f Mon Sep 17 00:00:00 2001
From: Jason Roberts
Date: Fri, 17 Sep 2021 11:41:51 -0400
Subject: [PATCH 22/30] changelog
---
.../fhir/changelog/5_6_0/3005-oidc-support-in-swagger.yaml | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3005-oidc-support-in-swagger.yaml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3005-oidc-support-in-swagger.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3005-oidc-support-in-swagger.yaml
new file mode 100644
index 00000000000..7a924a3fd8f
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3005-oidc-support-in-swagger.yaml
@@ -0,0 +1,5 @@
+---
+type: add
+issue: 3005
+jira: SMILE-723
+title: "Open up the visibility of some methods in the generation of the Open API definition files to allow extenders to add support for OIDC authorization."
From 4051fe084937e728f8ebd027cff76ae40af62f8e Mon Sep 17 00:00:00 2001
From: Jason Roberts
Date: Fri, 17 Sep 2021 14:17:33 -0400
Subject: [PATCH 23/30] code review feedback
---
.../ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java | 6 +++---
.../uhn/fhir/rest/openapi/OpenApiInterceptorTest.java | 11 +++++++++++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
index 13a3107cc02..9a3117c0d2f 100644
--- a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
+++ b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java
@@ -343,7 +343,7 @@ public class OpenApiInterceptor {
String page = extractPageName(theRequestDetails, PAGE_SYSTEM);
context.setVariable("PAGE", page);
- populateOIDCVariables(context);
+ populateOIDCVariables(theRequestDetails, context);
String outcome = myTemplateEngine.process("index.html", context);
@@ -351,8 +351,8 @@ public class OpenApiInterceptor {
theResponse.getWriter().close();
}
- protected void populateOIDCVariables(WebContext context) {
- context.setVariable("OAUTH2_REDIRECT_URL_PROPERTY", "");
+ protected void populateOIDCVariables(ServletRequestDetails theRequestDetails, WebContext theContext) {
+ theContext.setVariable("OAUTH2_REDIRECT_URL_PROPERTY", "");
}
private String extractPageName(ServletRequestDetails theRequestDetails, String theDefault) {
diff --git a/hapi-fhir-server-openapi/src/test/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptorTest.java b/hapi-fhir-server-openapi/src/test/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptorTest.java
index c7afe2ad42a..66d649cbfb1 100644
--- a/hapi-fhir-server-openapi/src/test/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptorTest.java
+++ b/hapi-fhir-server-openapi/src/test/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptorTest.java
@@ -213,6 +213,17 @@ public class OpenApiInterceptorTest {
assertEquals(null, url);
}
+ @Test
+ public void testStandardRedirectScriptIsAccessible() throws IOException {
+ myServer.getRestfulServer().registerInterceptor(new AddResourceCountsInterceptor());
+ myServer.getRestfulServer().registerInterceptor(new OpenApiInterceptor());
+
+ HttpGet get = new HttpGet("http://localhost:" + myServer.getPort() + "/fhir/swagger-ui/oauth2-redirect.html");
+ try (CloseableHttpResponse response = myClient.execute(get)) {
+ assertEquals(200, response.getStatusLine().getStatusCode());
+ }
+ }
+
private String fetchSwaggerUi(String url) throws IOException {
String resp;
HttpGet get = new HttpGet(url);
From f1f9c672ad1fed877b7c23c32812dfa5d8827ff0 Mon Sep 17 00:00:00 2001
From: Johnson Lu <71754637+lu-wenhua@users.noreply.github.com>
Date: Mon, 20 Sep 2021 12:40:56 -0700
Subject: [PATCH 24/30] 3110 zh disallow unknown extensions (#3009)
* Added allowKnownExtensionsOnly() method such which calls setAnyExtensionsAllowed() to set myAnyExtensionsAllowed to false and modified changelogs to add entry for this ticket.
* Modified docs to remove description for .allowAnyExtensions() and included it within a description for .allowKnownExtensionsOnly() and also added test for .allowKnownExtensionsOnly()
* refactored allowKnownExtensionsOnly() to rejectUnknownExtensions()
---
...positoryValidatingInterceptorExamples.java | 7 ++---
...add-toggle-to-deny-unknown-extensions.yaml | 4 +++
.../RepositoryValidatingRuleBuilder.java | 9 +++++++
...RepositoryValidatingInterceptorR4Test.java | 27 +++++++++++++++++++
4 files changed, 44 insertions(+), 3 deletions(-)
create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3110-add-toggle-to-deny-unknown-extensions.yaml
diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/RepositoryValidatingInterceptorExamples.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/RepositoryValidatingInterceptorExamples.java
index 896f021375e..babae3507e8 100644
--- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/RepositoryValidatingInterceptorExamples.java
+++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/RepositoryValidatingInterceptorExamples.java
@@ -28,7 +28,6 @@ import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingRuleBuilder;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import org.springframework.context.ApplicationContext;
-import javax.annotation.Nonnull;
import java.util.List;
@SuppressWarnings("unused")
@@ -121,8 +120,10 @@ public class RepositoryValidatingInterceptorExamples {
.forResourcesOfType("Patient")
.requireValidationToDeclaredProfiles()
- // Configure the validator to never reject extensions
- .allowAnyExtensions()
+ // Configure the validator to reject unknown extensions
+ // by default, all extensions are accepted and to undo this rejection
+ // call allowAnyExtensions()
+ .rejectUnknownExtensions()
// Configure the validator to not perform terminology validation
.disableTerminologyChecks()
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3110-add-toggle-to-deny-unknown-extensions.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3110-add-toggle-to-deny-unknown-extensions.yaml
new file mode 100644
index 00000000000..4dab26e6393
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3110-add-toggle-to-deny-unknown-extensions.yaml
@@ -0,0 +1,4 @@
+---
+type: add
+issue: 3110
+title: "Added a functionality to deny unknown extensions."
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java
index aff7afb1677..f1d2241eec3 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java
@@ -305,6 +305,15 @@ public final class RepositoryValidatingRuleBuilder implements IRuleRoot {
return this;
}
+ /**
+ * Configure the validator to reject unknown extensions
+ */
+ @Nonnull
+ public FinalizedRequireValidationRule rejectUnknownExtensions() {
+ myRule.getValidator().setAnyExtensionsAllowed(false);
+ return this;
+ }
+
/**
* Configure the validator to not perform terminology validation
*/
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java
index d48e9cbe61f..ca49294dcda 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptorR4Test.java
@@ -291,6 +291,33 @@ public class RepositoryValidatingInterceptorR4Test extends BaseJpaR4Test {
}
}
+ @Test
+ public void testRequireValidation_AdditionalOptions_Reject_UnKnown_Extensions() {
+ List rules = newRuleBuilder()
+ .forResourcesOfType("Observation")
+ .requireValidationToDeclaredProfiles()
+ .withBestPracticeWarningLevel("IGNORE")
+ .rejectUnknownExtensions()
+ .disableTerminologyChecks()
+ .errorOnUnknownProfiles()
+ .suppressNoBindingMessage()
+ .suppressWarningForExtensibleValueSetValidation()
+ .build();
+
+ myValInterceptor.setRules(rules);
+
+ Observation obs = new Observation();
+ obs.getCode().addCoding().setSystem("http://foo").setCode("123").setDisplay("help im a bug");
+ obs.setStatus(Observation.ObservationStatus.AMENDED);
+ try {
+ IIdType id = myObservationDao.create(obs).getId();
+ assertEquals("1", id.getVersionIdPart());
+ } catch (PreconditionFailedException e) {
+ // should not happen
+ fail(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome()));
+ }
+ }
+
@Test
public void testRequireValidation_FailNoRejectAndTag() {
List rules = newRuleBuilder()
From b6c8658f8ceb355b6ab6c456167683fdfb07cc8e Mon Sep 17 00:00:00 2001
From: Jason Roberts
Date: Tue, 21 Sep 2021 10:42:59 -0400
Subject: [PATCH 25/30] Fix MS SQLServer database migration
---
.../changelog/5_6_0/3012-mssql-database-migration.yaml | 4 ++++
.../src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java | 8 ++++++++
.../src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java | 7 +++++++
.../java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java | 5 +++++
4 files changed, 24 insertions(+)
create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3012-mssql-database-migration.yaml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3012-mssql-database-migration.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3012-mssql-database-migration.yaml
new file mode 100644
index 00000000000..899aacb26a5
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3012-mssql-database-migration.yaml
@@ -0,0 +1,4 @@
+---
+type: fix
+issue: 3012
+title: "Fixes some recent database schema migration failures on MS SQLServer."
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
index 3b1ed6553fd..20bd94a1586 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
@@ -221,6 +221,14 @@ public class TestUtil {
}
+ for (Class> innerClass : theClazz.getDeclaredClasses()) {
+ Embeddable embeddable = innerClass.getAnnotation(Embeddable.class);
+ if (embeddable != null) {
+ scanClassOrSuperclass(theNames, innerClass, false, columnNameToLength);
+ }
+
+ }
+
if (theClazz.getSuperclass().equals(Object.class)) {
return;
}
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
index fb4af862dd6..ec0d881b699 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
+++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
@@ -254,6 +254,13 @@ public class JdbcUtils {
return new ColumnType(ColumnTypeEnum.DATE_TIMESTAMP, length);
case Types.BLOB:
return new ColumnType(ColumnTypeEnum.BLOB, length);
+ case Types.VARBINARY:
+ if (theConnectionProperties.getDriverType().equals(DriverTypeEnum.MSSQL_2012)) {
+ // MS SQLServer seems to be mapping BLOB to VARBINARY under the covers, so we need to reverse that mapping
+ return new ColumnType(ColumnTypeEnum.BLOB, length);
+ } else {
+ throw new IllegalArgumentException("Don't know how to handle datatype " + dataType + " for column " + theColumnName + " on table " + theTableName);
+ }
case Types.CLOB:
return new ColumnType(ColumnTypeEnum.CLOB, length);
case Types.DOUBLE:
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java
index 34c8805de97..259a1e6f8c5 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java
+++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java
@@ -148,6 +148,11 @@ public class Builder {
super.addTask(theTask);
}
}
+
+ public BuilderAddTableByColumns failureAllowed() {
+ myTask.setFailureAllowed(true);
+ return this;
+ }
}
public static class BuilderWithTableName implements BaseMigrationTasks.IAcceptsTasks {
From 060791aeb4f098c81a4beb1cd914dd24de9a8238 Mon Sep 17 00:00:00 2001
From: Ken Stevens
Date: Tue, 21 Sep 2021 11:36:08 -0400
Subject: [PATCH 26/30] hapi-fhir-storage-api (#3006)
* rename hapi-fhir-jpaserver-migrate to hapi-fhir-sql-migrate and move hapi-tasks into jpaserver-persistence
* rename hapi-fhir-jpaserver-api to hapi-fhir-storage-api
* move bulk import apis
* create hapi-fhir-jpa
* create hapi-fhir-jpa
* move CircularQueueCaptureQueriesListener to japi-fhir-jpa
* move mdm logs to storage-api
* move gziputil to storage-api
* move quartz scheduling to hapi-fhir-jpa
* move default subscription channel factory to storage-api
* consolidated batch constants
* correct accidental Logs change
* remove dependency of cdr-api on cdr-persistence
* fix javadoc
* pom descriptions
* review feedback
---
hapi-deployable-pom/pom.xml | 2 +-
hapi-fhir-android/pom.xml | 2 +-
hapi-fhir-base/pom.xml | 5 +-
.../main/java/ca/uhn/fhir/util/TestUtil.java | 22 +++
.../pom.xml | 15 +-
.../jpa/batch/api/IBatchJobSubmitter.java | 2 +-
.../fhir/jpa/batch/config/BatchConstants.java | 81 ++++++++
.../config/NonPersistedBatchConfigurer.java | 1 -
.../jpa/batch/svc/BatchJobSubmitterImpl.java | 2 +-
.../uhn/fhir/jpa/batch/BaseBatchR4Test.java | 0
.../fhir/jpa/batch/config/BatchJobConfig.java | 1 -
.../jpa/batch/config/SampleItemReader.java | 0
.../fhir/jpa/batch/config/SampleTasklet.java | 0
.../jpa/batch/config/TestBatchConfig.java | 1 +
.../uhn/fhir/jpa/batch/svc/BatchSvcTest.java | 0
.../src/test/resources/logback-test.xml | 32 ++--
hapi-fhir-bom/pom.xml | 6 +-
hapi-fhir-cli/hapi-fhir-cli-api/pom.xml | 4 +-
hapi-fhir-cli/hapi-fhir-cli-app/pom.xml | 2 +-
hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml | 2 +-
hapi-fhir-cli/pom.xml | 2 +-
hapi-fhir-client-okhttp/pom.xml | 2 +-
hapi-fhir-client/pom.xml | 2 +-
hapi-fhir-converter/pom.xml | 2 +-
hapi-fhir-dist/pom.xml | 2 +-
hapi-fhir-docs/pom.xml | 2 +-
...-resolved-placeholder-identifier-true.yaml | 2 +-
.../uhn/hapi/fhir/docs/appendix/javadocs.md | 2 +-
.../fhir/docs/server_jpa/configuration.md | 12 +-
.../ca/uhn/hapi/fhir/docs/server_jpa/lastn.md | 8 +-
.../uhn/hapi/fhir/docs/server_jpa/schema.md | 13 +-
.../fhir/docs/server_jpa_mdm/mdm_expansion.md | 5 +-
.../docs/server_jpa_mdm/mdm_operations.md | 2 +-
.../server_jpa_partitioning/partitioning.md | 7 +-
hapi-fhir-jacoco/pom.xml | 4 +-
hapi-fhir-jaxrsserver-base/pom.xml | 2 +-
hapi-fhir-jpa/pom.xml | 119 ++++++++++++
...ocalContainerEntityManagerFactoryBean.java | 3 +-
.../ca/uhn/fhir/jpa/model/sched/HapiJob.java | 2 +-
.../fhir/jpa/model/sched/IHapiScheduler.java | 2 +-
.../jpa/model/sched/ISchedulerService.java | 2 +-
.../jpa/model/sched/ISmartLifecyclePhase.java | 2 +-
.../model/sched/ScheduledJobDefinition.java | 2 +-
.../sched/AutowiringSpringBeanJobFactory.java | 5 +-
.../uhn/fhir/jpa/sched/BaseHapiScheduler.java | 16 +-
.../jpa/sched/BaseSchedulerServiceImpl.java | 2 +-
.../jpa/sched/ClusteredHapiScheduler.java | 2 +-
.../uhn/fhir/jpa/sched/HapiNullScheduler.java | 2 +-
.../jpa/sched/HapiSchedulerServiceImpl.java | 2 +-
.../fhir/jpa/sched/LocalHapiScheduler.java | 2 +-
.../jpa/util/BaseCaptureQueriesListener.java | 2 +-
.../CircularQueueCaptureQueriesListener.java | 4 +-
.../CurrentThreadCaptureQueriesListener.java | 2 +-
.../util/DerbyTenSevenHapiFhirDialect.java | 2 +-
.../java/ca/uhn/fhir/jpa/util/SqlQuery.java | 2 +-
.../ca/uhn/fhir/jpa/util/SqlQueryList.java | 2 +-
.../java/ca/uhn/fhir/jpa/util/TestUtil.java | 9 +-
hapi-fhir-jpaserver-base/pom.xml | 85 +--------
.../uhn/fhir/jpa/batch/BatchJobsConfig.java | 60 ------
.../job/MultiUrlJobParameterValidator.java | 7 +-
.../batch/mdm/MdmClearJobSubmitterImpl.java | 4 +-
.../jpa/batch/mdm/job/MdmClearJobConfig.java | 2 +-
...BaseReverseCronologicalBatchPidReader.java | 36 ++--
.../bulk/export/job/BaseBulkItemReader.java | 3 +-
...portGenerateResourceFilesStepListener.java | 5 +-
.../bulk/export/job/BulkExportJobConfig.java | 13 +-
.../job/BulkExportJobParameterValidator.java | 5 +-
.../job/CreateBulkExportEntityTasklet.java | 31 +--
.../export/job/ResourceTypePartitioner.java | 3 +-
.../export/svc/BulkDataExportSvcImpl.java | 12 +-
.../ActivateBulkImportEntityStepListener.java | 5 +-
.../bulk/imprt/job/BulkImportFileReader.java | 4 +-
.../bulk/imprt/job/BulkImportFileWriter.java | 4 +-
.../bulk/imprt/job/BulkImportJobCloser.java | 4 +-
.../bulk/imprt/job/BulkImportJobConfig.java | 7 +-
.../job/BulkImportJobParameterValidator.java | 4 +-
.../bulk/imprt/job/BulkImportPartitioner.java | 6 +-
.../imprt/job/BulkImportStepListener.java | 6 +-
.../job/CreateBulkImportEntityTasklet.java | 6 +-
.../bulk/imprt/svc/BulkDataImportSvcImpl.java | 6 +-
.../ca/uhn/fhir/jpa/config/BaseConfig.java | 2 +-
.../jpa/dao/tx/HapiTransactionService.java | 21 +--
.../delete/DeleteExpungeJobSubmitterImpl.java | 4 +-
.../delete/job/DeleteExpungeJobConfig.java | 4 +-
.../MdmSearchExpandingInterceptor.java | 4 -
.../tasks/HapiFhirJpaMigrationTasks.java | 2 +-
.../jpa/provider/BaseJpaSystemProvider.java | 4 +-
.../jpa/reindex/ReindexJobSubmitterImpl.java | 6 +-
.../job/ReindexEverythingJobConfig.java | 2 +-
.../jpa/reindex/job/ReindexJobConfig.java | 6 +-
.../jpa/bulk/BulkDataExportSvcImplR4Test.java | 18 +-
.../bulk/imprt/svc/BulkDataImportR4Test.java | 6 +-
.../FhirResourceDaoR4SearchNoHashesTest.java | 4 +-
...FhirResourceDaoR4SearchPageExpiryTest.java | 8 +-
.../uhn/fhir/jpa/dao/r4/JpaHistoryR4Test.java | 2 +-
.../jpa/dao/r4/PartitioningSqlR4Test.java | 2 +-
.../jpa/delete/job/DeleteExpungeJobTest.java | 4 +-
.../fhir/jpa/delete/job/ReindexJobTest.java | 6 +-
.../migrate/taskdef/ArbitrarySqlTaskTest.java | 0
.../fhir/jpa/migrate/taskdef/BaseTest.java | 161 ++++++++++++++++
.../migrate/taskdef/CalculateHashesTest.java | 0
.../fhir/jpa/migrate/taskdef/HashTest.java | 0
.../tasks/HapiFhirJpaMigrationTasksTest.java | 0
.../r4/MultitenantBatchOperationR4Test.java | 4 +-
.../provider/r4/ResourceProviderR4Test.java | 178 +++++++++---------
.../r4/StaleSearchDeletingSvcR4Test.java | 2 +-
.../jpa/provider/r4/SystemProviderR4Test.java | 4 +-
.../jpa/sched/SchedulerServiceImplTest.java | 2 +-
.../search/SearchCoordinatorSvcImplTest.java | 2 +-
.../ca/uhn/fhir/jpa/batch/BatchConstants.java | 32 ----
.../InMemoryJobRepositoryBatchConfig.java | 85 ---------
hapi-fhir-jpaserver-cql/pom.xml | 2 +-
hapi-fhir-jpaserver-mdm/pom.xml | 2 +-
.../jpa/mdm/broker/MdmMessageHandler.java | 2 -
.../mdm/broker/MdmQueueConsumerLoader.java | 4 +-
.../MdmSubmitterInterceptorLoader.java | 6 +-
.../candidate/FindCandidateByExampleSvc.java | 8 +-
.../svc/candidate/FindCandidateByLinkSvc.java | 2 +-
.../MdmGoldenResourceFindingSvc.java | 2 +-
.../ColumnTypeToDriverTypeToSqlType.java | 124 ------------
hapi-fhir-jpaserver-model/pom.xml | 30 +--
hapi-fhir-jpaserver-searchparam/pom.xml | 2 +-
hapi-fhir-jpaserver-subscription/pom.xml | 4 +-
hapi-fhir-jpaserver-test-utilities/pom.xml | 2 +-
hapi-fhir-jpaserver-uhnfhirtest/pom.xml | 2 +-
hapi-fhir-server-mdm/pom.xml | 7 +-
hapi-fhir-server-openapi/pom.xml | 2 +-
hapi-fhir-server/pom.xml | 10 +-
.../server/provider/ProviderConstants.java | 9 +
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../hapi-fhir-spring-boot-samples/pom.xml | 2 +-
.../hapi-fhir-spring-boot-starter/pom.xml | 2 +-
hapi-fhir-spring-boot/pom.xml | 2 +-
.../pom.xml | 26 ++-
.../ca/uhn/fhir/jpa/migrate/BaseMigrator.java | 2 +-
.../uhn/fhir/jpa/migrate/DriverTypeEnum.java | 20 +-
.../fhir/jpa/migrate/FlywayMigrationTask.java | 1 -
.../uhn/fhir/jpa/migrate/FlywayMigrator.java | 0
.../ca/uhn/fhir/jpa/migrate/IMigrator.java | 0
.../ca/uhn/fhir/jpa/migrate/JdbcUtils.java | 156 ++++++++-------
.../jpa/migrate/MigrationTaskSkipper.java | 0
.../ca/uhn/fhir/jpa/migrate/Migrator.java | 0
.../uhn/fhir/jpa/migrate/SchemaMigrator.java | 0
.../fhir/jpa/migrate/TaskOnlyMigrator.java | 0
.../jpa/migrate/taskdef/AddColumnTask.java | 0
.../migrate/taskdef/AddForeignKeyTask.java | 0
.../migrate/taskdef/AddIdGeneratorTask.java | 0
.../jpa/migrate/taskdef/AddIndexTask.java | 7 +-
.../migrate/taskdef/AddTableByColumnTask.java | 0
.../migrate/taskdef/AddTableRawSqlTask.java | 0
.../jpa/migrate/taskdef/ArbitrarySqlTask.java | 36 ++--
.../taskdef/BaseColumnCalculatorTask.java | 67 ++++---
.../migrate/taskdef/BaseTableColumnTask.java | 17 +-
.../taskdef/BaseTableColumnTypeTask.java | 0
.../jpa/migrate/taskdef/BaseTableTask.java | 1 -
.../fhir/jpa/migrate/taskdef/BaseTask.java | 0
.../migrate/taskdef/CalculateHashesTask.java | 18 +-
.../taskdef/CalculateOrdinalDatesTask.java | 0
.../jpa/migrate/taskdef/ColumnTypeEnum.java | 0
.../ColumnTypeToDriverTypeToSqlType.java | 124 ++++++++++++
.../jpa/migrate/taskdef/DropColumnTask.java | 21 +--
.../migrate/taskdef/DropForeignKeyTask.java | 44 ++---
.../migrate/taskdef/DropIdGeneratorTask.java | 0
.../jpa/migrate/taskdef/DropIndexTask.java | 116 ++++++------
.../jpa/migrate/taskdef/DropTableTask.java | 0
.../migrate/taskdef/ExecuteRawSqlTask.java | 0
.../migrate/taskdef/InitializeSchemaTask.java | 0
.../jpa/migrate/taskdef/ModifyColumnTask.java | 16 +-
.../uhn/fhir/jpa/migrate/taskdef/NopTask.java | 0
.../jpa/migrate/taskdef/RenameColumnTask.java | 6 +-
.../jpa/migrate/taskdef/RenameIndexTask.java | 66 +++----
.../tasks/SchemaInitializationProvider.java | 7 +-
.../migrate/tasks/api/BaseMigrationTasks.java | 4 +-
.../fhir/jpa/migrate/tasks/api/Builder.java | 122 +++++++-----
.../api/ISchemaInitializationProvider.java | 0
.../jpa/migrate/FlywayMigrationTaskTest.java | 3 +-
.../uhn/fhir/jpa/migrate/JdbcUtilsTest.java | 2 +-
.../jpa/migrate/MigrationTaskSkipperTest.java | 6 +-
.../fhir/jpa/migrate/SchemaMigratorTest.java | 0
.../jpa/migrate/taskdef/AddColumnTest.java | 0
.../taskdef/AddForeignKeyTaskTest.java | 3 +-
.../taskdef/AddIdGeneratorTaskTest.java | 3 +-
.../jpa/migrate/taskdef/AddIndexTest.java | 0
.../taskdef/AddTableByColumnTaskTest.java | 5 +-
.../jpa/migrate/taskdef/AddTableTest.java | 2 +-
.../jpa/migrate/taskdef/BaseTaskTest.java | 0
.../fhir/jpa/migrate/taskdef/BaseTest.java | 100 +++++-----
.../jpa/migrate/taskdef/DropColumnTest.java | 6 +-
.../taskdef/DropForeignKeyTaskTest.java | 0
.../taskdef/DropIdGeneratorTaskTest.java | 3 +-
.../jpa/migrate/taskdef/DropIndexTest.java | 2 -
.../jpa/migrate/taskdef/DropTableTest.java | 1 -
.../taskdef/ExecuteRawSqlTaskTest.java | 0
.../taskdef/InitializeSchemaTaskTest.java | 3 +-
.../jpa/migrate/taskdef/ModifyColumnTest.java | 1 -
.../RenameColumnTaskDbSpecificTest.java | 0
.../migrate/taskdef/RenameColumnTaskTest.java | 7 +-
.../tasks/api/BaseMigrationTasksTest.java | 6 +-
.../src/test/resources/logback-test.xml | 2 +-
.../pom.xml | 15 +-
.../ca/uhn/fhir/jpa/api/config/DaoConfig.java | 52 +++--
.../ca/uhn/fhir/jpa/api/dao/DaoRegistry.java | 1 +
.../java/ca/uhn/fhir/jpa/api/dao/IDao.java | 0
.../fhir/jpa/api/dao/IFhirResourceDao.java | 0
.../api/dao/IFhirResourceDaoCodeSystem.java | 0
.../api/dao/IFhirResourceDaoComposition.java | 0
.../api/dao/IFhirResourceDaoConceptMap.java | 2 +-
.../api/dao/IFhirResourceDaoEncounter.java | 0
.../dao/IFhirResourceDaoMessageHeader.java | 0
.../api/dao/IFhirResourceDaoObservation.java | 7 +-
.../jpa/api/dao/IFhirResourceDaoPatient.java | 0
.../dao/IFhirResourceDaoSearchParameter.java | 0
.../IFhirResourceDaoStructureDefinition.java | 0
.../api/dao/IFhirResourceDaoSubscription.java | 0
.../jpa/api/dao/IFhirResourceDaoValueSet.java | 0
.../uhn/fhir/jpa/api/dao/IFhirSystemDao.java | 0
.../java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java | 2 +-
.../dao/MetadataKeyCurrentlyReindexing.java | 0
.../jpa/api/dao/MetadataKeyResourcePid.java | 0
.../fhir/jpa/api/model/DaoMethodOutcome.java | 8 +-
.../fhir/jpa/api/model/DeleteConflict.java | 0
.../jpa/api/model/DeleteConflictList.java | 0
.../jpa/api/model/DeleteMethodOutcome.java | 0
.../fhir/jpa/api/model/ExpungeOptions.java | 0
.../fhir/jpa/api/model/ExpungeOutcome.java | 0
.../jpa/api/model/HistoryCountModeEnum.java | 0
.../jpa/api/model/LazyDaoMethodOutcome.java | 0
...urceVersionConflictResolutionStrategy.java | 0
.../fhir/jpa/api/model/TranslationQuery.java | 2 +-
.../jpa/api/model/TranslationRequest.java | 24 +--
.../fhir/jpa/api/model/WarmCacheEntry.java | 0
.../jpa/api/svc/ISearchCoordinatorSvc.java | 2 +-
.../bulk/imprt/api/IBulkDataImportSvc.java | 2 +-
.../imprt/model/BulkImportJobFileJson.java | 2 +-
.../bulk/imprt/model/BulkImportJobJson.java | 2 +-
.../imprt/model/BulkImportJobStatusEnum.java | 2 +-
.../model/JobFileRowProcessingModeEnum.java | 2 +-
.../imprt/model/ParsedBulkImportRecord.java | 2 +-
.../java/ca/uhn/fhir/jpa/dao/GZipUtil.java | 9 +-
.../channel/api/BaseChannelSettings.java | 2 +-
.../channel/api/ChannelConsumerSettings.java | 2 +-
.../channel/api/ChannelProducerSettings.java | 2 +-
.../channel/api/IChannelFactory.java | 2 +-
.../channel/api/IChannelProducer.java | 2 +-
.../channel/api/IChannelReceiver.java | 2 +-
.../channel/api/IChannelSettings.java | 2 +-
.../config/SubscriptionChannelConfig.java | 2 +-
.../channel/impl/LinkedBlockingChannel.java | 2 +-
.../impl/LinkedBlockingChannelFactory.java | 2 +-
...roadcastingSubscribableChannelWrapper.java | 2 +-
.../channel/subscription/IChannelNamer.java | 2 +-
.../SubscriptionChannelFactory.java | 2 +-
.../matching/IResourceModifiedConsumer.java | 2 +-
.../SubscriptionMatchingStrategy.java | 2 +-
.../registry/SubscriptionCanonicalizer.java | 3 +-
.../match/registry/SubscriptionConstants.java | 2 +-
.../model/CanonicalSubscription.java | 2 +-
.../CanonicalSubscriptionChannelType.java | 2 +-
.../model/ResourceDeliveryJsonMessage.java | 2 +-
.../model/ResourceDeliveryMessage.java | 2 +-
.../model/ResourceModifiedJsonMessage.java | 2 +-
.../model/ResourceModifiedMessage.java | 2 +-
.../main/java/ca/uhn/fhir/mdm/log/Logs.java | 2 +-
.../src/main/resources/.keep-jpaserver-api | 0
.../src/test/java/.keep | 0
.../src/test/resources/.keep | 0
hapi-fhir-structures-dstu2.1/pom.xml | 2 +-
hapi-fhir-structures-dstu2/pom.xml | 2 +-
hapi-fhir-structures-dstu3/pom.xml | 2 +-
hapi-fhir-structures-hl7org-dstu2/pom.xml | 2 +-
hapi-fhir-structures-r4/pom.xml | 2 +-
hapi-fhir-structures-r5/pom.xml | 2 +-
hapi-fhir-test-utilities/pom.xml | 2 +-
hapi-fhir-testpage-overlay/pom.xml | 2 +-
.../pom.xml | 2 +-
hapi-fhir-validation-resources-dstu2/pom.xml | 2 +-
hapi-fhir-validation-resources-dstu3/pom.xml | 2 +-
hapi-fhir-validation-resources-r4/pom.xml | 2 +-
hapi-fhir-validation-resources-r5/pom.xml | 2 +-
hapi-fhir-validation/pom.xml | 2 +-
hapi-tinder-plugin/pom.xml | 16 +-
hapi-tinder-test/pom.xml | 2 +-
pom.xml | 33 +++-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
289 files changed, 1489 insertions(+), 1375 deletions(-)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/pom.xml (86%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java (97%)
create mode 100644 hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java (98%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java (98%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/BaseBatchR4Test.java (100%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java (99%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleItemReader.java (100%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleTasklet.java (100%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java (99%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/java/ca/uhn/fhir/jpa/batch/svc/BatchSvcTest.java (100%)
rename {hapi-fhir-jpaserver-batch => hapi-fhir-batch}/src/test/resources/logback-test.xml (82%)
create mode 100644 hapi-fhir-jpa/pom.xml
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java (97%)
rename {hapi-fhir-jpaserver-model => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java (97%)
rename {hapi-fhir-jpaserver-model => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java (97%)
rename {hapi-fhir-jpaserver-model => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java (98%)
rename {hapi-fhir-jpaserver-model => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java (97%)
rename {hapi-fhir-jpaserver-model => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java (95%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java (93%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-jpa}/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-jpaserver-base}/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-jpaserver-base}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTaskTest.java (100%)
create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-jpaserver-base}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-jpaserver-base}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/HashTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-jpaserver-base}/src/test/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasksTest.java (100%)
delete mode 100644 hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/BatchConstants.java
delete mode 100644 hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/InMemoryJobRepositoryBatchConfig.java
delete mode 100644 hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/pom.xml (86%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java (96%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java (95%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java (95%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java (74%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateOrdinalDatesTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeEnum.java (100%)
create mode 100644 hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnTypeToDriverTypeToSqlType.java
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTask.java (89%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java (94%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/NopTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameIndexTask.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java (97%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java (93%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTaskTest.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/JdbcUtilsTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipperTest.java (97%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTaskTest.java (97%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTaskTest.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java (97%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTaskTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropColumnTest.java (96%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTaskTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTaskTest.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTest.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTest.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTaskTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTaskTest.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTest.java (99%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTaskDbSpecificTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTaskTest.java (98%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasksTest.java (100%)
rename {hapi-fhir-jpaserver-migrate => hapi-fhir-sql-migrate}/src/test/resources/logback-test.xml (89%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/pom.xml (92%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java (99%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java (99%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IDao.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoComposition.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoConceptMap.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoEncounter.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoMessageHeader.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoObservation.java (81%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoPatient.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSearchParameter.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoStructureDefinition.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoSubscription.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoValueSet.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/IJpaDao.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyCurrentlyReindexing.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/dao/MetadataKeyResourcePid.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/DaoMethodOutcome.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflict.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteMethodOutcome.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOptions.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/ExpungeOutcome.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/HistoryCountModeEnum.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/LazyDaoMethodOutcome.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/ResourceVersionConflictResolutionStrategy.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java (99%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java (99%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/model/WarmCacheEntry.java (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java (100%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java (99%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobFileJson.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobJson.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/BulkImportJobStatusEnum.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/JobFileRowProcessingModeEnum.java (97%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ParsedBulkImportRecord.java (98%)
rename {hapi-fhir-jpaserver-base => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/dao/GZipUtil.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelConsumerSettings.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/ChannelProducerSettings.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelFactory.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelProducer.java (96%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelReceiver.java (96%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java (95%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/config/SubscriptionChannelConfig.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/BroadcastingSubscribableChannelWrapper.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/IChannelNamer.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/channel/subscription/SubscriptionChannelFactory.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/IResourceModifiedConsumer.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/matching/SubscriptionMatchingStrategy.java (96%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionConstants.java (98%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java (99%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java (97%)
rename {hapi-fhir-jpaserver-subscription => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedMessage.java (98%)
rename {hapi-fhir-server-mdm => hapi-fhir-storage-api}/src/main/java/ca/uhn/fhir/mdm/log/Logs.java (96%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/main/resources/.keep-jpaserver-api (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/test/java/.keep (100%)
rename {hapi-fhir-jpaserver-api => hapi-fhir-storage-api}/src/test/resources/.keep (100%)
diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index e70a9982ec0..575868e3c45 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml
index fcc0073c6c9..2526578113b 100644
--- a/hapi-fhir-android/pom.xml
+++ b/hapi-fhir-android/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml
index 4250734be2e..b4dba9128fd 100644
--- a/hapi-fhir-base/pom.xml
+++ b/hapi-fhir-base/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -18,6 +18,9 @@
+
+
com.fasterxml.jackson.datatype
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TestUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TestUtil.java
index 8edd16ce7fd..936ed1fc12b 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TestUtil.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TestUtil.java
@@ -192,4 +192,26 @@ public class TestUtil {
return stripReturns(theString).replace(" ", "");
}
+ public static void sleepAtLeast(long theMillis) {
+ sleepAtLeast(theMillis, true);
+ }
+
+
+ @SuppressWarnings("BusyWait")
+ public static void sleepAtLeast(long theMillis, boolean theLogProgress) {
+ long start = System.currentTimeMillis();
+ while (System.currentTimeMillis() <= start + theMillis) {
+ try {
+ long timeSinceStarted = System.currentTimeMillis() - start;
+ long timeToSleep = Math.max(0, theMillis - timeSinceStarted);
+ if (theLogProgress) {
+ ourLog.info("Sleeping for {}ms", timeToSleep);
+ }
+ Thread.sleep(timeToSleep);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ ourLog.error("Interrupted", e);
+ }
+ }
+ }
}
diff --git a/hapi-fhir-jpaserver-batch/pom.xml b/hapi-fhir-batch/pom.xml
similarity index 86%
rename from hapi-fhir-jpaserver-batch/pom.xml
rename to hapi-fhir-batch/pom.xml
index cf0abe606d6..97d413f1a3c 100644
--- a/hapi-fhir-jpaserver-batch/pom.xml
+++ b/hapi-fhir-batch/pom.xml
@@ -1,19 +1,22 @@
-
4.0.0
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
- hapi-fhir-jpaserver-batch
+ hapi-fhir-batch
jar
HAPI FHIR JPA Server - Batch Task Processor
+ Default implementation of batch job submitter along with constants used by the different hapi-fhir batch
+ jobs.
+
@@ -24,10 +27,6 @@
org.springframework.batch
spring-batch-infrastructure
-
- org.springframework.data
- spring-data-jpa
-
javax.annotation
javax.annotation-api
diff --git a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java
similarity index 97%
rename from hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java
rename to hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java
index 299ded644fd..172a8d57555 100644
--- a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java
+++ b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/api/IBatchJobSubmitter.java
@@ -30,7 +30,7 @@ public interface IBatchJobSubmitter {
/**
* Given a {@link Job} and a {@link JobParameters}, execute the job with the given parameters.
*
- * @param theJob the job to run.
+ * @param theJob the job to run.
* @param theJobParameters A collection of key-value pairs that are used to parameterize the job.
* @return A {@link JobExecution} representing the job.
* @throws JobParametersInvalidException If validation on the parameters fails.
diff --git a/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java
new file mode 100644
index 00000000000..6071b7679b5
--- /dev/null
+++ b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/BatchConstants.java
@@ -0,0 +1,81 @@
+package ca.uhn.fhir.jpa.batch.config;
+
+/*-
+ * #%L
+ * HAPI FHIR JPA Server - Batch Task Processor
+ * %%
+ * Copyright (C) 2014 - 2021 Smile CDR, Inc.
+ * %%
+ * 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 java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public final class BatchConstants {
+ public static final String JOB_PARAM_REQUEST_LIST = "url-list";
+ public static final String JOB_PARAM_BATCH_SIZE = "batch-size";
+ public static final String JOB_PARAM_START_TIME = "start-time";
+ public static final String CURRENT_URL_INDEX = "current.url-index";
+ public static final String CURRENT_THRESHOLD_HIGH = "current.threshold-high";
+ public static final String JOB_UUID_PARAMETER = "jobUUID";
+ public static final String JOB_LAUNCHING_TASK_EXECUTOR = "jobLaunchingTaskExecutor";
+ public static final String BULK_EXPORT_JOB_NAME = "bulkExportJob";
+ public static final String GROUP_BULK_EXPORT_JOB_NAME = "groupBulkExportJob";
+ public static final String PATIENT_BULK_EXPORT_JOB_NAME = "patientBulkExportJob";
+ public static final String BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP = "bulkExportGenerateResourceFilesStep";
+ public static final String BULK_IMPORT_JOB_NAME = "bulkImportJob";
+ public static final String BULK_IMPORT_PROCESSING_STEP = "bulkImportProcessingStep";
+ /**
+ * Delete Expunge
+ */
+ public static final String DELETE_EXPUNGE_JOB_NAME = "deleteExpungeJob";
+ /**
+ * Reindex
+ */
+ public static final String REINDEX_JOB_NAME = "reindexJob";
+ /**
+ * Reindex Everything
+ */
+ public static final String REINDEX_EVERYTHING_JOB_NAME = "reindexEverythingJob";
+ /**
+ * MDM Clear
+ */
+ public static final String MDM_CLEAR_JOB_NAME = "mdmClearJob";
+ /**
+ * This Set contains the step names across all job types that are appropriate for
+ * someone to look at the write count for that given step in order to determine the
+ * number of processed records.
+ *
+ * This is provided since a job might have multiple steps that the same data passes
+ * through, so you can't just sum up the total of all of them.
+ *
+ * For any given batch job type, there should only be one step name in this set
+ */
+ public static Set RECORD_PROCESSING_STEP_NAMES;
+
+ static {
+ HashSet recordProcessingStepNames = new HashSet<>();
+ recordProcessingStepNames.add(BatchConstants.BULK_IMPORT_PROCESSING_STEP);
+ recordProcessingStepNames.add(BatchConstants.BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP);
+ BatchConstants.RECORD_PROCESSING_STEP_NAMES = Collections.unmodifiableSet(recordProcessingStepNames);
+ }
+
+ /**
+ * v * Non instantiable
+ */
+ private BatchConstants() {
+ }
+}
diff --git a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java
similarity index 98%
rename from hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java
rename to hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java
index 27eb2518893..00234d7c447 100644
--- a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java
+++ b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/config/NonPersistedBatchConfigurer.java
@@ -20,7 +20,6 @@ package ca.uhn.fhir.jpa.batch.config;
* #L%
*/
-import ca.uhn.fhir.jpa.batch.BatchConstants;
import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean;
diff --git a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java
similarity index 98%
rename from hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java
rename to hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java
index 60f588d2e14..52625ec2c12 100644
--- a/hapi-fhir-jpaserver-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java
+++ b/hapi-fhir-batch/src/main/java/ca/uhn/fhir/jpa/batch/svc/BatchJobSubmitterImpl.java
@@ -46,7 +46,7 @@ public class BatchJobSubmitterImpl implements IBatchJobSubmitter {
private JobRepository myJobRepository;
@Override
- public JobExecution runJob(Job theJob, JobParameters theJobParameters) throws JobParametersInvalidException{
+ public JobExecution runJob(Job theJob, JobParameters theJobParameters) throws JobParametersInvalidException {
try {
return myJobLauncher.run(theJob, theJobParameters);
} catch (JobExecutionAlreadyRunningException | JobRestartException | JobInstanceAlreadyCompleteException e) {
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/BaseBatchR4Test.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/BaseBatchR4Test.java
similarity index 100%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/BaseBatchR4Test.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/BaseBatchR4Test.java
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java
similarity index 99%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java
index 7acf3590585..3de13fe7a66 100644
--- a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java
+++ b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/BatchJobConfig.java
@@ -22,7 +22,6 @@ public class BatchJobConfig {
private StepBuilderFactory myStepBuilderFactory;
-
@Bean
public Job testJob() {
return myJobBuilderFactory.get("testJob")
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleItemReader.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleItemReader.java
similarity index 100%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleItemReader.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleItemReader.java
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleTasklet.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleTasklet.java
similarity index 100%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleTasklet.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/SampleTasklet.java
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java
similarity index 99%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java
index ca0fd6edbea..62e56a3b7a4 100644
--- a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java
+++ b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/config/TestBatchConfig.java
@@ -28,6 +28,7 @@ public class TestBatchConfig {
asyncTaskExecutor.initialize();
return asyncTaskExecutor;
}
+
@Bean
public BatchConfigurer batchConfigurer() {
return new NonPersistedBatchConfigurer();
diff --git a/hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/svc/BatchSvcTest.java b/hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/svc/BatchSvcTest.java
similarity index 100%
rename from hapi-fhir-jpaserver-batch/src/test/java/ca/uhn/fhir/jpa/batch/svc/BatchSvcTest.java
rename to hapi-fhir-batch/src/test/java/ca/uhn/fhir/jpa/batch/svc/BatchSvcTest.java
diff --git a/hapi-fhir-jpaserver-batch/src/test/resources/logback-test.xml b/hapi-fhir-batch/src/test/resources/logback-test.xml
similarity index 82%
rename from hapi-fhir-jpaserver-batch/src/test/resources/logback-test.xml
rename to hapi-fhir-batch/src/test/resources/logback-test.xml
index 161f3ef0359..90a11833d3b 100644
--- a/hapi-fhir-jpaserver-batch/src/test/resources/logback-test.xml
+++ b/hapi-fhir-batch/src/test/resources/logback-test.xml
@@ -8,47 +8,50 @@
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
- INFO
+
+ INFO
+
${smile.basedir}/log/batch-troubleshooting.log
${smile.basedir}/log/batch-troubleshooting.log.%i.gz
@@ -59,7 +62,8 @@
5MB
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n${log.stackfilter.pattern}
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n${log.stackfilter.pattern}
+
@@ -68,7 +72,7 @@
-
+
diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml
index 8fe5cf9a5b4..0ef10754ac7 100644
--- a/hapi-fhir-bom/pom.xml
+++ b/hapi-fhir-bom/pom.xml
@@ -3,14 +3,14 @@
4.0.0
ca.uhn.hapi.fhir
hapi-fhir-bom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
pom
HAPI FHIR BOM
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -133,7 +133,7 @@
${project.groupId}
- hapi-fhir-jpaserver-migrate
+ hapi-fhir-sql-migrate
${project.version}
diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
index c03744e91ea..59e3eea4001 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../../hapi-deployable-pom/pom.xml
@@ -35,7 +35,7 @@
ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-migrate
+ hapi-fhir-sql-migrate
${project.version}
diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
index 5e11c79536a..66280895c25 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir-cli
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
index a53adf1d7b4..bc64a5bba36 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../../hapi-deployable-pom
diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml
index 1944f4105b2..887b3a49219 100644
--- a/hapi-fhir-cli/pom.xml
+++ b/hapi-fhir-cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml
index b12089d304e..d81caa143c1 100644
--- a/hapi-fhir-client-okhttp/pom.xml
+++ b/hapi-fhir-client-okhttp/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml
index 50382d3feb9..0f6c971115a 100644
--- a/hapi-fhir-client/pom.xml
+++ b/hapi-fhir-client/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml
index ca9ac09d67d..e7127e92765 100644
--- a/hapi-fhir-converter/pom.xml
+++ b/hapi-fhir-converter/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml
index 7bd546d13d0..e3236999149 100644
--- a/hapi-fhir-dist/pom.xml
+++ b/hapi-fhir-dist/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml
index 5f99f8bd00b..ff4b66f1152 100644
--- a/hapi-fhir-docs/pom.xml
+++ b/hapi-fhir-docs/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml
index 47398526684..51ac0bab5bb 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2446-issues-with-placeholder-reference-targets-need-to-be-resolved-placeholder-identifier-true.yaml
@@ -1,5 +1,5 @@
---
type: change
issue: 2446
-title: "DaoConfig setting for [Populate Identifier In Auto Created Placeholder Reference Targets](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets(boolean))
+title: "DaoConfig setting for [Populate Identifier In Auto Created Placeholder Reference Targets](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets(boolean))
now defaults to `true`."
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md
index 55175502942..00491ff2338 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/appendix/javadocs.md
@@ -9,7 +9,7 @@ See the [Modules Page](/docs/getting_started/modules.html) for more information
* [Model API (R5)](/apidocs/hapi-fhir-structures-r5/) - hapi-fhir-structures-r5
* [Client API](/apidocs/hapi-fhir-client/) - hapi-fhir-client
* [Plain Server API](/apidocs/hapi-fhir-server/) - hapi-fhir-server
-* [JPA Server - API](/apidocs/hapi-fhir-jpaserver-api/) - hapi-fhir-jpaserver-api
+* [JPA Server - API](/apidocs/hapi-fhir-storage-api/) - hapi-fhir-storage-api
* [JPA Server - Model](/apidocs/hapi-fhir-jpaserver-model/) - hapi-fhir-jpaserver-model
* [JPA Server - Base](/apidocs/hapi-fhir-jpaserver-base/) - hapi-fhir-jpaserver-base
* [Version Converter API](/apidocs/hapi-fhir-converter/) - hapi-fhir-converter
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md
index 932befb6f1a..1e3fe814321 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/configuration.md
@@ -54,9 +54,15 @@ In some cases, you may have references which are Logical References,
which means that they act as an identifier and not necessarily as a literal
web address.
-A common use for logical references is in references to conformance resources, such as ValueSets, StructureDefinitions, etc. For example, you might refer to the ValueSet `http://hl7.org/fhir/ValueSet/quantity-comparator` from your own resources. In this case, you are not necessarily telling the server that this is a real address that it should resolve, but rather that this is an identifier for a ValueSet where `ValueSet.url` has the given URI/URL.
+A common use for logical references is in references to conformance resources, such as ValueSets, StructureDefinitions,
+etc. For example, you might refer to the ValueSet `http://hl7.org/fhir/ValueSet/quantity-comparator` from your own
+resources. In this case, you are not necessarily telling the server that this is a real address that it should resolve,
+but rather that this is an identifier for a ValueSet where `ValueSet.url` has the given URI/URL.
-HAPI can be configured to treat certain URI/URL patterns as logical by using the DaoConfig#setTreatReferencesAsLogical property (see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setTreatReferencesAsLogical(java.util.Set))).
+HAPI can be configured to treat certain URI/URL patterns as logical by using the DaoConfig#setTreatReferencesAsLogical
+property (
+see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setTreatReferencesAsLogical(java.util.Set)))
+.
For example:
@@ -131,5 +137,5 @@ X-Retry-On-Version-Conflict: retry; max-retries=100
Delete with expunge submits a job to delete and expunge the requested resources. This is done in batches. If the DELETE
?_expunge=true syntax is used to trigger the delete expunge, then the batch size will be determined by the value
-of [Expunge Batch Size](/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize())
+of [Expunge Batch Size](/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize())
property.
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md
index 0848298ee66..1dbc3476d61 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/lastn.md
@@ -24,9 +24,13 @@ The grouping of Observation resources by `Observation.code` means that the `$las
# Deployment and Configuration
-The `$lastn` operation is disabled by default. The operation can be enabled by setting the DaoConfig#setLastNEnabled property (see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setLastNEnabled(boolean))).
+The `$lastn` operation is disabled by default. The operation can be enabled by setting the DaoConfig#setLastNEnabled
+property (
+see [JavaDoc](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setLastNEnabled(boolean)))
+.
-In addition, the Elasticsearch client service, `ElasticsearchSvcImpl` will need to be instantiated with parameters specifying how to connect to the Elasticsearch server, for e.g.:
+In addition, the Elasticsearch client service, `ElasticsearchSvcImpl` will need to be instantiated with parameters
+specifying how to connect to the Elasticsearch server, for e.g.:
```java
@Bean()
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md
index 17499751bb8..dc167281c69 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md
@@ -240,9 +240,18 @@ The complete raw contents of the resource is stored in the `RES_TEXT` column, us
By default, the **HFJ_RESOURCE.RES_ID** column is used as the resource ID for all server-assigned IDs. For example, if a Patient resource is created in a completely empty database, it will be assigned the ID `Patient/1` by the server and RES_ID will have a value of 1.
-However, when client-assigned IDs are used, these may contain text values to allow a client to create an ID such as `Patient/ABC`. When a client-assigned ID is given to a resource, a row is created in the **HFJ_RESOURCE** table. When an **HFJ_FORCED_ID** row exists corresponding to the equivalent **HFJ_RESOURCE** row, the RES_ID value is no longer visible or usable by FHIR clients and it becomes purely an internal ID to the JPA server.
+However, when client-assigned IDs are used, these may contain text values to allow a client to create an ID such
+as `Patient/ABC`. When a client-assigned ID is given to a resource, a row is created in the **HFJ_RESOURCE** table. When
+an **HFJ_FORCED_ID** row exists corresponding to the equivalent **HFJ_RESOURCE** row, the RES_ID value is no longer
+visible or usable by FHIR clients and it becomes purely an internal ID to the JPA server.
-If the server has been configured with a [Resource Server ID Strategy](/apidocs/hapi-fhir-jpaserver-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) of [UUID](/apidocs/hapi-fhir-jpaserver-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.IdStrategyEnum.html#UUID), or the server has been configured with a [Resource Client ID Strategy](/apidocs/hapi-fhir-jpaserver-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceClientIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.ClientIdStrategyEnum)) of [ANY](/apidocs/hapi-fhir-jpaserver-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.ClientIdStrategyEnum.html#ANY) the server will create a Forced ID for all resources (not only resources having textual IDs).
+If the server has been configured with
+a [Resource Server ID Strategy](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum))
+of [UUID](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.IdStrategyEnum.html#UUID), or
+the server has been configured with
+a [Resource Client ID Strategy](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceClientIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.ClientIdStrategyEnum))
+of [ANY](/apidocs/hapi-fhir-storage-api/undefined/ca/uhn/fhir/jpa/api/config/DaoConfig.ClientIdStrategyEnum.html#ANY)
+the server will create a Forced ID for all resources (not only resources having textual IDs).
## Columns
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md
index 42302e38332..d5f4747ed07 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_expansion.md
@@ -25,7 +25,10 @@ One important caveat is that chaining is currently not supported when using this
## Enabling MDM Expansion
-On top of needing to instantiate an MDM module, you must enable this feature in the [DaoConfig](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html) bean, using the [Allow MDM Expansion](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setAllowMdmExpansion(boolean)) property.
+On top of needing to instantiate an MDM module, you must enable this feature in
+the [DaoConfig](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html) bean, using
+the [Allow MDM Expansion](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setAllowMdmExpansion(boolean))
+property.
It is important to note that enabling this functionality can lead to incorrect data being returned by a request, if your MDM links are incorrect. Use with caution.
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md
index 7679c532977..8a291853cf2 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_mdm/mdm_operations.md
@@ -601,7 +601,7 @@ This operation takes two optional Parameters.
0..1 |
The number of links that should be deleted at a time. If ommitted, then the batch size will be determined by the value
-of [Expunge Batch Size](/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize())
+of [Expunge Batch Size](/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#getExpungeBatchSize())
property.
|
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
index 2bb299f0bcd..5fda22365d2 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
@@ -53,9 +53,12 @@ In a partitioned repository, it is important to understand that only a single po
This fact can have security implications:
-* A client might be blocked from creating `Patient/ABC` in the partition they have access to because this ID is already in use in another partition.
+* A client might be blocked from creating `Patient/ABC` in the partition they have access to because this ID is already
+ in use in another partition.
-* In a server using the default configuration of SEQUENTIAL_NUMERIC [Server ID Strategy](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum)) a client may be able to infer the IDs of resources in other partitions based on the ID they were assigned.
+* In a server using the default configuration of
+ SEQUENTIAL_NUMERIC [Server ID Strategy](/hapi-fhir/apidocs/hapi-fhir-storage-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setResourceServerIdStrategy(ca.uhn.fhir.jpa.api.config.DaoConfig.IdStrategyEnum))
+ a client may be able to infer the IDs of resources in other partitions based on the ID they were assigned.
These considerations can be addressed by using UUID Server ID Strategy, and disallowing client-assigned IDs.
diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml
index e9b53373037..b3b32b8b321 100644
--- a/hapi-fhir-jacoco/pom.xml
+++ b/hapi-fhir-jacoco/pom.xml
@@ -11,7 +11,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -118,7 +118,7 @@
ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-api
+ hapi-fhir-storage-api
${project.version}
diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml
index 2887333a9c8..4e860ecd4b0 100644
--- a/hapi-fhir-jaxrsserver-base/pom.xml
+++ b/hapi-fhir-jaxrsserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml
new file mode 100644
index 00000000000..149ee8cb261
--- /dev/null
+++ b/hapi-fhir-jpa/pom.xml
@@ -0,0 +1,119 @@
+
+
+
+ ca.uhn.hapi.fhir
+ hapi-deployable-pom
+ 5.6.0-PRE6-SNAPSHOT
+ ../hapi-deployable-pom/pom.xml
+
+ 4.0.0
+
+ hapi-fhir-jpa
+ This project contains utility classes for working with spring-hibernate jpa and the Quartz Scheduler.
+
+
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-base
+ ${project.version}
+
+
+
+ javax.annotation
+ javax.annotation-api
+
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-structures-r4
+ ${project.version}
+
+
+
+
+ org.hibernate
+ hibernate-entitymanager
+
+
+ org.hibernate
+ hibernate-java8
+
+
+ org.hibernate
+ hibernate-ehcache
+
+
+ net.sf.ehcache
+ ehcache-core
+
+
+
+
+ org.hibernate.validator
+ hibernate-validator
+
+
+ com.fasterxml
+ classmate
+
+
+ org.jboss.logging
+ jboss-logging
+
+
+
+
+ org.hibernate.search
+ hibernate-search-mapper-orm
+
+
+ org.apache.logging.log4j
+ log4j-api
+
+
+
+
+
+ org.springframework
+ spring-beans
+
+
+ org.springframework
+ spring-orm
+
+
+ org.springframework
+ spring-context
+
+
+ xml-apis
+ xml-apis
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+ net.ttddyy
+ datasource-proxy
+
+
+
+
+
+ org.quartz-scheduler
+ quartz
+
+
+
+
+ org.apache.commons
+ commons-collections4
+
+
+
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java
similarity index 97%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java
index c0e3fcc1cf6..139d8056459 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirLocalContainerEntityManagerFactoryBean.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.config;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
@@ -23,7 +23,6 @@ package ca.uhn.fhir.jpa.config;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.query.criteria.LiteralHandlingMode;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.orm.hibernate5.SpringBeanContainer;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java
similarity index 97%
rename from hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java
index 54b21244673..55c9bd14974 100644
--- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/HapiJob.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.sched;
/*-
* #%L
- * HAPI FHIR JPA Model
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java
similarity index 97%
rename from hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java
index 28490808079..e3c7f5f211c 100644
--- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/IHapiScheduler.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.sched;
/*-
* #%L
- * HAPI FHIR JPA Model
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java
similarity index 98%
rename from hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java
index d4de58c1427..ca61f336722 100644
--- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISchedulerService.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.sched;
/*-
* #%L
- * HAPI FHIR JPA Model
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java
similarity index 97%
rename from hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java
index 203f0d7039a..3b13fcc6c30 100644
--- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ISmartLifecyclePhase.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.sched;
/*-
* #%L
- * HAPI FHIR JPA Model
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java
similarity index 98%
rename from hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java
index 6abfe39b8e5..65b41be9597 100644
--- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/model/sched/ScheduledJobDefinition.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.model.sched;
/*-
* #%L
- * HAPI FHIR JPA Model
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java
similarity index 95%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java
index 24c70a77d68..b29631b2ab9 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/AutowiringSpringBeanJobFactory.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
@@ -20,8 +20,7 @@ package ca.uhn.fhir.jpa.sched;
* #L%
*/
-import org.hl7.fhir.r5.model.InstantType;
-import org.hl7.fhir.utilities.DateTimeUtil;
+import org.hl7.fhir.r4.model.InstantType;
import org.quartz.JobKey;
import org.quartz.spi.TriggerFiredBundle;
import org.slf4j.Logger;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java
similarity index 93%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java
index 49edd277ed0..288ea5a8605 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
@@ -27,7 +27,15 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.Validate;
-import org.quartz.*;
+import org.quartz.JobDataMap;
+import org.quartz.JobKey;
+import org.quartz.ScheduleBuilder;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.SimpleScheduleBuilder;
+import org.quartz.Trigger;
+import org.quartz.TriggerBuilder;
+import org.quartz.TriggerKey;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.matchers.GroupMatcher;
@@ -41,8 +49,6 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
-import static org.quartz.impl.StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME;
-
public abstract class BaseHapiScheduler implements IHapiScheduler {
private static final Logger ourLog = LoggerFactory.getLogger(BaseHapiScheduler.class);
@@ -96,7 +102,7 @@ public abstract class BaseHapiScheduler implements IHapiScheduler {
protected void setProperties() {
addProperty("org.quartz.threadPool.threadCount", "4");
- myProperties.setProperty(PROP_SCHED_INSTANCE_NAME, myInstanceName + "-" + nextSchedulerId());
+ myProperties.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, myInstanceName + "-" + nextSchedulerId());
addProperty("org.quartz.threadPool.threadNamePrefix", getThreadPrefix());
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java
similarity index 99%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java
index 7b7e5cef61f..71f9664e1ac 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseSchedulerServiceImpl.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java
similarity index 97%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java
index b1ec4812aa5..e2738e8cdfc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/ClusteredHapiScheduler.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java
similarity index 98%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java
index 44d89110ff6..4141a76f63e 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiNullScheduler.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java
similarity index 97%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java
index 2bfb5ec83ba..cea59c2c120 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/HapiSchedulerServiceImpl.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java
similarity index 97%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java
index 41b90d503f7..d3ee459d268 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/LocalHapiScheduler.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.sched;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java
similarity index 99%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java
index ee05a385b97..e4d9a11f4d5 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java
similarity index 99%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java
index 1dc3a47ee17..68239b01831 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
@@ -24,7 +24,7 @@ import ca.uhn.fhir.util.StopWatch;
import com.google.common.collect.Queues;
import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder;
import org.apache.commons.collections4.queue.CircularFifoQueue;
-import org.hl7.fhir.dstu3.model.InstantType;
+import org.hl7.fhir.r4.model.InstantType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java
similarity index 99%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java
index 7c55cc6884c..36d01eb7c49 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/CurrentThreadCaptureQueriesListener.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java
similarity index 98%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java
index c0b3f22e008..5d869400e11 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/DerbyTenSevenHapiFhirDialect.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java
similarity index 99%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java
index d2221bd8eec..30e39105a8e 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQuery.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java
similarity index 97%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java
index e8dddd1ff81..ff83ab7f61e 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/SqlQueryList.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
similarity index 98%
rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
rename to hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
index 3b1ed6553fd..92282e69fcc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
+++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.util;
/*-
* #%L
- * HAPI FHIR JPA Server
+ * hapi-fhir-jpa
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
@@ -20,7 +20,6 @@ package ca.uhn.fhir.jpa.util;
* #L%
*/
-import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import com.google.common.collect.ImmutableSet;
@@ -347,16 +346,12 @@ public class TestUtil {
}
}
- public static void sleepAtLeast(long theMillis) {
- HapiTransactionService.sleepAtLeast(theMillis, true);
- }
-
public static InstantType getTimestamp(IBaseResource resource) {
return new InstantType(new Date(resource.getMeta().getLastUpdated().getTime()));
}
public static void sleepOneClick() {
- sleepAtLeast(1);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(1);
}
diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml
index 428612b17c4..807371d55f8 100644
--- a/hapi-fhir-jpaserver-base/pom.xml
+++ b/hapi-fhir-jpaserver-base/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -90,6 +90,11 @@
hapi-fhir-jpaserver-searchparam
${project.version}
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-sql-migrate
+ ${project.version}
+
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-model
@@ -147,13 +152,9 @@
ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-batch
+ hapi-fhir-batch
${project.version}
-
- net.ttddyy
- datasource-proxy
-
ch.qos.logback
@@ -307,12 +308,6 @@
provided
-
- org.quartz-scheduler
- quartz
-
-
-
org.springframework
@@ -324,24 +319,6 @@
-
- org.springframework
- spring-orm
-
-
- org.springframework
- spring-context
-
-
- xml-apis
- xml-apis
-
-
-
-
- org.springframework
- spring-beans
-
org.springframework.data
spring-data-jpa
@@ -376,40 +353,6 @@
org.springframework
spring-websocket
-
-
-
- org.hibernate
- hibernate-entitymanager
-
-
- org.hibernate
- hibernate-java8
-
-
- org.hibernate
- hibernate-ehcache
-
-
- net.sf.ehcache
- ehcache-core
-
-
-
-
- org.hibernate.validator
- hibernate-validator
-
-
- com.fasterxml
- classmate
-
-
- org.jboss.logging
- jboss-logging
-
-
-
javax.el
javax.el-api
@@ -426,16 +369,6 @@
log4j-to-slf4j
-
- org.hibernate.search
- hibernate-search-mapper-orm
-
-
- org.apache.logging.log4j
- log4j-api
-
-
-
org.elasticsearch.client
elasticsearch-rest-high-level-client
@@ -467,10 +400,6 @@
com.google.guava
guava
-
- org.apache.commons
- commons-collections4
-
org.eclipse.jetty
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/BatchJobsConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/BatchJobsConfig.java
index 9e96243d45c..f95d515ad18 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/BatchJobsConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/BatchJobsConfig.java
@@ -29,10 +29,6 @@ import ca.uhn.fhir.jpa.reindex.job.ReindexJobConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
@Configuration
//When you define a new batch job, add it here.
@Import({
@@ -45,60 +41,4 @@ import java.util.Set;
MdmClearJobConfig.class
})
public class BatchJobsConfig {
-
- /*
- * Bulk Export
- */
-
- public static final String BULK_EXPORT_JOB_NAME = "bulkExportJob";
- public static final String GROUP_BULK_EXPORT_JOB_NAME = "groupBulkExportJob";
- public static final String PATIENT_BULK_EXPORT_JOB_NAME = "patientBulkExportJob";
- public static final String BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP = "bulkExportGenerateResourceFilesStep";
-
- /*
- * Bulk Import
- */
-
- public static final String BULK_IMPORT_JOB_NAME = "bulkImportJob";
- public static final String BULK_IMPORT_PROCESSING_STEP = "bulkImportProcessingStep";
-
- /**
- * This Set contains the step names across all job types that are appropriate for
- * someone to look at the write count for that given step in order to determine the
- * number of processed records.
- *
- * This is provided since a job might have multiple steps that the same data passes
- * through, so you can't just sum up the total of all of them.
- *
- * For any given batch job type, there should only be one step name in this set
- */
- public static final Set RECORD_PROCESSING_STEP_NAMES;
-
- static {
- HashSet recordProcessingStepNames = new HashSet<>();
- recordProcessingStepNames.add(BULK_IMPORT_PROCESSING_STEP);
- recordProcessingStepNames.add(BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP);
- RECORD_PROCESSING_STEP_NAMES = Collections.unmodifiableSet(recordProcessingStepNames);
- }
-
- /**
- * Delete Expunge
- */
- public static final String DELETE_EXPUNGE_JOB_NAME = "deleteExpungeJob";
-
- /**
- * Reindex
- */
- public static final String REINDEX_JOB_NAME = "reindexJob";
-
- /**
- * Reindex Everything
- */
- public static final String REINDEX_EVERYTHING_JOB_NAME = "reindexEverythingJob";
-
- /**
- * MDM Clear
- */
- public static final String MDM_CLEAR_JOB_NAME = "mdmClearJob";
-
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/job/MultiUrlJobParameterValidator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/job/MultiUrlJobParameterValidator.java
index 57b77ea52ac..69774c7ac70 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/job/MultiUrlJobParameterValidator.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/job/MultiUrlJobParameterValidator.java
@@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.batch.job;
*/
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.model.PartitionedUrl;
import ca.uhn.fhir.jpa.batch.job.model.RequestListJson;
import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
@@ -29,8 +30,6 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.JobParametersValidator;
-import static ca.uhn.fhir.jpa.batch.reader.ReverseCronologicalBatchResourcePidReader.JOB_PARAM_REQUEST_LIST;
-
/**
* This class will prevent a job from running any of the provided URLs are not valid on this server.
*/
@@ -50,7 +49,7 @@ public class MultiUrlJobParameterValidator implements JobParametersValidator {
throw new JobParametersInvalidException("This job requires Parameters: [urlList]");
}
- RequestListJson requestListJson = RequestListJson.fromJson(theJobParameters.getString(JOB_PARAM_REQUEST_LIST));
+ RequestListJson requestListJson = RequestListJson.fromJson(theJobParameters.getString(BatchConstants.JOB_PARAM_REQUEST_LIST));
for (PartitionedUrl partitionedUrl : requestListJson.getPartitionedUrls()) {
String url = partitionedUrl.getUrl();
try {
@@ -60,7 +59,7 @@ public class MultiUrlJobParameterValidator implements JobParametersValidator {
throw new JobParametersInvalidException("The resource type " + resourceName + " is not supported on this server.");
}
} catch (UnsupportedOperationException e) {
- throw new JobParametersInvalidException("Failed to parse " + theJobParameters.getString(JOB_PARAM_OPERATION_NAME) + " " + JOB_PARAM_REQUEST_LIST + " item " + url + ": " + e.getMessage());
+ throw new JobParametersInvalidException("Failed to parse " + theJobParameters.getString(JOB_PARAM_OPERATION_NAME) + " " + BatchConstants.JOB_PARAM_REQUEST_LIST + " item " + url + ": " + e.getMessage());
}
}
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/MdmClearJobSubmitterImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/MdmClearJobSubmitterImpl.java
index 90bee86b963..246bebac7c4 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/MdmClearJobSubmitterImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/MdmClearJobSubmitterImpl.java
@@ -24,8 +24,8 @@ import ca.uhn.fhir.interceptor.api.HookParams;
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.PartitionedUrlValidator;
import ca.uhn.fhir.jpa.batch.job.model.RequestListJson;
import ca.uhn.fhir.jpa.batch.mdm.job.ReverseCronologicalBatchMdmLinkPidReader;
@@ -55,7 +55,7 @@ public class MdmClearJobSubmitterImpl implements IMdmClearJobSubmitter {
@Autowired
private IBatchJobSubmitter myBatchJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.MDM_CLEAR_JOB_NAME)
+ @Qualifier(BatchConstants.MDM_CLEAR_JOB_NAME)
private Job myMdmClearJob;
@Override
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/job/MdmClearJobConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/job/MdmClearJobConfig.java
index b2786f7cc84..9f8f339191b 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/job/MdmClearJobConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/mdm/job/MdmClearJobConfig.java
@@ -41,7 +41,7 @@ import org.springframework.context.annotation.Lazy;
import java.util.ArrayList;
import java.util.List;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.MDM_CLEAR_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.MDM_CLEAR_JOB_NAME;
/**
* Spring batch Job configuration file. Contains all necessary plumbing to run a
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/reader/BaseReverseCronologicalBatchPidReader.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/reader/BaseReverseCronologicalBatchPidReader.java
index 46c5e91c22f..d32a3c6cae3 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/reader/BaseReverseCronologicalBatchPidReader.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch/reader/BaseReverseCronologicalBatchPidReader.java
@@ -24,6 +24,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.batch.CommonBatchJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.MultiUrlJobParameterValidator;
import ca.uhn.fhir.jpa.batch.job.model.PartitionedUrl;
import ca.uhn.fhir.jpa.batch.job.model.RequestListJson;
@@ -58,22 +59,17 @@ import java.util.function.Function;
/**
* This Spring Batch reader takes 4 parameters:
- * {@link #JOB_PARAM_REQUEST_LIST}: A list of URLs to search for along with the partitions those searches should be performed on
- * {@link #JOB_PARAM_BATCH_SIZE}: The number of resources to return with each search. If ommitted, {@link DaoConfig#getExpungeBatchSize} will be used.
- * {@link #JOB_PARAM_START_TIME}: The latest timestamp of entities to search for
+ * {@link BatchConstants#JOB_PARAM_REQUEST_LIST}: A list of URLs to search for along with the partitions those searches should be performed on
+ * {@link BatchConstants#JOB_PARAM_BATCH_SIZE}: The number of resources to return with each search. If ommitted, {@link DaoConfig#getExpungeBatchSize} will be used.
+ * {@link BatchConstants#JOB_PARAM_START_TIME}: The latest timestamp of entities to search for
*
- * The reader will return at most {@link #JOB_PARAM_BATCH_SIZE} pids every time it is called, or null
+ * The reader will return at most {@link BatchConstants#JOB_PARAM_BATCH_SIZE} pids every time it is called, or null
* once no more matching entities are available. It returns the resources in reverse chronological order
- * and stores where it's at in the Spring Batch execution context with the key {@link #CURRENT_THRESHOLD_HIGH}
+ * and stores where it's at in the Spring Batch execution context with the key {@link BatchConstants#CURRENT_THRESHOLD_HIGH}
* appended with "." and the index number of the url list item it has gotten up to. This is to permit
* restarting jobs that use this reader so it can pick up where it left off.
*/
public abstract class BaseReverseCronologicalBatchPidReader implements ItemReader>, ItemStream {
- public static final String JOB_PARAM_REQUEST_LIST = "url-list";
- public static final String JOB_PARAM_BATCH_SIZE = "batch-size";
- public static final String JOB_PARAM_START_TIME = "start-time";
- public static final String CURRENT_URL_INDEX = "current.url-index";
- public static final String CURRENT_THRESHOLD_HIGH = "current.threshold-high";
private static final Logger ourLog = LoggerFactory.getLogger(ReverseCronologicalBatchResourcePidReader.class);
private final BatchDateThresholdUpdater myBatchDateThresholdUpdater = new BatchDateThresholdUpdater();
private final Map myThresholdHighByUrlIndex = new HashMap<>();
@@ -88,30 +84,30 @@ public abstract class BaseReverseCronologicalBatchPidReader implements ItemReade
private Date myStartTime;
private static String highKey(int theIndex) {
- return CURRENT_THRESHOLD_HIGH + "." + theIndex;
+ return BatchConstants.CURRENT_THRESHOLD_HIGH + "." + theIndex;
}
@Nonnull
public static JobParameters buildJobParameters(String theOperationName, Integer theBatchSize, RequestListJson theRequestListJson) {
Map map = new HashMap<>();
map.put(MultiUrlJobParameterValidator.JOB_PARAM_OPERATION_NAME, new JobParameter(theOperationName));
- map.put(ReverseCronologicalBatchResourcePidReader.JOB_PARAM_REQUEST_LIST, new JobParameter(theRequestListJson.toJson()));
- map.put(ReverseCronologicalBatchResourcePidReader.JOB_PARAM_START_TIME, new JobParameter(DateUtils.addMinutes(new Date(), CommonBatchJobConfig.MINUTES_IN_FUTURE_TO_PROCESS_FROM)));
+ map.put(BatchConstants.JOB_PARAM_REQUEST_LIST, new JobParameter(theRequestListJson.toJson()));
+ map.put(BatchConstants.JOB_PARAM_START_TIME, new JobParameter(DateUtils.addMinutes(new Date(), CommonBatchJobConfig.MINUTES_IN_FUTURE_TO_PROCESS_FROM)));
if (theBatchSize != null) {
- map.put(ReverseCronologicalBatchResourcePidReader.JOB_PARAM_BATCH_SIZE, new JobParameter(theBatchSize.longValue()));
+ map.put(BatchConstants.JOB_PARAM_BATCH_SIZE, new JobParameter(theBatchSize.longValue()));
}
JobParameters parameters = new JobParameters(map);
return parameters;
}
@Autowired
- public void setRequestListJson(@Value("#{jobParameters['" + JOB_PARAM_REQUEST_LIST + "']}") String theRequestListJson) {
+ public void setRequestListJson(@Value("#{jobParameters['" + BatchConstants.JOB_PARAM_REQUEST_LIST + "']}") String theRequestListJson) {
RequestListJson requestListJson = RequestListJson.fromJson(theRequestListJson);
myPartitionedUrls = requestListJson.getPartitionedUrls();
}
@Autowired
- public void setStartTime(@Value("#{jobParameters['" + JOB_PARAM_START_TIME + "']}") Date theStartTime) {
+ public void setStartTime(@Value("#{jobParameters['" + BatchConstants.JOB_PARAM_START_TIME + "']}") Date theStartTime) {
myStartTime = theStartTime;
}
@@ -166,8 +162,8 @@ public abstract class BaseReverseCronologicalBatchPidReader implements ItemReade
@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
- if (executionContext.containsKey(CURRENT_URL_INDEX)) {
- myUrlIndex = new Long(executionContext.getLong(CURRENT_URL_INDEX)).intValue();
+ if (executionContext.containsKey(BatchConstants.CURRENT_URL_INDEX)) {
+ myUrlIndex = new Long(executionContext.getLong(BatchConstants.CURRENT_URL_INDEX)).intValue();
}
for (int index = 0; index < myPartitionedUrls.size(); ++index) {
String key = highKey(index);
@@ -181,7 +177,7 @@ public abstract class BaseReverseCronologicalBatchPidReader implements ItemReade
@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
- executionContext.putLong(CURRENT_URL_INDEX, myUrlIndex);
+ executionContext.putLong(BatchConstants.CURRENT_URL_INDEX, myUrlIndex);
for (int index = 0; index < myPartitionedUrls.size(); ++index) {
Date date = myThresholdHighByUrlIndex.get(index);
if (date != null) {
@@ -199,7 +195,7 @@ public abstract class BaseReverseCronologicalBatchPidReader implements ItemReade
}
@Autowired
- public void setBatchSize(@Value("#{jobParameters['" + JOB_PARAM_BATCH_SIZE + "']}") Integer theBatchSize) {
+ public void setBatchSize(@Value("#{jobParameters['" + BatchConstants.JOB_PARAM_BATCH_SIZE + "']}") Integer theBatchSize) {
myBatchSize = theBatchSize;
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BaseBulkItemReader.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BaseBulkItemReader.java
index 7f934cfb248..6f647bd0e58 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BaseBulkItemReader.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BaseBulkItemReader.java
@@ -25,6 +25,7 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.context.RuntimeSearchParam;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.log.Logs;
import ca.uhn.fhir.jpa.dao.ISearchBuilder;
import ca.uhn.fhir.jpa.dao.SearchBuilderFactory;
@@ -57,7 +58,7 @@ public abstract class BaseBulkItemReader implements ItemReader, List>chunk(CHUNK_SIZE) //1000 resources per generated file, as the reader returns 10 resources at a time.
.reader(bulkItemReader())
.processor(myPidToIBaseResourceProcessor)
@@ -217,7 +216,7 @@ public class BulkExportJobConfig {
@Bean
public Step bulkExportPartitionStep() {
return myStepBuilderFactory.get("partitionStep")
- .partitioner(BatchJobsConfig.BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP, bulkExportResourceTypePartitioner())
+ .partitioner(BatchConstants.BULK_EXPORT_GENERATE_RESOURCE_FILES_STEP, bulkExportResourceTypePartitioner())
.step(bulkExportGenerateResourceFilesStep())
.build();
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BulkExportJobParameterValidator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BulkExportJobParameterValidator.java
index 64d06052d43..300a26c8c1f 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BulkExportJobParameterValidator.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BulkExportJobParameterValidator.java
@@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.bulk.export.job;
* #L%
*/
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.dao.data.IBulkExportJobDao;
import ca.uhn.fhir.jpa.entity.BulkExportJobEntity;
import ca.uhn.fhir.rest.api.Constants;
@@ -34,8 +35,6 @@ import org.springframework.transaction.support.TransactionTemplate;
import java.util.Arrays;
import java.util.Optional;
-import static org.slf4j.LoggerFactory.getLogger;
-
/**
* This class will prevent a job from running if the UUID does not exist or is invalid.
*/
@@ -59,7 +58,7 @@ public class BulkExportJobParameterValidator implements JobParametersValidator {
if (readChunkSize == null || readChunkSize < 1) {
errorBuilder.append("There must be a valid number for readChunkSize, which is at least 1. ");
}
- String jobUUID = theJobParameters.getString(BulkExportJobConfig.JOB_UUID_PARAMETER);
+ String jobUUID = theJobParameters.getString(BatchConstants.JOB_UUID_PARAMETER);
Optional oJob = myBulkExportJobDao.findByJobId(jobUUID);
if (!StringUtils.isBlank(jobUUID) && !oJob.isPresent()) {
errorBuilder.append("There is no persisted job that exists with UUID: " + jobUUID + ". ");
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java
index 9c10bcecba8..8be17cb3b4d 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/CreateBulkExportEntityTasklet.java
@@ -20,10 +20,11 @@ package ca.uhn.fhir.jpa.bulk.export.job;
* #L%
*/
-import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportSvc;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.api.Constants;
+import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions;
import org.apache.commons.lang3.StringUtils;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
@@ -42,18 +43,27 @@ public class CreateBulkExportEntityTasklet implements Tasklet {
@Autowired
private IBulkDataExportSvc myBulkDataExportSvc;
+ public static void addUUIDToJobContext(ChunkContext theChunkContext, String theJobUUID) {
+ theChunkContext
+ .getStepContext()
+ .getStepExecution()
+ .getJobExecution()
+ .getExecutionContext()
+ .putString(BatchConstants.JOB_UUID_PARAMETER, theJobUUID);
+ }
+
@Override
public RepeatStatus execute(StepContribution theStepContribution, ChunkContext theChunkContext) throws Exception {
Map jobParameters = theChunkContext.getStepContext().getJobParameters();
//We can leave early if they provided us with an existing job.
- if (jobParameters.containsKey(BulkExportJobConfig.JOB_UUID_PARAMETER)) {
- addUUIDToJobContext(theChunkContext, (String)jobParameters.get(BulkExportJobConfig.JOB_UUID_PARAMETER));
+ if (jobParameters.containsKey(BatchConstants.JOB_UUID_PARAMETER)) {
+ addUUIDToJobContext(theChunkContext, (String) jobParameters.get(BatchConstants.JOB_UUID_PARAMETER));
return RepeatStatus.FINISHED;
} else {
- String resourceTypes = (String)jobParameters.get("resourceTypes");
- Date since = (Date)jobParameters.get("since");
- String filters = (String)jobParameters.get("filters");
+ String resourceTypes = (String) jobParameters.get("resourceTypes");
+ Date since = (Date) jobParameters.get("since");
+ String filters = (String) jobParameters.get("filters");
Set filterSet;
if (StringUtils.isBlank(filters)) {
filterSet = null;
@@ -86,13 +96,4 @@ public class CreateBulkExportEntityTasklet implements Tasklet {
return RepeatStatus.FINISHED;
}
}
-
- public static void addUUIDToJobContext(ChunkContext theChunkContext, String theJobUUID) {
- theChunkContext
- .getStepContext()
- .getStepExecution()
- .getJobExecution()
- .getExecutionContext()
- .putString(BulkExportJobConfig.JOB_UUID_PARAMETER, theJobUUID);
- }
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/ResourceTypePartitioner.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/ResourceTypePartitioner.java
index 7eb612d2211..f341d25ffdc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/ResourceTypePartitioner.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/ResourceTypePartitioner.java
@@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.bulk.export.job;
* #L%
*/
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.svc.BulkExportDaoSvc;
import org.slf4j.Logger;
import org.springframework.batch.core.partition.support.Partitioner;
@@ -60,7 +61,7 @@ public class ResourceTypePartitioner implements Partitioner {
// The worker step needs to know which parent job it is processing for, and which collection entity it will be
// attaching its results to.
- context.putString(BulkExportJobConfig.JOB_UUID_PARAMETER, myJobUUID);
+ context.putString(BatchConstants.JOB_UUID_PARAMETER, myJobUUID);
context.putLong("bulkExportCollectionEntityId", collectionEntityId);
// Name the partition based on the resource type
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportSvcImpl.java
index ab862ce44f2..2caa72135bc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportSvcImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportSvcImpl.java
@@ -30,9 +30,8 @@ import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
-import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportSvc;
import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
import ca.uhn.fhir.jpa.bulk.export.model.BulkExportJobStatusEnum;
@@ -49,6 +48,7 @@ import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.jpa.partition.SystemRequestDetails;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.server.RequestDetails;
+import ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
@@ -114,15 +114,15 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
private IBatchJobSubmitter myJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.BULK_EXPORT_JOB_NAME)
private org.springframework.batch.core.Job myBulkExportJob;
@Autowired
- @Qualifier(BatchJobsConfig.GROUP_BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.GROUP_BULK_EXPORT_JOB_NAME)
private org.springframework.batch.core.Job myGroupBulkExportJob;
@Autowired
- @Qualifier(BatchJobsConfig.PATIENT_BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.PATIENT_BULK_EXPORT_JOB_NAME)
private org.springframework.batch.core.Job myPatientBulkExportJob;
private Set myCompartmentResources;
@@ -243,7 +243,7 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
private void processJob(BulkExportJobEntity theBulkExportJobEntity) {
String theJobUuid = theBulkExportJobEntity.getJobId();
JobParametersBuilder parameters = new JobParametersBuilder()
- .addString(BulkExportJobConfig.JOB_UUID_PARAMETER, theJobUuid)
+ .addString(BatchConstants.JOB_UUID_PARAMETER, theJobUuid)
.addLong(BulkExportJobConfig.READ_CHUNK_PARAMETER, READ_CHUNK_SIZE);
ourLog.info("Submitting bulk export job {} to job scheduler", theJobUuid);
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/ActivateBulkImportEntityStepListener.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/ActivateBulkImportEntityStepListener.java
index 52520edf6b3..994aea3796e 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/ActivateBulkImportEntityStepListener.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/ActivateBulkImportEntityStepListener.java
@@ -20,10 +20,9 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobStatusEnum;
-import org.elasticsearch.client.enrich.ExecutePolicyResponse;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
@@ -39,7 +38,7 @@ public class ActivateBulkImportEntityStepListener implements StepExecutionListen
@Override
public void beforeStep(StepExecution theStepExecution) {
- String jobUuid = theStepExecution.getJobExecution().getJobParameters().getString(BulkExportJobConfig.JOB_UUID_PARAMETER);
+ String jobUuid = theStepExecution.getJobExecution().getJobParameters().getString(BatchConstants.JOB_UUID_PARAMETER);
if (jobUuid != null) {
myBulkImportDaoSvc.setJobToStatus(jobUuid, BulkImportJobStatusEnum.RUNNING);
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileReader.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileReader.java
index c16e7c3f67c..c1e4bec40fd 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileReader.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileReader.java
@@ -21,8 +21,8 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
*/
import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.log.Logs;
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobFileJson;
import ca.uhn.fhir.jpa.bulk.imprt.model.ParsedBulkImportRecord;
@@ -42,7 +42,7 @@ public class BulkImportFileReader implements ItemReader
private IBulkDataImportSvc myBulkDataImportSvc;
@Autowired
private FhirContext myFhirContext;
- @Value("#{stepExecutionContext['" + BulkExportJobConfig.JOB_UUID_PARAMETER + "']}")
+ @Value("#{stepExecutionContext['" + BatchConstants.JOB_UUID_PARAMETER + "']}")
private String myJobUuid;
@Value("#{stepExecutionContext['" + BulkImportPartitioner.FILE_INDEX + "']}")
private int myFileIndex;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileWriter.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileWriter.java
index 37a49ca2a95..5edc7ef9e23 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileWriter.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportFileWriter.java
@@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.model.JobFileRowProcessingModeEnum;
import ca.uhn.fhir.jpa.bulk.imprt.model.ParsedBulkImportRecord;
import ca.uhn.fhir.jpa.partition.SystemRequestDetails;
@@ -39,7 +39,7 @@ import java.util.List;
public class BulkImportFileWriter implements ItemWriter {
private static final Logger ourLog = LoggerFactory.getLogger(BulkImportFileWriter.class);
- @Value("#{stepExecutionContext['" + BulkExportJobConfig.JOB_UUID_PARAMETER + "']}")
+ @Value("#{stepExecutionContext['" + BatchConstants.JOB_UUID_PARAMETER + "']}")
private String myJobUuid;
@Value("#{stepExecutionContext['" + BulkImportPartitioner.FILE_INDEX + "']}")
private int myFileIndex;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobCloser.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobCloser.java
index 504874e327d..3866829bf16 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobCloser.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobCloser.java
@@ -20,7 +20,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobStatusEnum;
import org.springframework.batch.core.BatchStatus;
@@ -36,7 +36,7 @@ import org.springframework.beans.factory.annotation.Value;
*/
public class BulkImportJobCloser implements Tasklet {
- @Value("#{jobParameters['" + BulkExportJobConfig.JOB_UUID_PARAMETER + "']}")
+ @Value("#{jobParameters['" + BatchConstants.JOB_UUID_PARAMETER + "']}")
private String myJobUUID;
@Autowired
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobConfig.java
index b235c81ea2b..019b5db8ed1 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobConfig.java
@@ -21,14 +21,13 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
*/
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchConstants;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.model.ParsedBulkImportRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParametersValidator;
import org.springframework.batch.core.Step;
-import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.JobScope;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
@@ -50,8 +49,8 @@ import org.springframework.retry.policy.TimeoutRetryPolicy;
import javax.batch.api.chunk.listener.RetryProcessListener;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.BULK_IMPORT_JOB_NAME;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.BULK_IMPORT_PROCESSING_STEP;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.BULK_IMPORT_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.BULK_IMPORT_PROCESSING_STEP;
/**
* Spring batch Job configuration file. Contains all necessary plumbing to run a
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobParameterValidator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobParameterValidator.java
index a46405fec31..c26673665ed 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobParameterValidator.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportJobParameterValidator.java
@@ -20,7 +20,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.dao.data.IBulkImportJobDao;
import ca.uhn.fhir.jpa.entity.BulkImportJobEntity;
import org.apache.commons.lang3.StringUtils;
@@ -52,7 +52,7 @@ public class BulkImportJobParameterValidator implements JobParametersValidator {
TransactionTemplate txTemplate = new TransactionTemplate(myTransactionManager);
String errorMessage = txTemplate.execute(tx -> {
StringBuilder errorBuilder = new StringBuilder();
- String jobUUID = theJobParameters.getString(BulkExportJobConfig.JOB_UUID_PARAMETER);
+ String jobUUID = theJobParameters.getString(BatchConstants.JOB_UUID_PARAMETER);
Optional oJob = myBulkImportJobDao.findByJobId(jobUUID);
if (!StringUtils.isBlank(jobUUID) && !oJob.isPresent()) {
errorBuilder.append("There is no persisted job that exists with UUID: ");
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportPartitioner.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportPartitioner.java
index 6a88cfbecab..6df34a9571d 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportPartitioner.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportPartitioner.java
@@ -20,7 +20,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobJson;
import org.slf4j.Logger;
@@ -43,7 +43,7 @@ public class BulkImportPartitioner implements Partitioner {
private static final Logger ourLog = getLogger(BulkImportPartitioner.class);
- @Value("#{jobParameters['" + BulkExportJobConfig.JOB_UUID_PARAMETER + "']}")
+ @Value("#{jobParameters['" + BatchConstants.JOB_UUID_PARAMETER + "']}")
private String myJobUUID;
@Autowired
@@ -61,7 +61,7 @@ public class BulkImportPartitioner implements Partitioner {
String fileDescription = myBulkDataImportSvc.getFileDescription(myJobUUID, i);
ExecutionContext context = new ExecutionContext();
- context.putString(BulkExportJobConfig.JOB_UUID_PARAMETER, myJobUUID);
+ context.putString(BatchConstants.JOB_UUID_PARAMETER, myJobUUID);
context.putInt(FILE_INDEX, i);
context.put(ROW_PROCESSING_MODE, job.getProcessingMode());
context.put(JOB_DESCRIPTION, job.getJobDescription());
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportStepListener.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportStepListener.java
index 2861780a4ff..014ec74a92b 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportStepListener.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/BulkImportStepListener.java
@@ -20,7 +20,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobStatusEnum;
import org.springframework.batch.core.ExitStatus;
@@ -52,9 +52,9 @@ public class BulkImportStepListener implements StepExecutionListener, RetryListe
public ExitStatus afterStep(StepExecution theStepExecution) {
if (theStepExecution.getExitStatus().getExitCode().equals(ExitStatus.FAILED.getExitCode())) {
//Try to fetch it from the parameters first, and if it doesn't exist, fetch it from the context.
- String jobUuid = theStepExecution.getJobExecution().getJobParameters().getString(BulkExportJobConfig.JOB_UUID_PARAMETER);
+ String jobUuid = theStepExecution.getJobExecution().getJobParameters().getString(BatchConstants.JOB_UUID_PARAMETER);
if (jobUuid == null) {
- jobUuid = theStepExecution.getJobExecution().getExecutionContext().getString(BulkExportJobConfig.JOB_UUID_PARAMETER);
+ jobUuid = theStepExecution.getJobExecution().getExecutionContext().getString(BatchConstants.JOB_UUID_PARAMETER);
}
assert isNotBlank(jobUuid);
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/CreateBulkImportEntityTasklet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/CreateBulkImportEntityTasklet.java
index c543ba4961f..2d93b98c98f 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/CreateBulkImportEntityTasklet.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/job/CreateBulkImportEntityTasklet.java
@@ -20,7 +20,7 @@ package ca.uhn.fhir.jpa.bulk.imprt.job;
* #L%
*/
-import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.job.CreateBulkExportEntityTasklet;
import ca.uhn.fhir.util.ValidateUtil;
import org.springframework.batch.core.StepContribution;
@@ -37,8 +37,8 @@ public class CreateBulkImportEntityTasklet implements Tasklet {
Map jobParameters = theChunkContext.getStepContext().getJobParameters();
//We can leave early if they provided us with an existing job.
- ValidateUtil.isTrueOrThrowInvalidRequest(jobParameters.containsKey(BulkExportJobConfig.JOB_UUID_PARAMETER), "Job doesn't have a UUID");
- CreateBulkExportEntityTasklet.addUUIDToJobContext(theChunkContext, (String) jobParameters.get(BulkExportJobConfig.JOB_UUID_PARAMETER));
+ ValidateUtil.isTrueOrThrowInvalidRequest(jobParameters.containsKey(BatchConstants.JOB_UUID_PARAMETER), "Job doesn't have a UUID");
+ CreateBulkExportEntityTasklet.addUUIDToJobContext(theChunkContext, (String) jobParameters.get(BatchConstants.JOB_UUID_PARAMETER));
return RepeatStatus.FINISHED;
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportSvcImpl.java
index 7c162ea8aca..3124eb43dbf 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportSvcImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportSvcImpl.java
@@ -21,8 +21,8 @@ package ca.uhn.fhir.jpa.bulk.imprt.svc;
*/
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.log.Logs;
import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
@@ -79,7 +79,7 @@ public class BulkDataImportSvcImpl implements IBulkDataImportSvc {
@Autowired
private IBatchJobSubmitter myJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.BULK_IMPORT_JOB_NAME)
+ @Qualifier(BatchConstants.BULK_IMPORT_JOB_NAME)
private org.springframework.batch.core.Job myBulkImportJob;
@Autowired
private DaoConfig myDaoConfig;
@@ -271,7 +271,7 @@ public class BulkDataImportSvcImpl implements IBulkDataImportSvc {
ValidateUtil.isTrueOrThrowInvalidRequest(batchSize > 0, "Batch size must be positive");
JobParametersBuilder parameters = new JobParametersBuilder()
- .addString(BulkExportJobConfig.JOB_UUID_PARAMETER, jobId)
+ .addString(BatchConstants.JOB_UUID_PARAMETER, jobId)
.addLong(BulkImportJobConfig.JOB_PARAM_COMMIT_INTERVAL, (long) batchSize);
if (isNotBlank(theBulkExportJobEntity.getJobDescription())) {
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java
index 72a2535faef..f2a6ccfe046 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java
@@ -11,9 +11,9 @@ import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IDao;
import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc;
-import ca.uhn.fhir.jpa.batch.BatchConstants;
import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.config.NonPersistedBatchConfigurer;
import ca.uhn.fhir.jpa.batch.job.PartitionedUrlValidator;
import ca.uhn.fhir.jpa.batch.mdm.MdmBatchJobSubmitterFactoryImpl;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java
index 4a9c94376c8..200ac7a6861 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java
@@ -32,6 +32,7 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster;
+import ca.uhn.fhir.util.TestUtil;
import com.google.common.annotations.VisibleForTesting;
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
import org.slf4j.Logger;
@@ -118,7 +119,7 @@ public class HapiTransactionService {
theTransactionDetails.clearUserData(BaseHapiFhirDao.XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS);
double sleepAmount = (250.0d * i) * Math.random();
long sleepAmountLong = (long) sleepAmount;
- sleepAtLeast(sleepAmountLong, false);
+ TestUtil.sleepAtLeast(sleepAmountLong, false);
ourLog.info("About to start a transaction retry due to conflict or constraint error. Sleeping {}ms first.", sleepAmountLong);
continue;
@@ -164,22 +165,4 @@ public class HapiTransactionService {
super(theThrowable);
}
}
-
- @SuppressWarnings("BusyWait")
- public static void sleepAtLeast(long theMillis, boolean theLogProgress) {
- long start = System.currentTimeMillis();
- while (System.currentTimeMillis() <= start + theMillis) {
- try {
- long timeSinceStarted = System.currentTimeMillis() - start;
- long timeToSleep = Math.max(0, theMillis - timeSinceStarted);
- if (theLogProgress) {
- ourLog.info("Sleeping for {}ms", timeToSleep);
- }
- Thread.sleep(timeToSleep);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- ourLog.error("Interrupted", e);
- }
- }
- }
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteExpungeJobSubmitterImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteExpungeJobSubmitterImpl.java
index 73e561d1dd1..deb926ab426 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteExpungeJobSubmitterImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/DeleteExpungeJobSubmitterImpl.java
@@ -25,8 +25,8 @@ import ca.uhn.fhir.interceptor.api.HookParams;
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.PartitionedUrlValidator;
import ca.uhn.fhir.jpa.batch.job.model.RequestListJson;
import ca.uhn.fhir.jpa.batch.reader.ReverseCronologicalBatchResourcePidReader;
@@ -52,7 +52,7 @@ public class DeleteExpungeJobSubmitterImpl implements IDeleteExpungeJobSubmitter
@Autowired
private IBatchJobSubmitter myBatchJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.DELETE_EXPUNGE_JOB_NAME)
+ @Qualifier(BatchConstants.DELETE_EXPUNGE_JOB_NAME)
private Job myDeleteExpungeJob;
@Autowired
FhirContext myFhirContext;
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobConfig.java
index 756aab743e4..4ab6c91bea4 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobConfig.java
@@ -20,12 +20,10 @@ package ca.uhn.fhir.jpa.delete.job;
* #L%
*/
-import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.batch.job.MultiUrlJobParameterValidator;
import ca.uhn.fhir.jpa.batch.listener.PidReaderCounterListener;
import ca.uhn.fhir.jpa.batch.reader.ReverseCronologicalBatchResourcePidReader;
import ca.uhn.fhir.jpa.batch.writer.SqlExecutorWriter;
-import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
@@ -39,7 +37,7 @@ import org.springframework.context.annotation.Lazy;
import java.util.List;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.DELETE_EXPUNGE_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.DELETE_EXPUNGE_JOB_NAME;
/**
* Spring batch Job configuration file. Contains all necessary plumbing to run a
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/MdmSearchExpandingInterceptor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/MdmSearchExpandingInterceptor.java
index 1ec7b3593c9..5eb66b5aab2 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/MdmSearchExpandingInterceptor.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/MdmSearchExpandingInterceptor.java
@@ -29,9 +29,7 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.mdm.log.Logs;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.primitive.IdDt;
-import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.param.ReferenceParam;
-import joptsimple.internal.Strings;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@@ -39,8 +37,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import static org.slf4j.LoggerFactory.getLogger;
-
/**
* This interceptor replaces the auto-generated CapabilityStatement that is generated
* by the HAPI FHIR Server with a static hard-coded resource.
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java
similarity index 99%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java
rename to hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java
index 5cd1eb78135..2229c43cb64 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java
@@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.migrate.tasks;
/*-
* #%L
- * HAPI FHIR JPA Server - Migration
+ * HAPI FHIR JPA Server
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProvider.java
index 05c695f6b47..876bae329fe 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProvider.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaSystemProvider.java
@@ -50,13 +50,13 @@ public class BaseJpaSystemProvider extends BaseJpaProvider implements IJp
* @deprecated
*/
@Deprecated
- public static final String MARK_ALL_RESOURCES_FOR_REINDEXING = "$mark-all-resources-for-reindexing";
+ public static final String MARK_ALL_RESOURCES_FOR_REINDEXING = ProviderConstants.MARK_ALL_RESOURCES_FOR_REINDEXING;
/**
* @see ProviderConstants#OPERATION_REINDEX
* @deprecated
*/
@Deprecated
- public static final String PERFORM_REINDEXING_PASS = "$perform-reindexing-pass";
+ public static final String PERFORM_REINDEXING_PASS = ProviderConstants.PERFORM_REINDEXING_PASS;
private IFhirSystemDao myDao;
@Autowired
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/ReindexJobSubmitterImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/ReindexJobSubmitterImpl.java
index 582eba93e23..572d2f5e409 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/ReindexJobSubmitterImpl.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/ReindexJobSubmitterImpl.java
@@ -22,8 +22,8 @@ package ca.uhn.fhir.jpa.reindex;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.PartitionedUrlValidator;
import ca.uhn.fhir.jpa.batch.job.model.RequestListJson;
import ca.uhn.fhir.jpa.batch.reader.CronologicalBatchAllResourcePidReader;
@@ -53,10 +53,10 @@ public class ReindexJobSubmitterImpl implements IReindexJobSubmitter {
@Autowired
private IBatchJobSubmitter myBatchJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.REINDEX_JOB_NAME)
+ @Qualifier(BatchConstants.REINDEX_JOB_NAME)
private Job myReindexJob;
@Autowired
- @Qualifier(BatchJobsConfig.REINDEX_EVERYTHING_JOB_NAME)
+ @Qualifier(BatchConstants.REINDEX_EVERYTHING_JOB_NAME)
private Job myReindexEverythingJob;
@Override
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexEverythingJobConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexEverythingJobConfig.java
index 33fdfaf8ece..48b9c3683c0 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexEverythingJobConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexEverythingJobConfig.java
@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Lazy;
import java.util.List;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.REINDEX_EVERYTHING_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.REINDEX_EVERYTHING_JOB_NAME;
/**
* Spring batch Job configuration file. Contains all necessary plumbing to run a
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexJobConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexJobConfig.java
index c5465ec3533..d3aa68c8fda 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexJobConfig.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/job/ReindexJobConfig.java
@@ -20,18 +20,14 @@ package ca.uhn.fhir.jpa.reindex.job;
* #L%
*/
-import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.batch.job.MultiUrlJobParameterValidator;
import ca.uhn.fhir.jpa.batch.listener.PidReaderCounterListener;
import ca.uhn.fhir.jpa.batch.reader.ReverseCronologicalBatchResourcePidReader;
-import ca.uhn.fhir.jpa.batch.writer.SqlExecutorWriter;
-import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.listener.ExecutionContextPromotionListener;
-import org.springframework.batch.item.ItemReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -39,7 +35,7 @@ import org.springframework.context.annotation.Lazy;
import java.util.List;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.REINDEX_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.REINDEX_JOB_NAME;
/**
* Spring batch Job configuration file. Contains all necessary plumbing to run a
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java
index 019e799e760..2aea7021f12 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportSvcImplR4Test.java
@@ -6,8 +6,8 @@ import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportSvc;
import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobParametersBuilder;
import ca.uhn.fhir.jpa.bulk.export.job.GroupBulkExportJobParametersBuilder;
@@ -102,15 +102,15 @@ public class BulkDataExportSvcImplR4Test extends BaseJpaR4Test {
private BatchJobHelper myBatchJobHelper;
@Autowired
- @Qualifier(BatchJobsConfig.BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.BULK_EXPORT_JOB_NAME)
private Job myBulkJob;
@Autowired
- @Qualifier(BatchJobsConfig.GROUP_BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.GROUP_BULK_EXPORT_JOB_NAME)
private Job myGroupBulkJob;
@Autowired
- @Qualifier(BatchJobsConfig.PATIENT_BULK_EXPORT_JOB_NAME)
+ @Qualifier(BatchConstants.PATIENT_BULK_EXPORT_JOB_NAME)
private Job myPatientBulkJob;
private IIdType myPatientGroupId;
@@ -328,11 +328,11 @@ public class BulkDataExportSvcImplR4Test extends BaseJpaR4Test {
private void awaitAllBulkJobCompletions() {
myBatchJobHelper.awaitAllBulkJobCompletions(
- BatchJobsConfig.BULK_EXPORT_JOB_NAME,
- BatchJobsConfig.PATIENT_BULK_EXPORT_JOB_NAME,
- BatchJobsConfig.GROUP_BULK_EXPORT_JOB_NAME,
- BatchJobsConfig.DELETE_EXPUNGE_JOB_NAME,
- BatchJobsConfig.MDM_CLEAR_JOB_NAME
+ BatchConstants.BULK_EXPORT_JOB_NAME,
+ BatchConstants.PATIENT_BULK_EXPORT_JOB_NAME,
+ BatchConstants.GROUP_BULK_EXPORT_JOB_NAME,
+ BatchConstants.DELETE_EXPUNGE_JOB_NAME,
+ BatchConstants.MDM_CLEAR_JOB_NAME
);
}
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java
index e34f63b3985..3eeb2fbea3c 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java
@@ -5,7 +5,7 @@ import ca.uhn.fhir.interceptor.api.HookParams;
import ca.uhn.fhir.interceptor.api.IAnonymousInterceptor;
import ca.uhn.fhir.interceptor.api.Interceptor;
import ca.uhn.fhir.interceptor.api.Pointcut;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.bulk.export.job.BulkExportJobConfig;
import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc;
import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobFileJson;
@@ -44,7 +44,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
-import static ca.uhn.fhir.jpa.batch.BatchJobsConfig.BULK_IMPORT_JOB_NAME;
+import static ca.uhn.fhir.jpa.batch.config.BatchConstants.BULK_IMPORT_JOB_NAME;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
@@ -212,7 +212,7 @@ public class BulkDataImportR4Test extends BaseJpaR4Test implements ITestDataBuil
}
protected List awaitAllBulkImportJobCompletion() {
- return myBatchJobHelper.awaitAllBulkJobCompletions(BatchJobsConfig.BULK_IMPORT_JOB_NAME);
+ return myBatchJobHelper.awaitAllBulkJobCompletions(BatchConstants.BULK_IMPORT_JOB_NAME);
}
@Interceptor
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchNoHashesTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchNoHashesTest.java
index 86220f8281d..23a9385d684 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchNoHashesTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchNoHashesTest.java
@@ -1451,9 +1451,9 @@ public class FhirResourceDaoR4SearchNoHashesTest extends BaseJpaR4Test {
id1b = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless();
}
- TestUtil.sleepAtLeast(1100);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(1100);
DateTimeType beforeR2 = new DateTimeType(new Date(), TemporalPrecisionEnum.MILLI);
- TestUtil.sleepAtLeast(1100);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(1100);
IIdType id2;
{
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java
index 2ea2fac62a0..64c22c667d6 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java
@@ -6,11 +6,11 @@ import ca.uhn.fhir.jpa.entity.Search;
import ca.uhn.fhir.jpa.model.search.SearchStatusEnum;
import ca.uhn.fhir.jpa.search.cache.DatabaseSearchCacheSvcImpl;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
-import ca.uhn.fhir.jpa.util.TestUtil;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.util.StopWatch;
+import ca.uhn.fhir.util.TestUtil;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.time.DateUtils;
import org.hl7.fhir.instance.model.api.IIdType;
@@ -116,7 +116,7 @@ public class FhirResourceDaoR4SearchPageExpiryTest extends BaseJpaR4Test {
}
assertEquals(searchUuid1, searchUuid2);
- TestUtil.sleepAtLeast(reuseCachedSearchResultsForMillis + 1);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(reuseCachedSearchResultsForMillis + 1);
// We're now past reuseCachedSearchResultsForMillis so we shouldn't reuse the search
@@ -291,7 +291,7 @@ public class FhirResourceDaoR4SearchPageExpiryTest extends BaseJpaR4Test {
}
assertEquals(searchUuid1, searchUuid2);
- TestUtil.sleepAtLeast(reuseCachedSearchResultsForMillis + 1);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(reuseCachedSearchResultsForMillis + 1);
myStaleSearchDeletingSvc.pollForStaleSearchesAndDeleteThem();
// We're now past reuseCachedSearchResultsForMillis so we shouldn't reuse the search
@@ -376,7 +376,7 @@ public class FhirResourceDaoR4SearchPageExpiryTest extends BaseJpaR4Test {
}
});
if (search == null) {
- TestUtil.sleepAtLeast(100);
+ ca.uhn.fhir.util.TestUtil.sleepAtLeast(100);
}
}
assertNotNull(search, "Search " + bundleProvider.getUuid() + " not found on disk after 10 seconds");
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/JpaHistoryR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/JpaHistoryR4Test.java
index 8c9ec09fda1..096e37a461b 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/JpaHistoryR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/JpaHistoryR4Test.java
@@ -22,7 +22,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import static ca.uhn.fhir.jpa.util.TestUtil.sleepAtLeast;
+import static ca.uhn.fhir.util.TestUtil.sleepAtLeast;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java
index 150e795a5be..24bb7903c64 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/PartitioningSqlR4Test.java
@@ -72,7 +72,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import java.util.stream.Collectors;
-import static ca.uhn.fhir.jpa.util.TestUtil.sleepAtLeast;
+import static ca.uhn.fhir.util.TestUtil.sleepAtLeast;
import static org.apache.commons.lang3.StringUtils.countMatches;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobTest.java
index 442102c0973..3931f4abb62 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/DeleteExpungeJobTest.java
@@ -1,7 +1,7 @@
package ca.uhn.fhir.jpa.delete.job;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.MultiUrlJobParameterUtil;
import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
@@ -23,7 +23,7 @@ public class DeleteExpungeJobTest extends BaseJpaR4Test {
@Autowired
private IBatchJobSubmitter myBatchJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.DELETE_EXPUNGE_JOB_NAME)
+ @Qualifier(BatchConstants.DELETE_EXPUNGE_JOB_NAME)
private Job myDeleteExpungeJob;
@Autowired
private BatchJobHelper myBatchJobHelper;
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexJobTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexJobTest.java
index 61018ef82b1..8df82b52b93 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexJobTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexJobTest.java
@@ -1,8 +1,8 @@
package ca.uhn.fhir.jpa.delete.job;
-import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
import ca.uhn.fhir.jpa.batch.CommonBatchJobConfig;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
+import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.job.MultiUrlJobParameterUtil;
import ca.uhn.fhir.jpa.batch.reader.CronologicalBatchAllResourcePidReader;
import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test;
@@ -37,10 +37,10 @@ public class ReindexJobTest extends BaseJpaR4Test {
@Autowired
private IBatchJobSubmitter myBatchJobSubmitter;
@Autowired
- @Qualifier(BatchJobsConfig.REINDEX_JOB_NAME)
+ @Qualifier(BatchConstants.REINDEX_JOB_NAME)
private Job myReindexJob;
@Autowired
- @Qualifier(BatchJobsConfig.REINDEX_EVERYTHING_JOB_NAME)
+ @Qualifier(BatchConstants.REINDEX_EVERYTHING_JOB_NAME)
private Job myReindexEverythingJob;
@Autowired
private BatchJobHelper myBatchJobHelper;
diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTaskTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTaskTest.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTaskTest.java
rename to hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTaskTest.java
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java
new file mode 100644
index 00000000000..878cc32cdbf
--- /dev/null
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java
@@ -0,0 +1,161 @@
+package ca.uhn.fhir.jpa.migrate.taskdef;
+
+import ca.uhn.fhir.jpa.migrate.DriverTypeEnum;
+import ca.uhn.fhir.jpa.migrate.FlywayMigrator;
+import ca.uhn.fhir.jpa.migrate.JdbcUtils;
+import ca.uhn.fhir.jpa.migrate.SchemaMigrator;
+import org.apache.commons.dbcp2.BasicDataSource;
+import org.intellij.lang.annotations.Language;
+import org.junit.jupiter.api.AfterEach;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Supplier;
+import java.util.stream.Stream;
+
+// TODO KHS copied from hapi-fhir-sql-migrate
+public abstract class BaseTest {
+
+ private static final String DATABASE_NAME = "DATABASE";
+ private static final Logger ourLog = LoggerFactory.getLogger(BaseTest.class);
+ private static int ourDatabaseUrl = 0;
+ private BasicDataSource myDataSource;
+ private String myUrl;
+ private FlywayMigrator myMigrator;
+ private DriverTypeEnum.ConnectionProperties myConnectionProperties;
+
+ public static Stream> data() {
+ ourLog.info("H2: {}", org.h2.Driver.class.toString());
+
+ ArrayList> retVal = new ArrayList<>();
+
+ // H2
+ retVal.add(new Supplier() {
+ @Override
+ public TestDatabaseDetails get() {
+ String url = "jdbc:h2:mem:" + DATABASE_NAME + ourDatabaseUrl++;
+ DriverTypeEnum.ConnectionProperties connectionProperties = DriverTypeEnum.H2_EMBEDDED.newConnectionProperties(url, "SA", "SA");
+ BasicDataSource dataSource = new BasicDataSource();
+ dataSource.setUrl(url);
+ dataSource.setUsername("SA");
+ dataSource.setPassword("SA");
+ dataSource.setDriverClassName(DriverTypeEnum.H2_EMBEDDED.getDriverClassName());
+ FlywayMigrator migrator = new FlywayMigrator(SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME, dataSource, DriverTypeEnum.H2_EMBEDDED);
+ return new TestDatabaseDetails(url, connectionProperties, dataSource, migrator);
+ }
+
+ @Override
+ public String toString() {
+ return "H2";
+ }
+ });
+
+ // Derby
+ retVal.add(new Supplier() {
+ @Override
+ public TestDatabaseDetails get() {
+ String url = "jdbc:derby:memory:" + DATABASE_NAME + ourDatabaseUrl++ + ";create=true";
+ DriverTypeEnum.ConnectionProperties connectionProperties = DriverTypeEnum.DERBY_EMBEDDED.newConnectionProperties(url, "SA", "SA");
+ BasicDataSource dataSource = new BasicDataSource();
+ dataSource.setUrl(url);
+ dataSource.setUsername("SA");
+ dataSource.setPassword("SA");
+ dataSource.setDriverClassName(DriverTypeEnum.DERBY_EMBEDDED.getDriverClassName());
+ FlywayMigrator migrator = new FlywayMigrator(SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME, dataSource, DriverTypeEnum.DERBY_EMBEDDED);
+ return new TestDatabaseDetails(url, connectionProperties, dataSource, migrator);
+ }
+
+ @Override
+ public String toString() {
+ return "Derby";
+ }
+ });
+
+ return retVal.stream();
+ }
+
+ public void before(Supplier theTestDatabaseDetails) {
+ TestDatabaseDetails testDatabaseDetails = theTestDatabaseDetails.get();
+ myUrl = testDatabaseDetails.myUrl;
+ myConnectionProperties = testDatabaseDetails.myConnectionProperties;
+ myDataSource = testDatabaseDetails.myDataSource;
+ myMigrator = testDatabaseDetails.myMigrator;
+ }
+
+ public String getUrl() {
+ return myUrl;
+ }
+
+ public DriverTypeEnum.ConnectionProperties getConnectionProperties() {
+ return myConnectionProperties;
+ }
+
+ protected BasicDataSource getDataSource() {
+ return myDataSource;
+ }
+
+ @AfterEach
+ public void resetMigrationVersion() throws SQLException {
+ if (getConnectionProperties() != null) {
+ Set tableNames = JdbcUtils.getTableNames(getConnectionProperties());
+ if (tableNames.contains(SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME)) {
+ executeSql("DELETE from " + SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME + " where \"installed_rank\" > 0");
+ }
+ }
+ }
+
+ protected void executeSql(@Language("SQL") String theSql, Object... theArgs) {
+ myConnectionProperties.getTxTemplate().execute(t -> {
+ myConnectionProperties.newJdbcTemplate().update(theSql, theArgs);
+ return null;
+ });
+ }
+
+ protected List
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-jpa
+ ${project.version}
+
ca.uhn.hapi.fhir
hapi-fhir-server
@@ -66,24 +71,6 @@
org.hibernate
hibernate-core
-
-
- xml-apis
- xml-apis
-
-
- javax.activation
- activation
-
-
- javax.activation
- javax.activation-api
-
-
- javax.xml.bind
- jaxb-api
-
-
org.hibernate.search
@@ -122,11 +109,6 @@
jscience
-
- org.apache.commons
- commons-collections4
-
-
org.quartz-scheduler
quartz
diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml
index 769c3156374..6a029def188 100755
--- a/hapi-fhir-jpaserver-searchparam/pom.xml
+++ b/hapi-fhir-jpaserver-searchparam/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml
index e82047b9a84..1fb86ca9421 100644
--- a/hapi-fhir-jpaserver-subscription/pom.xml
+++ b/hapi-fhir-jpaserver-subscription/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -22,7 +22,7 @@
ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-api
+ hapi-fhir-storage-api
${project.version}
diff --git a/hapi-fhir-jpaserver-test-utilities/pom.xml b/hapi-fhir-jpaserver-test-utilities/pom.xml
index ed0446ecb7c..4cbb297b273 100644
--- a/hapi-fhir-jpaserver-test-utilities/pom.xml
+++ b/hapi-fhir-jpaserver-test-utilities/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
index 102099628b9..74a95489730 100644
--- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
+++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-server-mdm/pom.xml b/hapi-fhir-server-mdm/pom.xml
index c4b363475e5..a152ba8887e 100644
--- a/hapi-fhir-server-mdm/pom.xml
+++ b/hapi-fhir-server-mdm/pom.xml
@@ -7,7 +7,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -27,6 +27,11 @@
hapi-fhir-server
${project.version}
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-storage-api
+ ${project.version}
+
org.springframework.data
spring-data-commons
diff --git a/hapi-fhir-server-openapi/pom.xml b/hapi-fhir-server-openapi/pom.xml
index a7a0f5b62e4..d4fae64c88b 100644
--- a/hapi-fhir-server-openapi/pom.xml
+++ b/hapi-fhir-server-openapi/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml
index 9e939a8b842..56a785466bc 100644
--- a/hapi-fhir-server/pom.xml
+++ b/hapi-fhir-server/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -69,10 +69,6 @@
test
-
- org.apache.commons
- commons-collections4
-
org.springframework
spring-messaging
@@ -110,6 +106,10 @@
+
+ org.apache.commons
+ commons-collections4
+
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java
index f9296160b36..365393697ce 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ProviderConstants.java
@@ -170,4 +170,13 @@ public class ProviderConstants {
* The Spring Batch job id of the delete expunge job created by a $delete-expunge operation
*/
public static final String OPERATION_REINDEX_RESPONSE_JOB_ID = "jobId";
+
+ @Deprecated
+ public static final String MARK_ALL_RESOURCES_FOR_REINDEXING = "$mark-all-resources-for-reindexing";
+ /**
+ * @see ProviderConstants#OPERATION_REINDEX
+ * @deprecated
+ */
+ @Deprecated
+ public static final String PERFORM_REINDEXING_PASS = "$perform-reindexing-pass";
}
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
index 53e0d08a968..3447508f8a1 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-autoconfigure/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
index 1bc5de61f40..7e39b57ee6a 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-apache/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
hapi-fhir-spring-boot-sample-client-apache
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
index 7e30b65d2b7..2bc8878adba 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-client-okhttp/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
hapi-fhir-spring-boot-sample-client-okhttp
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
index a76318684c6..672ce4ae812 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/hapi-fhir-spring-boot-sample-server-jersey/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot-samples
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
hapi-fhir-spring-boot-sample-server-jersey
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
index 4f824c60db2..86d5f76bf7d 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir-spring-boot
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
hapi-fhir-spring-boot-samples
diff --git a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
index d0d3f5e065f..ecf05d548c6 100644
--- a/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
+++ b/hapi-fhir-spring-boot/hapi-fhir-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-spring-boot/pom.xml b/hapi-fhir-spring-boot/pom.xml
index 04d9e96e88d..01db97a81f7 100644
--- a/hapi-fhir-spring-boot/pom.xml
+++ b/hapi-fhir-spring-boot/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-jpaserver-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml
similarity index 86%
rename from hapi-fhir-jpaserver-migrate/pom.xml
rename to hapi-fhir-sql-migrate/pom.xml
index 6381faf35c4..e995ed778ee 100644
--- a/hapi-fhir-jpaserver-migrate/pom.xml
+++ b/hapi-fhir-sql-migrate/pom.xml
@@ -1,31 +1,25 @@
-
+
4.0.0
ca.uhn.hapi.fhir
hapi-deployable-pom
- 5.6.0-PRE5-SNAPSHOT
+ 5.6.0-PRE6-SNAPSHOT
../hapi-deployable-pom/pom.xml
- hapi-fhir-jpaserver-migrate
+ hapi-fhir-sql-migrate
jar
- HAPI FHIR JPA Server - Migration
+ HAPI FHIR Server - SQL Migration
+ Tooling for migrating SQL schemas.
mysql
mysql-connector-java
-
-
org.springframework
spring-jdbc
@@ -34,13 +28,15 @@
org.apache.commons
commons-dbcp2
-
-
ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-base
+ hapi-fhir-base
${project.version}
+
+ org.hibernate
+ hibernate-core
+
com.h2database
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java
index 9991b57859d..18ed02ade1d 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/BaseMigrator.java
@@ -32,9 +32,9 @@ import java.util.List;
import java.util.Objects;
public abstract class BaseMigrator implements IMigrator {
+ private final List myExecutedStatements = new ArrayList<>();
private boolean myDryRun;
private boolean myNoColumnShrink;
- private final List myExecutedStatements = new ArrayList<>();
private boolean mySchemaWasInitialized;
private DriverTypeEnum myDriverType;
private DataSource myDataSource;
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java
similarity index 99%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java
index e3ffc87b834..89369665502 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/DriverTypeEnum.java
@@ -67,6 +67,15 @@ public enum DriverTypeEnum {
myDerby = theDerby;
}
+ public static DriverTypeEnum fromDriverClassName(String theDriverClassName) {
+ for (DriverTypeEnum driverTypeEnum : DriverTypeEnum.values()) {
+ if (driverTypeEnum.myDriverClassName.equals(theDriverClassName)) {
+ return driverTypeEnum;
+ }
+ }
+ return null;
+ }
+
public String getDriverClassName() {
return myDriverClassName;
}
@@ -99,18 +108,9 @@ public enum DriverTypeEnum {
return retval;
}
- public static DriverTypeEnum fromDriverClassName(String theDriverClassName) {
- for (DriverTypeEnum driverTypeEnum : DriverTypeEnum.values()) {
- if (driverTypeEnum.myDriverClassName.equals(theDriverClassName)) {
- return driverTypeEnum;
- }
- }
- return null;
- }
-
public ConnectionProperties newConnectionProperties(String theUrl, String theUsername, String thePassword) {
- BasicDataSource dataSource = new BasicDataSource(){
+ BasicDataSource dataSource = new BasicDataSource() {
@Override
public Connection getConnection() throws SQLException {
ourLog.debug("Creating new DB connection");
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java
similarity index 98%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java
index 7889e45933e..176b97a1e06 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrationTask.java
@@ -21,7 +21,6 @@ package ca.uhn.fhir.jpa.migrate;
*/
import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask;
-import ca.uhn.fhir.jpa.migrate.taskdef.InitializeSchemaTask;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import org.flywaydb.core.api.MigrationVersion;
import org.flywaydb.core.api.migration.Context;
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/FlywayMigrator.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IMigrator.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
similarity index 96%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
index fb4af862dd6..481cc6c770d 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java
@@ -62,78 +62,9 @@ import java.util.Locale;
import java.util.Objects;
import java.util.Set;
-import static org.thymeleaf.util.StringUtils.toUpperCase;
-
public class JdbcUtils {
private static final Logger ourLog = LoggerFactory.getLogger(JdbcUtils.class);
- public static class ColumnType {
- private final ColumnTypeEnum myColumnTypeEnum;
- private final Long myLength;
-
- public ColumnType(ColumnTypeEnum theColumnType, Long theLength) {
- myColumnTypeEnum = theColumnType;
- myLength = theLength;
- }
-
- public ColumnType(ColumnTypeEnum theColumnType, int theLength) {
- this(theColumnType, (long) theLength);
- }
-
- public ColumnType(ColumnTypeEnum theColumnType) {
- this(theColumnType, null);
- }
-
- @Override
- public boolean equals(Object theO) {
- if (this == theO) {
- return true;
- }
-
- if (theO == null || getClass() != theO.getClass()) {
- return false;
- }
-
- ColumnType that = (ColumnType) theO;
-
- return new EqualsBuilder()
- .append(myColumnTypeEnum, that.myColumnTypeEnum)
- .append(myLength, that.myLength)
- .isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder(17, 37)
- .append(myColumnTypeEnum)
- .append(myLength)
- .toHashCode();
- }
-
- @Override
- public String toString() {
- ToStringBuilder b = new ToStringBuilder(this);
- b.append("type", myColumnTypeEnum);
- if (myLength != null) {
- b.append("length", myLength);
- }
- return b.toString();
- }
-
- public ColumnTypeEnum getColumnTypeEnum() {
- return myColumnTypeEnum;
- }
-
- public Long getLength() {
- return myLength;
- }
-
- public boolean equals(ColumnTypeEnum theTaskColumnType, Long theTaskColumnLength) {
- ourLog.debug("Comparing existing {} {} to new {} {}", myColumnTypeEnum, myLength, theTaskColumnType, theTaskColumnLength);
- return myColumnTypeEnum == theTaskColumnType && (theTaskColumnLength == null || theTaskColumnLength.equals(myLength));
- }
- }
-
/**
* Retrieve all index names
*/
@@ -155,7 +86,7 @@ public class JdbcUtils {
while (indexes.next()) {
ourLog.debug("*** Next index: {}", new ColumnMapRowMapper().mapRow(indexes, 0));
String indexName = indexes.getString("INDEX_NAME");
- indexName = toUpperCase(indexName, Locale.US);
+ indexName = indexName.toUpperCase(Locale.US);
indexNames.add(indexName);
}
@@ -163,7 +94,7 @@ public class JdbcUtils {
while (indexes.next()) {
ourLog.debug("*** Next index: {}", new ColumnMapRowMapper().mapRow(indexes, 0));
String indexName = indexes.getString("INDEX_NAME");
- indexName = toUpperCase(indexName, Locale.US);
+ indexName = indexName.toUpperCase(Locale.US);
indexNames.add(indexName);
}
@@ -226,11 +157,11 @@ public class JdbcUtils {
while (indexes.next()) {
- String tableName = toUpperCase(indexes.getString("TABLE_NAME"), Locale.US);
+ String tableName = indexes.getString("TABLE_NAME").toUpperCase(Locale.US);
if (!theTableName.equalsIgnoreCase(tableName)) {
continue;
}
- String columnName = toUpperCase(indexes.getString("COLUMN_NAME"), Locale.US);
+ String columnName = indexes.getString("COLUMN_NAME").toUpperCase(Locale.US);
if (!theColumnName.equalsIgnoreCase(columnName)) {
continue;
}
@@ -308,7 +239,7 @@ public class JdbcUtils {
while (indexes.next()) {
String fkName = indexes.getString("FK_NAME");
- fkName = toUpperCase(fkName, Locale.US);
+ fkName = fkName.toUpperCase(Locale.US);
fkNames.add(fkName);
}
}
@@ -348,7 +279,7 @@ public class JdbcUtils {
while (indexes.next()) {
if (theForeignKeyColumn.equals(indexes.getString("FKCOLUMN_NAME"))) {
String fkName = indexes.getString("FK_NAME");
- fkName = toUpperCase(fkName, Locale.US);
+ fkName = fkName.toUpperCase(Locale.US);
fkNames.add(fkName);
}
}
@@ -376,13 +307,13 @@ public class JdbcUtils {
Set columnNames = new HashSet<>();
while (indexes.next()) {
- String tableName = toUpperCase(indexes.getString("TABLE_NAME"), Locale.US);
+ String tableName = indexes.getString("TABLE_NAME").toUpperCase(Locale.US);
if (!theTableName.equalsIgnoreCase(tableName)) {
continue;
}
String columnName = indexes.getString("COLUMN_NAME");
- columnName = toUpperCase(columnName, Locale.US);
+ columnName = columnName.toUpperCase(Locale.US);
columnNames.add(columnName);
}
@@ -499,7 +430,7 @@ public class JdbcUtils {
Set columnNames = new HashSet<>();
while (tables.next()) {
String tableName = tables.getString("TABLE_NAME");
- tableName = toUpperCase(tableName, Locale.US);
+ tableName = tableName.toUpperCase(Locale.US);
String tableType = tables.getString("TABLE_TYPE");
if ("SYSTEM TABLE".equalsIgnoreCase(tableType)) {
@@ -531,7 +462,7 @@ public class JdbcUtils {
ResultSet tables = metadata.getColumns(connection.getCatalog(), connection.getSchema(), massageIdentifier(metadata, theTableName), null);
while (tables.next()) {
- String tableName = toUpperCase(tables.getString("TABLE_NAME"), Locale.US);
+ String tableName = tables.getString("TABLE_NAME").toUpperCase(Locale.US);
if (!theTableName.equalsIgnoreCase(tableName)) {
continue;
}
@@ -567,4 +498,71 @@ public class JdbcUtils {
}
return retVal;
}
+
+ public static class ColumnType {
+ private final ColumnTypeEnum myColumnTypeEnum;
+ private final Long myLength;
+
+ public ColumnType(ColumnTypeEnum theColumnType, Long theLength) {
+ myColumnTypeEnum = theColumnType;
+ myLength = theLength;
+ }
+
+ public ColumnType(ColumnTypeEnum theColumnType, int theLength) {
+ this(theColumnType, (long) theLength);
+ }
+
+ public ColumnType(ColumnTypeEnum theColumnType) {
+ this(theColumnType, null);
+ }
+
+ @Override
+ public boolean equals(Object theO) {
+ if (this == theO) {
+ return true;
+ }
+
+ if (theO == null || getClass() != theO.getClass()) {
+ return false;
+ }
+
+ ColumnType that = (ColumnType) theO;
+
+ return new EqualsBuilder()
+ .append(myColumnTypeEnum, that.myColumnTypeEnum)
+ .append(myLength, that.myLength)
+ .isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(17, 37)
+ .append(myColumnTypeEnum)
+ .append(myLength)
+ .toHashCode();
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this);
+ b.append("type", myColumnTypeEnum);
+ if (myLength != null) {
+ b.append("length", myLength);
+ }
+ return b.toString();
+ }
+
+ public ColumnTypeEnum getColumnTypeEnum() {
+ return myColumnTypeEnum;
+ }
+
+ public Long getLength() {
+ return myLength;
+ }
+
+ public boolean equals(ColumnTypeEnum theTaskColumnType, Long theTaskColumnLength) {
+ ourLog.debug("Comparing existing {} {} to new {} {}", myColumnTypeEnum, myLength, theTaskColumnType, theTaskColumnLength);
+ return myColumnTypeEnum == theTaskColumnType && (theTaskColumnLength == null || theTaskColumnLength.equals(myLength));
+ }
+ }
}
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipper.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/Migrator.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/SchemaMigrator.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/TaskOnlyMigrator.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java
similarity index 100%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java
similarity index 95%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java
index c00aa23e008..99e199d46a8 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java
@@ -27,7 +27,6 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.thymeleaf.util.StringUtils;
import javax.annotation.Nonnull;
import java.sql.SQLException;
@@ -50,7 +49,7 @@ public class AddIndexTask extends BaseTableTask {
}
public void setIndexName(String theIndexName) {
- myIndexName = StringUtils.toUpperCase(theIndexName, Locale.US);
+ myIndexName = theIndexName.toUpperCase(Locale.US);
}
public void setColumns(List theColumns) {
@@ -104,7 +103,7 @@ public class AddIndexTask extends BaseTableTask {
switch (getDriverType()) {
case POSTGRES_9_4:
case MSSQL_2012:
- includeClause = " INCLUDE (" + StringUtils.join(myIncludeColumns, ", ") + ")";
+ includeClause = " INCLUDE (" + String.join(", ", myIncludeColumns) + ")";
break;
case H2_EMBEDDED:
case DERBY_EMBEDDED:
@@ -119,7 +118,7 @@ public class AddIndexTask extends BaseTableTask {
}
if (myUnique && getDriverType() == DriverTypeEnum.MSSQL_2012) {
mssqlWhereClause = " WHERE (";
- for (int i = 0; i 0);
}
}
-
- private static class TableAndColumn {
- private final String myTable;
- private final String myColumn;
-
- private TableAndColumn(String theTable, String theColumn) {
- myTable = theTable;
- myColumn = theColumn;
- }
-
- public String getTable() {
- return myTable;
- }
-
- public String getColumn() {
- return myColumn;
- }
- }
}
diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java
similarity index 99%
rename from hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java
rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java
index 4bacbc4eef6..4a5163cb398 100644
--- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java
+++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseColumnCalculatorTask.java
@@ -211,40 +211,6 @@ public abstract class BaseColumnCalculatorTask extends BaseTableColumnTask {
return myExecutor.submit(task);
}
- private class MyRowCallbackHandler implements RowCallbackHandler {
-
- private List