diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4823ea9b222..8f0a48f0f3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: - repo: https://github.com/ejba/pre-commit-maven - rev: v0.3.3 + rev: v0.3.4 hooks: - id: maven-spotless-apply stages: [pre-push] diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 09f8ce921e9..e0fdc9defbd 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml index 32004a48b33..ee1c47560a0 100644 --- a/hapi-fhir-android/pom.xml +++ b/hapi-fhir-android/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 7b126077940..0b400e33354 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -116,10 +116,16 @@ + + com.google.code.findbugs jsr305 + + jakarta.annotation + jakarta.annotation-api + org.awaitility diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java index 76ece1131bf..6cbb0693f57 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeElementDefinition.java @@ -21,6 +21,8 @@ package ca.uhn.fhir.context; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; @@ -31,8 +33,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public abstract class BaseRuntimeElementDefinition { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java index f62b3fdfc49..44859cf8bc8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java @@ -49,6 +49,8 @@ import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.ReflectionUtil; import ca.uhn.fhir.util.VersionUtil; import ca.uhn.fhir.validation.FhirValidator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.jena.riot.Lang; @@ -77,8 +79,6 @@ import java.util.Optional; import java.util.Properties; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * The FHIR context is the central starting point for the use of the HAPI FHIR API. It should be created once, and then diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java index 002c34edb7e..7913bc10fa9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.XhtmlDt; import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; import ca.uhn.fhir.util.ReflectionUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBackboneElement; import org.hl7.fhir.instance.model.api.IBaseDatatype; @@ -67,7 +68,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -498,7 +498,7 @@ class ModelScanner { nextElementType = ReflectionUtil.getGenericCollectionTypeOfField(next); } else if (Collection.class.isAssignableFrom(nextElementType)) { throw new ConfigurationException(Msg.code(1722) + "Field '" + next.getName() + "' in type '" - + next.getClass().getCanonicalName() + + nextElementType.getCanonicalName() + "' is a Collection - Only java.util.List curently supported"); } return nextElementType; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeSearchParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeSearchParam.java index cba53cb118c..6cbc5532614 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeSearchParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeSearchParam.java @@ -21,6 +21,8 @@ package ca.uhn.fhir.context; import ca.uhn.fhir.context.phonetic.IPhoneticEncoder; import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -37,8 +39,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.trim; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java index c90b466982b..87bb3d000eb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java @@ -23,6 +23,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.util.ILockable; import ca.uhn.fhir.util.ReflectionUtil; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -32,7 +33,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import javax.annotation.Nullable; /** * This class returns the vocabulary that is shipped with the base FHIR diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupportBundleStrategy.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupportBundleStrategy.java index 22a130a98fe..79d9ba03855 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupportBundleStrategy.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupportBundleStrategy.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.parser.LenientErrorHandler; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.ClasspathUtil; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -43,7 +44,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Properties; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IValidationSupport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IValidationSupport.java index 3f9c4030c44..967aeb3a549 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IValidationSupport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IValidationSupport.java @@ -24,6 +24,8 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.ParametersUtil; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -42,8 +44,6 @@ import java.util.List; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; @@ -295,8 +295,8 @@ public interface IValidationSupport { */ @Nullable default CodeValidationResult validateCode( - @Nonnull ValidationSupportContext theValidationSupportContext, - @Nonnull ConceptValidationOptions theOptions, + ValidationSupportContext theValidationSupportContext, + ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, @@ -526,8 +526,13 @@ public interface IValidationSupport { public String getPropertyName() { return myPropertyName; } + + public abstract String getType(); } + String TYPE_STRING = "string"; + String TYPE_CODING = "Coding"; + class StringConceptProperty extends BaseConceptProperty { private final String myValue; @@ -544,6 +549,10 @@ public interface IValidationSupport { public String getValue() { return myValue; } + + public String getType() { + return TYPE_STRING; + } } class CodingConceptProperty extends BaseConceptProperty { @@ -574,6 +583,10 @@ public interface IValidationSupport { public String getDisplay() { return myDisplay; } + + public String getType() { + return TYPE_CODING; + } } class CodeValidationResult { @@ -881,25 +894,35 @@ public interface IValidationSupport { } for (BaseConceptProperty next : myProperties) { + String propertyName = next.getPropertyName(); - if (!properties.isEmpty()) { - if (!properties.contains(next.getPropertyName())) { - continue; - } + if (!properties.isEmpty() && !properties.contains(propertyName)) { + continue; } IBase property = ParametersUtil.addParameterToParameters(theContext, retVal, "property"); - ParametersUtil.addPartCode(theContext, property, "code", next.getPropertyName()); + ParametersUtil.addPartCode(theContext, property, "code", propertyName); - if (next instanceof StringConceptProperty) { - StringConceptProperty prop = (StringConceptProperty) next; - ParametersUtil.addPartString(theContext, property, "value", prop.getValue()); - } else if (next instanceof CodingConceptProperty) { - CodingConceptProperty prop = (CodingConceptProperty) next; - ParametersUtil.addPartCoding( - theContext, property, "value", prop.getCodeSystem(), prop.getCode(), prop.getDisplay()); - } else { - throw new IllegalStateException(Msg.code(1739) + "Don't know how to handle " + next.getClass()); + String propertyType = next.getType(); + switch (propertyType) { + case TYPE_STRING: + StringConceptProperty stringConceptProperty = (StringConceptProperty) next; + ParametersUtil.addPartString( + theContext, property, "value", stringConceptProperty.getValue()); + break; + case TYPE_CODING: + CodingConceptProperty codingConceptProperty = (CodingConceptProperty) next; + ParametersUtil.addPartCoding( + theContext, + property, + "value", + codingConceptProperty.getCodeSystem(), + codingConceptProperty.getCode(), + codingConceptProperty.getDisplay()); + break; + default: + throw new IllegalStateException( + Msg.code(1739) + "Don't know how to handle " + next.getClass()); } } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPath.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPath.java index 67fc8ce5ff3..194607b8873 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPath.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPath.java @@ -19,11 +19,11 @@ */ package ca.uhn.fhir.fhirpath; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public interface IFhirPath { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPathEvaluationContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPathEvaluationContext.java index 00b6abeab61..ad99df8b7bb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPathEvaluationContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/fhirpath/IFhirPathEvaluationContext.java @@ -19,12 +19,11 @@ */ package ca.uhn.fhir.fhirpath; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public interface IFhirPathEvaluationContext { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/HookParams.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/HookParams.java index f9f96ccb4c1..9784541da0b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/HookParams.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/HookParams.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.interceptor.api; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.util.Collection; @@ -29,7 +30,6 @@ import java.util.Collections; import java.util.List; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class HookParams { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IBaseInterceptorService.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IBaseInterceptorService.java index d0fdcb61c94..0f4b14a6ff1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IBaseInterceptorService.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IBaseInterceptorService.java @@ -19,10 +19,11 @@ */ package ca.uhn.fhir.interceptor.api; +import jakarta.annotation.Nullable; + import java.util.Collection; import java.util.List; import java.util.function.Predicate; -import javax.annotation.Nullable; public interface IBaseInterceptorService extends IBaseInterceptorBroadcaster { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IPointcut.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IPointcut.java index 8ebd00bee4c..4c389567ecf 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IPointcut.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/IPointcut.java @@ -19,8 +19,9 @@ */ package ca.uhn.fhir.interceptor.api; +import jakarta.annotation.Nonnull; + import java.util.List; -import javax.annotation.Nonnull; public interface IPointcut { @Nonnull diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java index 9bca309c817..828a060a113 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.validation.ValidationResult; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseConformance; import java.io.Writer; @@ -33,7 +34,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; /** * Value for {@link Hook#value()} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java index 9a592bdd6e9..5d1f409a3eb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java @@ -31,6 +31,8 @@ import ca.uhn.fhir.util.ReflectionUtil; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -57,8 +59,6 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public abstract class BaseInterceptorService & IPointcut> implements IBaseInterceptorService, IBaseInterceptorBroadcaster { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java index 2486f655e0d..8f78cb4f1fd 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java @@ -24,6 +24,8 @@ import ca.uhn.fhir.util.JsonUtil; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -37,8 +39,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/BaseNarrativeGenerator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/BaseNarrativeGenerator.java index 1917356c6cd..fbc1f298143 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/BaseNarrativeGenerator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/BaseNarrativeGenerator.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.INarrative; @@ -37,7 +38,6 @@ import java.util.EnumSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultIfEmpty; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/INarrativeTemplateManifest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/INarrativeTemplateManifest.java index e12362bd861..db479e5b1b8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/INarrativeTemplateManifest.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/INarrativeTemplateManifest.java @@ -20,12 +20,12 @@ package ca.uhn.fhir.narrative2; import ca.uhn.fhir.context.FhirContext; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import java.util.Collection; import java.util.EnumSet; import java.util.List; -import javax.annotation.Nonnull; public interface INarrativeTemplateManifest { List getTemplateByResourceName( diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/NarrativeTemplateManifest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/NarrativeTemplateManifest.java index b8cb84adc4b..15af18e5c56 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/NarrativeTemplateManifest.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative2/NarrativeTemplateManifest.java @@ -28,6 +28,7 @@ import com.google.common.base.Charsets; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -53,7 +54,6 @@ import java.util.Objects; import java.util.Properties; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java index 831e5789257..93a8875e10d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java @@ -45,6 +45,7 @@ import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.UrlUtil; import com.google.common.base.Charsets; +import jakarta.annotation.Nullable; import org.apache.commons.io.output.StringBuilderWriter; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -78,7 +79,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonStructure.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonStructure.java index 27d93057d0c..14b0831c301 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonStructure.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonStructure.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.parser.json.BaseJsonLikeWriter; import ca.uhn.fhir.parser.json.JsonLikeStructure; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.StreamReadConstraints; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; @@ -114,14 +115,38 @@ public class JacksonStructure implements JsonLikeStructure { setNativeArray((ArrayNode) OBJECT_MAPPER.readTree(pbr)); } } catch (Exception e) { - if (e.getMessage().startsWith("Unexpected char 39")) { + String message; + if (e instanceof JsonProcessingException) { + /* + * Currently there is no way of preventing Jackson from adding this + * annoying REDACTED message from certain messages we get back from + * the parser, so we just manually strip them. Hopefully Jackson + * will accept this request at some point: + * https://github.com/FasterXML/jackson-core/issues/1158 + */ + JsonProcessingException jpe = (JsonProcessingException) e; + StringBuilder messageBuilder = new StringBuilder(); + String originalMessage = jpe.getOriginalMessage(); + originalMessage = originalMessage.replace( + "Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); ", ""); + messageBuilder.append(originalMessage); + if (jpe.getLocation() != null) { + messageBuilder.append("\n at ["); + jpe.getLocation().appendOffsetDescription(messageBuilder); + messageBuilder.append("]"); + } + message = messageBuilder.toString(); + } else { + message = e.getMessage(); + } + + if (message.startsWith("Unexpected char 39")) { throw new DataFormatException( - Msg.code(1860) + "Failed to parse JSON encoded FHIR content: " + e.getMessage() + " - " + Msg.code(1860) + "Failed to parse JSON encoded FHIR content: " + message + " - " + "This may indicate that single quotes are being used as JSON escapes where double quotes are required", e); } - throw new DataFormatException( - Msg.code(1861) + "Failed to parse JSON encoded FHIR content: " + e.getMessage(), e); + throw new DataFormatException(Msg.code(1861) + "Failed to parse JSON encoded FHIR content: " + message, e); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonWriter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonWriter.java index d0101d0af7c..1e4ba3af13c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonWriter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/json/jackson/JacksonWriter.java @@ -45,29 +45,15 @@ public class JacksonWriter extends BaseJsonLikeWriter { @Override public BaseJsonLikeWriter init() { if (isPrettyPrint()) { - DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter() { - - /** - * Objects should serialize as - *
-				 * {
-				 *    "key": "value"
-				 * }
-				 * 
- * in order to be consistent with Gson behaviour, instead of the jackson default - *
-				 * {
-				 *    "key" : "value"
-				 * }
-				 * 
- */ - @Override - public DefaultPrettyPrinter withSeparators(Separators separators) { - _separators = separators; - _objectFieldValueSeparatorWithSpaces = separators.getObjectFieldValueSeparator() + " "; - return this; - } - }; + DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter() + .withSeparators(new Separators( + Separators.DEFAULT_ROOT_VALUE_SEPARATOR, + ':', + Separators.Spacing.AFTER, + ',', + Separators.Spacing.NONE, + ',', + Separators.Spacing.NONE)); prettyPrinter = prettyPrinter.withObjectIndenter(new DefaultIndenter(" ", "\n")); myJsonGenerator.setPrettyPrinter(prettyPrinter); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java index adce742a4f9..00d0b90799d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java @@ -220,21 +220,6 @@ public class Constants { public static final String PARAM_TEXT = "_text"; public static final String PARAM_VALIDATE = "_validate"; - /** - * $member-match operation - */ - public static final String PARAM_MEMBER_PATIENT = "MemberPatient"; - - public static final String PARAM_MEMBER_IDENTIFIER = "MemberIdentifier"; - - public static final String COVERAGE_TO_MATCH = "CoverageToMatch"; - public static final String COVERAGE_TO_LINK = "CoverageToLink"; - public static final String PARAM_CONSENT = "Consent"; - public static final String PARAM_MEMBER_PATIENT_NAME = PARAM_MEMBER_PATIENT + " Name"; - public static final String PARAM_MEMBER_PATIENT_BIRTHDATE = PARAM_MEMBER_PATIENT + " Birthdate"; - public static final String PARAM_CONSENT_PATIENT_REFERENCE = PARAM_CONSENT + "'s Patient Reference"; - public static final String PARAM_CONSENT_PERFORMER_REFERENCE = PARAM_CONSENT + "'s Performer Reference"; - public static final String PARAMQUALIFIER_MISSING = ":missing"; public static final String PARAMQUALIFIER_MISSING_FALSE = "false"; public static final String PARAMQUALIFIER_MISSING_TRUE = "true"; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/IVersionSpecificBundleFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/IVersionSpecificBundleFactory.java index 946c8943fbf..8027b1e11bc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/IVersionSpecificBundleFactory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/IVersionSpecificBundleFactory.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.rest.api; import ca.uhn.fhir.context.api.BundleInclusionRule; import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -29,8 +31,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This interface should be considered experimental and will likely change in future releases of HAPI. Use with caution! diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PatchTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PatchTypeEnum.java index ea4c764e044..b8383671d80 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PatchTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PatchTypeEnum.java @@ -23,10 +23,10 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.annotation.Patch; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferHeader.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferHeader.java index 09d42fdce25..03f9a115215 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferHeader.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferHeader.java @@ -19,7 +19,7 @@ */ package ca.uhn.fhir.rest.api; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class PreferHeader { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferReturnEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferReturnEnum.java index 07ab10f62c0..09a945ca651 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferReturnEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/PreferReturnEnum.java @@ -19,8 +19,9 @@ */ package ca.uhn.fhir.rest.api; +import jakarta.annotation.Nullable; + import java.util.HashMap; -import javax.annotation.Nullable; /** * Represents values for "return" value as provided in the the HTTP Prefer header. diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/RestOperationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/RestOperationTypeEnum.java index 9a37ca86aa2..cd864314b82 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/RestOperationTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/RestOperationTypeEnum.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.rest.api; import ca.uhn.fhir.util.CoverageIgnore; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; @CoverageIgnore public enum RestOperationTypeEnum { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java index daec727f9f8..2f49f863fda 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java @@ -24,10 +24,9 @@ import ca.uhn.fhir.interceptor.api.IInterceptorService; import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.api.RequestFormatParamStyleEnum; import ca.uhn.fhir.rest.api.SummaryEnum; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; -import javax.annotation.Nonnull; - public interface IRestfulClient { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java index c1192fe5f70..ce6c7c51776 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.rest.api.QualifiedParamList; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.DateUtils; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -34,7 +35,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.EQUAL; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.GREATERTHAN_OR_EQUALS; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java index 4c2bd44fb72..a073f2a0dcf 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleBuilder.java @@ -25,6 +25,8 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.primitive.IdDt; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBackboneElement; @@ -36,8 +38,6 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.Date; import java.util.Objects; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This class can be used to build a Bundle resource to be used as a FHIR transaction. Convenience methods provide @@ -196,11 +196,7 @@ public class BundleBuilder { public UpdateBuilder addTransactionUpdateEntry(IBaseResource theResource) { Validate.notNull(theResource, "theResource must not be null"); - IIdType id = theResource.getIdElement(); - if (id.hasIdPart() && !id.hasResourceType()) { - String resourceType = myContext.getResourceType(theResource); - id = id.withResourceType(resourceType); - } + IIdType id = getIdTypeForUpdate(theResource); String requestUrl = id.toUnqualifiedVersionless().getValue(); String fullUrl = id.getValue(); @@ -225,13 +221,29 @@ public class BundleBuilder { myEntryRequestUrlChild.getMutator().setValue(request, url); // Bundle.entry.request.method - IPrimitiveType method = (IPrimitiveType) - myEntryRequestMethodDef.newInstance(myEntryRequestMethodChild.getInstanceConstructorArguments()); - method.setValueAsString(theHttpVerb); - myEntryRequestMethodChild.getMutator().setValue(request, method); + addRequestMethod(request, theHttpVerb); return url; } + /** + * Adds an entry containing an update (UPDATE) request without the body of the resource. + * Also sets the Bundle.type value to "transaction" if it is not already set. + * + * @param theResource The resource to update. + */ + public void addTransactionUpdateIdOnlyEntry(IBaseResource theResource) { + setBundleField("type", "transaction"); + + Validate.notNull(theResource, "theResource must not be null"); + + IIdType id = getIdTypeForUpdate(theResource); + String requestUrl = id.toUnqualifiedVersionless().getValue(); + String fullUrl = id.getValue(); + String httpMethod = "PUT"; + + addIdOnlyEntry(requestUrl, httpMethod, fullUrl); + } + /** * Adds an entry containing an create (POST) request. * Also sets the Bundle.type value to "transaction" if it is not already set. @@ -247,20 +259,47 @@ public class BundleBuilder { String resourceType = myContext.getResourceType(theResource); // Bundle.entry.request.url - IPrimitiveType url = - (IPrimitiveType) myContext.getElementDefinition("uri").newInstance(); - url.setValueAsString(resourceType); - myEntryRequestUrlChild.getMutator().setValue(request, url); + addRequestUrl(request, resourceType); - // Bundle.entry.request.url - IPrimitiveType method = (IPrimitiveType) - myEntryRequestMethodDef.newInstance(myEntryRequestMethodChild.getInstanceConstructorArguments()); - method.setValueAsString("POST"); - myEntryRequestMethodChild.getMutator().setValue(request, method); + // Bundle.entry.request.method + addRequestMethod(request, "POST"); return new CreateBuilder(request); } + /** + * Adds an entry containing a create (POST) request without the body of the resource. + * Also sets the Bundle.type value to "transaction" if it is not already set. + * + * @param theResource The resource to create + */ + public void addTransactionCreateEntryIdOnly(IBaseResource theResource) { + setBundleField("type", "transaction"); + + String requestUrl = myContext.getResourceType(theResource); + String fullUrl = theResource.getIdElement().getValue(); + String httpMethod = "POST"; + + addIdOnlyEntry(requestUrl, httpMethod, fullUrl); + } + + private void addIdOnlyEntry(String theRequestUrl, String theHttpMethod, String theFullUrl) { + IBase entry = addEntry(); + + // Bundle.entry.request + IBase request = myEntryRequestDef.newInstance(); + myEntryRequestChild.getMutator().setValue(entry, request); + + // Bundle.entry.request.url + addRequestUrl(request, theRequestUrl); + + // Bundle.entry.request.method + addRequestMethod(request, theHttpMethod); + + // Bundle.entry.fullUrl + addFullUrl(entry, theFullUrl); + } + /** * Adds an entry containing a delete (DELETE) request. * Also sets the Bundle.type value to "transaction" if it is not already set. @@ -341,20 +380,44 @@ public class BundleBuilder { IBase request = addEntryAndReturnRequest(); // Bundle.entry.request.url - IPrimitiveType url = - (IPrimitiveType) myContext.getElementDefinition("uri").newInstance(); - url.setValueAsString(theDeleteUrl); - myEntryRequestUrlChild.getMutator().setValue(request, url); + addRequestUrl(request, theDeleteUrl); // Bundle.entry.request.method - IPrimitiveType method = (IPrimitiveType) - myEntryRequestMethodDef.newInstance(myEntryRequestMethodChild.getInstanceConstructorArguments()); - method.setValueAsString("DELETE"); - myEntryRequestMethodChild.getMutator().setValue(request, method); + addRequestMethod(request, "DELETE"); return new DeleteBuilder(); } + private IIdType getIdTypeForUpdate(IBaseResource theResource) { + IIdType id = theResource.getIdElement(); + if (id.hasIdPart() && !id.hasResourceType()) { + String resourceType = myContext.getResourceType(theResource); + id = id.withResourceType(resourceType); + } + return id; + } + + private void addFullUrl(IBase theEntry, String theFullUrl) { + IPrimitiveType fullUrl = + (IPrimitiveType) myContext.getElementDefinition("uri").newInstance(); + fullUrl.setValueAsString(theFullUrl); + myEntryFullUrlChild.getMutator().setValue(theEntry, fullUrl); + } + + private void addRequestUrl(IBase request, String theRequestUrl) { + IPrimitiveType url = + (IPrimitiveType) myContext.getElementDefinition("uri").newInstance(); + url.setValueAsString(theRequestUrl); + myEntryRequestUrlChild.getMutator().setValue(request, url); + } + + private void addRequestMethod(IBase theRequest, String theMethod) { + IPrimitiveType method = (IPrimitiveType) + myEntryRequestMethodDef.newInstance(myEntryRequestMethodChild.getInstanceConstructorArguments()); + method.setValueAsString(theMethod); + myEntryRequestMethodChild.getMutator().setValue(theRequest, method); + } + /** * Adds an entry for a Collection bundle type */ @@ -406,10 +469,7 @@ public class BundleBuilder { IBase entry = addEntry(); // Bundle.entry.fullUrl - IPrimitiveType fullUrl = - (IPrimitiveType) myContext.getElementDefinition("uri").newInstance(); - fullUrl.setValueAsString(theFullUrl); - myEntryFullUrlChild.getMutator().setValue(entry, fullUrl); + addFullUrl(entry, theFullUrl); // Bundle.entry.resource myEntryResourceChild.getMutator().setValue(entry, theResource); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java index 516c5c078b7..98fc0bfac63 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/BundleUtil.java @@ -35,6 +35,7 @@ import ca.uhn.fhir.util.bundle.EntryListAccumulator; import ca.uhn.fhir.util.bundle.ModifiableBundleEntry; import ca.uhn.fhir.util.bundle.SearchBundleEntryParts; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.tuple.Pair; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBinary; @@ -54,7 +55,6 @@ import java.util.Objects; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.hl7.fhir.instance.model.api.IBaseBundle.LINK_PREV; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ClasspathUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ClasspathUtil.java index f22e114484e..03a81448288 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ClasspathUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ClasspathUtil.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import com.google.common.base.Charsets; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.BOMInputStream; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -37,7 +38,6 @@ import java.io.Reader; import java.nio.charset.StandardCharsets; import java.util.function.Function; import java.util.zip.GZIPInputStream; -import javax.annotation.Nonnull; /** * Use this API with caution, it may change! diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/CompositionBuilder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/CompositionBuilder.java index 2cd02c96e09..a20c383a2be 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/CompositionBuilder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/CompositionBuilder.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeResourceDefinition; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseReference; @@ -29,7 +30,6 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.Date; -import javax.annotation.Nonnull; /** * This class can be used to generate Composition resources in diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateRangeUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateRangeUtil.java index 6e488c39a2d..6204c5d1897 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateRangeUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateRangeUtil.java @@ -20,10 +20,10 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.rest.param.DateRangeParam; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class DateRangeUtil { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ExtensionUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ExtensionUtil.java index 074fbac22f3..9b100ec1309 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ExtensionUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ExtensionUtil.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; @@ -33,7 +34,6 @@ import java.util.List; import java.util.Optional; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; /** * Utility for modifying with extensions in a FHIR version-independent approach. diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java index 294761ae174..9b812de7198 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java @@ -42,6 +42,8 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.parser.DataFormatException; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; @@ -71,8 +73,6 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/JsonUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/JsonUtil.java index f02d60eecf4..0110dbba6f1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/JsonUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/JsonUtil.java @@ -27,12 +27,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.List; -import javax.annotation.Nonnull; public class JsonUtil { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java index eadf61d44f2..ddcdf5ff20c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; @@ -36,7 +37,6 @@ import org.hl7.fhir.instance.model.api.ICompositeType; import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.List; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ParametersUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ParametersUtil.java index c7ffd7cb439..da99474dbe5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ParametersUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ParametersUtil.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.StringDt; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseDatatype; @@ -45,7 +46,6 @@ import java.util.List; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultIfBlank; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ReflectionUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ReflectionUtil.java index 0da15e2c571..ea691ac14e7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ReflectionUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/ReflectionUtil.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.lang.reflect.Constructor; @@ -39,7 +40,6 @@ import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nonnull; public class ReflectionUtil { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/SearchParameterUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/SearchParameterUtil.java index 9f5f9c0c32e..8ff4e8596dc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/SearchParameterUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/SearchParameterUtil.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeSearchParam; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -34,7 +35,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; public class SearchParameterUtil { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StringUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StringUtil.java index 34b092ced88..d3ad98daed7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StringUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StringUtil.java @@ -19,11 +19,12 @@ */ package ca.uhn.fhir.util; +import jakarta.annotation.Nonnull; + import java.io.CharArrayWriter; import java.nio.charset.StandardCharsets; import java.text.Normalizer; import java.util.Arrays; -import javax.annotation.Nonnull; public class StringUtil { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java index bca08865ebc..34d4650582e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java @@ -28,6 +28,8 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import com.google.common.escape.Escaper; import com.google.common.net.PercentEscaper; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URLEncodedUtils; @@ -50,8 +52,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.StringTokenizer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultIfBlank; import static org.apache.commons.lang3.StringUtils.defaultString; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/IValidationContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/IValidationContext.java index e24720f8ede..4e0347f11c6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/IValidationContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/IValidationContext.java @@ -21,9 +21,9 @@ package ca.uhn.fhir.validation; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.api.EncodingEnum; +import jakarta.annotation.Nonnull; import java.util.List; -import javax.annotation.Nonnull; public interface IValidationContext { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java index 1756e7fd124..ac7f35e844d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java @@ -26,11 +26,11 @@ import ca.uhn.fhir.parser.LenientErrorHandler; import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.ObjectUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java index 902db207996..ce3ae543536 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java @@ -19,7 +19,7 @@ */ package org.hl7.fhir.instance.model.api; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public interface IPrimitiveType extends IBaseDatatype { diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties index f0375733e44..fa53cd9effe 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties @@ -206,10 +206,3 @@ ca.uhn.fhir.jpa.provider.DiffProvider.cantDiffDifferentTypes=Unable to diff two ca.uhn.fhir.jpa.interceptor.validation.RuleRequireProfileDeclaration.noMatchingProfile=Resource of type "{0}" does not declare conformance to profile from: {1} ca.uhn.fhir.jpa.interceptor.validation.RuleRequireProfileDeclaration.illegalProfile=Resource of type "{0}" must not declare conformance to profile: {1} - -operation.member.match.error.coverage.not.found=Could not find coverage for member based on coverage id or coverage identifier. -operation.member.match.error.beneficiary.not.found=Could not find beneficiary for coverage. -operation.member.match.error.missing.parameter=Parameter "{0}" is required. -operation.member.match.error.beneficiary.without.identifier=Coverage beneficiary does not have an identifier. -operation.member.match.error.patient.not.found=Could not find matching patient for coverage. -operation.member.match.error.consent.release.data.mismatch=Consent policy does not match the data release segmentation capabilities. diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/TaskChunkerTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/TaskChunkerTest.java index 811608c0b8a..3b4133323f7 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/TaskChunkerTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/TaskChunkerTest.java @@ -8,7 +8,7 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.verify; diff --git a/hapi-fhir-bom/pom.xml b/hapi-fhir-bom/pom.xml index e70d734aa84..39b230f2ea5 100644 --- a/hapi-fhir-bom/pom.xml +++ b/hapi-fhir-bom/pom.xml @@ -4,7 +4,7 @@ 4.0.0 ca.uhn.hapi.fhir hapi-fhir-bom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT pom HAPI FHIR BOM @@ -12,7 +12,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-checkstyle/pom.xml b/hapi-fhir-checkstyle/pom.xml index a1e8d7553cd..22eba74f131 100644 --- a/hapi-fhir-checkstyle/pom.xml +++ b/hapi-fhir-checkstyle/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml index 620676e3c80..3e2a2c34f5c 100644 --- a/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml +++ b/hapi-fhir-checkstyle/src/checkstyle/hapi-base-checkstyle.xml @@ -31,9 +31,19 @@ + + + + + + + + + + diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml index 3126cd0baf1..aa68ece2aeb 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java index 7e9da8b5f25..2d15d1733ec 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BaseCommand.java @@ -34,6 +34,7 @@ import com.google.common.base.Charsets; import com.google.common.collect.Sets; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import jakarta.annotation.Nullable; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; @@ -75,7 +76,6 @@ import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import java.util.zip.GZIPInputStream; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BulkImportCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BulkImportCommand.java index 3b8868eeaa9..d6b242b5ffb 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BulkImportCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/BulkImportCommand.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; @@ -68,7 +69,6 @@ import java.util.List; import java.util.Locale; import java.util.concurrent.ExecutionException; import java.util.zip.GZIPInputStream; -import javax.annotation.Nonnull; public class BulkImportCommand extends BaseCommand { diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ReindexTerminologyCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ReindexTerminologyCommand.java index f5ea9c1f8dd..8d202922236 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ReindexTerminologyCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/ReindexTerminologyCommand.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.ParseException; import org.hl7.fhir.instance.model.api.IBaseParameters; @@ -31,7 +32,6 @@ import org.hl7.fhir.r4.model.Parameters; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.provider.BaseJpaSystemProvider.RESP_PARAM_SUCCESS; diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiClearMigrationLockCommandTest.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiClearMigrationLockCommandTest.java index d6cd7dc01dd..e25841cacb3 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiClearMigrationLockCommandTest.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiClearMigrationLockCommandTest.java @@ -14,7 +14,7 @@ import org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatemen import org.springframework.jdbc.support.lob.DefaultLobHandler; import org.springframework.jdbc.support.lob.LobCreator; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.sql.PreparedStatement; diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiFlywayMigrateDatabaseCommandTest.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiFlywayMigrateDatabaseCommandTest.java index 7c9601db73f..d83a1ce05d4 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiFlywayMigrateDatabaseCommandTest.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/test/java/ca/uhn/fhir/cli/HapiFlywayMigrateDatabaseCommandTest.java @@ -20,7 +20,7 @@ import org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatemen import org.springframework.jdbc.support.lob.DefaultLobHandler; import org.springframework.jdbc.support.lob.LobCreator; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.sql.PreparedStatement; diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml index ec740677b09..a1d5071ed88 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml index 19562217626..dbcfdedd285 100644 --- a/hapi-fhir-cli/pom.xml +++ b/hapi-fhir-cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml index 70ac8a73a06..78bda8b4a32 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml index bed73ac4cbf..8dfd0a83790 100644 --- a/hapi-fhir-client/pom.xml +++ b/hapi-fhir-client/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseClient.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseClient.java index 5aa920c920e..62ce2db85a3 100644 --- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseClient.java +++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseClient.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.OperationOutcomeUtil; import ca.uhn.fhir.util.XmlDetectionUtil; import com.google.common.base.Charsets; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -79,7 +80,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/tls/TlsAuthenticationSvc.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/tls/TlsAuthenticationSvc.java index a829b16f4c5..472e7174c43 100644 --- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/tls/TlsAuthenticationSvc.java +++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/tls/TlsAuthenticationSvc.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.tls.KeyStoreInfo; import ca.uhn.fhir.tls.PathType; import ca.uhn.fhir.tls.TlsAuthentication; import ca.uhn.fhir.tls.TrustStoreInfo; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.NoopHostnameVerifier; @@ -37,7 +38,6 @@ import java.io.FileInputStream; import java.io.InputStream; import java.security.KeyStore; import java.util.Optional; -import javax.annotation.Nonnull; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml index 0accae54174..9589ca5d79c 100644 --- a/hapi-fhir-converter/pom.xml +++ b/hapi-fhir-converter/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java b/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java index 916322631f9..83941fa05d2 100644 --- a/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java +++ b/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu2.composite.CodingDt; import ca.uhn.fhir.util.HapiExtensions; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_50; @@ -69,7 +70,6 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_30.java b/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_30.java index e890353c895..89ee7307da7 100644 --- a/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_30.java +++ b/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_30.java @@ -19,13 +19,12 @@ */ package org.hl7.fhir.converter; +import jakarta.annotation.Nullable; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30; import org.hl7.fhir.dstu3.model.CodeSystem; import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.exceptions.FHIRException; -import javax.annotation.Nullable; - public class NullVersionConverterAdvisor10_30 extends BaseAdvisor_10_30 { @Nullable diff --git a/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_40.java b/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_40.java index edeb30824c3..31e005d9c4e 100644 --- a/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_40.java +++ b/hapi-fhir-converter/src/main/java/org/hl7/fhir/converter/NullVersionConverterAdvisor10_40.java @@ -19,13 +19,12 @@ */ package org.hl7.fhir.converter; +import jakarta.annotation.Nullable; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.ValueSet; -import javax.annotation.Nullable; - public class NullVersionConverterAdvisor10_40 extends BaseAdvisor_10_40 { @Nullable diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml index 298abf36b56..e896e8c4bf0 100644 --- a/hapi-fhir-dist/pom.xml +++ b/hapi-fhir-dist/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-docs/pom.xml b/hapi-fhir-docs/pom.xml index 0de0b3b0a0a..53b477e73d8 100644 --- a/hapi-fhir-docs/pom.xml +++ b/hapi-fhir-docs/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/BalpExample.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/BalpExample.java index 94e987a1c0c..8ebd8519160 100644 --- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/BalpExample.java +++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/BalpExample.java @@ -26,11 +26,11 @@ import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.storage.interceptor.balp.AsyncMemoryQueueBackedFhirClientBalpSink; import ca.uhn.fhir.storage.interceptor.balp.IBalpAuditContextServices; import ca.uhn.fhir.storage.interceptor.balp.IBalpAuditEventSink; +import jakarta.annotation.Nonnull; import jakarta.servlet.ServletException; import org.hl7.fhir.r4.model.Reference; import java.util.List; -import javax.annotation.Nonnull; public class BalpExample { diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/PagingPatientProvider.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/PagingPatientProvider.java index 7712ad307d2..ffeff021c9d 100644 --- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/PagingPatientProvider.java +++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/PagingPatientProvider.java @@ -25,12 +25,12 @@ import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.method.ResponsePage; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.InstantType; import org.hl7.fhir.r4.model.Patient; import java.util.List; -import javax.annotation.Nonnull; @SuppressWarnings("null") // START SNIPPET: provider diff --git a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/ValidatorExamples.java b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/ValidatorExamples.java index 7fa54099747..dce56e686df 100644 --- a/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/ValidatorExamples.java +++ b/hapi-fhir-docs/src/main/java/ca/uhn/hapi/fhir/docs/ValidatorExamples.java @@ -36,6 +36,7 @@ import ca.uhn.fhir.validation.SchemaBaseValidator; import ca.uhn.fhir.validation.SingleValidationMessage; import ca.uhn.fhir.validation.ValidationResult; import ca.uhn.fhir.validation.schematron.SchematronBaseValidator; +import jakarta.annotation.Nonnull; import jakarta.servlet.ServletException; import org.apache.commons.io.IOUtils; import org.apache.commons.io.filefilter.WildcardFileFilter; @@ -60,7 +61,6 @@ import org.hl7.fhir.r4.model.ValueSet; import java.io.File; import java.io.FileReader; import java.util.List; -import javax.annotation.Nonnull; @SuppressWarnings({"serial", "unused"}) public class ValidatorExamples { diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5340-update-hapifhir-document.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5340-update-hapifhir-document.yaml new file mode 100644 index 00000000000..99a64ec7af0 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5340-update-hapifhir-document.yaml @@ -0,0 +1,4 @@ +--- +type: fix +issue: 5340 +title: "Updated documentation specifying the correct status (CANCELLED) to set the job status to if a job is cancelled." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5493-linked-resources-for-several-partitions-are-not-returned-in-the-everything-operation.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5493-linked-resources-for-several-partitions-are-not-returned-in-the-everything-operation.yaml new file mode 100644 index 00000000000..dfe811b38c3 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5493-linked-resources-for-several-partitions-are-not-returned-in-the-everything-operation.yaml @@ -0,0 +1,6 @@ +--- +type: fix +jira: SMILE-7624 +title: "Previously, it was impossible to find all resources from different partitions for $everything operation + with partitioning.cross_partition_reference_mode=ALLOWED_UNQUALIFIED and dao_config.client_id_mode=ANY. + It's fixed now" \ No newline at end of file diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5498-add-empty-and-id-only-payload-content-support-for-topic-subscriptions.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5498-add-empty-and-id-only-payload-content-support-for-topic-subscriptions.yaml new file mode 100644 index 00000000000..55ed0de5ec6 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5498-add-empty-and-id-only-payload-content-support-for-topic-subscriptions.yaml @@ -0,0 +1,5 @@ +--- +type: add +issue: 5498 +title: "Added support for `id-only` and `empty` payload content types for notifications +triggered by R5, R4B, and R4 back-ported topic subscriptions." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5505-remove-broken-member-match-from-hapi.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5505-remove-broken-member-match-from-hapi.yaml new file mode 100644 index 00000000000..ae082e5f83a --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5505-remove-broken-member-match-from-hapi.yaml @@ -0,0 +1,4 @@ +--- +type: remove +issue: 5505 +title: "Removed an incorrect implementation of $member-match." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5512-codesystem-lookup-with-designation-no-language-nullpointerexception.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5512-codesystem-lookup-with-designation-no-language-nullpointerexception.yaml new file mode 100644 index 00000000000..b55b4044b51 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5512-codesystem-lookup-with-designation-no-language-nullpointerexception.yaml @@ -0,0 +1,6 @@ +--- +type: fix +issue: 5511 +title: 'Previously, CodeSystem `$lookup` with Remote Terminology Service enabled would throw NullPointerException +when the CodeSystem included designations with no language value. Also, there was an inconsistency between +input and output type `string` vs. `code` for property parameters. These issues have been fixed.' diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5523-case-sensitive-package-ids.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5523-case-sensitive-package-ids.yaml new file mode 100644 index 00000000000..a2b9b590398 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5523-case-sensitive-package-ids.yaml @@ -0,0 +1,5 @@ +--- +type: fix +issue: 5523 +jira: SMILE-7729 +title: "Previously, it was possible to store NPM Packages where the package name's case did not match the package ID's case, e.g. `my-package` was different than `MY-PACKAGE`. Names are now normalized to lower case before queries occur." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5536-sql-migration-lowercase-and-custom-column-type-sql.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5536-sql-migration-lowercase-and-custom-column-type-sql.yaml new file mode 100644 index 00000000000..c98850e5161 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/5536-sql-migration-lowercase-and-custom-column-type-sql.yaml @@ -0,0 +1,4 @@ +--- +type: add +issue: 5536 +title: "In code: Support lowercase for SQL columns and overridden column type/driver type SQL type string rules" diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml index 891e4962f07..dae1d7e2967 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0/changes.yaml @@ -4,13 +4,20 @@ title: "The version of a few dependencies have been bumped to the latest versions (dependent HAPI modules listed in brackets):
    -
  • Spring Framework (JPA): 5.3.27 -> 6.0.12
  • -
  • Spring Data BOM (JPA): 2021.2.2 -> 2023.0.0
  • -
  • Hibernate (JPA): 5.6.15.Final -> 6.2.8.Final
  • +
  • Jackson (Base): 2.15.3 -> 2.16.0
  • +
  • SLF4j (Base): 2.0.3 -> 2.0.9
  • +
  • Logback (Base): 1.4.7 -> 1.4.14
  • +
  • Caffeine (Base): 3.1.1 -> 3.1.8
  • +
  • Spring Framework (JPA): 5.3.27 -> 6.1.1
  • +
  • Spring Boot (JPA-Starter): 5.3.27 -> 6.2.0
  • +
  • Spring Data BOM (JPA): 2021.2.2 -> 2023.1.0
  • +
  • Hibernate (JPA): 5.6.15.Final -> 6.4.0.Final
  • Hibernate Validator (JPA): 6.1.5.Final -> 8.0.0.Final
  • -
  • Hibernate Search (JPA): 6.1.6.Final -> 6.2.1.Final
  • +
  • Hibernate Search (JPA): 6.1.6.Final -> 6.2.2.Final
  • +
  • Commons-DBCP2 (JPA): 2.9.0 -> 2.11.0
  • Spring Boot (Boot+Starter): 2.7.12 -> 3.1.4
  • -
  • Jetty (CLI): 10.0.14 -> 12.0.2
  • +
  • Jetty (CLI): 10.0.14 -> 12.0.3
  • +
  • Jansi (CLI): 2.4.0 -> 2.4.1
  • Phloc Schematron (Schematron Validator): 5.6.5 -> 7.1.2
  • RestEasy (JAX-RS Server): 5.0.2.Final -> 6.2.5.Final
" diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_batch/introduction.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_batch/introduction.md index 74551d291a0..ce8dbc4a1f0 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_batch/introduction.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_batch/introduction.md @@ -31,7 +31,7 @@ HAPI-FHIR Batch Jobs run based on job notification messages. The process is kic The handler then does the following: 1. Change the work chunk status from QUEUED to IN_PROGRESS 2. Change the Job Instance status from QUEUED to IN_PROGRESS -3. If the Job Instance is cancelled, change the status to COMPLETED and abort processing. +3. If the Job Instance is cancelled, change the status to CANCELLED and abort processing. 4. The first step of the job definition is executed with the job parameters 5. This step creates new work chunks. For each work chunk it creates, it json serializes the work chunk data, stores it in the database, and publishes a new message to the Batch Notification Message Channel to notify worker threads that there are new work chunks waiting to be processed. 6. If the step succeeded, the work chunk status is changed from IN_PROGRESS to COMPLETED, and the data it contained is deleted. diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml index a1ae5cb4b1e..96c394d0795 100644 --- a/hapi-fhir-jacoco/pom.xml +++ b/hapi-fhir-jacoco/pom.xml @@ -11,7 +11,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml index 8b55c6e27ac..ce646c625d0 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java index 94015f91c42..1de1682f63d 100644 --- a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java +++ b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsResponse.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jaxrs.server.util; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.BaseRestfulResponse; import ca.uhn.fhir.util.IoUtil; +import jakarta.annotation.Nonnull; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response.ResponseBuilder; import org.apache.commons.lang3.StringUtils; @@ -34,7 +35,6 @@ import java.io.StringWriter; import java.io.Writer; import java.util.List; import java.util.Map.Entry; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpa/pom.xml b/hapi-fhir-jpa/pom.xml index b6830dcdfaf..dc3ad059655 100644 --- a/hapi-fhir-jpa/pom.xml +++ b/hapi-fhir-jpa/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameMap.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameMap.java index 5399355c6f6..7920c60b997 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameMap.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameMap.java @@ -19,6 +19,8 @@ */ package ca.uhn.fhir.jpa.nickname; +import jakarta.annotation.Nonnull; + import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; @@ -27,7 +29,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; class NicknameMap { private final Map> myFormalToNick = new HashMap<>(); diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameSvc.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameSvc.java index cc4c2d37df9..816d84685d4 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameSvc.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/nickname/NicknameSvc.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.nickname; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.ClassPathResource; @@ -34,7 +35,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; /** * Nickname service is used to load nicknames diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java index 6a514116e9c..33bb4be6992 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/sched/BaseHapiScheduler.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.quartz.JobDataMap; import org.quartz.JobKey; @@ -47,7 +48,6 @@ import java.util.Properties; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public abstract class BaseHapiScheduler implements IHapiScheduler { private static final Logger ourLog = LoggerFactory.getLogger(BaseHapiScheduler.class); diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/ISequenceValueMassager.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/ISequenceValueMassager.java index a7bfc43a1bc..26b38682fba 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/ISequenceValueMassager.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/ISequenceValueMassager.java @@ -19,10 +19,9 @@ */ package ca.uhn.fhir.jpa.util; +import jakarta.annotation.Nullable; import org.hibernate.service.Service; -import javax.annotation.Nullable; - /** * This is an internal API and may change or disappear without notice * diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index 915810128cf..f8b5642bab5 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -578,8 +578,8 @@ ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect - classpath:ca/uhn/fhir/jpa/docs/database/hapifhirpostgres94-init01.sql postgres.sql + classpath:ca/uhn/fhir/jpa/docs/database/hapifhirpostgres94-init01.sql ${project.build.directory}/classes/ca/uhn/hapi/fhir/jpa/docs/database diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JobInstanceUtil.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JobInstanceUtil.java index b58c5764dd2..2cf68eab8ed 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JobInstanceUtil.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JobInstanceUtil.java @@ -23,8 +23,7 @@ import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.jpa.entity.Batch2JobInstanceEntity; import ca.uhn.fhir.jpa.entity.Batch2WorkChunkEntity; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; class JobInstanceUtil { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImpl.java index c66ef427e01..d9d411de2c3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImpl.java @@ -47,6 +47,8 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.LockModeType; import jakarta.persistence.Query; @@ -72,8 +74,6 @@ import java.util.UUID; import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.batch2.coordinator.WorkChunkProcessor.MAX_CHUNK_ERROR_COUNT; import static ca.uhn.fhir.jpa.entity.Batch2WorkChunkEntity.ERROR_MSG_MAX_LENGTH; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/binstore/DatabaseBlobBinaryStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/binstore/DatabaseBlobBinaryStorageSvcImpl.java index f4d906f52c6..da13a94c46d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/binstore/DatabaseBlobBinaryStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/binstore/DatabaseBlobBinaryStorageSvcImpl.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import com.google.common.hash.HashingInputStream; import com.google.common.io.ByteStreams; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -47,7 +48,6 @@ import java.sql.Blob; import java.sql.SQLException; import java.util.Date; import java.util.Optional; -import javax.annotation.Nonnull; @Transactional public class DatabaseBlobBinaryStorageSvcImpl extends BaseBinaryStorageSvcImpl { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImpl.java index 74e01095381..db0e0d22709 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImpl.java @@ -34,6 +34,7 @@ import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.util.Batch2JobDefinitionConstants; import ca.uhn.fhir.util.JsonUtil; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; @@ -55,7 +56,6 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Optional; -import javax.annotation.Nonnull; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java index ab3c79551ce..eab1633b605 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.util.ExtensionUtil; import ca.uhn.fhir.util.HapiExtensions; import ca.uhn.fhir.util.Logs; import ca.uhn.fhir.util.SearchParameterUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseExtension; @@ -79,7 +80,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.api.Constants.PARAM_HAS; import static ca.uhn.fhir.rest.api.Constants.PARAM_ID; 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 9d9b5e9248e..8d4097f0aa9 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 @@ -40,6 +40,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.Logs; import ca.uhn.fhir.util.ValidateUtil; import com.apicatalog.jsonld.StringUtils; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.time.DateUtils; import org.quartz.JobExecutionContext; @@ -59,7 +60,6 @@ import java.util.Objects; import java.util.Optional; import java.util.UUID; import java.util.concurrent.Semaphore; -import javax.annotation.Nonnull; import static ca.uhn.fhir.batch2.jobs.importpull.BulkImportPullConfig.BULK_IMPORT_JOB_NAME; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcDaoImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcDaoImpl.java index cdd9e944eef..f3fa8c0016b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcDaoImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/cache/ResourceVersionSvcDaoImpl.java @@ -29,6 +29,7 @@ import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.util.QueryChunker; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +42,6 @@ import java.util.HashMap; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirHibernateJpaDialect.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirHibernateJpaDialect.java index 3043fe69b81..2869152a254 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirHibernateJpaDialect.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/HapiFhirHibernateJpaDialect.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.jpa.model.entity.ResourceSearchUrlEntity; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.system.HapiSystemProperties; +import jakarta.annotation.Nonnull; import jakarta.persistence.PersistenceException; import org.hibernate.HibernateException; import org.hibernate.PessimisticLockException; @@ -36,8 +37,6 @@ import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; import org.springframework.orm.jpa.vendor.HibernateJpaDialect; -import javax.annotation.Nonnull; - import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/JpaConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/JpaConfig.java index 9d752b6694c..e61559c1392 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/JpaConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/JpaConfig.java @@ -176,6 +176,7 @@ import ca.uhn.fhir.subscription.api.IResourceModifiedMessagePersistenceSvc; import ca.uhn.fhir.util.IMetaTagSorter; import ca.uhn.fhir.util.MetaTagSorterAlphabetical; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; +import jakarta.annotation.Nullable; import org.hl7.fhir.common.hapi.validation.support.UnknownCodeSystemWarningValidationSupport; import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices; import org.springframework.beans.factory.annotation.Autowired; @@ -194,7 +195,6 @@ import org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean; import org.springframework.transaction.PlatformTransactionManager; import java.util.Date; -import javax.annotation.Nullable; @Configuration // repositoryFactoryBeanClass: EnversRevisionRepositoryFactoryBean is needed primarily for unit testing diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/JpaR4Config.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/JpaR4Config.java index 281abe9a277..2175aaf4c8c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/JpaR4Config.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/r4/JpaR4Config.java @@ -22,7 +22,6 @@ package ca.uhn.fhir.jpa.config.r4; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.jpa.api.IDaoRegistry; -import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.config.GeneratedDaoAndResourceProviderConfigR4; import ca.uhn.fhir.jpa.config.JpaConfig; @@ -31,9 +30,6 @@ import ca.uhn.fhir.jpa.dao.r4.TransactionProcessorVersionAdapterR4; import ca.uhn.fhir.jpa.graphql.GraphQLProvider; import ca.uhn.fhir.jpa.graphql.GraphQLProviderWithIntrospection; import ca.uhn.fhir.jpa.provider.JpaSystemProvider; -import ca.uhn.fhir.jpa.provider.r4.IMemberMatchConsentHook; -import ca.uhn.fhir.jpa.provider.r4.MemberMatchR4ResourceProvider; -import ca.uhn.fhir.jpa.provider.r4.MemberMatcherR4Helper; import ca.uhn.fhir.jpa.term.TermLoaderSvcImpl; import ca.uhn.fhir.jpa.term.TermVersionAdapterSvcR4; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc; @@ -42,12 +38,8 @@ import ca.uhn.fhir.jpa.term.api.ITermLoaderSvc; import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Consent; -import org.hl7.fhir.r4.model.Coverage; import org.hl7.fhir.r4.model.Meta; -import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -104,21 +96,4 @@ public class JpaR4Config { ITermDeferredStorageSvc theDeferredStorageSvc, ITermCodeSystemStorageSvc theCodeSystemStorageSvc) { return new TermLoaderSvcImpl(theDeferredStorageSvc, theCodeSystemStorageSvc); } - - @Bean - public MemberMatcherR4Helper memberMatcherR4Helper( - @Autowired FhirContext theContext, - @Autowired IFhirResourceDao theCoverageDao, - @Autowired IFhirResourceDao thePatientDao, - @Autowired IFhirResourceDao theConsentDao, - @Autowired(required = false) IMemberMatchConsentHook theExtensionProvider) { - return new MemberMatcherR4Helper( - theContext, theCoverageDao, thePatientDao, theConsentDao, theExtensionProvider); - } - - @Bean - public MemberMatchR4ResourceProvider memberMatchR4ResourceProvider( - FhirContext theFhirContext, MemberMatcherR4Helper theMemberMatchR4Helper) { - return new MemberMatchR4ResourceProvider(theFhirContext, theMemberMatchR4Helper); - } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java index af3d76dead1..3e23911c980 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java @@ -107,6 +107,8 @@ import com.google.common.collect.Sets; import com.google.common.hash.HashCode; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.persistence.EntityManager; import jakarta.persistence.NoResultException; @@ -159,8 +161,6 @@ import java.util.List; import java.util.Set; import java.util.StringTokenizer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.xml.stream.events.Characters; import javax.xml.stream.events.XMLEvent; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index 4d58d571ca7..dbb35bb4967 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -118,6 +118,8 @@ import ca.uhn.fhir.validation.ValidationOptions; import ca.uhn.fhir.validation.ValidationResult; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Streams; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.persistence.LockModeType; import jakarta.persistence.NoResultException; @@ -157,8 +159,6 @@ import java.util.concurrent.Callable; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static java.util.Objects.isNull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirSystemDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirSystemDao.java index 961992748e1..242669a58a9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirSystemDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirSystemDao.java @@ -48,6 +48,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -69,7 +70,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Nullable; public abstract class BaseHapiFhirSystemDao extends BaseStorageDao implements IFhirSystemDao { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FulltextSearchSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FulltextSearchSvcImpl.java index 80bd0e9a7f1..f6b1791f57b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FulltextSearchSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FulltextSearchSvcImpl.java @@ -53,6 +53,7 @@ import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import com.google.common.collect.Ordering; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -81,7 +82,6 @@ import java.util.List; import java.util.Spliterators; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.server.BasePagingProvider.DEFAULT_MAX_PAGE_SIZE; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilder.java index 30a181df720..0b3ce422e5e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilder.java @@ -32,6 +32,7 @@ import ca.uhn.fhir.rest.param.HistorySearchStyleEnum; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.Multimaps; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -53,7 +54,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.util.QueryParameterUtils.toPredicateArray; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilderFactory.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilderFactory.java index 31205fdba27..0d016d43cf6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilderFactory.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/HistoryBuilderFactory.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.jpa.dao; import ca.uhn.fhir.jpa.config.JpaConfig; +import jakarta.annotation.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import java.util.Date; -import javax.annotation.Nullable; public class HistoryBuilderFactory { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IJpaStorageResourceParser.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IJpaStorageResourceParser.java index e706c3d6e02..5e171d96666 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IJpaStorageResourceParser.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IJpaStorageResourceParser.java @@ -22,10 +22,10 @@ package ca.uhn.fhir.jpa.dao; import ca.uhn.fhir.jpa.model.entity.BaseTag; import ca.uhn.fhir.jpa.model.entity.IBaseResourceEntity; import ca.uhn.fhir.jpa.model.entity.ResourceTag; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collection; -import javax.annotation.Nullable; public interface IJpaStorageResourceParser extends IStorageResourceParser { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java index d3c32df28f8..9bb9b9f9f08 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupport.java @@ -36,6 +36,7 @@ import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.param.UriParam; import ca.uhn.fhir.sl.cache.Cache; import ca.uhn.fhir.sl.cache.CacheFactory; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IAnyResource; @@ -58,7 +59,6 @@ import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaResourceDaoCodeSystem.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaResourceDaoCodeSystem.java index 1a51e09e493..2bc82648bc2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaResourceDaoCodeSystem.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaResourceDaoCodeSystem.java @@ -42,6 +42,7 @@ import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.FhirTerser; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import org.apache.commons.collections4.CollectionUtils; import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService; @@ -59,7 +60,6 @@ import java.util.Collection; import java.util.Date; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.DatatypeUtil.toStringValue; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaStorageResourceParser.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaStorageResourceParser.java index 74ed3f1b492..54d4f74ef4d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaStorageResourceParser.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/JpaStorageResourceParser.java @@ -56,6 +56,7 @@ import ca.uhn.fhir.parser.LenientErrorHandler; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.util.IMetaTagSorter; import ca.uhn.fhir.util.MetaUtil; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseCoding; @@ -71,7 +72,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.List; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.decodeResource; import static java.util.Objects.nonNull; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TolerantJsonParser.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TolerantJsonParser.java index 1ae25cae3fa..9be401ba68b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TolerantJsonParser.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TolerantJsonParser.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.parser.JsonParser; import ca.uhn.fhir.parser.LenientErrorHandler; import com.google.gson.Gson; import com.google.gson.JsonObject; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.slf4j.Logger; @@ -34,7 +35,6 @@ import org.slf4j.LoggerFactory; import java.math.BigDecimal; import java.util.Objects; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessor.java index 437677f99c5..1a25d6dae25 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/TransactionProcessor.java @@ -44,6 +44,7 @@ import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -74,7 +75,6 @@ import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static ca.uhn.fhir.util.UrlUtil.determineResourceTypeInResourceUrl; import static org.apache.commons.lang3.StringUtils.countMatches; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageDao.java index 6df63c7d233..d9d9716161f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageDao.java @@ -28,6 +28,6 @@ import java.util.Optional; public interface INpmPackageDao extends JpaRepository, IHapiFhirJpaRepository { - @Query("SELECT p FROM NpmPackageEntity p WHERE p.myPackageId = :id") + @Query("SELECT p FROM NpmPackageEntity p WHERE lower(p.myPackageId) = lower(:id)") Optional findByPackageId(@Param("id") String thePackageId); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageVersionDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageVersionDao.java index 26d4076401e..3a27873e811 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageVersionDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/INpmPackageVersionDao.java @@ -30,10 +30,11 @@ import java.util.Optional; public interface INpmPackageVersionDao extends JpaRepository, IHapiFhirJpaRepository { - @Query("SELECT p FROM NpmPackageVersionEntity p WHERE p.myPackageId = :id") + @Query("SELECT p FROM NpmPackageVersionEntity p WHERE lower(p.myPackageId) = lower(:id)") Collection findByPackageId(@Param("id") String thePackageId); - @Query("SELECT p FROM NpmPackageVersionEntity p WHERE p.myPackageId = :id AND p.myVersionId = :version") + @Query( + "SELECT p FROM NpmPackageVersionEntity p WHERE lower(p.myPackageId) = lower(:id) AND p.myVersionId = :version") Optional findByPackageIdAndVersion( @Param("id") String thePackageId, @Param("version") String thePackageVersion); @@ -41,7 +42,7 @@ public interface INpmPackageVersionDao extends JpaRepository findVersionIdsByPackageIdAndLikeVersion( @Param("id") String theId, @Param("version") String thePartialVersionString); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java index 9c192fa58e8..9962eed3ef3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ExpungeEverythingService.java @@ -78,6 +78,7 @@ import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -97,7 +98,6 @@ import org.springframework.transaction.annotation.Propagation; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Nullable; @Service public class ExpungeEverythingService implements IExpungeEverythingService { @@ -140,6 +140,18 @@ public class ExpungeEverythingService implements IExpungeEverythingService { RequestPartitionId requestPartitionId = myRequestPartitionHelperSvc.determineReadPartitionForRequest(theRequest, details); + deleteAll(theRequest, propagation, requestPartitionId, counter); + + purgeAllCaches(); + + ourLog.info("COMPLETED GLOBAL $expunge - Deleted {} rows", counter.get()); + } + + protected void deleteAll( + @Nullable RequestDetails theRequest, + Propagation propagation, + RequestPartitionId requestPartitionId, + AtomicInteger counter) { myTxService .withRequest(theRequest) .withPropagation(propagation) @@ -248,10 +260,6 @@ public class ExpungeEverythingService implements IExpungeEverythingService { .execute(() -> { counter.addAndGet(doExpungeEverythingQuery("DELETE from " + Search.class.getSimpleName() + " d")); }); - - purgeAllCaches(); - - ourLog.info("COMPLETED GLOBAL $expunge - Deleted {} rows", counter.get()); } @Override @@ -263,7 +271,7 @@ public class ExpungeEverythingService implements IExpungeEverythingService { myMemoryCacheService.invalidateAllCaches(); } - private int expungeEverythingByTypeWithoutPurging( + protected int expungeEverythingByTypeWithoutPurging( RequestDetails theRequest, Class theEntityType, RequestPartitionId theRequestPartitionId) { HapiTransactionService.noTransactionAllowed(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceTableFKProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceTableFKProvider.java index fe5c2d80804..22551b6e9a1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceTableFKProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceTableFKProvider.java @@ -20,12 +20,12 @@ package ca.uhn.fhir.jpa.dao.expunge; import ca.uhn.fhir.mdm.api.IMdmSettings; +import jakarta.annotation.Nonnull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; @Service public class ResourceTableFKProvider { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java index e23720ad33d..2978764db68 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/IdHelperService.java @@ -42,6 +42,8 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ListMultimap; import com.google.common.collect.MultimapBuilder; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -73,8 +75,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.search.builder.predicate.BaseJoiningPredicateBuilder.replaceDefaultPartitionIdIfNonNull; import static org.apache.commons.lang3.StringUtils.isNotBlank; @@ -210,7 +210,9 @@ public class IdHelperService implements IIdHelperService { Validate.isTrue(!theIds.isEmpty(), "theIds must not be empty"); Map retVals = new HashMap<>(); - + RequestPartitionId partitionId = myPartitionSettings.isAllowUnqualifiedCrossPartitionReference() + ? RequestPartitionId.allPartitions() + : theRequestPartitionId; for (String id : theIds) { JpaPid retVal; if (!idRequiresForcedId(id)) { @@ -221,18 +223,17 @@ public class IdHelperService implements IIdHelperService { // is a forced id // we must resolve! if (myStorageSettings.isDeleteEnabled()) { - retVal = resolveResourceIdentity(theRequestPartitionId, theResourceType, id, theExcludeDeleted) + retVal = resolveResourceIdentity(partitionId, theResourceType, id, theExcludeDeleted) .getPersistentId(); retVals.put(id, retVal); } else { // fetch from cache... adding to cache if not available - String key = toForcedIdToPidKey(theRequestPartitionId, theResourceType, id); + String key = toForcedIdToPidKey(partitionId, theResourceType, id); retVal = myMemoryCacheService.getThenPutAfterCommit( MemoryCacheService.CacheEnum.FORCED_ID_TO_PID, key, t -> { List ids = Collections.singletonList(new IdType(theResourceType, id)); // fetches from cache using a function that checks cache first... - List resolvedIds = - resolveResourcePersistentIdsWithCache(theRequestPartitionId, ids); + List resolvedIds = resolveResourcePersistentIdsWithCache(partitionId, ids); if (resolvedIds.isEmpty()) { throw new ResourceNotFoundException(Msg.code(1100) + ids.get(0)); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/SearchParamWithInlineReferencesExtractor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/SearchParamWithInlineReferencesExtractor.java index 24b04c5e508..7934a7c64db 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/SearchParamWithInlineReferencesExtractor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/index/SearchParamWithInlineReferencesExtractor.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -51,7 +52,6 @@ import org.springframework.stereotype.Service; import java.util.Collection; import java.util.Iterator; import java.util.stream.Collectors; -import javax.annotation.Nullable; @Service @Lazy diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/mdm/MdmLinkDaoJpaImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/mdm/MdmLinkDaoJpaImpl.java index b915187a6f6..f8a3765754f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/mdm/MdmLinkDaoJpaImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/mdm/MdmLinkDaoJpaImpl.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.mdm.dao.IMdmLinkDao; import ca.uhn.fhir.mdm.model.MdmPidTuple; import ca.uhn.fhir.rest.api.SortOrderEnum; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.TypedQuery; import jakarta.persistence.criteria.CriteriaBuilder; @@ -74,7 +75,6 @@ import java.util.Date; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.mdm.api.params.MdmQuerySearchParameters.GOLDEN_RESOURCE_NAME; import static ca.uhn.fhir.mdm.api.params.MdmQuerySearchParameters.GOLDEN_RESOURCE_PID_NAME; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java index 8dde509dbb6..e72cba34462 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchClauseBuilder.java @@ -42,6 +42,7 @@ import ca.uhn.fhir.rest.param.UriParam; import ca.uhn.fhir.util.DateUtils; import ca.uhn.fhir.util.NumericParamRangeUtil; import ca.uhn.fhir.util.StringUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -66,7 +67,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.dao.search.PathContext.joinPath; import static ca.uhn.fhir.jpa.model.search.HSearchIndexWriter.IDX_STRING_EXACT; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchIndexExtractor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchIndexExtractor.java index 8cb8ed8d9b0..d5bcf5e3312 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchIndexExtractor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchIndexExtractor.java @@ -36,6 +36,7 @@ import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.MetaUtil; import com.google.common.base.Strings; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -46,7 +47,6 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/LastNAggregation.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/LastNAggregation.java index 8b2e463f980..7b7857843b1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/LastNAggregation.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/LastNAggregation.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.dao.search; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,7 +30,6 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.model.search.HSearchIndexWriter.SEARCH_PARAM_ROOT; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java index f059361e7c6..614c04cec82 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.jpa.dao.search; +import jakarta.annotation.Nonnull; import org.hibernate.search.engine.search.predicate.SearchPredicate; import org.hibernate.search.engine.search.predicate.dsl.*; import org.hibernate.search.util.common.annotation.Incubating; @@ -26,7 +27,6 @@ import org.hibernate.search.util.common.annotation.Incubating; import java.util.List; import java.util.function.Consumer; import java.util.function.Function; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.dao.search.ExtendedHSearchClauseBuilder.PATH_JOINER; import static ca.uhn.fhir.jpa.model.search.HSearchIndexWriter.NESTED_SEARCH_PARAM_ROOT; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/batch2/DeleteExpungeSqlBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/batch2/DeleteExpungeSqlBuilder.java index 0bc2a272449..f368b52a161 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/batch2/DeleteExpungeSqlBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/delete/batch2/DeleteExpungeSqlBuilder.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.jpa.dao.expunge.ResourceTableFKProvider; import ca.uhn.fhir.jpa.model.dao.JpaPid; import ca.uhn.fhir.jpa.model.entity.ResourceLink; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,7 +37,6 @@ import java.util.Collections; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class DeleteExpungeSqlBuilder { private static final Logger ourLog = LoggerFactory.getLogger(DeleteExpungeSqlBuilder.class); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceSearchView.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceSearchView.java index 47e18ec763c..cb654724381 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceSearchView.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceSearchView.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.rest.api.Constants; +import jakarta.annotation.Nullable; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; @@ -41,7 +42,6 @@ import org.hibernate.annotations.Subselect; import java.io.Serializable; import java.util.Date; -import javax.annotation.Nullable; @SuppressWarnings("SqlDialectInspection") @Entity diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/Search.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/Search.java index 51bab558b3a..336409823d6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/Search.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/Search.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.rest.param.HistorySearchStyleEnum; import ca.uhn.fhir.rest.server.util.ICachedSearchDetails; import ca.uhn.fhir.system.HapiSystemProperties; +import jakarta.annotation.Nonnull; import jakarta.persistence.Basic; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; @@ -64,7 +65,6 @@ import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystem.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystem.java index 55977502199..847b5ddfb04 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystem.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystem.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.*; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -28,7 +29,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java index 908ec44a31f..2bc117ad202 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConcept.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink.RelationshipTypeEnum; import ca.uhn.fhir.jpa.search.DeferConceptIndexingRoutingBinder; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -66,7 +67,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptDesignation.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptDesignation.java index f93e90fb963..14c1703dd06 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptDesignation.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptDesignation.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -36,7 +37,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMap.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMap.java index c59ee2cde49..548af3a74c9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMap.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMap.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.*; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -28,7 +29,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroup.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroup.java index 7f4e4cb6efd..6a5de9a94bc 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroup.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroup.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.*; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -27,7 +28,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElement.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElement.java index da1bb5d0832..b06f09a7284 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElement.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElement.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.*; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -29,7 +30,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElementTarget.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElementTarget.java index d07d8a8565a..e38c9af6e42 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElementTarget.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptMapGroupElementTarget.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.*; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -28,7 +29,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence; import java.io.Serializable; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptProperty.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptProperty.java index 001f36be247..1aecb591068 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptProperty.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermConceptProperty.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; @@ -50,7 +51,6 @@ import org.hibernate.validator.constraints.NotBlank; import java.io.Serializable; import java.nio.charset.StandardCharsets; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java index ecda46f4788..dd0d3cdfd39 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSet.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; @@ -49,7 +50,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConcept.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConcept.java index a7939742ed5..aad16cce80f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConcept.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConcept.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -43,7 +44,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConceptDesignation.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConceptDesignation.java index 8649dfc10ce..76e2dde2d38 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConceptDesignation.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermValueSetConceptDesignation.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.entity; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -39,7 +40,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.left; import static org.apache.commons.lang3.StringUtils.length; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/esr/ExternallyStoredResourceServiceRegistry.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/esr/ExternallyStoredResourceServiceRegistry.java index a8a5caa06c0..928ae9e5b16 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/esr/ExternallyStoredResourceServiceRegistry.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/esr/ExternallyStoredResourceServiceRegistry.java @@ -19,11 +19,11 @@ */ package ca.uhn.fhir.jpa.esr; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.defaultString; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java index a1f918a9018..60ded14d06a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java @@ -46,6 +46,8 @@ import graphql.schema.idl.SchemaGenerator; import graphql.schema.idl.SchemaParser; import graphql.schema.idl.TypeDefinitionRegistry; import graphql.schema.idl.TypeRuntimeWiring; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.io.output.StringBuilderWriter; import org.apache.commons.lang3.Validate; import org.hl7.fhir.common.hapi.validation.validator.VersionSpecificWorkerContextWrapper; @@ -68,8 +70,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.util.MessageSupplier.msg; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java index a460257089e..6fdf75f8ccd 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java @@ -34,6 +34,8 @@ import ca.uhn.fhir.rest.api.server.ResponseDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.OperationOutcomeUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -43,8 +45,6 @@ import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.delete.DeleteConflictService.MAX_RETRY_ATTEMPTS; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java index 8f8b0e4fe89..f35730ec802 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/JpaPackageCache.java @@ -50,6 +50,8 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.ResourceUtil; import ca.uhn.fhir.util.StringUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.TypedQuery; @@ -92,8 +94,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.util.QueryParameterUtils.toPredicateArray; import static ca.uhn.fhir.util.StringUtil.toUtf8String; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmJpaValidationSupport.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmJpaValidationSupport.java index f60e6fbcd85..01a24d3999e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmJpaValidationSupport.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmJpaValidationSupport.java @@ -22,11 +22,11 @@ package ca.uhn.fhir.jpa.packages; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.support.IValidationSupport; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; -import javax.annotation.Nullable; public class NpmJpaValidationSupport implements IValidationSupport { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmPackageMetadataJson.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmPackageMetadataJson.java index 2ba08c9ae98..a7c72e0274c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmPackageMetadataJson.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/NpmPackageMetadataJson.java @@ -27,11 +27,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.annotation.Nonnull; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; -import javax.annotation.Nonnull; @Schema(description = "Represents an NPM package metadata response") @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/loader/PackageLoaderSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/loader/PackageLoaderSvc.java index 1d02fae2c6d..55cbdc06686 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/loader/PackageLoaderSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/packages/loader/PackageLoaderSvc.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.packages.PackageInstallationSpec; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.ClasspathUtil; +import jakarta.annotation.Nullable; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.Validate; import org.apache.http.client.methods.CloseableHttpResponse; @@ -44,7 +45,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Paths; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/IPartitionLookupSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/IPartitionLookupSvc.java index 8150fb53c7a..ac6bda04378 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/IPartitionLookupSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/IPartitionLookupSvc.java @@ -22,9 +22,9 @@ package ca.uhn.fhir.jpa.partition; import ca.uhn.fhir.jpa.entity.PartitionEntity; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import jakarta.annotation.Nullable; import java.util.List; -import javax.annotation.Nullable; public interface IPartitionLookupSvc { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionLookupSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionLookupSvcImpl.java index 655af28fcbc..40f9d761577 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionLookupSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionLookupSvcImpl.java @@ -36,6 +36,7 @@ import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ICallable; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; @@ -50,7 +51,6 @@ import java.util.Optional; import java.util.concurrent.ThreadLocalRandom; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionManagementProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionManagementProvider.java index 31edc63401d..4c0fabb51c5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionManagementProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/PartitionManagementProvider.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -36,7 +37,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.validatePartitionIdSupplied; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/DiffProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/DiffProvider.java index b20caebfd72..2a4310d9c6f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/DiffProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/DiffProvider.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import com.google.common.base.Objects; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -41,8 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; - public class DiffProvider { private static final Logger ourLog = LoggerFactory.getLogger(DiffProvider.class); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/InstanceReindexProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/InstanceReindexProvider.java index 646f1523b18..4d77a09251c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/InstanceReindexProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/InstanceReindexProvider.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.rest.annotation.Operation; import ca.uhn.fhir.rest.annotation.OperationParam; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.provider.ProviderConstants; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IIdType; @@ -33,7 +34,6 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class InstanceReindexProvider { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaCapabilityStatementProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaCapabilityStatementProvider.java index 2983384f549..a164becf92a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaCapabilityStatementProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaCapabilityStatementProvider.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.util.CoverageIgnore; import ca.uhn.fhir.util.ExtensionConstants; import ca.uhn.fhir.util.ExtensionUtil; import ca.uhn.fhir.util.FhirTerser; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseConformance; @@ -40,7 +41,6 @@ import org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy; import org.hl7.fhir.r4.model.Meta; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/TerminologyUploaderProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/TerminologyUploaderProvider.java index 88dc83093ec..64c65e38aa7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/TerminologyUploaderProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/TerminologyUploaderProvider.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.util.ValidateUtil; import com.google.common.base.Charsets; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40; import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; @@ -60,7 +61,6 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.*; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IConsentExtensionProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IConsentExtensionProvider.java deleted file mode 100644 index ae63a090f16..00000000000 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IConsentExtensionProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * #%L - * HAPI FHIR JPA Server - * %% - * Copyright (C) 2014 - 2023 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% - */ -package ca.uhn.fhir.jpa.provider.r4; - -import ca.uhn.fhir.util.ExtensionUtil; -import org.hl7.fhir.instance.model.api.IBaseExtension; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Collection; - -/** - * Hook for Consent pre-save additions. - * - * @deprecated - we just use Consumer now - * TODO delete this. - */ -@Deprecated(since = "6.3.6", forRemoval = true) -public interface IConsentExtensionProvider extends IMemberMatchConsentHook { - Logger ourLog = LoggerFactory.getLogger(IConsentExtensionProvider.class); - - Collection getConsentExtension(IBaseResource theConsentResource); - - default void accept(IBaseResource theResource) { - Collection extensions = getConsentExtension(theResource); - - for (IBaseExtension ext : extensions) { - IBaseExtension e = ExtensionUtil.addExtension(theResource, ext.getUrl()); - e.setValue(ext.getValue()); - } - ourLog.trace("{} extension(s) added to Consent", extensions.size()); - } -} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatchR4ResourceProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatchR4ResourceProvider.java index 6ad2956d88d..6d4426c36c2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatchR4ResourceProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatchR4ResourceProvider.java @@ -17,155 +17,3 @@ * limitations under the License. * #L% */ -package ca.uhn.fhir.jpa.provider.r4; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.i18n.Msg; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.api.Constants; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; -import ca.uhn.fhir.rest.server.provider.ProviderConstants; -import org.hl7.fhir.r4.model.Consent; -import org.hl7.fhir.r4.model.Coverage; -import org.hl7.fhir.r4.model.Parameters; -import org.hl7.fhir.r4.model.Patient; - -import java.util.Optional; -import javax.annotation.Nullable; - -public class MemberMatchR4ResourceProvider { - - private final MemberMatcherR4Helper myMemberMatcherR4Helper; - private final FhirContext myFhirContext; - - public MemberMatchR4ResourceProvider(FhirContext theFhirContext, MemberMatcherR4Helper theMemberMatcherR4Helper) { - myFhirContext = theFhirContext; - myMemberMatcherR4Helper = theMemberMatcherR4Helper; - } - - /** - * /Patient/$member-match operation - * Basic implementation matching by coverage id or by coverage identifier. Matching by - * Beneficiary (Patient) demographics on family name and birthdate in this version - */ - @Operation( - name = ProviderConstants.OPERATION_MEMBER_MATCH, - typeName = "Patient", - canonicalUrl = "http://hl7.org/fhir/us/davinci-hrex/OperationDefinition/member-match", - idempotent = false, - returnParameters = {@OperationParam(name = "MemberIdentifier", typeName = "string")}) - public Parameters patientMemberMatch( - jakarta.servlet.http.HttpServletRequest theServletRequest, - @Description(shortDefinition = "The target of the operation. Contain member Patient demographics.") - @OperationParam(name = Constants.PARAM_MEMBER_PATIENT, min = 1, max = 1) - Patient theMemberPatient, - @Description( - shortDefinition = - "Old coverage information as extracted from beneficiary's card. Identifies the coverage to be matched by the receiving payer.") - @OperationParam(name = Constants.COVERAGE_TO_MATCH, min = 1, max = 1) - Coverage oldCoverage, - @Description( - shortDefinition = - "New Coverage information. Identifies the coverage information of the member as they are known by the requesting payer. Provided as a reference.") - @OperationParam(name = Constants.COVERAGE_TO_LINK, min = 1, max = 1) - Coverage newCoverage, - @Description( - shortDefinition = - "Consent information. Consent held by the system seeking the match that grants permission to access the patient information.") - @OperationParam(name = Constants.PARAM_CONSENT, min = 1, max = 1) - Consent theConsent, - RequestDetails theRequestDetails) { - return doMemberMatchOperation(theMemberPatient, oldCoverage, newCoverage, theConsent, theRequestDetails); - } - - private Parameters doMemberMatchOperation( - Patient theMemberPatient, - Coverage theCoverageToMatch, - Coverage theCoverageToLink, - Consent theConsent, - RequestDetails theRequestDetails) { - - validateParams(theMemberPatient, theCoverageToMatch, theCoverageToLink, theConsent); - - Optional coverageOpt = - myMemberMatcherR4Helper.findMatchingCoverage(theCoverageToMatch, theRequestDetails); - if (coverageOpt.isEmpty()) { - String i18nMessage = - myFhirContext.getLocalizer().getMessage("operation.member.match.error.coverage.not.found"); - throw new UnprocessableEntityException(Msg.code(1155) + i18nMessage); - } - Coverage coverage = coverageOpt.get(); - - Optional patientOpt = myMemberMatcherR4Helper.getBeneficiaryPatient(coverage, theRequestDetails); - if (patientOpt.isEmpty()) { - String i18nMessage = - myFhirContext.getLocalizer().getMessage("operation.member.match.error.beneficiary.not.found"); - throw new UnprocessableEntityException(Msg.code(1156) + i18nMessage); - } - - Patient patient = patientOpt.get(); - if (!myMemberMatcherR4Helper.validPatientMember(patient, theMemberPatient, theRequestDetails)) { - String i18nMessage = - myFhirContext.getLocalizer().getMessage("operation.member.match.error.patient.not.found"); - throw new UnprocessableEntityException(Msg.code(2146) + i18nMessage); - } - - if (patient.getIdentifier().isEmpty()) { - String i18nMessage = myFhirContext - .getLocalizer() - .getMessage("operation.member.match.error.beneficiary.without.identifier"); - throw new UnprocessableEntityException(Msg.code(1157) + i18nMessage); - } - - if (!myMemberMatcherR4Helper.validConsentDataAccess(theConsent)) { - String i18nMessage = myFhirContext - .getLocalizer() - .getMessage("operation.member.match.error.consent.release.data.mismatch"); - throw new UnprocessableEntityException(Msg.code(2147) + i18nMessage); - } - - myMemberMatcherR4Helper.addMemberIdentifierToMemberPatient(theMemberPatient, patient.getIdentifierFirstRep()); - myMemberMatcherR4Helper.updateConsentForMemberMatch(theConsent, patient, theMemberPatient, theRequestDetails); - return myMemberMatcherR4Helper.buildSuccessReturnParameters(patient); - } - - private void validateParams( - Patient theMemberPatient, Coverage theOldCoverage, Coverage theNewCoverage, Consent theConsent) { - validateParam(theMemberPatient, Constants.PARAM_MEMBER_PATIENT); - validateParam(theOldCoverage, Constants.COVERAGE_TO_MATCH); - validateParam(theNewCoverage, Constants.COVERAGE_TO_LINK); - validateParam(theConsent, Constants.PARAM_CONSENT); - validateMemberPatientParam(theMemberPatient); - validateConsentParam(theConsent); - } - - private void validateParam(@Nullable Object theParam, String theParamName) { - if (theParam == null) { - String i18nMessage = myFhirContext - .getLocalizer() - .getMessage("operation.member.match.error.missing.parameter", theParamName); - throw new UnprocessableEntityException(Msg.code(1158) + i18nMessage); - } - } - - private void validateMemberPatientParam(Patient theMemberPatient) { - if (theMemberPatient.getName().isEmpty()) { - validateParam(null, Constants.PARAM_MEMBER_PATIENT_NAME); - } - - validateParam(theMemberPatient.getName().get(0).getFamily(), Constants.PARAM_MEMBER_PATIENT_NAME); - validateParam(theMemberPatient.getBirthDate(), Constants.PARAM_MEMBER_PATIENT_BIRTHDATE); - } - - private void validateConsentParam(Consent theConsent) { - if (theConsent.getPatient().isEmpty()) { - validateParam(null, Constants.PARAM_CONSENT_PATIENT_REFERENCE); - } - if (theConsent.getPerformer().isEmpty()) { - validateParam(null, Constants.PARAM_CONSENT_PERFORMER_REFERENCE); - } - } -} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4Helper.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4Helper.java index b05cec467fe..6d4426c36c2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4Helper.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4Helper.java @@ -1,4 +1,4 @@ -/* +/*- * #%L * HAPI FHIR JPA Server * %% @@ -17,269 +17,3 @@ * limitations under the License. * #L% */ -package ca.uhn.fhir.jpa.provider.r4; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.i18n.Msg; -import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; -import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.param.DateParam; -import ca.uhn.fhir.rest.param.StringOrListParam; -import ca.uhn.fhir.rest.param.StringParam; -import ca.uhn.fhir.rest.param.TokenOrListParam; -import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; -import ca.uhn.fhir.util.ParametersUtil; -import com.google.common.collect.Lists; -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.api.IBaseParameters; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.r4.model.CodeableConcept; -import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.Consent; -import org.hl7.fhir.r4.model.Coverage; -import org.hl7.fhir.r4.model.HumanName; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Parameters; -import org.hl7.fhir.r4.model.Patient; -import org.hl7.fhir.r4.model.Reference; - -import java.util.List; -import java.util.Optional; -import java.util.function.Consumer; -import javax.annotation.Nullable; - -import static ca.uhn.fhir.rest.api.Constants.PARAM_MEMBER_IDENTIFIER; - -public class MemberMatcherR4Helper { - static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MemberMatcherR4Helper.class); - - private static final String OUT_COVERAGE_IDENTIFIER_CODE_SYSTEM = "http://terminology.hl7.org/CodeSystem/v2-0203"; - private static final String OUT_COVERAGE_IDENTIFIER_CODE = "MB"; - private static final String OUT_COVERAGE_IDENTIFIER_TEXT = "Member Number"; - private static final String COVERAGE_TYPE = "Coverage"; - private static final String CONSENT_POLICY_REGULAR_TYPE = "regular"; - private static final String CONSENT_POLICY_SENSITIVE_TYPE = "sensitive"; - public static final String CONSENT_IDENTIFIER_CODE_SYSTEM = - "https://smilecdr.com/fhir/ns/member-match-source-client"; - - private final FhirContext myFhirContext; - private final IFhirResourceDao myCoverageDao; - private final IFhirResourceDao myPatientDao; - private final IFhirResourceDao myConsentDao; - /** A hook to modify the Consent before save */ - private final Consumer myConsentModifier; - - private boolean myRegularFilterSupported = false; - - public MemberMatcherR4Helper( - FhirContext theContext, - IFhirResourceDao theCoverageDao, - IFhirResourceDao thePatientDao, - IFhirResourceDao theConsentDao, - @Nullable IMemberMatchConsentHook theConsentModifier) { - myFhirContext = theContext; - myConsentDao = theConsentDao; - myPatientDao = thePatientDao; - myCoverageDao = theCoverageDao; - myConsentModifier = (theConsentModifier != null) ? theConsentModifier : noop -> {}; - } - - /** - * Find Coverage matching the received member (Patient) by coverage id or by coverage identifier only - */ - public Optional findMatchingCoverage(Coverage theCoverageToMatch, RequestDetails theRequestDetails) { - // search by received old coverage id - List foundCoverages = findCoverageByCoverageId(theCoverageToMatch, theRequestDetails); - if (foundCoverages.size() == 1 && isCoverage(foundCoverages.get(0))) { - return Optional.of((Coverage) foundCoverages.get(0)); - } - - // search by received old coverage identifier - foundCoverages = findCoverageByCoverageIdentifier(theCoverageToMatch, theRequestDetails); - if (foundCoverages.size() == 1 && isCoverage(foundCoverages.get(0))) { - return Optional.of((Coverage) foundCoverages.get(0)); - } - - return Optional.empty(); - } - - private List findCoverageByCoverageIdentifier( - Coverage theCoverageToMatch, RequestDetails theRequestDetails) { - TokenOrListParam identifierParam = new TokenOrListParam(); - for (Identifier identifier : theCoverageToMatch.getIdentifier()) { - identifierParam.add(identifier.getSystem(), identifier.getValue()); - } - - SearchParameterMap paramMap = new SearchParameterMap().add("identifier", identifierParam); - ca.uhn.fhir.rest.api.server.IBundleProvider retVal = myCoverageDao.search(paramMap, theRequestDetails); - - return retVal.getAllResources(); - } - - private boolean isCoverage(IBaseResource theIBaseResource) { - return theIBaseResource.fhirType().equals(COVERAGE_TYPE); - } - - private List findCoverageByCoverageId( - Coverage theCoverageToMatch, RequestDetails theRequestDetails) { - SearchParameterMap paramMap = new SearchParameterMap().add("_id", new StringParam(theCoverageToMatch.getId())); - ca.uhn.fhir.rest.api.server.IBundleProvider retVal = myCoverageDao.search(paramMap, theRequestDetails); - - return retVal.getAllResources(); - } - - public void updateConsentForMemberMatch( - Consent theConsent, Patient thePatient, Patient theMemberPatient, RequestDetails theRequestDetails) { - updateConsentPatientAndPerformer(theConsent, thePatient); - myConsentModifier.accept(theConsent); - - // Trust RequestTenantPartitionInterceptor or PatientIdPartitionInterceptor to assign the partition. - myConsentDao.create(theConsent, theRequestDetails); - } - - public Parameters buildSuccessReturnParameters(Patient thePatient) { - IBaseParameters parameters = ParametersUtil.newInstance(myFhirContext); - ParametersUtil.addParameterToParameters( - myFhirContext, - parameters, - PARAM_MEMBER_IDENTIFIER, - thePatient.getIdElement().toUnqualifiedVersionless()); - return (Parameters) parameters; - } - - private Identifier getIdentifier(Patient theMemberPatient) { - return theMemberPatient.getIdentifier().stream() - .filter(this::isTypeMB) - .findFirst() - .orElseThrow(() -> { - String i18nMessage = myFhirContext - .getLocalizer() - .getMessage("operation.member.match.error.beneficiary.without.identifier"); - return new UnprocessableEntityException(Msg.code(2219) + i18nMessage); - }); - } - - private boolean isTypeMB(Identifier theMemberIdentifier) { - return theMemberIdentifier.getType() != null - && theMemberIdentifier.getType().getCoding().stream() - .anyMatch(typeCoding -> typeCoding.getCode().equals("MB")); - } - - public void addMemberIdentifierToMemberPatient(Patient theMemberPatient, Identifier theNewIdentifier) { - Coding coding = new Coding() - .setSystem(OUT_COVERAGE_IDENTIFIER_CODE_SYSTEM) - .setCode(OUT_COVERAGE_IDENTIFIER_CODE) - .setDisplay(OUT_COVERAGE_IDENTIFIER_TEXT) - .setUserSelected(false); - - CodeableConcept concept = - new CodeableConcept().setCoding(Lists.newArrayList(coding)).setText(OUT_COVERAGE_IDENTIFIER_TEXT); - - Identifier newIdentifier = new Identifier() - .setUse(Identifier.IdentifierUse.USUAL) - .setType(concept) - .setSystem(theNewIdentifier.getSystem()) - .setValue(theNewIdentifier.getValue()); - - theMemberPatient.addIdentifier(newIdentifier); - } - - public Optional getBeneficiaryPatient(Coverage theCoverage, RequestDetails theRequestDetails) { - if (theCoverage.getBeneficiaryTarget() == null && theCoverage.getBeneficiary() == null) { - return Optional.empty(); - } - - if (theCoverage.getBeneficiaryTarget() != null - && !theCoverage.getBeneficiaryTarget().getIdentifier().isEmpty()) { - return Optional.of(theCoverage.getBeneficiaryTarget()); - } - - Reference beneficiaryRef = theCoverage.getBeneficiary(); - if (beneficiaryRef == null) { - return Optional.empty(); - } - - if (beneficiaryRef.getResource() != null) { - return Optional.of((Patient) beneficiaryRef.getResource()); - } - - if (beneficiaryRef.getReference() == null) { - return Optional.empty(); - } - - Patient beneficiary = myPatientDao.read(new IdDt(beneficiaryRef.getReference()), theRequestDetails); - return Optional.ofNullable(beneficiary); - } - - /** - * Matching by member patient demographics - family name and birthdate only - */ - public boolean validPatientMember( - Patient thePatientFromContract, Patient thePatientToMatch, RequestDetails theRequestDetails) { - if (thePatientFromContract == null - || thePatientFromContract.getIdElement() == null - || thePatientToMatch == null) { - return false; - } - StringOrListParam familyName = new StringOrListParam(); - for (HumanName name : thePatientToMatch.getName()) { - familyName.addOr(new StringParam(name.getFamily())); - } - SearchParameterMap map = new SearchParameterMap() - .add("family", familyName) - .add( - "birthdate", - new DateParam(thePatientToMatch.getBirthDateElement().getValueAsString())); - ca.uhn.fhir.rest.api.server.IBundleProvider bundle = myPatientDao.search(map, theRequestDetails); - for (IBaseResource patientResource : bundle.getAllResources()) { - IIdType patientId = patientResource.getIdElement().toUnqualifiedVersionless(); - if (patientId - .getValue() - .equals(thePatientFromContract - .getIdElement() - .toUnqualifiedVersionless() - .getValue())) { - return true; - } - } - return false; - } - - public boolean validConsentDataAccess(Consent theConsent) { - if (theConsent.getPolicy().isEmpty()) { - return false; - } - for (Consent.ConsentPolicyComponent policyComponent : theConsent.getPolicy()) { - if (policyComponent.getUri() == null || !validConsentPolicy(policyComponent.getUri())) { - return false; - } - } - return true; - } - - /** - * The consent policy rules are - * - * described here. - */ - private boolean validConsentPolicy(String thePolicyUri) { - String policyTypes = StringUtils.substringAfterLast(thePolicyUri, "#"); - if (policyTypes.equals(CONSENT_POLICY_SENSITIVE_TYPE)) { - return true; - } - return policyTypes.equals(CONSENT_POLICY_REGULAR_TYPE) && myRegularFilterSupported; - } - - public void setRegularFilterSupported(boolean theRegularFilterSupported) { - myRegularFilterSupported = theRegularFilterSupported; - } - - private void updateConsentPatientAndPerformer(Consent theConsent, Patient thePatient) { - String patientRef = thePatient.getIdElement().toUnqualifiedVersionless().getValue(); - theConsent.getPatient().setReference(patientRef); - theConsent.getPerformer().set(0, new Reference(patientRef)); - } -} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImpl.java index 26d7f77625a..743639be839 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImpl.java @@ -41,13 +41,13 @@ import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.DateRangeUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.util.Date; import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class Batch2DaoSvcImpl implements IBatch2DaoSvc { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(Batch2DaoSvcImpl.class); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/DatabaseBackedPagingProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/DatabaseBackedPagingProvider.java index 289744fca73..c81f1b78479 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/DatabaseBackedPagingProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/DatabaseBackedPagingProvider.java @@ -25,10 +25,9 @@ import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.BasePagingProvider; +import jakarta.annotation.Nullable; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nullable; - // Note: this class is not annotated with @Service because we want to // explicitly define it in BaseConfig.java. This is done so that // implementors can override if they want to. diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/ExceptionService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/ExceptionService.java index 5802b090fe6..84eb70ba303 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/ExceptionService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/ExceptionService.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.jpa.search; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; import ca.uhn.fhir.rest.server.method.PageMethodBinding; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class ExceptionService { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchCoordinatorSvcImpl.class); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java index b25435b6751..5eb365b37fd 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.rest.server.method.ResponsePage; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -71,7 +72,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Function; -import javax.annotation.Nonnull; public class PersistedJpaBundleProvider implements IBundleProvider { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaSearchFirstPageBundleProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaSearchFirstPageBundleProvider.java index f2357932a0e..6317dd37e6e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaSearchFirstPageBundleProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaSearchFirstPageBundleProvider.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.method.ResponsePage; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,7 +38,6 @@ import org.slf4j.LoggerFactory; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class PersistedJpaSearchFirstPageBundleProvider extends PersistedJpaBundleProvider { private static final Logger ourLog = LoggerFactory.getLogger(PersistedJpaSearchFirstPageBundleProvider.class); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java index c22c3b65fbc..5b5d540e0d9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java @@ -64,6 +64,8 @@ import ca.uhn.fhir.util.AsyncUtil; import ca.uhn.fhir.util.StopWatch; import ca.uhn.fhir.util.UrlUtil; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.time.DateUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.BeanFactory; @@ -84,8 +86,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.util.QueryParameterUtils.DEFAULT_SYNC_SIZE; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchStrategyFactory.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchStrategyFactory.java index e6de39ec5d6..fb289ee2f8c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchStrategyFactory.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchStrategyFactory.java @@ -25,12 +25,12 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.SimpleBundleProvider; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collections; import java.util.List; import java.util.function.Supplier; -import javax.annotation.Nullable; /** * Figure out how we're going to run the query up front, and build a branchless strategy object. diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/RawElasticJsonBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/RawElasticJsonBuilder.java index c9c81baaa64..e4cda499c82 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/RawElasticJsonBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/RawElasticJsonBuilder.java @@ -20,10 +20,9 @@ package ca.uhn.fhir.jpa.search.autocomplete; import com.google.gson.JsonObject; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; -import javax.annotation.Nonnull; - public class RawElasticJsonBuilder { @Nonnull static JsonObject makeMatchBoolPrefixPredicate(String theFieldName, String queryText) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteAggregation.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteAggregation.java index 574055d839d..c7e767f1508 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteAggregation.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteAggregation.java @@ -28,13 +28,13 @@ import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.ParseContext; import com.jayway.jsonpath.spi.json.GsonJsonProvider; import com.jayway.jsonpath.spi.mapper.GsonMappingProvider; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import java.util.List; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.model.search.HSearchIndexWriter.IDX_STRING_TEXT; import static ca.uhn.fhir.jpa.model.search.HSearchIndexWriter.NESTED_SEARCH_PARAM_ROOT; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteHit.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteHit.java index 2780964ea3a..0532754e32d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteHit.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteHit.java @@ -19,11 +19,10 @@ */ package ca.uhn.fhir.jpa.search.autocomplete; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; -import javax.annotation.Nonnull; - /** * A single autocomplete search hit. */ diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteSearch.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteSearch.java index dc14f226676..a9d959848a4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteSearch.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteSearch.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.dao.search.ExtendedHSearchClauseBuilder; import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.StorageSettings; import com.google.gson.JsonObject; +import jakarta.annotation.Nonnull; import org.hibernate.search.backend.elasticsearch.ElasticsearchExtension; import org.hibernate.search.engine.search.aggregation.AggregationKey; import org.hibernate.search.engine.search.aggregation.SearchAggregation; @@ -35,7 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java index 1075761f352..cf0951ea8e9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java @@ -99,6 +99,7 @@ import com.healthmarketscience.sqlbuilder.SetOperationQuery; import com.healthmarketscience.sqlbuilder.Subquery; import com.healthmarketscience.sqlbuilder.UnionQuery; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Triple; import org.hl7.fhir.instance.model.api.IAnyResource; @@ -119,7 +120,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.search.builder.QueryStack.SearchForIdsParams.with; import static ca.uhn.fhir.jpa.util.QueryParameterUtils.fromOperation; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java index bc40f4c3c19..238f46c43d3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchBuilder.java @@ -95,6 +95,8 @@ import ca.uhn.fhir.util.StringUtil; import ca.uhn.fhir.util.UrlUtil; import com.google.common.collect.Streams; import com.healthmarketscience.sqlbuilder.Condition; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -126,8 +128,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.model.util.JpaConstants.UNDESIRED_RESOURCE_LINKAGES_FOR_EVERYTHING_ON_PATIENT_INSTANCE; import static ca.uhn.fhir.jpa.search.builder.QueryStack.LOCATION_POSITION; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchQueryExecutors.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchQueryExecutors.java index e1a6ddacf25..f183d13b528 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchQueryExecutors.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/SearchQueryExecutors.java @@ -21,11 +21,11 @@ package ca.uhn.fhir.jpa.search.builder; import ca.uhn.fhir.jpa.model.dao.JpaPid; import ca.uhn.fhir.jpa.search.builder.models.ResolvedSearchQueryExecutor; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.util.Iterator; import java.util.List; -import javax.annotation.Nonnull; public class SearchQueryExecutors { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/models/ResolvedSearchQueryExecutor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/models/ResolvedSearchQueryExecutor.java index 62a19e3b89b..b78688ae91e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/models/ResolvedSearchQueryExecutor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/models/ResolvedSearchQueryExecutor.java @@ -20,10 +20,10 @@ package ca.uhn.fhir.jpa.search.builder.models; import ca.uhn.fhir.jpa.search.builder.ISearchQueryExecutor; +import jakarta.annotation.Nonnull; import java.util.Iterator; import java.util.List; -import javax.annotation.Nonnull; public class ResolvedSearchQueryExecutor implements ISearchQueryExecutor { private final Iterator myIterator; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseJoiningPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseJoiningPredicateBuilder.java index 0c34500bba3..482be7bac69 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseJoiningPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseJoiningPredicateBuilder.java @@ -28,11 +28,11 @@ import com.healthmarketscience.sqlbuilder.NotCondition; import com.healthmarketscience.sqlbuilder.UnaryCondition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nullable; public abstract class BaseJoiningPredicateBuilder extends BasePredicateBuilder { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BasePredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BasePredicateBuilder.java index e168c357031..6673a43a2dc 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BasePredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BasePredicateBuilder.java @@ -28,10 +28,10 @@ import ca.uhn.fhir.rest.param.ParamPrefixEnum; import com.healthmarketscience.sqlbuilder.BinaryCondition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; +import jakarta.annotation.Nonnull; import java.util.Collection; import java.util.List; -import javax.annotation.Nonnull; public abstract class BasePredicateBuilder { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseSearchParamPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseSearchParamPredicateBuilder.java index 74427f68a91..dcc0ad9bc46 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseSearchParamPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/BaseSearchParamPredicateBuilder.java @@ -32,10 +32,10 @@ import com.healthmarketscience.sqlbuilder.SelectQuery; import com.healthmarketscience.sqlbuilder.UnaryCondition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; public abstract class BaseSearchParamPredicateBuilder extends BaseJoiningPredicateBuilder implements ICanMakeMissingParamPredicate { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceIdPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceIdPredicateBuilder.java index 6aa5376a644..4d1c7592938 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceIdPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceIdPredicateBuilder.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.param.TokenParamModifier; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import com.healthmarketscience.sqlbuilder.Condition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; +import jakarta.annotation.Nullable; import org.hl7.fhir.r4.model.IdType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,7 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java index 81b42f46429..0dfa2ae005c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/ResourceLinkPredicateBuilder.java @@ -68,6 +68,8 @@ import com.healthmarketscience.sqlbuilder.NotCondition; import com.healthmarketscience.sqlbuilder.SelectQuery; import com.healthmarketscience.sqlbuilder.UnaryCondition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; @@ -83,8 +85,6 @@ import java.util.List; import java.util.ListIterator; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.search.builder.QueryStack.SearchForIdsParams.with; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/StringPredicateBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/StringPredicateBuilder.java index 2663e127fde..cef3b986184 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/StringPredicateBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/predicate/StringPredicateBuilder.java @@ -37,10 +37,9 @@ import com.healthmarketscience.sqlbuilder.BinaryCondition; import com.healthmarketscience.sqlbuilder.ComboCondition; import com.healthmarketscience.sqlbuilder.Condition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; +import jakarta.annotation.Nonnull; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; - public class StringPredicateBuilder extends BaseSearchParamPredicateBuilder { private final DbColumn myColumnResId; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilder.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilder.java index 3a310e5c4d7..252034b4949 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilder.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilder.java @@ -61,6 +61,8 @@ import com.healthmarketscience.sqlbuilder.dbspec.basic.DbJoin; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbSchema; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbSpec; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.pagination.AbstractLimitHandler; @@ -76,8 +78,6 @@ import java.util.List; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.GREATERTHAN; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.GREATERTHAN_OR_EQUALS; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/tasks/SearchTask.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/tasks/SearchTask.java index 700d409e216..fd39eb0b488 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/tasks/SearchTask.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/tasks/SearchTask.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.util.StopWatch; import co.elastic.apm.api.ElasticApm; import co.elastic.apm.api.Span; import co.elastic.apm.api.Transaction; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.exception.ExceptionUtils; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -67,7 +68,6 @@ import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.util.SearchParameterMapCalculator.isWantCount; import static ca.uhn.fhir.jpa.util.SearchParameterMapCalculator.isWantOnlyCount; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java index 1e886ca9c1b..2acd744ea0a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.jpa.entity.Search; import ca.uhn.fhir.jpa.model.search.SearchStatusEnum; import ca.uhn.fhir.system.HapiSystemProperties; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.time.DateUtils; @@ -53,7 +54,6 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; -import javax.annotation.Nonnull; public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc { /* diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/ISearchResultCacheSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/ISearchResultCacheSvc.java index 68dc8745f28..9956db92198 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/ISearchResultCacheSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/ISearchResultCacheSvc.java @@ -23,9 +23,9 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.entity.Search; import ca.uhn.fhir.jpa.model.dao.JpaPid; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nullable; import java.util.List; -import javax.annotation.Nullable; public interface ISearchResultCacheSvc { /** diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchRestClientFactory.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchRestClientFactory.java index 564d39bf804..c89bebe91a9 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchRestClientFactory.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchRestClientFactory.java @@ -25,6 +25,7 @@ import co.elastic.clients.elasticsearch.ElasticsearchClient; import co.elastic.clients.json.jackson.JacksonJsonpMapper; import co.elastic.clients.transport.ElasticsearchTransport; import co.elastic.clients.transport.rest_client.RestClientTransport; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.http.Header; import org.apache.http.HttpHost; @@ -40,7 +41,6 @@ import org.elasticsearch.client.RestClientBuilder; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nullable; public class ElasticsearchRestClientFactory { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchSvcImpl.java index f9d344277d4..00871d5c251 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchSvcImpl.java @@ -34,6 +34,7 @@ import co.elastic.clients.elasticsearch.core.SearchResponse; import co.elastic.clients.elasticsearch.core.search.Hit; import co.elastic.clients.elasticsearch.indices.ExistsRequest; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; @@ -44,7 +45,6 @@ import java.io.StringReader; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nullable; public class ElasticsearchSvcImpl implements IElasticsearchSvc { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/IInstanceReindexService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/IInstanceReindexService.java index c56932a5168..945158d6e50 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/IInstanceReindexService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/IInstanceReindexService.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.jpa.search.reindex; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IIdType; import java.util.Set; -import javax.annotation.Nullable; public interface IInstanceReindexService { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImpl.java index 574cda69677..8238bbf929b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImpl.java @@ -46,6 +46,8 @@ import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.StopWatch; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -66,8 +68,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.dao.index.DaoSearchParamSynchronizer.subtract; import static java.util.Comparator.comparing; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java index ad429000749..35c4f7244c8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/reindex/ResourceReindexingSvcImpl.java @@ -39,6 +39,7 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; @@ -74,7 +75,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ExpansionFilter.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ExpansionFilter.java index f6f11baa8c8..70b6fe0aabb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ExpansionFilter.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ExpansionFilter.java @@ -21,13 +21,13 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.util.FhirVersionIndependentConcept; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.r4.model.ValueSet; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNoneBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/IValueSetConceptAccumulator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/IValueSetConceptAccumulator.java index f72f70c33ed..0a7e8faf046 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/IValueSetConceptAccumulator.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/IValueSetConceptAccumulator.java @@ -20,9 +20,9 @@ package ca.uhn.fhir.jpa.term; import ca.uhn.fhir.jpa.entity.TermConceptDesignation; +import jakarta.annotation.Nullable; import java.util.Collection; -import javax.annotation.Nullable; public interface IValueSetConceptAccumulator { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index e8f2c66b6c3..9aabe85cd9b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -53,6 +53,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.util.ObjectUtil; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContextType; @@ -84,7 +85,6 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.api.dao.IDao.RESOURCE_PID_KEY; import static org.apache.commons.lang3.StringUtils.isBlank; 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 ba636bd5f83..78a5601a2a1 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 @@ -66,6 +66,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; +import jakarta.annotation.Nonnull; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; @@ -103,7 +104,6 @@ import java.util.Optional; import java.util.Properties; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc.MAKE_LOADING_VERSION_CURRENT; import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_ANSWERLIST_FILE; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java index 0869b8e47f0..ac169cf84ca 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermReadSvcImpl.java @@ -91,6 +91,8 @@ import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Stopwatch; import com.google.common.collect.ArrayListMultimap; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.persistence.EntityManager; import jakarta.persistence.NonUniqueResultException; @@ -174,8 +176,6 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.entity.TermConceptPropertyBinder.CONCEPT_PROPERTY_PREFIX_NAME; import static ca.uhn.fhir.jpa.term.api.ITermLoaderSvc.LOINC_URI; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java index 18c91c828b0..3fa13ccfb6b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetConceptAccumulator.java @@ -27,11 +27,11 @@ import ca.uhn.fhir.jpa.entity.TermValueSet; import ca.uhn.fhir.jpa.entity.TermValueSetConcept; import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import java.util.Collection; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isAnyBlank; import static org.apache.commons.lang3.StringUtils.isNoneBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetExpansionComponentWithConceptAccumulator.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetExpansionComponentWithConceptAccumulator.java index 94a6184120c..6cd56bfd5a6 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetExpansionComponentWithConceptAccumulator.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/ValueSetExpansionComponentWithConceptAccumulator.java @@ -25,6 +25,8 @@ import ca.uhn.fhir.jpa.entity.TermConceptDesignation; import ca.uhn.fhir.jpa.term.ex.ExpansionTooCostlyException; import ca.uhn.fhir.model.api.annotation.Block; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.r4.model.ValueSet; @@ -36,8 +38,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java index 52bbbd2cc2e..a606a6ab601 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/api/ITermReadSvc.java @@ -29,6 +29,8 @@ import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.term.IValueSetConceptAccumulator; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.FhirVersionIndependentConcept; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -41,8 +43,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This interface is the "read" interface for the terminology service. It handles things like diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/custom/CustomTerminologySet.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/custom/CustomTerminologySet.java index 72bd94f53a8..d9ef9b2790a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/custom/CustomTerminologySet.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/custom/CustomTerminologySet.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.jpa.term.IZipContentsHandlerCsv; import ca.uhn.fhir.jpa.term.LoadedFileDescriptors; import ca.uhn.fhir.jpa.term.TermLoaderSvcImpl; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.apache.commons.csv.QuoteMode; import org.apache.commons.lang3.Validate; @@ -39,7 +40,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class CustomTerminologySet { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincLinguisticVariantsHandler.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincLinguisticVariantsHandler.java index 1245dad647c..234c089c715 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincLinguisticVariantsHandler.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/loinc/LoincLinguisticVariantsHandler.java @@ -20,10 +20,10 @@ package ca.uhn.fhir.jpa.term.loinc; import ca.uhn.fhir.jpa.term.IZipContentsHandlerCsv; +import jakarta.annotation.Nonnull; import org.apache.commons.csv.CSVRecord; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.trim; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/QueryParameterUtils.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/QueryParameterUtils.java index 2da96d1c54f..3e3444f395c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/QueryParameterUtils.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/QueryParameterUtils.java @@ -37,6 +37,8 @@ import com.healthmarketscience.sqlbuilder.ComboCondition; import com.healthmarketscience.sqlbuilder.Condition; import com.healthmarketscience.sqlbuilder.InCondition; import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.From; import jakarta.persistence.criteria.Predicate; @@ -54,8 +56,6 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImplTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImplTest.java index e14dcc61f0d..f7c90efb7c8 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImplTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/bulk/export/svc/BulkDataExportJobSchedulingHelperImplTest.java @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.temporal.ChronoUnit; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/CodingSpyTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/CodingSpyTest.java index f321c205e02..87f0d0b48cf 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/CodingSpyTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/CodingSpyTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/index/IdHelperServiceTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/index/IdHelperServiceTest.java new file mode 100644 index 00000000000..12888335a95 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/index/IdHelperServiceTest.java @@ -0,0 +1,168 @@ +package ca.uhn.fhir.jpa.dao.index; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.interceptor.model.RequestPartitionId; +import ca.uhn.fhir.jpa.api.config.JpaStorageSettings; +import ca.uhn.fhir.jpa.dao.data.IResourceTableDao; +import ca.uhn.fhir.jpa.model.config.PartitionSettings; +import ca.uhn.fhir.jpa.model.dao.JpaPid; +import ca.uhn.fhir.jpa.model.entity.ResourceTable; +import ca.uhn.fhir.jpa.util.MemoryCacheService; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Tuple; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.*; +import org.hl7.fhir.r4.hapi.ctx.FhirR4; +import org.hl7.fhir.r4.model.Patient; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.time.Instant; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +public class IdHelperServiceTest { + + @InjectMocks + private final IdHelperService subject = new IdHelperService(); + + @Mock + protected IResourceTableDao myResourceTableDao; + + @Mock + private JpaStorageSettings myStorageSettings; + + @Mock + private FhirContext myFhirCtx; + + @Mock + private MemoryCacheService myMemoryCacheService; + + @Mock + private EntityManager myEntityManager; + + @Mock + private PartitionSettings myPartitionSettings; + + @BeforeEach + void setUp() { + subject.setDontCheckActiveTransactionForUnitTest(true); + + when(myStorageSettings.isDeleteEnabled()).thenReturn(true); + when(myStorageSettings.getResourceClientIdStrategy()).thenReturn(JpaStorageSettings.ClientIdStrategyEnum.ANY); + when(myPartitionSettings.isAllowUnqualifiedCrossPartitionReference()).thenReturn(true); + } + + @Test + public void testResolveResourcePersistentIds() { + //prepare params + RequestPartitionId requestPartitionId = RequestPartitionId.fromPartitionName("Partition-A"); + String resourceType = "Patient"; + Long id = 123L; + List ids = List.of(String.valueOf(id)); + boolean theExcludeDeleted = false; + + //prepare results + Patient expectedPatient = new Patient(); + expectedPatient.setId(ids.get(0)); + Object[] obj = new Object[] {resourceType, Long.parseLong(ids.get(0)), ids.get(0), Date.from(Instant.now())}; + + // configure mock behaviour + when(myStorageSettings.isDeleteEnabled()).thenReturn(true); + when(myResourceTableDao + .findAndResolveByForcedIdWithNoType(eq(resourceType), eq(ids), eq(theExcludeDeleted))) + .thenReturn(Collections.singletonList(obj)); + + Map actualIds = subject.resolveResourcePersistentIds(requestPartitionId, resourceType, ids, theExcludeDeleted); + + //verify results + assertFalse(actualIds.isEmpty()); + assertEquals(id, actualIds.get(ids.get(0)).getId()); + } + + @Test + public void testResolveResourcePersistentIdsDeleteFalse() { + //prepare Params + RequestPartitionId requestPartitionId = RequestPartitionId.fromPartitionName("Partition-A"); + Long id = 123L; + String resourceType = "Patient"; + List ids = List.of(String.valueOf(id)); + String forcedId = "(all)/" + resourceType + "/" + id; + boolean theExcludeDeleted = false; + + //prepare results + Patient expectedPatient = new Patient(); + expectedPatient.setId(ids.get(0)); + + // configure mock behaviour + configureCacheBehaviour(forcedId); + configureEntityManagerBehaviour(id, resourceType, ids.get(0)); + when(myStorageSettings.isDeleteEnabled()).thenReturn(false); + when(myFhirCtx.getVersion()).thenReturn(new FhirR4()); + + Map actualIds = subject.resolveResourcePersistentIds(requestPartitionId, resourceType, ids, theExcludeDeleted); + + //verifyResult + assertFalse(actualIds.isEmpty()); + assertEquals(id, actualIds.get(ids.get(0)).getId()); + } + + private void configureCacheBehaviour(String resourceUrl) { + when(myMemoryCacheService.getThenPutAfterCommit(eq(MemoryCacheService.CacheEnum.FORCED_ID_TO_PID), eq(resourceUrl), any())).thenCallRealMethod(); + doNothing().when(myMemoryCacheService).putAfterCommit(eq(MemoryCacheService.CacheEnum.FORCED_ID_TO_PID), eq(resourceUrl), ArgumentMatchers.any()); + when(myMemoryCacheService.getIfPresent(eq(MemoryCacheService.CacheEnum.FORCED_ID_TO_PID), eq(resourceUrl))).thenReturn(null); + } + + private void configureEntityManagerBehaviour(Long idNumber, String resourceType, String id) { + List mockedTupleList = getMockedTupleList(idNumber, resourceType, id); + CriteriaBuilder builder = getMockedCriteriaBuilder(); + Root from = getMockedFrom(); + + @SuppressWarnings("unchecked") + TypedQuery query = (TypedQuery) mock(TypedQuery.class); + @SuppressWarnings("unchecked") + CriteriaQuery cq = mock(CriteriaQuery.class); + + when(builder.createTupleQuery()).thenReturn(cq); + when(cq.from(ArgumentMatchers.>any())).thenReturn(from); + when(query.getResultList()).thenReturn(mockedTupleList); + + when(myEntityManager.getCriteriaBuilder()).thenReturn(builder); + when(myEntityManager.createQuery(ArgumentMatchers.>any())).thenReturn(query); + } + + private CriteriaBuilder getMockedCriteriaBuilder() { + Predicate pred = mock(Predicate.class); + CriteriaBuilder builder = mock(CriteriaBuilder.class); + lenient().when(builder.equal(any(), any())).thenReturn(pred); + return builder; + } + private Root getMockedFrom() { + @SuppressWarnings("unchecked") + Path path = mock(Path.class); + @SuppressWarnings("unchecked") + Root from = mock(Root.class); + lenient().when(from.get(ArgumentMatchers.any())).thenReturn(path); + return from; + } + + private List getMockedTupleList(Long idNumber, String resourceType, String id) { + Tuple tuple = mock(Tuple.class); + when(tuple.get(eq(0), eq(Long.class))).thenReturn(idNumber); + when(tuple.get(eq(1), eq(String.class))).thenReturn(resourceType); + when(tuple.get(eq(2), eq(String.class))).thenReturn(id); + return List.of(tuple); + } +} diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplTest.java index 75e8cee5e15..e949c32c6d9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplTest.java @@ -40,7 +40,7 @@ import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4HelperTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4HelperTest.java deleted file mode 100644 index 9f46be520dc..00000000000 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/MemberMatcherR4HelperTest.java +++ /dev/null @@ -1,544 +0,0 @@ -package ca.uhn.fhir.jpa.provider.r4; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; -import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; -import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.rest.api.server.IBundleProvider; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.api.server.SystemRequestDetails; -import ca.uhn.fhir.rest.server.SimpleBundleProvider; -import ca.uhn.test.util.LogbackCaptureTestExtension; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; -import com.google.common.collect.Lists; -import org.hl7.fhir.r4.model.CodeableConcept; -import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.Consent; -import org.hl7.fhir.r4.model.Coverage; -import org.hl7.fhir.r4.model.DateType; -import org.hl7.fhir.r4.model.HumanName; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Parameters; -import org.hl7.fhir.r4.model.Patient; -import org.hl7.fhir.r4.model.Reference; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.extension.RegisterExtension; -import org.mockito.Answers; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.Spy; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import static ca.uhn.fhir.rest.api.Constants.PARAM_MEMBER_IDENTIFIER; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.empty; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.isA; -import static org.mockito.ArgumentMatchers.same; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -public class MemberMatcherR4HelperTest { - - @RegisterExtension - LogbackCaptureTestExtension myLogCapture = new LogbackCaptureTestExtension((Logger) MemberMatcherR4Helper.ourLog, Level.TRACE); - @Spy - private final FhirContext myFhirContext = FhirContext.forR4Cached(); - @Mock - private IFhirResourceDao myCoverageDao; - @Mock - private IFhirResourceDao myPatientDao; - @Mock - private IFhirResourceDao myConsentDao; - - private MemberMatcherR4Helper myHelper; - RequestDetails myRequestDetails = new SystemRequestDetails(); - - @BeforeEach - public void before() { - myHelper = new MemberMatcherR4Helper( - myFhirContext, - myCoverageDao, - myPatientDao, - myConsentDao, - null // extension provider - ); - } - - @Mock private Coverage myCoverageToMatch; - @Mock private IBundleProvider myBundleProvider; - - private final Coverage myMatchedCoverage = new Coverage() - .setBeneficiary(new Reference("Patient/123")); - private final Identifier myMatchingIdentifier = new Identifier() - .setSystem("identifier-system").setValue("identifier-value"); - - @Captor - ArgumentCaptor mySearchParameterMapCaptor; - - @Test - void findMatchingCoverageMatchByIdReturnsMatched() { - when(myCoverageToMatch.getId()).thenReturn("cvg-to-match-id"); - when(myCoverageDao.search(isA(SearchParameterMap.class), same(myRequestDetails))).thenReturn(myBundleProvider); - when(myBundleProvider.getAllResources()).thenReturn(Collections.singletonList(myMatchedCoverage)); - - Optional result = myHelper.findMatchingCoverage(myCoverageToMatch, myRequestDetails); - - assertEquals(Optional.of(myMatchedCoverage), result); - verify(myCoverageDao).search(mySearchParameterMapCaptor.capture(), same(myRequestDetails)); - SearchParameterMap spMap = mySearchParameterMapCaptor.getValue(); - assertTrue(spMap.containsKey("_id")); - List> listListParams = spMap.get("_id"); - assertEquals(1, listListParams.size()); - assertEquals(1, listListParams.get(0).size()); - IQueryParameterType param = listListParams.get(0).get(0); - assertEquals("cvg-to-match-id", param.getValueAsQueryToken(myFhirContext)); - } - - - @Test - void findMatchingCoverageMatchByIdentifierReturnsMatched() { - when(myCoverageToMatch.getId()).thenReturn("non-matching-id"); - when(myCoverageToMatch.getIdentifier()).thenReturn(Collections.singletonList(myMatchingIdentifier)); - when(myCoverageDao.search(isA(SearchParameterMap.class), same(myRequestDetails))).thenReturn(myBundleProvider); - when(myBundleProvider.getAllResources()).thenReturn( - Collections.emptyList(), Collections.singletonList(myMatchedCoverage)); - - Optional result = myHelper.findMatchingCoverage(myCoverageToMatch, myRequestDetails); - - assertEquals(Optional.of(myMatchedCoverage), result); - verify(myCoverageDao, times(2)).search(mySearchParameterMapCaptor.capture(), same(myRequestDetails)); - List spMap = mySearchParameterMapCaptor.getAllValues(); - assertTrue(spMap.get(0).containsKey("_id")); - assertTrue(spMap.get(1).containsKey("identifier")); - List> listListParams = spMap.get(1).get("identifier"); - assertEquals(1, listListParams.size()); - assertEquals(1, listListParams.get(0).size()); - IQueryParameterType param = listListParams.get(0).get(0); - assertEquals(myMatchingIdentifier.getSystem() + "|" + myMatchingIdentifier.getValue(), - param.getValueAsQueryToken(myFhirContext)); - } - - - @Test - void findMatchingCoverageNoMatchReturnsEmpty() { - when(myCoverageToMatch.getId()).thenReturn("non-matching-id"); - when(myCoverageToMatch.getIdentifier()).thenReturn(Collections.singletonList(myMatchingIdentifier)); - when(myCoverageDao.search(any(SearchParameterMap.class), same(myRequestDetails))).thenReturn(myBundleProvider); - when(myBundleProvider.getAllResources()).thenReturn(Collections.emptyList(), Collections.emptyList()); - - Optional result = myHelper.findMatchingCoverage(myCoverageToMatch, myRequestDetails); - - assertFalse(result.isPresent()); - } - - - @Test - void buildSuccessReturnParameters() { - Identifier identifier = new Identifier(); - CodeableConcept identifierType = new CodeableConcept(); - identifierType.addCoding(new Coding("", "MB", "")); - identifier.setType(identifierType); - Patient patient = new Patient(); - patient.setId("Patient/test123"); - patient.addIdentifier(identifier); - - Parameters result = myHelper.buildSuccessReturnParameters(patient); - - assertEquals(PARAM_MEMBER_IDENTIFIER, result.getParameter().get(0).getName()); - assertEquals(patient.getId(), ((IdType)(result.getParameter().get(0).getValue())).getValue()); - } - - @Test - void addMemberIdentifierToMemberPatient() { - Identifier originalIdentifier = new Identifier() - .setSystem("original-identifier-system").setValue("original-identifier-value"); - - Identifier newIdentifier = new Identifier() - .setSystem("new-identifier-system").setValue("new-identifier-value"); - - Patient patient = new Patient().setIdentifier(Lists.newArrayList(originalIdentifier)); - - myHelper.addMemberIdentifierToMemberPatient(patient, newIdentifier); - - assertEquals(2, patient.getIdentifier().size()); - - assertEquals("original-identifier-system", patient.getIdentifier().get(0).getSystem()); - assertEquals("original-identifier-value", patient.getIdentifier().get(0).getValue()); - - assertEquals("new-identifier-system", patient.getIdentifier().get(1).getSystem()); - assertEquals("new-identifier-value", patient.getIdentifier().get(1).getValue()); - } - - /** - * Testing multiple scenarios for getting patient resource from coverage's plan beneficiary - */ - @Nested - public class TestGetBeneficiaryPatient { - - @Mock(answer = Answers.RETURNS_DEEP_STUBS) - private Coverage coverage; - - - @Test - void noBeneficiaryOrBeneficiaryTargetReturnsEmpty() { - when(coverage.getBeneficiaryTarget()).thenReturn(null); - when(coverage.getBeneficiary()).thenReturn(null); - - Optional result = myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - assertFalse(result.isPresent()); - } - - - @Test - void beneficiaryTargetWithNoIdentifierReturnsEmpty() { - when(coverage.getBeneficiary()).thenReturn(null); - when(coverage.getBeneficiaryTarget()).thenReturn(new Patient()); - - Optional result = myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - assertFalse(result.isPresent()); - } - - - @Test - void beneficiaryTargetWithIdentifierReturnsBeneficiary() { - Patient patient = new Patient().setIdentifier(Collections.singletonList(new Identifier())); - when(coverage.getBeneficiaryTarget()).thenReturn(patient); - - Optional result = myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - assertTrue(result.isPresent()); - assertEquals(patient, result.get()); - } - - - @Test - void beneficiaryReferenceResourceReturnsBeneficiary() { - Patient patient = new Patient().setIdentifier(Collections.singletonList(new Identifier())); - when(coverage.getBeneficiaryTarget()).thenReturn(null); - when(coverage.getBeneficiary().getResource()).thenReturn(patient); - - Optional result = myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - assertTrue(result.isPresent()); - assertEquals(patient, result.get()); - } - - - @Test - void beneficiaryReferenceNoResourceOrReferenceReturnsEmpty() { - when(coverage.getBeneficiaryTarget()).thenReturn(null); - when(coverage.getBeneficiary()).thenReturn(new Reference()); - - Optional result = myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - assertFalse(result.isPresent()); - } - - - @Test - void beneficiaryReferenceReferenceReturnsReadPatient() { - when(coverage.getBeneficiaryTarget()).thenReturn(null); - when(coverage.getBeneficiary().getResource()).thenReturn(null); - when(coverage.getBeneficiary().getReference()).thenReturn("patient-id"); - - myHelper.getBeneficiaryPatient(coverage, myRequestDetails); - - verify(myPatientDao).read(new IdDt("patient-id"), myRequestDetails); - } - } - - /** - * Testing multiple scenarios for validity of Patient Member parameter - */ - @Nested - public class TestValidPatientMember { - - private final Patient patient = new Patient(); - - @Test - void noPatientFoundFromContractReturnsFalse() { - boolean result = myHelper.validPatientMember(null, patient, myRequestDetails); - assertFalse(result); - } - - @Test - void noPatientFoundFromPatientMemberReturnsFalse() { - boolean result = myHelper.validPatientMember(patient, null, myRequestDetails); - assertFalse(result); - } - - @Test - void noMatchingFamilyNameReturnsFalse() { - Patient patientFromMemberMatch = getPatientWithNoIDParm("Person", "2020-01-01"); - Patient patientFromContractFound = getPatientWithIDParm("A123", "Smith", "2020-01-01"); - when(myPatientDao.search(any(SearchParameterMap.class), same(myRequestDetails))).thenAnswer(t -> { - IBundleProvider provider = new SimpleBundleProvider(Collections.singletonList(new Patient().setId("B123"))); - return provider; - }); - boolean result = myHelper.validPatientMember(patientFromContractFound, patientFromMemberMatch, myRequestDetails); - assertFalse(result); - } - - - @Test - void noMatchingBirthdayReturnsFalse() { - Patient patientFromMemberMatch = getPatientWithNoIDParm("Person", "1990-01-01"); - Patient patientFromContractFound = getPatientWithIDParm("A123", "Person", "2020-01-01"); - when(myPatientDao.search(any(SearchParameterMap.class), same(myRequestDetails))).thenAnswer(t -> { - IBundleProvider provider = new SimpleBundleProvider(Collections.singletonList(new Patient().setId("B123"))); - return provider; - }); - boolean result = myHelper.validPatientMember(patientFromContractFound, patientFromMemberMatch, myRequestDetails); - assertFalse(result); - } - - @Test - void noMatchingFieldsReturnsFalse() { - Patient patientFromMemberMatch = getPatientWithNoIDParm("Person", "1990-01-01"); - Patient patientFromContractFound = getPatientWithIDParm("A123", "Smith", "2020-01-01"); - when(myPatientDao.search(any(SearchParameterMap.class), same(myRequestDetails))).thenAnswer(t -> { - IBundleProvider provider = new SimpleBundleProvider(Collections.singletonList(new Patient().setId("B123"))); - return provider; - }); - boolean result = myHelper.validPatientMember(patientFromContractFound, patientFromMemberMatch, myRequestDetails); - assertFalse(result); - } - - @Test - void patientMatchingReturnTrue() { - Patient patientFromMemberMatch = getPatientWithNoIDParm("Person", "2020-01-01"); - Patient patientFromContractFound = getPatientWithIDParm("A123", "Person", "2020-01-01"); - when(myPatientDao.search(any(SearchParameterMap.class), same(myRequestDetails))).thenAnswer(t -> { - IBundleProvider provider = new SimpleBundleProvider(Collections.singletonList(patientFromContractFound)); - return provider; - }); - boolean result = myHelper.validPatientMember(patientFromContractFound, patientFromMemberMatch, myRequestDetails); - assertTrue(result); - } - - private Patient getPatientWithNoIDParm(String familyName, String birthdate) { - Patient patient = new Patient().setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily(familyName))) - .setBirthDateElement(new DateType(birthdate)); - return patient; - } - - private Patient getPatientWithIDParm(String id, String familyName, String birthdate) { - Patient patient = getPatientWithNoIDParm(familyName, birthdate); - patient.setId(id); - return patient; - } - - } - - /** - * Testing multiple scenarios for consent's policy data that is defined in - * https://build.fhir.org/ig/HL7/davinci-ehrx/StructureDefinition-hrex-consent.html#notes - */ - @Nested - public class TestValidvalidConsentDataAccess { - - private Consent consent; - - @Test - void noConsentProfileFoundReturnsFalse() { - consent = new Consent(); - boolean result = myHelper.validConsentDataAccess(consent); - assertFalse(result); - } - - @Test - void noDataAccessValueProvidedReturnsFalse() { - consent = getConsent(); - boolean result = myHelper.validConsentDataAccess(consent); - assertFalse(result); - } - - @Test - void wrongDataAccessValueProvidedReturnsFalse() { - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#access_data")); - boolean result = myHelper.validConsentDataAccess(consent); - assertFalse(result); - } - - @Test - void regularDataAccessWithRegularNotAllowedReturnsFalse() { - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - boolean result = myHelper.validConsentDataAccess(consent); - assertFalse(result); - } - - @Test - void regularDataAccessWithRegularAllowedReturnsTrue() { - myHelper.setRegularFilterSupported(true); - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - boolean result = myHelper.validConsentDataAccess(consent); - assertTrue(result); - } - - @Test - void sensitiveDataAccessAllowedReturnsTrue() { - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - boolean result = myHelper.validConsentDataAccess(consent); - assertTrue(result); - } - - @Test - void multipleSensitivePolicyDataAccessAllowedReturnsTrue() { - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - boolean result = myHelper.validConsentDataAccess(consent); - assertTrue(result); - } - - @Test - void multipleRegularPolicyDataAccessWithRegularAllowedReturnsTrue() { - myHelper.setRegularFilterSupported(true); - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - boolean result = myHelper.validConsentDataAccess(consent); - assertTrue(result); - } - - @Test - void multipleMixedPolicyDataAccessWithRegularNotAllowedReturnsFalse() { - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - boolean result = myHelper.validConsentDataAccess(consent); - assertFalse(result); - } - - @Test - void multipleMixedPolicyDataAccessWithRegularAllowedReturnsTrue() { - myHelper.setRegularFilterSupported(true); - consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#regular")); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - boolean result = myHelper.validConsentDataAccess(consent); - assertTrue(result); - } - } - - private Consent getConsent() { - Consent consent = new Consent(); - consent.getPerformer().add(new Reference("Patient/1")); - return consent; - } - - private Consent.ConsentPolicyComponent constructConsentPolicyComponent(String uriAccess) { - String uri = "http://hl7.org/fhir/us/davinci-hrex/StructureDefinition-hrex-consent.html"; - return new Consent.ConsentPolicyComponent().setUri(uri + uriAccess); - } - - private Patient createPatientForMemberMatchUpdate(boolean addIdentifier) { - Patient patient = new Patient(); - patient.setId("Patient/RED"); - Identifier identifier = new Identifier(); - if (addIdentifier) { - CodeableConcept identifierType = new CodeableConcept(); - identifierType.addCoding(new Coding("", "MB", "")); - identifier.setType(identifierType); - } - identifier.setValue("RED-Patient"); - patient.addIdentifier(identifier); - - return patient; - } - - @Nested - public class MemberMatchWithoutConsentProvider { - @Captor - private ArgumentCaptor myDaoCaptor; - - @Test - public void updateConsentForMemberMatch_noProvider_UpdatePatientButNotExtensionAndSaves() { - // setup - Consent consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - Patient patient = createPatientForMemberMatchUpdate(false); - Patient memberPatient = createPatientForMemberMatchUpdate(true); - - // test - myHelper.updateConsentForMemberMatch(consent, patient, memberPatient, myRequestDetails); - - // verify - - verify(myConsentDao).create(myDaoCaptor.capture(), same(myRequestDetails)); - Consent saved = myDaoCaptor.getValue(); - - // check consent patient info - String patientRef = patient.getIdElement().toUnqualifiedVersionless().getValue(); - assertEquals(patientRef, saved.getPatient().getReference()); - assertEquals(patientRef, saved.getPerformer().get(0).getReference()); - - assertThat(myLogCapture.getLogEvents(), empty()); - - } - } - - @Nested - public class MemberMatchWithConsentProvider { - @Mock - private IConsentExtensionProvider myExtensionProvider; - @Captor - private ArgumentCaptor myHookCaptor; - - @BeforeEach - public void before() { - myHelper = new MemberMatcherR4Helper( - myFhirContext, - myCoverageDao, - myPatientDao, - myConsentDao, - myExtensionProvider - ); - } - - @Test - public void addClientIdAsExtensionToConsentIfAvailable_withProvider_addsExtensionAndSaves() { - // setup - Consent consent = getConsent(); - consent.addPolicy(constructConsentPolicyComponent("#sensitive")); - consent.setId("Consent/RED"); - Patient patient = createPatientForMemberMatchUpdate(false); - Patient memberPatient = createPatientForMemberMatchUpdate(true); - - // test - myHelper.updateConsentForMemberMatch(consent, patient, memberPatient, myRequestDetails); - - // verify - verify(myExtensionProvider).accept(myHookCaptor.capture()); - - assertSame(consent, myHookCaptor.getValue()); - assertThat(myLogCapture.getLogEvents(), empty()); - } - } -} diff --git a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml index 672c17c1096..646a34bf07a 100644 --- a/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml +++ b/hapi-fhir-jpaserver-elastic-test-utilities/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java b/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java index b24e2b46ab8..a17f61fe13e 100644 --- a/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java +++ b/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchWithElasticSearchIT.java @@ -103,7 +103,7 @@ import org.springframework.transaction.PlatformTransactionManager; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import java.io.IOException; import java.net.URLEncoder; diff --git a/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteElasticsearchIT.java b/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteElasticsearchIT.java index 6e25869547a..aab45bc35b1 100644 --- a/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteElasticsearchIT.java +++ b/hapi-fhir-jpaserver-elastic-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/autocomplete/TokenAutocompleteElasticsearchIT.java @@ -37,7 +37,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import java.util.List; import java.util.Objects; diff --git a/hapi-fhir-jpaserver-hfql/pom.xml b/hapi-fhir-jpaserver-hfql/pom.xml index 736c8753f00..254e53aa47f 100644 --- a/hapi-fhir-jpaserver-hfql/pom.xml +++ b/hapi-fhir-jpaserver-hfql/pom.xml @@ -3,7 +3,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutor.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutor.java index 424c713f90a..fd31d99e8cd 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutor.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutor.java @@ -51,6 +51,8 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.UrlUtil; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -78,8 +80,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/IHfqlExecutor.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/IHfqlExecutor.java index 348ccdb1ecf..8fc6088ab2d 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/IHfqlExecutor.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/IHfqlExecutor.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.jpa.fql.executor; import ca.uhn.fhir.jpa.fql.parser.HfqlStatement; import ca.uhn.fhir.rest.api.server.RequestDetails; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public interface IHfqlExecutor { diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/StaticHfqlExecutionResult.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/StaticHfqlExecutionResult.java index bc8237acb5a..6259d9f2d1a 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/StaticHfqlExecutionResult.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/executor/StaticHfqlExecutionResult.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.jpa.fql.executor; import ca.uhn.fhir.jpa.fql.parser.HfqlStatement; +import jakarta.annotation.Nullable; import java.util.Collections; import java.util.Iterator; import java.util.List; -import javax.annotation.Nullable; /** * @see IHfqlExecutionResult for information about the purpose of this class diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClient.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClient.java index 7b8ad5e0f10..8bdfb644be6 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClient.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClient.java @@ -23,6 +23,7 @@ import ca.uhn.fhir.jpa.fql.executor.IHfqlExecutionResult; import ca.uhn.fhir.jpa.fql.util.HfqlConstants; import ca.uhn.fhir.rest.client.impl.HttpBasicAuthInterceptor; import ca.uhn.fhir.util.IoUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.csv.CSVFormat; import org.apache.commons.lang3.Validate; import org.apache.http.impl.client.CloseableHttpClient; @@ -35,7 +36,6 @@ import org.hl7.fhir.r4.model.StringType; import java.sql.SQLException; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.fql.util.HfqlConstants.DEFAULT_FETCH_SIZE; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/JdbcConnection.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/JdbcConnection.java index 79627b4450f..3147a290edc 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/JdbcConnection.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/jdbc/JdbcConnection.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.fql.jdbc; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import java.sql.Array; import java.sql.Blob; @@ -39,7 +40,6 @@ import java.sql.Struct; import java.util.Map; import java.util.Properties; import java.util.concurrent.Executor; -import javax.annotation.Nonnull; class JdbcConnection implements Connection { private final String myServerUrl; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlFhirPathParser.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlFhirPathParser.java index 821fda283d2..c5933cc8633 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlFhirPathParser.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlFhirPathParser.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.jpa.fql.parser; import ca.uhn.fhir.context.*; import ca.uhn.fhir.jpa.fql.executor.HfqlDataTypeEnum; +import jakarta.annotation.Nullable; import org.apache.commons.text.WordUtils; import java.util.Map; -import javax.annotation.Nullable; import static java.util.Map.entry; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexer.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexer.java index b8f4b850a53..db8d10ef8d8 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexer.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexer.java @@ -22,11 +22,11 @@ package ca.uhn.fhir.jpa.fql.parser; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import static java.lang.Character.isWhitespace; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexerToken.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexerToken.java index 2458f773d84..d15dd6dcc12 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexerToken.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlLexerToken.java @@ -19,10 +19,10 @@ */ package ca.uhn.fhir.jpa.fql.parser; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import java.util.Locale; -import javax.annotation.Nonnull; class HfqlLexerToken { diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatement.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatement.java index 333c8d2fa94..181349af138 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatement.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatement.java @@ -24,13 +24,13 @@ import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.ValidateUtil; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This class represents a parsed HFQL expression tree. It is useful for diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatementParser.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatementParser.java index 0c6ede1489a..5c5d2ed5da9 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatementParser.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/parser/HfqlStatementParser.java @@ -23,14 +23,14 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/provider/HfqlRestProvider.java b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/provider/HfqlRestProvider.java index 805707e3621..13be8309154 100644 --- a/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/provider/HfqlRestProvider.java +++ b/hapi-fhir-jpaserver-hfql/src/main/java/ca/uhn/fhir/jpa/fql/provider/HfqlRestProvider.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.util.DatatypeUtil; import ca.uhn.fhir.util.JsonUtil; import ca.uhn.fhir.util.ValidateUtil; import ca.uhn.fhir.util.VersionUtil; +import jakarta.annotation.Nullable; import jakarta.servlet.ServletOutputStream; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.csv.CSVPrinter; @@ -38,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; import java.io.OutputStreamWriter; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.fql.jdbc.HfqlRestClient.CSV_FORMAT; import static ca.uhn.fhir.rest.api.Constants.CHARSET_UTF8_CTSUFFIX; diff --git a/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutorTest.java b/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutorTest.java index 5136c116ad0..73ede74a09a 100644 --- a/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutorTest.java +++ b/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/executor/HfqlExecutorTest.java @@ -36,7 +36,7 @@ import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.sql.Types; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClientTest.java b/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClientTest.java index 044717fee96..decc334dd05 100644 --- a/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClientTest.java +++ b/hapi-fhir-jpaserver-hfql/src/test/java/ca/uhn/fhir/jpa/fql/jdbc/HfqlRestClientTest.java @@ -31,7 +31,7 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.util.Base64Utils; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.nio.charset.StandardCharsets; import java.sql.SQLException; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-ips/pom.xml b/hapi-fhir-jpaserver-ips/pom.xml index 2f75ba5a60f..c284d9ed955 100644 --- a/hapi-fhir-jpaserver-ips/pom.xml +++ b/hapi-fhir-jpaserver-ips/pom.xml @@ -3,7 +3,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -40,7 +40,7 @@ test - net.sourceforge.htmlunit + org.htmlunit htmlunit test diff --git a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/IIpsGenerationStrategy.java b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/IIpsGenerationStrategy.java index 4a61fba6231..3f9300095a7 100644 --- a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/IIpsGenerationStrategy.java +++ b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/IIpsGenerationStrategy.java @@ -21,13 +21,13 @@ package ca.uhn.fhir.jpa.ips.api; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.model.api.Include; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This interface is the primary configuration and strategy provider for the diff --git a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/SectionRegistry.java b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/SectionRegistry.java index fa16b55e2fc..09603c53bd4 100644 --- a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/SectionRegistry.java +++ b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/api/SectionRegistry.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.jpa.ips.api; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -36,7 +37,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Consumer; -import javax.annotation.Nullable; /** * This class is the registry for sections for the IPS document. It can be extended diff --git a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImpl.java b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImpl.java index 69a69f3d0a0..d90a8b72cd6 100644 --- a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImpl.java +++ b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImpl.java @@ -45,6 +45,8 @@ import ca.uhn.fhir.util.ResourceReferenceInfo; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseExtension; @@ -68,8 +70,6 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.term.api.ITermLoaderSvc.LOINC_URI; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/strategy/DefaultIpsGenerationStrategy.java b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/strategy/DefaultIpsGenerationStrategy.java index c96add02935..dc56842cd8b 100644 --- a/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/strategy/DefaultIpsGenerationStrategy.java +++ b/hapi-fhir-jpaserver-ips/src/main/java/ca/uhn/fhir/jpa/ips/strategy/DefaultIpsGenerationStrategy.java @@ -30,6 +30,8 @@ import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.param.TokenParam; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.*; @@ -39,8 +41,6 @@ import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.jpa.term.api.ITermLoaderSvc.LOINC_URI; diff --git a/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGenerationR4Test.java b/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGenerationR4Test.java index ab94afa4404..fc9711c1331 100644 --- a/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGenerationR4Test.java +++ b/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGenerationR4Test.java @@ -38,8 +38,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.List; import java.util.stream.Collectors; diff --git a/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImplTest.java b/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImplTest.java index d89c4af3294..fbdaf9fa0d4 100644 --- a/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImplTest.java +++ b/hapi-fhir-jpaserver-ips/src/test/java/ca/uhn/fhir/jpa/ips/generator/IpsGeneratorSvcImplTest.java @@ -15,11 +15,11 @@ import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.server.SimpleBundleProvider; import ca.uhn.fhir.test.utilities.HtmlUtil; import ca.uhn.fhir.util.ClasspathUtil; -import com.gargoylesoftware.htmlunit.html.DomElement; -import com.gargoylesoftware.htmlunit.html.DomNodeList; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTable; -import com.gargoylesoftware.htmlunit.html.HtmlTableRow; +import org.htmlunit.html.DomElement; +import org.htmlunit.html.DomNodeList; +import org.htmlunit.html.HtmlPage; +import org.htmlunit.html.HtmlTable; +import org.htmlunit.html.HtmlTableRow; import com.google.common.collect.Lists; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.AllergyIntolerance; @@ -49,6 +49,11 @@ import org.hl7.fhir.r4.model.Procedure; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.StringType; +import org.htmlunit.html.DomElement; +import org.htmlunit.html.DomNodeList; +import org.htmlunit.html.HtmlPage; +import org.htmlunit.html.HtmlTable; +import org.htmlunit.html.HtmlTableRow; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -56,7 +61,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Collections; import java.util.Date; diff --git a/hapi-fhir-jpaserver-mdm/pom.xml b/hapi-fhir-jpaserver-mdm/pom.xml index dd2a1fba351..94bd39c91a2 100644 --- a/hapi-fhir-jpaserver-mdm/pom.xml +++ b/hapi-fhir-jpaserver-mdm/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmMessageKeySvc.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmMessageKeySvc.java index 5f3f1c381f3..6cb3f810232 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmMessageKeySvc.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmMessageKeySvc.java @@ -22,12 +22,12 @@ package ca.uhn.fhir.jpa.mdm.broker; import ca.uhn.fhir.jpa.subscription.api.ISubscriptionMessageKeySvc; import ca.uhn.fhir.mdm.model.CanonicalEID; import ca.uhn.fhir.mdm.util.EIDHelper; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; -import javax.annotation.Nullable; @Service public class MdmMessageKeySvc implements ISubscriptionMessageKeySvc { diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvc.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvc.java index 57ca03f6774..1832b09a130 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvc.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvc.java @@ -36,6 +36,8 @@ import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.model.MdmTransactionContext; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; @@ -50,8 +52,6 @@ import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class MdmLinkDaoSvc

> { diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/BlockRuleEvaluationSvcImpl.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/BlockRuleEvaluationSvcImpl.java index ec118655786..decb338c77b 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/BlockRuleEvaluationSvcImpl.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/BlockRuleEvaluationSvcImpl.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.mdm.blocklist.json.BlockedFieldJson; import ca.uhn.fhir.mdm.blocklist.svc.IBlockListRuleProvider; import ca.uhn.fhir.mdm.blocklist.svc.IBlockRuleEvaluationSvc; import ca.uhn.fhir.util.FhirTypeUtil; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.slf4j.Logger; import java.util.List; -import javax.annotation.Nullable; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/GoldenResourceSearchSvcImpl.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/GoldenResourceSearchSvcImpl.java index 62c259bca4b..d96cd3be0c1 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/GoldenResourceSearchSvcImpl.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/GoldenResourceSearchSvcImpl.java @@ -40,14 +40,14 @@ import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.util.DateRangeUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class GoldenResourceSearchSvcImpl implements IGoldenResourceSearchSvc { @Autowired diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmControllerSvcImpl.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmControllerSvcImpl.java index a9ddf8b322a..1071b9ba26b 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmControllerSvcImpl.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmControllerSvcImpl.java @@ -57,6 +57,8 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -68,8 +70,6 @@ import java.math.BigDecimal; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This class acts as a layer between MdmProviders and MDM services to support a REST API that's not a FHIR Operation API. diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmEidUpdateService.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmEidUpdateService.java index 52677a69b51..c6e1359d540 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmEidUpdateService.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmEidUpdateService.java @@ -35,6 +35,7 @@ import ca.uhn.fhir.mdm.model.MdmTransactionContext; import ca.uhn.fhir.mdm.util.EIDHelper; import ca.uhn.fhir.mdm.util.GoldenResourceHelper; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +43,6 @@ import org.springframework.stereotype.Service; import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; @Service public class MdmEidUpdateService { diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmLinkSvcImpl.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmLinkSvcImpl.java index 027f69e3b7f..b74d3ed3e8b 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmLinkSvcImpl.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmLinkSvcImpl.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.model.MdmTransactionContext; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; /** * This class is in charge of managing MdmLinks between Golden Resources and source resources diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java index 0d3ee482998..426b096cf11 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/MdmMatchFinderSvcImpl.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.mdm.api.IMdmMatchFinderSvc; import ca.uhn.fhir.mdm.api.MatchedTarget; import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.rules.svc.MdmResourceMatcherSvc; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -34,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.jpa.mdm.svc.candidate.CandidateSearcher.idOrType; diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/candidate/MdmCandidateSearchCriteriaBuilderSvc.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/candidate/MdmCandidateSearchCriteriaBuilderSvc.java index 7eddf52c5c3..fb5d0b0828c 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/candidate/MdmCandidateSearchCriteriaBuilderSvc.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/svc/candidate/MdmCandidateSearchCriteriaBuilderSvc.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.jpa.mdm.svc.candidate; import ca.uhn.fhir.mdm.rules.json.MdmResourceSearchParamJson; import ca.uhn.fhir.mdm.svc.MdmSearchParamSvc; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,8 +32,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; @Service public class MdmCandidateSearchCriteriaBuilderSvc { diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/BaseMdmR4Test.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/BaseMdmR4Test.java index 3e9d31edb6b..325313eaca1 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/BaseMdmR4Test.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/BaseMdmR4Test.java @@ -58,7 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Collections; import java.util.Date; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvcTest.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvcTest.java index 39780e1a182..fc1aaa49a8f 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvcTest.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/dao/MdmLinkDaoSvcTest.java @@ -25,7 +25,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/helper/MdmHelperR4.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/helper/MdmHelperR4.java index 7e3023cc5b9..b3dea888987 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/helper/MdmHelperR4.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/helper/MdmHelperR4.java @@ -13,7 +13,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Patient; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import static ca.uhn.fhir.mdm.api.MdmConstants.CODE_GOLDEN_RECORD; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmEventIT.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmEventIT.java index d5dba4b5100..ca31a16f384 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmEventIT.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmEventIT.java @@ -27,7 +27,7 @@ import org.springframework.data.domain.Example; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.Set; import java.util.UUID; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/matcher/BaseGoldenResourceMatcher.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/matcher/BaseGoldenResourceMatcher.java index 92cbc41a334..cc139087ad3 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/matcher/BaseGoldenResourceMatcher.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/matcher/BaseGoldenResourceMatcher.java @@ -12,7 +12,7 @@ import org.hl7.fhir.instance.model.api.IAnyResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseLinkR4Test.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseLinkR4Test.java index 7860c5d33d3..3ea0ea7e7df 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseLinkR4Test.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseLinkR4Test.java @@ -14,7 +14,7 @@ import org.hl7.fhir.r4.model.StringType; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.List; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseProviderR4Test.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseProviderR4Test.java index 8b46fe10d87..ddf5fa37f80 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseProviderR4Test.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/BaseProviderR4Test.java @@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/MdmProviderClearLinkR4Test.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/MdmProviderClearLinkR4Test.java index 11384438ca4..385b398653c 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/MdmProviderClearLinkR4Test.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/jpa/mdm/provider/MdmProviderClearLinkR4Test.java @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; diff --git a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStepTest.java b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStepTest.java index 8af62eed33b..84e8c98a7fa 100644 --- a/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStepTest.java +++ b/hapi-fhir-jpaserver-mdm/src/test/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStepTest.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/hapi-fhir-jpaserver-model/pom.xml b/hapi-fhir-jpaserver-model/pom.xml index 8860e76228d..5000d617b40 100644 --- a/hapi-fhir-jpaserver-model/pom.xml +++ b/hapi-fhir-jpaserver-model/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/AuditableBasePartitionable.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/AuditableBasePartitionable.java index 8601fba3c21..5423b278373 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/AuditableBasePartitionable.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/AuditableBasePartitionable.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.model.entity; * #L% */ +import jakarta.annotation.Nullable; import jakarta.persistence.Column; import jakarta.persistence.Embedded; import jakarta.persistence.MappedSuperclass; @@ -27,7 +28,6 @@ import org.hibernate.envers.Audited; import org.hibernate.envers.NotAudited; import java.io.Serializable; -import javax.annotation.Nullable; /** * This is a copy of (@link {@link BasePartitionable} used ONLY for entities that are audited by Hibernate Envers. diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/BasePartitionable.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/BasePartitionable.java index 60f1d7962e5..939180a23b9 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/BasePartitionable.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/BasePartitionable.java @@ -19,12 +19,12 @@ */ package ca.uhn.fhir.jpa.model.entity; +import jakarta.annotation.Nullable; import jakarta.persistence.Column; import jakarta.persistence.Embedded; import jakarta.persistence.MappedSuperclass; import java.io.Serializable; -import javax.annotation.Nullable; /** * This is the base class for entities with partitioning that does NOT include Hibernate Envers logging. diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/IBaseResourceEntity.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/IBaseResourceEntity.java index 2da32bd3661..1e61691d8f3 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/IBaseResourceEntity.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/IBaseResourceEntity.java @@ -22,9 +22,9 @@ package ca.uhn.fhir.jpa.model.entity; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; +import jakarta.annotation.Nullable; import java.util.Date; -import javax.annotation.Nullable; public interface IBaseResourceEntity { diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/PartitionablePartitionId.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/PartitionablePartitionId.java index e1a9026e9f7..88a786410b1 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/PartitionablePartitionId.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/PartitionablePartitionId.java @@ -21,14 +21,14 @@ package ca.uhn.fhir.jpa.model.entity; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.model.config.PartitionSettings; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import java.time.LocalDate; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; @Embeddable public class PartitionablePartitionId implements Cloneable { diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceLink.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceLink.java index 24ced82e9c4..f1167937b13 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceLink.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceLink.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.jpa.model.entity; +import jakarta.annotation.Nullable; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; @@ -41,7 +42,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextFi import org.hl7.fhir.instance.model.api.IIdType; import java.util.Date; -import javax.annotation.Nullable; @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/HSearchElementCache.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/HSearchElementCache.java index c96ee902c79..36c0df1d0a3 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/HSearchElementCache.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/HSearchElementCache.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.jpa.model.search; +import jakarta.annotation.Nonnull; import org.hibernate.search.engine.backend.document.DocumentElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,7 +28,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; /** * Provide a lookup of created Hibernate Search DocumentElement entries. diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/UcumServiceUtil.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/UcumServiceUtil.java index 56ef214852e..ab469668adc 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/UcumServiceUtil.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util/UcumServiceUtil.java @@ -23,6 +23,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.param.QuantityParam; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.ClasspathUtil; +import jakarta.annotation.Nullable; import org.fhir.ucum.Decimal; import org.fhir.ucum.Pair; import org.fhir.ucum.UcumEssenceService; @@ -33,7 +34,6 @@ import org.slf4j.LoggerFactory; import java.io.InputStream; import java.math.BigDecimal; import java.math.RoundingMode; -import javax.annotation.Nullable; /** * It's a wrapper of UcumEssenceService diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml index 7668f21ed10..20a05eaa091 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/interceptor/model/ReadPartitionIdRequestDetails.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/interceptor/model/ReadPartitionIdRequestDetails.java index c7884f8ad60..af9740918c9 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/interceptor/model/ReadPartitionIdRequestDetails.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/interceptor/model/ReadPartitionIdRequestDetails.java @@ -21,12 +21,11 @@ package ca.uhn.fhir.interceptor.model; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.StringUtils.isNotBlank; /** diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/IResourceVersionSvc.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/IResourceVersionSvc.java index d7297b2e453..1ec8e09d97e 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/IResourceVersionSvc.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/IResourceVersionSvc.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.jpa.cache; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IIdType; import java.util.List; -import javax.annotation.Nonnull; /** * This interface is used by the {@literal IResourceChangeListenerCacheRefresher} to read resources matching the provided diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/ResourceChangeListenerRegistryImpl.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/ResourceChangeListenerRegistryImpl.java index bdd8ab4d164..051a4a080ed 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/ResourceChangeListenerRegistryImpl.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/cache/ResourceChangeListenerRegistryImpl.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult; import ca.uhn.fhir.jpa.searchparam.matcher.InMemoryResourceMatcher; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,7 +37,6 @@ import java.util.Queue; import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.stream.Collectors; -import javax.annotation.Nonnull; /** * This component holds an in-memory list of all registered {@link IResourceChangeListener} instances along diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/partition/IRequestPartitionHelperSvc.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/partition/IRequestPartitionHelperSvc.java index c2bfd3a67f1..235f4224b20 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/partition/IRequestPartitionHelperSvc.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/partition/IRequestPartitionHelperSvc.java @@ -23,12 +23,12 @@ import ca.uhn.fhir.interceptor.model.ReadPartitionIdRequestDetails; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IRequestPartitionHelperSvc { diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java index c3d1ffa1ae1..7b7a56c2557 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.param.QuantityParam; import ca.uhn.fhir.rest.param.TokenParamModifier; import ca.uhn.fhir.util.UrlUtil; import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.CompareToBuilder; @@ -55,7 +56,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.GREATERTHAN_OR_EQUALS; import static ca.uhn.fhir.rest.param.ParamPrefixEnum.LESSTHAN_OR_EQUALS; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java index fdaf1eeafa1..32509e6ffb7 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java @@ -49,6 +49,8 @@ import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.bundle.BundleEntryParts; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -81,8 +83,6 @@ import java.util.Optional; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.measure.quantity.Quantity; import javax.measure.unit.NonSI; import javax.measure.unit.Unit; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/CrossPartitionReferenceDetails.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/CrossPartitionReferenceDetails.java index 643d26cef7b..569c0cb89af 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/CrossPartitionReferenceDetails.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/CrossPartitionReferenceDetails.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.jpa.searchparam.extractor; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class CrossPartitionReferenceDetails { diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/IResourceLinkResolver.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/IResourceLinkResolver.java index fad69f1ffef..e837a65d084 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/IResourceLinkResolver.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/IResourceLinkResolver.java @@ -23,11 +23,10 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.model.cross.IResourceLookup; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public interface IResourceLinkResolver { /** diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/ResourceIndexedSearchParams.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/ResourceIndexedSearchParams.java index 29b0baeef31..9d287030750 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/ResourceIndexedSearchParams.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/ResourceIndexedSearchParams.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; import ca.uhn.fhir.rest.param.QuantityParam; import ca.uhn.fhir.rest.param.ReferenceParam; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; @@ -41,7 +42,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.function.Predicate; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.compare; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorService.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorService.java index b8fddf42ea2..1832bb9c2c9 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorService.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorService.java @@ -60,6 +60,8 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.FhirTerser; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -77,8 +79,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcher.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcher.java index 4b3c145fb36..4efaf6d2395 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcher.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcher.java @@ -51,6 +51,8 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.util.MetaUtil; import ca.uhn.fhir.util.UrlUtil; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.dstu3.model.Location; @@ -68,8 +70,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/IndexedSearchParamExtractor.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/IndexedSearchParamExtractor.java index 64767055e00..c36e59bd9cb 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/IndexedSearchParamExtractor.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/matcher/IndexedSearchParamExtractor.java @@ -26,11 +26,10 @@ import ca.uhn.fhir.jpa.searchparam.extractor.ResourceIndexedSearchParams; import ca.uhn.fhir.jpa.searchparam.extractor.SearchParamExtractorService; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; - public class IndexedSearchParamExtractor { @Autowired private FhirContext myContext; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/ReadOnlySearchParamCache.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/ReadOnlySearchParamCache.java index 7bacb9317ae..bee998af5bc 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/ReadOnlySearchParamCache.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/ReadOnlySearchParamCache.java @@ -26,6 +26,8 @@ import ca.uhn.fhir.context.RuntimeSearchParam; import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.ClasspathUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -37,8 +39,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImpl.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImpl.java index 1fb3fa28831..6d3a5b4db8d 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImpl.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImpl.java @@ -42,6 +42,8 @@ import ca.uhn.fhir.util.SearchParameterUtil; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import org.apache.commons.lang3.StringUtils; @@ -59,8 +61,6 @@ import java.util.Iterator; import java.util.List; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/util/JpaParamUtil.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/util/JpaParamUtil.java index 66bdb32cd8e..267ed55edb2 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/util/JpaParamUtil.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/util/JpaParamUtil.java @@ -49,12 +49,12 @@ import ca.uhn.fhir.rest.param.UriParam; import ca.uhn.fhir.rest.param.binder.QueryParameterAndBinder; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; -import javax.annotation.Nonnull; public enum JpaParamUtil { ; diff --git a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorDstu3Test.java b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorDstu3Test.java index eb3024f548d..79463fd5517 100644 --- a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorDstu3Test.java +++ b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/SearchParamExtractorDstu3Test.java @@ -38,7 +38,7 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.text.Normalizer; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcherR5Test.java b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcherR5Test.java index 908ba13a1c2..fdf20ec5eb1 100644 --- a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcherR5Test.java +++ b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/matcher/InMemoryResourceMatcherR5Test.java @@ -35,7 +35,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.time.Duration; import java.time.Instant; import java.util.Date; diff --git a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImplTest.java b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImplTest.java index c559b1dcd62..5a9c356797d 100644 --- a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImplTest.java +++ b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/registry/SearchParamRegistryImplTest.java @@ -36,7 +36,7 @@ import org.springframework.context.annotation.Import; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.testcontainers.shaded.com.google.common.collect.Sets; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml index 03f4d2159b5..dca57d868d6 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/api/ISubscriptionMessageKeySvc.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/api/ISubscriptionMessageKeySvc.java index 54a509c23e0..27a5a6c4aba 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/api/ISubscriptionMessageKeySvc.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/api/ISubscriptionMessageKeySvc.java @@ -19,10 +19,9 @@ */ package ca.uhn.fhir.jpa.subscription.api; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; -import javax.annotation.Nullable; - /** * This is used by "message" type subscriptions to provide a key to the message wrapper before submitting it to the channel */ diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailDetails.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailDetails.java index f7ceb37b2ec..e6b73e500db 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailDetails.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailDetails.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.subscription.match.deliver.email; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IIdType; import org.simplejavamail.api.email.Email; @@ -33,7 +34,6 @@ import org.thymeleaf.templateresolver.StringTemplateResolver; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class EmailDetails { private final SpringTemplateEngine myTemplateEngine; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailSenderImpl.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailSenderImpl.java index b2cc733ecd2..1a37fbafe3f 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailSenderImpl.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/EmailSenderImpl.java @@ -21,13 +21,12 @@ package ca.uhn.fhir.jpa.subscription.match.deliver.email; import ca.uhn.fhir.rest.server.mail.IMailSvc; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.simplejavamail.api.email.Email; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; - public class EmailSenderImpl implements IEmailSender { private static final Logger ourLog = LoggerFactory.getLogger(EmailSenderImpl.class); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/resthook/SubscriptionDeliveringRestHookSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/resthook/SubscriptionDeliveringRestHookSubscriber.java index 6d4054a7d30..6f83665014c 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/resthook/SubscriptionDeliveringRestHookSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/resthook/SubscriptionDeliveringRestHookSubscriber.java @@ -46,6 +46,7 @@ import ca.uhn.fhir.rest.server.messaging.BaseResourceModifiedMessage; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.Logs; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -61,7 +62,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/websocket/WebsocketConnectionValidator.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/websocket/WebsocketConnectionValidator.java index cf82917ba0f..dbc0f3d928f 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/websocket/WebsocketConnectionValidator.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/websocket/WebsocketConnectionValidator.java @@ -22,13 +22,12 @@ package ca.uhn.fhir.jpa.subscription.match.deliver.websocket; import ca.uhn.fhir.jpa.subscription.match.registry.ActiveSubscription; import ca.uhn.fhir.jpa.subscription.match.registry.SubscriptionRegistry; import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscriptionChannelType; +import jakarta.annotation.Nonnull; import org.hl7.fhir.r4.model.IdType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; - public class WebsocketConnectionValidator { private static Logger ourLog = LoggerFactory.getLogger(WebsocketConnectionValidator.class); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionActivatingSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionActivatingSubscriber.java index 405cd94796d..32640b9bbe5 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionActivatingSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionActivatingSubscriber.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.subscription.SubscriptionConstants; import ca.uhn.fhir.subscription.api.IResourceModifiedMessagePersistenceSvc; import ca.uhn.fhir.util.SubscriptionUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.dstu2.model.Subscription; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; @@ -43,7 +44,6 @@ import org.springframework.messaging.MessageHandler; import org.springframework.messaging.MessagingException; import java.util.Optional; -import javax.annotation.Nonnull; /** * Responsible for transitioning subscription resources from REQUESTED to ACTIVE diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionCriteriaParser.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionCriteriaParser.java index af2f5ac4d3a..a7914d72ee8 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionCriteriaParser.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionCriteriaParser.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.subscription.match.matcher.subscriber; import ca.uhn.fhir.jpa.searchparam.extractor.StringTrimmingTrimmerMatcher; import ca.uhn.fhir.rest.api.Constants; import com.google.common.collect.Sets; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.text.StringTokenizer; @@ -29,7 +30,6 @@ import org.apache.commons.text.StringTokenizer; import java.util.Collections; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionDeliveryRequest.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionDeliveryRequest.java index 0ad8112ca0e..c4515a4e8e7 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionDeliveryRequest.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionDeliveryRequest.java @@ -26,12 +26,11 @@ import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage; import ca.uhn.fhir.jpa.topic.SubscriptionTopicDispatchRequest; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.server.messaging.BaseResourceModifiedMessage; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nonnull; - public class SubscriptionDeliveryRequest { // One of these two will be populated private final IBaseResource myPayload; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchDeliverer.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchDeliverer.java index d123f33e98a..fb60960b54b 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchDeliverer.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchDeliverer.java @@ -33,14 +33,13 @@ import ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryJsonMessage; import ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage; import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage; import ca.uhn.fhir.rest.api.EncodingEnum; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.messaging.MessageChannel; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; public class SubscriptionMatchDeliverer { diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchingSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchingSubscriber.java index f2ef0d1302e..422f8e8eb13 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchingSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionMatchingSubscriber.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage; import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage; import ca.uhn.fhir.subscription.api.IResourceModifiedMessagePersistenceSvc; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; @@ -42,7 +43,6 @@ import org.springframework.messaging.MessagingException; import java.util.Collection; import java.util.Optional; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.server.messaging.BaseResourceMessage.OperationTypeEnum.DELETE; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionRegisteringSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionRegisteringSubscriber.java index c2ca97b0ee4..c07ec015e59 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionRegisteringSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/matcher/subscriber/SubscriptionRegisteringSubscriber.java @@ -29,6 +29,7 @@ import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage; import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; @@ -38,8 +39,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.MessagingException; -import javax.annotation.Nonnull; - /** * Responsible for transitioning subscription resources from REQUESTED to ACTIVE * Once activated, the subscription is added to the SubscriptionRegistry. diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionLoader.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionLoader.java index 13e14e72dc2..ac567cf3969 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionLoader.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionLoader.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.jpa.subscription.match.matcher.subscriber.SubscriptionActivat import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.subscription.SubscriptionConstants; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Subscription; @@ -35,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; public class SubscriptionLoader extends BaseResourceCacheSynchronizer { private static final Logger ourLog = LoggerFactory.getLogger(SubscriptionLoader.class); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/SubscriptionTriggeringSvcImpl.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/SubscriptionTriggeringSvcImpl.java index c32a2fadb6d..7d543edf335 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/SubscriptionTriggeringSvcImpl.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/SubscriptionTriggeringSvcImpl.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.util.StopWatch; import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.collect.Lists; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.Validate; @@ -80,7 +81,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.server.provider.ProviderConstants.SUBSCRIPTION_TRIGGERING_PARAM_RESOURCE_ID; import static java.util.Objects.isNull; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicDispatchRequest.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicDispatchRequest.java index 4727829ff78..5d6246eba1a 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicDispatchRequest.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicDispatchRequest.java @@ -23,11 +23,11 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult; import ca.uhn.fhir.jpa.topic.filter.ISubscriptionTopicFilterMatcher; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class SubscriptionTopicDispatchRequest { @Nonnull diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicLoader.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicLoader.java index daaaa3bcc20..3b3e2c1e69a 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicLoader.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicLoader.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.subscription.SubscriptionConstants; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.SubscriptionTopic; @@ -36,7 +37,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; public class SubscriptionTopicLoader extends BaseResourceCacheSynchronizer { private static final Logger ourLog = Logs.getSubscriptionTopicLog(); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicMatchingSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicMatchingSubscriber.java index abccbe2c514..59c32c3ef36 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicMatchingSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicMatchingSubscriber.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.jpa.topic.filter.InMemoryTopicFilterMatcher; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.subscription.api.IResourceModifiedMessagePersistenceSvc; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.SubscriptionTopic; import org.slf4j.Logger; @@ -42,7 +43,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public class SubscriptionTopicMatchingSubscriber implements MessageHandler { private static final Logger ourLog = Logs.getSubscriptionTopicLog(); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilder.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilder.java index 2efab3bb355..39b3c5c4e5f 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilder.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilder.java @@ -23,12 +23,14 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.subscription.match.registry.ActiveSubscription; +import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; import ca.uhn.fhir.jpa.topic.status.INotificationStatusBuilder; import ca.uhn.fhir.jpa.topic.status.R4BNotificationStatusBuilder; import ca.uhn.fhir.jpa.topic.status.R4NotificationStatusBuilder; import ca.uhn.fhir.jpa.topic.status.R5NotificationStatusBuilder; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.util.BundleBuilder; +import org.apache.commons.lang3.ObjectUtils; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Bundle; @@ -37,6 +39,8 @@ import org.slf4j.LoggerFactory; import java.util.List; +import static org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE; + public class SubscriptionTopicPayloadBuilder { private static final Logger ourLog = LoggerFactory.getLogger(SubscriptionTopicPayloadBuilder.class); private final FhirContext myFhirContext; @@ -73,7 +77,7 @@ public class SubscriptionTopicPayloadBuilder { myNotificationStatusBuilder.buildNotificationStatus(theResources, theActiveSubscription, theTopicUrl); bundleBuilder.addCollectionEntry(notificationStatus); - addResources(bundleBuilder, theResources, theRestOperationType); + addResources(theResources, theActiveSubscription.getSubscription(), theRestOperationType, bundleBuilder); // WIP STR5 add support for notificationShape include, revinclude // Note we need to set the bundle type after we add the resources since adding the resources automatically sets @@ -87,7 +91,46 @@ public class SubscriptionTopicPayloadBuilder { return retval; } - private static void addResources( + private void addResources( + List theResources, + CanonicalSubscription theCanonicalSubscription, + RestOperationTypeEnum theRestOperationType, + BundleBuilder theBundleBuilder) { + + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent content = + ObjectUtils.defaultIfNull(theCanonicalSubscription.getContent(), FULLRESOURCE); + + switch (content) { + case EMPTY: + // skip adding resource to the Bundle + break; + case IDONLY: + addIdOnly(theBundleBuilder, theResources, theRestOperationType); + break; + case FULLRESOURCE: + addFullResources(theBundleBuilder, theResources, theRestOperationType); + break; + } + } + + private void addIdOnly( + BundleBuilder bundleBuilder, List theResources, RestOperationTypeEnum theRestOperationType) { + for (IBaseResource resource : theResources) { + switch (theRestOperationType) { + case CREATE: + bundleBuilder.addTransactionCreateEntryIdOnly(resource); + break; + case UPDATE: + bundleBuilder.addTransactionUpdateIdOnlyEntry(resource); + break; + case DELETE: + bundleBuilder.addTransactionDeleteEntry(resource); + break; + } + } + } + + private void addFullResources( BundleBuilder bundleBuilder, List theResources, RestOperationTypeEnum theRestOperationType) { for (IBaseResource resource : theResources) { switch (theRestOperationType) { diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicRegisteringSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicRegisteringSubscriber.java index c2c17a7e5f2..27ba8d9971f 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicRegisteringSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicRegisteringSubscriber.java @@ -29,6 +29,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r5.model.Enumerations; @@ -39,8 +40,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.MessagingException; -import javax.annotation.Nonnull; - /** * Responsible for transitioning subscription resources from REQUESTED to ACTIVE * Once activated, the subscription is added to the SubscriptionRegistry. diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtil.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtil.java index 0a05e8f44aa..95908704ad0 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtil.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtil.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.topic; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage; import ca.uhn.fhir.rest.server.messaging.BaseResourceMessage; import ca.uhn.fhir.util.BundleUtil; @@ -72,4 +73,14 @@ public class SubscriptionTopicUtil { .findFirst() .orElse(null); } + + /** + * Checks if {@link CanonicalSubscription} has EMPTY {@link org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent} + * Used for R5/R4B/R4 Notification Status object building. + */ + public static boolean isEmptyContentTopicSubscription(CanonicalSubscription theCanonicalSubscription) { + return theCanonicalSubscription.isTopicSubscription() + && org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.EMPTY + == theCanonicalSubscription.getTopicSubscription().getContent(); + } } diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/filter/SubscriptionTopicFilterUtil.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/filter/SubscriptionTopicFilterUtil.java index 99558c07b7f..a9deaf51a49 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/filter/SubscriptionTopicFilterUtil.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/filter/SubscriptionTopicFilterUtil.java @@ -22,11 +22,10 @@ package ca.uhn.fhir.jpa.topic.filter; import ca.uhn.fhir.jpa.subscription.model.CanonicalTopicSubscription; import ca.uhn.fhir.jpa.subscription.model.CanonicalTopicSubscriptionFilter; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; -import javax.annotation.Nonnull; - public final class SubscriptionTopicFilterUtil { private static final Logger ourLog = Logs.getSubscriptionTopicLog(); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R4NotificationStatusBuilder.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R4NotificationStatusBuilder.java index 68da40e3b99..16300900bda 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R4NotificationStatusBuilder.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R4NotificationStatusBuilder.java @@ -21,6 +21,8 @@ package ca.uhn.fhir.jpa.topic.status; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.subscription.match.registry.ActiveSubscription; +import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; +import ca.uhn.fhir.jpa.topic.SubscriptionTopicUtil; import ca.uhn.fhir.subscription.SubscriptionConstants; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.CanonicalType; @@ -46,6 +48,7 @@ public class R4NotificationStatusBuilder implements INotificationStatusBuilder

theResources, ActiveSubscription theActiveSubscription, String theTopicUrl) { Long eventNumber = theActiveSubscription.getDeliveriesCount(); + CanonicalSubscription canonicalSubscription = theActiveSubscription.getSubscription(); // See http://build.fhir.org/ig/HL7/fhir-subscription-backport-ig/Parameters-r4-notification-status.json.html // and @@ -66,12 +69,12 @@ public class R4NotificationStatusBuilder implements INotificationStatusBuilder

0) { + if (!theResources.isEmpty() && !SubscriptionTopicUtil.isEmptyContentTopicSubscription(canonicalSubscription)) { IBaseResource firstResource = theResources.get(0); - notificationEvent - .addPart() - .setName("focus") - .setValue(new Reference(firstResource.getIdElement().toUnqualifiedVersionless())); + Reference resourceReference = + new Reference(firstResource.getIdElement().toUnqualifiedVersionless()); + + notificationEvent.addPart().setName("focus").setValue(resourceReference); } return parameters; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R5NotificationStatusBuilder.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R5NotificationStatusBuilder.java index c9128d9f638..8140066b929 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R5NotificationStatusBuilder.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/topic/status/R5NotificationStatusBuilder.java @@ -21,6 +21,8 @@ package ca.uhn.fhir.jpa.topic.status; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.subscription.match.registry.ActiveSubscription; +import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; +import ca.uhn.fhir.jpa.topic.SubscriptionTopicUtil; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Reference; @@ -40,6 +42,7 @@ public class R5NotificationStatusBuilder implements INotificationStatusBuilder theResources, ActiveSubscription theActiveSubscription, String theTopicUrl) { long eventNumber = theActiveSubscription.getDeliveriesCount(); + CanonicalSubscription canonicalSubscription = theActiveSubscription.getSubscription(); SubscriptionStatus subscriptionStatus = new SubscriptionStatus(); subscriptionStatus.setId(UUID.randomUUID().toString()); @@ -50,7 +53,7 @@ public class R5NotificationStatusBuilder implements INotificationStatusBuilder 0) { + if (!theResources.isEmpty() && !SubscriptionTopicUtil.isEmptyContentTopicSubscription(canonicalSubscription)) { event.setFocus(new Reference(theResources.get(0).getIdElement())); } subscriptionStatus.setSubscription( diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/match/deliver/BaseSubscriptionDeliverySubscriberTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/match/deliver/BaseSubscriptionDeliverySubscriberTest.java index 5153c161776..42cb241235e 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/match/deliver/BaseSubscriptionDeliverySubscriberTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/match/deliver/BaseSubscriptionDeliverySubscriberTest.java @@ -50,7 +50,7 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; import org.springframework.messaging.support.GenericMessage; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.net.URISyntaxException; import java.time.LocalDate; import java.util.Collection; diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/submit/interceptor/SubscriptionValidatingInterceptorTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/submit/interceptor/SubscriptionValidatingInterceptorTest.java index 02483240403..a89f16de667 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/submit/interceptor/SubscriptionValidatingInterceptorTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/submit/interceptor/SubscriptionValidatingInterceptorTest.java @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.net.URI; import java.net.URISyntaxException; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR4BTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR4BTest.java index 20a6dd42e45..a37808dbfa5 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR4BTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR4BTest.java @@ -8,74 +8,177 @@ import ca.uhn.fhir.util.BundleUtil; import org.hl7.fhir.r4b.model.Bundle; import org.hl7.fhir.r4b.model.Encounter; import org.hl7.fhir.r4b.model.Resource; -import org.junit.jupiter.api.Test; +import org.hl7.fhir.r4b.model.SubscriptionStatus; +import org.hl7.fhir.r5.model.Subscription; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.ValueSource; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class SubscriptionTopicPayloadBuilderR4BTest { private static final String TEST_TOPIC_URL = "test-builder-topic-url"; FhirContext ourFhirContext = FhirContext.forR4BCached(); - @Test - public void testBuildPayloadDelete() { + private SubscriptionTopicPayloadBuilder myStPayloadBuilder; + private Encounter myEncounter; + private CanonicalSubscription myCanonicalSubscription; + private ActiveSubscription myActiveSubscription; + + @BeforeEach + void before() { + myStPayloadBuilder = new SubscriptionTopicPayloadBuilder(ourFhirContext); + myEncounter = new Encounter(); + myEncounter.setId("Encounter/1"); + myCanonicalSubscription = new CanonicalSubscription(); + myCanonicalSubscription.setTopicSubscription(true); + myActiveSubscription = new ActiveSubscription(myCanonicalSubscription, "test"); + } + + @ParameterizedTest + @ValueSource(strings = { + "full-resource", + "" // payload content not provided + }) + public void testBuildPayload_deleteWithFullResourceContent_returnsCorrectPayload(String thePayloadContent) { // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + Subscription.SubscriptionPayloadContent payloadContent = + Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent); + myCanonicalSubscription.getTopicSubscription().setContent(payloadContent); // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.DELETE); + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, RestOperationTypeEnum.DELETE); - // verify + // verify Bundle size + assertEquals(2, payload.getEntry().size()); List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); assertEquals(1, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); - assertEquals(Bundle.HTTPVerb.DELETE, payload.getEntry().get(1).getRequest().getMethod()); + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); + + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertNull(encounterEntry.getResource()); + assertNull(encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE.name(), "Encounter/1"); } - @Test - public void testBuildPayloadUpdate() { + @ParameterizedTest + @CsvSource({ + "create, POST , full-resource, Encounter/1, Encounter", + "update, PUT , full-resource, Encounter/1, Encounter/1", + "create, POST , , Encounter/1, Encounter", + "update, PUT , , Encounter/1, Encounter/1", + }) + public void testBuildPayload_createUpdateWithFullResourceContent_returnsCorrectPayload(String theRestOperationType, + String theHttpMethod, + String thePayloadContent, + String theFullUrl, + String theRequestUrl) { // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + Subscription.SubscriptionPayloadContent payloadContent = + Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent); + + myCanonicalSubscription.getTopicSubscription().setContent(payloadContent); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.UPDATE); + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); - // verify + // verify Bundle size + assertEquals(2, payload.getEntry().size()); List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); assertEquals(2, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); - assertEquals("Encounter", resources.get(1).getResourceType().name()); - assertEquals(Bundle.HTTPVerb.PUT, payload.getEntry().get(1).getRequest().getMethod()); + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); + + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertEquals("Encounter", resources.get(1).getResourceType().name()); + assertEquals(myEncounter, resources.get(1)); + assertEquals(theFullUrl, encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, theHttpMethod, theRequestUrl); } - @Test - public void testBuildPayloadCreate() { + @ParameterizedTest + @CsvSource({ + "create, POST , Encounter/1, Encounter", + "update, PUT , Encounter/1, Encounter/1", + "delete, DELETE, , Encounter/1" + }) + public void testBuildPayload_withIdOnlyContent_returnsCorrectPayload(String theRestOperationType, + String theHttpMethod, String theFullUrl, + String theRequestUrl) { // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + myCanonicalSubscription.getTopicSubscription().setContent(Subscription.SubscriptionPayloadContent.IDONLY); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.CREATE); + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); - // verify + // verify Bundle size + assertEquals(2, payload.getEntry().size()); List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); - assertEquals(2, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); - assertEquals("Encounter", resources.get(1).getResourceType().name()); + assertEquals(1, resources.size()); - assertEquals(Bundle.HTTPVerb.POST, payload.getEntry().get(1).getRequest().getMethod()); + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); + + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertNull(encounterEntry.getResource()); + assertEquals(theFullUrl, encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, theHttpMethod, theRequestUrl); + } + + @ParameterizedTest + @CsvSource({ + "create", + "update", + "delete" + }) + public void testBuildPayload_withEmptyContent_returnsCorrectPayload(String theRestOperationType) { + // setup + myCanonicalSubscription.getTopicSubscription().setContent(Subscription.SubscriptionPayloadContent.EMPTY); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); + + // run + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); + + // verify Bundle size + assertEquals(1, payload.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); + assertEquals(1, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); + assertEquals(1, ((SubscriptionStatus) resources.get(0)).getNotificationEvent().size()); + SubscriptionStatus.SubscriptionStatusNotificationEventComponent notificationEvent = + ((SubscriptionStatus) resources.get(0)).getNotificationEventFirstRep(); + assertFalse(notificationEvent.hasFocus()); + } + + private void verifyRequestParameters(Bundle.BundleEntryComponent theEncounterEntry, + String theHttpMethod, String theRequestUrl) { + assertNotNull(theEncounterEntry.getRequest()); + assertEquals(theHttpMethod, theEncounterEntry.getRequest().getMethod().name()); + assertEquals(theRequestUrl, theEncounterEntry.getRequest().getUrl()); + } + + private void verifySubscriptionStatusNotificationEvent(Resource theResource) { + assertEquals("SubscriptionStatus", theResource.getResourceType().name()); + assertEquals(1, ((SubscriptionStatus) theResource).getNotificationEvent().size()); + SubscriptionStatus.SubscriptionStatusNotificationEventComponent notificationEvent = + ((SubscriptionStatus) theResource).getNotificationEventFirstRep(); + assertTrue(notificationEvent.hasFocus()); + assertEquals(myEncounter.getId(), notificationEvent.getFocus().getReference()); } } diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR5Test.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR5Test.java index 808ed42d8e9..d3f57de55ee 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR5Test.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicPayloadBuilderR5Test.java @@ -8,74 +8,177 @@ import ca.uhn.fhir.util.BundleUtil; import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Encounter; import org.hl7.fhir.r5.model.Resource; -import org.junit.jupiter.api.Test; +import org.hl7.fhir.r5.model.Subscription; +import org.hl7.fhir.r5.model.SubscriptionStatus; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.ValueSource; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class SubscriptionTopicPayloadBuilderR5Test { - private static final String TEST_TOPIC_URL = "test-builder-topic-url"; - FhirContext ourFhirContext = FhirContext.forR5Cached(); - @Test - public void testBuildPayloadDelete() { - // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + private static final String TEST_TOPIC_URL = "test-builder-topic-url"; + FhirContext ourFhirContext = FhirContext.forR5Cached(); + private SubscriptionTopicPayloadBuilder myStPayloadBuilder; + private Encounter myEncounter; + private CanonicalSubscription myCanonicalSubscription; + private ActiveSubscription myActiveSubscription; - // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.DELETE); + @BeforeEach + void before() { + myStPayloadBuilder = new SubscriptionTopicPayloadBuilder(ourFhirContext); + myEncounter = new Encounter(); + myEncounter.setId("Encounter/1"); + myCanonicalSubscription = new CanonicalSubscription(); + myCanonicalSubscription.setTopicSubscription(true); + myActiveSubscription = new ActiveSubscription(myCanonicalSubscription, "test"); + } - // verify - List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); - assertEquals(1, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); + @ParameterizedTest + @ValueSource(strings = { + "full-resource", + "" // payload content not provided + }) + public void testBuildPayload_deleteWithFullResourceContent_returnsCorrectPayload(String thePayloadContent) { + // setup + Subscription.SubscriptionPayloadContent payloadContent = + Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent); + myCanonicalSubscription.getTopicSubscription().setContent(payloadContent); - assertEquals(Bundle.HTTPVerb.DELETE, payload.getEntry().get(1).getRequest().getMethod()); - } + // run + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, RestOperationTypeEnum.DELETE); - @Test - public void testBuildPayloadUpdate() { - // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + // verify Bundle size + assertEquals(2, payload.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); + assertEquals(1, resources.size()); - // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.UPDATE); + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); - // verify - List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); - assertEquals(2, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); - assertEquals("Encounter", resources.get(1).getResourceType().name()); + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertNull(encounterEntry.getResource()); + assertNull(encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, Bundle.HTTPVerb.DELETE.name(), "Encounter/1"); + } - assertEquals(Bundle.HTTPVerb.PUT, payload.getEntry().get(1).getRequest().getMethod()); - } + @ParameterizedTest + @CsvSource({ + "create, POST , full-resource, Encounter/1, Encounter", + "update, PUT , full-resource, Encounter/1, Encounter/1", + "create, POST , , Encounter/1, Encounter", + "update, PUT , , Encounter/1, Encounter/1", + }) + public void testBuildPayload_createUpdateWithFullResourceContent_returnsCorrectPayload(String theRestOperationType, + String theHttpMethod, + String thePayloadContent, + String theFullUrl, + String theRequestUrl) { + // setup + Subscription.SubscriptionPayloadContent payloadContent = + Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent); - @Test - public void testBuildPayloadCreate() { - // setup - var svc = new SubscriptionTopicPayloadBuilder(ourFhirContext); - var encounter = new Encounter(); - encounter.setId("Encounter/1"); - CanonicalSubscription sub = new CanonicalSubscription(); - ActiveSubscription subscription = new ActiveSubscription(sub, "test"); + myCanonicalSubscription.getTopicSubscription().setContent(payloadContent); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); - // run - Bundle payload = (Bundle)svc.buildPayload(List.of(encounter), subscription, TEST_TOPIC_URL, RestOperationTypeEnum.CREATE); + // run + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); - // verify - List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); - assertEquals(2, resources.size()); - assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); - assertEquals("Encounter", resources.get(1).getResourceType().name()); + // verify Bundle size + assertEquals(2, payload.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); + assertEquals(2, resources.size()); - assertEquals(Bundle.HTTPVerb.POST, payload.getEntry().get(1).getRequest().getMethod()); - } + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); + + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertEquals("Encounter", resources.get(1).getResourceType().name()); + assertEquals(myEncounter, resources.get(1)); + assertEquals(theFullUrl, encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, theHttpMethod, theRequestUrl); + } + + @ParameterizedTest + @CsvSource({ + "create, POST , Encounter/1, Encounter", + "update, PUT , Encounter/1, Encounter/1", + "delete, DELETE, , Encounter/1" + }) + public void testBuildPayload_withIdOnlyContent_returnsCorrectPayload(String theRestOperationType, + String theHttpMethod, String theFullUrl, + String theRequestUrl) { + // setup + myCanonicalSubscription.getTopicSubscription().setContent(Subscription.SubscriptionPayloadContent.IDONLY); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); + + // run + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); + + // verify Bundle size + assertEquals(2, payload.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); + assertEquals(1, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + verifySubscriptionStatusNotificationEvent(resources.get(0)); + + // verify Encounter entry + Bundle.BundleEntryComponent encounterEntry = payload.getEntry().get(1); + assertNull(encounterEntry.getResource()); + assertEquals(theFullUrl, encounterEntry.getFullUrl()); + verifyRequestParameters(encounterEntry, theHttpMethod, theRequestUrl); + } + + @ParameterizedTest + @CsvSource({ + "create", + "update", + "delete" + }) + public void testBuildPayload_withEmptyContent_returnsCorrectPayload(String theRestOperationType) { + // setup + myCanonicalSubscription.getTopicSubscription().setContent(Subscription.SubscriptionPayloadContent.EMPTY); + RestOperationTypeEnum restOperationType = RestOperationTypeEnum.forCode(theRestOperationType); + + // run + Bundle payload = (Bundle) myStPayloadBuilder.buildPayload(List.of(myEncounter), myActiveSubscription, TEST_TOPIC_URL, restOperationType); + + // verify Bundle size + assertEquals(1, payload.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(ourFhirContext, payload, Resource.class); + assertEquals(1, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + assertEquals("SubscriptionStatus", resources.get(0).getResourceType().name()); + assertEquals(1, ((SubscriptionStatus) resources.get(0)).getNotificationEvent().size()); + SubscriptionStatus.SubscriptionStatusNotificationEventComponent notificationEvent = + ((SubscriptionStatus) resources.get(0)).getNotificationEventFirstRep(); + assertFalse(notificationEvent.hasFocus()); + } + + private void verifyRequestParameters(Bundle.BundleEntryComponent theEncounterEntry, + String theHttpMethod, String theRequestUrl) { + assertNotNull(theEncounterEntry.getRequest()); + assertEquals(theHttpMethod, theEncounterEntry.getRequest().getMethod().name()); + assertEquals(theRequestUrl, theEncounterEntry.getRequest().getUrl()); + } + + private void verifySubscriptionStatusNotificationEvent(Resource theResource) { + assertEquals("SubscriptionStatus", theResource.getResourceType().name()); + assertEquals(1, ((SubscriptionStatus) theResource).getNotificationEvent().size()); + SubscriptionStatus.SubscriptionStatusNotificationEventComponent notificationEvent = + ((SubscriptionStatus) theResource).getNotificationEventFirstRep(); + assertTrue(notificationEvent.hasFocus()); + assertEquals(myEncounter.getId(), notificationEvent.getFocus().getReference()); + } } diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtilTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtilTest.java index adf5b851055..5915f8e4956 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtilTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/topic/SubscriptionTopicUtilTest.java @@ -1,6 +1,9 @@ package ca.uhn.fhir.jpa.topic; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.jpa.subscription.match.registry.ActiveSubscription; +import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription; +import ca.uhn.fhir.jpa.subscription.model.CanonicalTopicSubscription; import ca.uhn.fhir.rest.server.messaging.BaseResourceMessage; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Bundle; @@ -8,9 +11,12 @@ import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Patient; import org.hl7.fhir.r5.model.Reference; import org.hl7.fhir.r5.model.Resource; +import org.hl7.fhir.r5.model.Subscription; import org.hl7.fhir.r5.model.SubscriptionStatus; import org.hl7.fhir.r5.model.SubscriptionTopic; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; import java.util.List; @@ -21,6 +27,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; class SubscriptionTopicUtilTest { + private static final String TEST_CHANNEL_NAME = "TEST_CHANNEL"; + private final FhirContext myContext = FhirContext.forR5Cached(); @Test @@ -86,4 +94,32 @@ class SubscriptionTopicUtilTest { IBaseResource extractionResult = SubscriptionTopicUtil.extractResourceFromBundle(myContext, new Bundle()); assertNull(extractionResult); } + + @Test + public void testIsEmptyContentTopicSubscription_withEmptySubscription_returnsFalse() { + CanonicalSubscription canonicalSubscription = new CanonicalSubscription(); + boolean result = SubscriptionTopicUtil.isEmptyContentTopicSubscription(canonicalSubscription); + + assertFalse(result); + } + + @ParameterizedTest + @CsvSource({ + "full-resource, false", + "id-only , false", + "empty , true", + " , false", + }) + public void testIsEmptyContentTopicSubscription_withContentPayload_returnsExpectedResult(String thePayloadContent, + boolean theExpectedResult) { + CanonicalTopicSubscription canonicalTopicSubscription = new CanonicalTopicSubscription(); + canonicalTopicSubscription.setContent(Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent)); + CanonicalSubscription canonicalSubscription = new CanonicalSubscription(); + canonicalSubscription.setTopicSubscription(canonicalTopicSubscription); + canonicalSubscription.setTopicSubscription(true); + + boolean actualResult = SubscriptionTopicUtil.isEmptyContentTopicSubscription(canonicalSubscription); + + assertEquals(theExpectedResult, actualResult); + } } diff --git a/hapi-fhir-jpaserver-test-dstu2/pom.xml b/hapi-fhir-jpaserver-test-dstu2/pom.xml index 773adc6b312..d168f8148a2 100644 --- a/hapi-fhir-jpaserver-test-dstu2/pom.xml +++ b/hapi-fhir-jpaserver-test-dstu2/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java index 26b16537848..0786572596e 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2ValueSetTest.java @@ -16,7 +16,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.List; import java.util.stream.Collectors; diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImplTest.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImplTest.java index 5d9c438b7e2..4ec3d81ca2d 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImplTest.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImplTest.java @@ -43,7 +43,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Pageable; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu2Test.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu2Test.java index 563b2627355..a6d637f0f38 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu2Test.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu2Test.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/hapi-fhir-jpaserver-test-dstu3/pom.xml b/hapi-fhir-jpaserver-test-dstu3/pom.xml index 3af365157a4..b23b2ed48f0 100644 --- a/hapi-fhir-jpaserver-test-dstu3/pom.xml +++ b/hapi-fhir-jpaserver-test-dstu3/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java index 2da47c1baed..61f5865c871 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3Test.java @@ -69,7 +69,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemPropertiesTest.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemPropertiesTest.java index 66eaa679850..5ea44c64476 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemPropertiesTest.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3CodeSystemPropertiesTest.java @@ -4,8 +4,12 @@ import ca.uhn.fhir.jpa.model.util.JpaConstants; import ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil; import ca.uhn.fhir.rest.gclient.IOperationUntypedWithInputAndPartialOutput; import org.hl7.fhir.dstu3.model.CodeSystem; +import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent; import org.hl7.fhir.dstu3.model.CodeType; +import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.Parameters; +import org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.dstu3.model.UriType; import org.junit.jupiter.params.ParameterizedTest; @@ -21,8 +25,12 @@ import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCod import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCodeSystemUrl; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyC; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCode; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCodeSystem; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyDisplay; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -30,72 +38,70 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class ResourceProviderDstu3CodeSystemPropertiesTest extends BaseResourceProviderDstu3Test { - public static Stream parametersLookup() { - return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); - } + public static Stream parametersLookup() { + return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); + } - @ParameterizedTest - @MethodSource(value = "parametersLookup") - public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { - // setup - CodeSystem codeSystem = new CodeSystem(); - codeSystem.setId(ourCodeSystemId); - codeSystem.setUrl(ourCodeSystemUrl); - CodeSystem.ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode); - CodeSystem.ConceptPropertyComponent propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA)); - concept.addProperty(propertyComponent); - propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB)); - concept.addProperty(propertyComponent); - myCodeSystemDao.create(codeSystem, mySrd); + @ParameterizedTest + @MethodSource(value = "parametersLookup") + public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { + // setup + CodeSystem codeSystem = new CodeSystem(); + codeSystem.setId(ourCodeSystemId); + codeSystem.setUrl(ourCodeSystemUrl); + ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyC).setValue(new Coding(propertyCodeSystem, propertyCode, propertyDisplay))); + myCodeSystemDao.create(codeSystem, mySrd); - // test - IOperationUntypedWithInputAndPartialOutput respParam = myClient - .operation() - .onType(CodeSystem.class) - .named(JpaConstants.OPERATION_LOOKUP) - .withParameter(Parameters.class, "code", new CodeType(ourCode)) - .andParameter("system", new UriType(ourCodeSystemUrl)); + // test + IOperationUntypedWithInputAndPartialOutput respParam = myClient + .operation() + .onType(CodeSystem.class) + .named(JpaConstants.OPERATION_LOOKUP) + .withParameter(Parameters.class, "code", new CodeType(ourCode)) + .andParameter("system", new UriType(ourCodeSystemUrl)); - theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); - Parameters parameters = respParam.execute(); + theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); + Parameters parameters = respParam.execute(); - Iterator paramIterator = parameters.getParameter().iterator(); - Parameters.ParametersParameterComponent parameter = null; - while (paramIterator.hasNext()) { - Parameters.ParametersParameterComponent currentParameter = paramIterator.next(); - if (currentParameter.getName().equals("property")) { - parameter = currentParameter; - break; - } - } + Iterator paramIterator = parameters.getParameter().iterator(); + ParametersParameterComponent parameter = null; + while (paramIterator.hasNext()) { + ParametersParameterComponent currentParameter = paramIterator.next(); + if (currentParameter.getName().equals("property")) { + parameter = currentParameter; + break; + } + } - if (theExpectedReturnedProperties.isEmpty()) { - assertNull(parameter); - return; - } + // verify + if (theExpectedReturnedProperties.isEmpty()) { + assertNull(parameter); + return; + } - Iterator propertyIterator = concept.getProperty().stream() - .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); + Iterator propertyIterator = concept.getProperty().stream() + .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); - while (propertyIterator.hasNext()) { - CodeSystem.ConceptPropertyComponent property = propertyIterator.next(); - assertNotNull(parameter); + while (propertyIterator.hasNext()) { + ConceptPropertyComponent property = propertyIterator.next(); + assertNotNull(parameter); - Iterator parameterPartIterator = parameter.getPart().iterator(); + Iterator parameterPartIterator = parameter.getPart().iterator(); - parameter = parameterPartIterator.next(); - assertEquals("code", parameter.getName()); - assertEquals(property.getCode(), ((CodeType)parameter.getValue()).getValue()); + parameter = parameterPartIterator.next(); + assertEquals("code", parameter.getName()); + assertEquals(property.getCode(), ((CodeType) parameter.getValue()).getValue()); - parameter = parameterPartIterator.next(); - assertEquals("value", parameter.getName()); - assertTrue(property.getValue().equalsShallow(parameter.getValue())); + parameter = parameterPartIterator.next(); + assertEquals("value", parameter.getName()); + assertTrue(property.getValue().equalsShallow(parameter.getValue())); - if (paramIterator.hasNext()) { - parameter = paramIterator.next(); - } - } - } + if (paramIterator.hasNext()) { + parameter = paramIterator.next(); + } + } + } } diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java index 5bee62a6211..a5baecc2e3b 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetTest.java @@ -43,7 +43,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java index 888cd3b2497..aeb4cc7328c 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3ValueSetVersionedTest.java @@ -40,7 +40,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu3Test.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu3Test.java index 730cb5c13fb..de033a89c7b 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu3Test.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestDstu3Test.java @@ -51,7 +51,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java index b36ee053d6e..1eeff788b9f 100644 --- a/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java +++ b/hapi-fhir-jpaserver-test-dstu3/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplDstu3Test.java @@ -32,7 +32,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/hapi-fhir-jpaserver-test-r4/pom.xml b/hapi-fhir-jpaserver-test-r4/pom.xml index f284432c58c..fbcdfb36f6e 100644 --- a/hapi-fhir-jpaserver-test-r4/pom.xml +++ b/hapi-fhir-jpaserver-test-r4/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2CoordinatorIT.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2CoordinatorIT.java index 8b20ca42b83..1114a7e4d58 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2CoordinatorIT.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2CoordinatorIT.java @@ -42,7 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Sort; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceDatabaseIT.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceDatabaseIT.java index b483c06fad4..8030e908f5a 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceDatabaseIT.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceDatabaseIT.java @@ -39,7 +39,7 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.support.ChannelInterceptor; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceIT.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceIT.java index bb7797a39fa..6f989437e6e 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceIT.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/Batch2JobMaintenanceIT.java @@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImplTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImplTest.java index 34ea4fec283..c2cdca398fb 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImplTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/batch2/JpaJobPersistenceImplTest.java @@ -35,7 +35,7 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.transaction.PlatformTransactionManager; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportTest.java index 72b994d4703..b11c35d5f0f 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkDataExportTest.java @@ -70,7 +70,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkExportUseCaseTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkExportUseCaseTest.java index 9d1c1ee1421..e1f05e2de11 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkExportUseCaseTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/BulkExportUseCaseTest.java @@ -61,7 +61,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java index c7c7bb69969..405d6b2bc5b 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/bulk/imprt/svc/BulkDataImportR4Test.java @@ -44,7 +44,7 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.support.ExecutorChannelInterceptor; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDaoTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDaoTest.java index 371091d3d62..088b7504609 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDaoTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDaoTest.java @@ -29,7 +29,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.support.TransactionSynchronizationManager; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityExistsException; import jakarta.persistence.EntityManager; import jakarta.persistence.NoResultException; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDaoTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDaoTest.java index 7fdd962e5c0..6aff8e400a7 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDaoTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDaoTest.java @@ -65,7 +65,7 @@ class BaseHapiFhirResourceDaoTest { private IRequestPartitionHelperSvc myRequestPartitionHelperSvc; @Mock - private IIdHelperService myIdHelperService; + private IIdHelperService myIdHelperService; @Mock private EntityManager myEntityManager; @@ -86,10 +86,10 @@ class BaseHapiFhirResourceDaoTest { private ISearchParamRegistry mySearchParamRegistry; @Mock - private SearchBuilderFactory mySearchBuilderFactory; + private SearchBuilderFactory mySearchBuilderFactory; @Mock - private ISearchBuilder myISearchBuilder; + private ISearchBuilder myISearchBuilder; @Captor private ArgumentCaptor mySearchParameterMapCaptor; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportFromValidationChainTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportFromValidationChainTest.java index 995270607d2..599d026abec 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportFromValidationChainTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/JpaPersistedResourceValidationSupportFromValidationChainTest.java @@ -26,7 +26,7 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.util.ReflectionTestUtils; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.function.Predicate; import static ca.uhn.fhir.util.ClasspathUtil.loadResource; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ComboUniqueParamIT.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ComboUniqueParamIT.java index 65dec5ee11c..06d8176a729 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ComboUniqueParamIT.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ComboUniqueParamIT.java @@ -44,7 +44,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Collections; import java.util.List; import java.util.UUID; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConceptMapTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConceptMapTest.java index 8e51cf917d6..da57450eb99 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConceptMapTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConceptMapTest.java @@ -29,7 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Collections; import java.util.HashSet; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java index 6756c8c0472..f2c80276000 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4ConcurrentWriteTest.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.DirtiesContext; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4HistoryRewriteTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4HistoryRewriteTest.java index 98d6761fa83..fdce11ad76c 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4HistoryRewriteTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4HistoryRewriteTest.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Date; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java index 77d17e0e3f0..fb828747880 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java @@ -93,7 +93,7 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; import org.springframework.util.comparator.ComparableComparator; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java index 8e92cde712f..6140b4c69c5 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4SearchPageExpiryTest.java @@ -29,7 +29,7 @@ import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.concurrent.atomic.AtomicLong; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsInlineTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsInlineTest.java index 02d829a3b11..0ca7116f5b2 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsInlineTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsInlineTest.java @@ -12,7 +12,7 @@ import org.hl7.fhir.r4.model.SearchParameter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static ca.uhn.fhir.jpa.dao.r4.FhirResourceDaoR4TagsTest.toProfiles; import static ca.uhn.fhir.jpa.dao.r4.FhirResourceDaoR4TagsTest.toSecurityLabels; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java index 20fb40ba531..ae5c099e611 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java @@ -18,7 +18,7 @@ import org.hl7.fhir.r4.model.SearchParameter; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.stream.Collectors; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java index 988421f7cc7..9d48781b40b 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java @@ -90,7 +90,7 @@ import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/ThreadSafeResourceDeleterSvcTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/ThreadSafeResourceDeleterSvcTest.java index 7f6ba9f9292..359faa820e0 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/ThreadSafeResourceDeleterSvcTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/ThreadSafeResourceDeleterSvcTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexTestHelper.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexTestHelper.java index a556bda3e08..9ed3490580f 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexTestHelper.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/delete/job/ReindexTestHelper.java @@ -27,7 +27,7 @@ import org.hl7.fhir.r4.model.StringType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; public class ReindexTestHelper { diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/interceptor/ResponseTerminologyTranslationInterceptorTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/interceptor/ResponseTerminologyTranslationInterceptorTest.java index f9967311119..f2ab212a437 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/interceptor/ResponseTerminologyTranslationInterceptorTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/interceptor/ResponseTerminologyTranslationInterceptorTest.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.List; import java.util.Map; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/JpaPackageCacheTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/JpaPackageCacheTest.java index 3ca0078506c..fdad3b86b7d 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/JpaPackageCacheTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/JpaPackageCacheTest.java @@ -177,6 +177,9 @@ public class JpaPackageCacheTest extends BaseJpaR4Test { // The package has the ID in lower-case, so for the test we input the first parameter in upper-case & check that no error is thrown assertDoesNotThrow(() -> myPackageCacheManager.addPackageToCache(packageNameUppercase, "0.2.0", stream, "hl7.fhir.us.davinci-cdex")); + + // Ensure uninstalling it also works! + assertDoesNotThrow(() -> myPackageCacheManager.uninstallPackage(packageNameUppercase, "0.2.0")); } @Test diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplCreateTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplCreateTest.java index 25d450771d7..2000ef23918 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplCreateTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/packages/PackageInstallerSvcImplCreateTest.java @@ -17,7 +17,7 @@ import org.hl7.fhir.utilities.npm.PackageGenerator; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/partition/PartitionManagementProviderTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/partition/PartitionManagementProviderTest.java index cbafec0d2ea..792b64985bc 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/partition/PartitionManagementProviderTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/partition/PartitionManagementProviderTest.java @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchApplyR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchApplyR4Test.java index 87eb166506f..87693e434b6 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchApplyR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchApplyR4Test.java @@ -29,8 +29,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.test.util.XmlExpectationsHelper; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.stream.Collectors; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java deleted file mode 100644 index fc2cad47867..00000000000 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/PatientMemberMatchOperationR4Test.java +++ /dev/null @@ -1,440 +0,0 @@ -package ca.uhn.fhir.jpa.provider.r4; - -import ca.uhn.fhir.jpa.api.config.JpaStorageSettings; -import ca.uhn.fhir.jpa.provider.BaseResourceProviderR4Test; -import ca.uhn.fhir.parser.StrictErrorHandler; -import ca.uhn.fhir.rest.api.Constants; -import ca.uhn.fhir.rest.api.EncodingEnum; -import ca.uhn.fhir.rest.client.apache.ResourceEntity; -import ca.uhn.fhir.util.ParametersUtil; -import com.google.common.collect.Lists; -import org.apache.commons.io.IOUtils; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.hl7.fhir.instance.model.api.IBase; -import org.hl7.fhir.r4.model.*; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import static ca.uhn.fhir.rest.api.Constants.*; -import static ca.uhn.fhir.rest.api.Constants.PARAM_MEMBER_IDENTIFIER; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.assertTrue; - -@SuppressWarnings("Duplicates") -public class PatientMemberMatchOperationR4Test extends BaseResourceProviderR4Test { - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PatientMemberMatchOperationR4Test.class); - - private static final String ourQuery = "/Patient/$member-match?_format=json"; - private static final String PATIENT_ID = "Patient/A123"; - private static final String EXISTING_COVERAGE_ID = "cov-id-123"; - private static final String EXISTING_COVERAGE_IDENT_SYSTEM = "http://centene.com/insurancePlanIds"; - private static final String EXISTING_COVERAGE_IDENT_VALUE = "U1234567890"; - private static final String EXISTING_COVERAGE_PATIENT_IDENT_SYSTEM = "http://oldhealthplan.example.com"; - private static final String EXISTING_COVERAGE_PATIENT_IDENT_VALUE = "DHU-55678"; - private static final String CONSENT_POLICY_SENSITIVE_DATA_URI = "http://hl7.org/fhir/us/davinci-hrex/StructureDefinition-hrex-consent.html#sensitive"; - private static final String CONSENT_POLICY_REGULAR_DATA_URI = "http://hl7.org/fhir/us/davinci-hrex/StructureDefinition-hrex-consent.html#regular"; - - private Identifier ourExistingCoverageIdentifier; - private Patient myPatient; - private Coverage coverageToMatch; // Old Coverage (must match field) - private Coverage coverageToLink; - private Consent myConsent; - - @Autowired - MemberMatcherR4Helper myMemberMatcherR4Helper; - - @Autowired - MemberMatchR4ResourceProvider theMemberMatchR4ResourceProvider; - - @BeforeEach - public void beforeDisableResultReuse() { - myStorageSettings.setReuseCachedSearchResultsForMillis(null); - } - - @Override - @AfterEach - public void after() throws Exception { - super.after(); - myStorageSettings.setReuseCachedSearchResultsForMillis(new JpaStorageSettings().getReuseCachedSearchResultsForMillis()); - myStorageSettings.setEverythingIncludesFetchPageSize(new JpaStorageSettings().getEverythingIncludesFetchPageSize()); - myStorageSettings.setSearchPreFetchThresholds(new JpaStorageSettings().getSearchPreFetchThresholds()); - myStorageSettings.setAllowExternalReferences(new JpaStorageSettings().isAllowExternalReferences()); - myServer.getRestfulServer().unregisterProvider(theMemberMatchR4ResourceProvider); - } - - @Override - @BeforeEach - public void before() throws Exception { - super.before(); - myFhirContext.setParserErrorHandler(new StrictErrorHandler()); - myPatient = (Patient) new Patient().setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily("Person"))) - .setBirthDateElement(new DateType("2020-01-01")) - .setId(PATIENT_ID); - - // Old Coverage (must match field) - coverageToMatch = (Coverage) new Coverage() - .setId(EXISTING_COVERAGE_ID); - - // New Coverage (must return unchanged) - coverageToLink = (Coverage) new Coverage() - .setIdentifier(Lists.newArrayList(new Identifier().setSystem("http://newealthplan.example.com").setValue("234567"))) - .setId("AA87654"); - - myConsent = new Consent() - .setStatus(Consent.ConsentState.ACTIVE) - .setScope(new CodeableConcept().addCoding(new Coding("http://terminology.hl7.org/CodeSystem/consentscope", "patient-privacy", null))) - .addPolicy(new Consent.ConsentPolicyComponent().setUri(CONSENT_POLICY_SENSITIVE_DATA_URI)) - .setPatient(new Reference(PATIENT_ID)) - .addPerformer(new Reference(PATIENT_ID)); - myServer.getRestfulServer().registerProvider(theMemberMatchR4ResourceProvider); - myMemberMatcherR4Helper.setRegularFilterSupported(false); - } - - private void createCoverageWithBeneficiary( - boolean theAssociateBeneficiaryPatient, boolean includeBeneficiaryIdentifier) { - - Patient member = new Patient(); - if (theAssociateBeneficiaryPatient) { - // Patient - member.setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily("Person"))) - .setBirthDateElement(new DateType("2020-01-01")) - .setId(PATIENT_ID); - if (includeBeneficiaryIdentifier) { - member.setIdentifier(Collections.singletonList(new Identifier() - .setSystem(EXISTING_COVERAGE_PATIENT_IDENT_SYSTEM).setValue(EXISTING_COVERAGE_PATIENT_IDENT_VALUE))); - } - member.setActive(true); - myClient.update().resource(member).execute(); - } - - // Coverage - ourExistingCoverageIdentifier = new Identifier() - .setSystem(EXISTING_COVERAGE_IDENT_SYSTEM).setValue(EXISTING_COVERAGE_IDENT_VALUE); - Coverage ourExistingCoverage = (Coverage) new Coverage() - .setStatus(Coverage.CoverageStatus.ACTIVE) - .setIdentifier(Collections.singletonList(ourExistingCoverageIdentifier)); - - if (theAssociateBeneficiaryPatient) { - ourExistingCoverage.setBeneficiary(new Reference(member)) - .setId(EXISTING_COVERAGE_ID); - } - - myClient.create().resource(ourExistingCoverage).execute().getId().toUnqualifiedVersionless().getValue(); - } - - @Test - public void testCoverageNoBeneficiaryReturns422() throws Exception { - createCoverageWithBeneficiary(false, false); - - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Could not find beneficiary for coverage."); - } - - @Test - public void testCoverageBeneficiaryNoIdentifierReturns422() throws Exception { - createCoverageWithBeneficiary(true, false); - - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Coverage beneficiary does not have an identifier."); - } - - @Test - public void testCoverageNoMatchingPatientFamilyNameReturns422() throws Exception { - createCoverageWithBeneficiary(true, true); - - myPatient.setName(Lists.newArrayList(new HumanName().setUse(HumanName.NameUse.OFFICIAL).setFamily("Smith"))); - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Could not find matching patient for coverage."); - } - - @Test - public void testCoverageNoMatchingPatientBirthdateReturns422() throws Exception { - createCoverageWithBeneficiary(true, false); - - myPatient.setBirthDateElement(new DateType("2000-01-01")); - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Could not find matching patient for coverage."); - } - - @Test - public void testRegularContentProfileAccessWithRegularNotAllowedReturns422() throws Exception { - createCoverageWithBeneficiary(true, true); - myConsent.getPolicy().get(0).setUri(CONSENT_POLICY_REGULAR_DATA_URI); - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Consent policy does not match the data release segmentation capabilities."); - } - - @Test - public void testSensitiveContentProfileAccessWithRegularNotAllowed() throws Exception { - createCoverageWithBeneficiary(true, true); - - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - Parameters parametersResponse = performOperation(myServerBase + ourQuery, - EncodingEnum.JSON, inputParameters); - - validateMemberIdentifier(parametersResponse); - } - - @Test - public void testRegularContentProfileAccessWithRegularAllowed() throws Exception { - createCoverageWithBeneficiary(true, true); - myConsent.getPolicy().get(0).setUri(CONSENT_POLICY_REGULAR_DATA_URI); - myMemberMatcherR4Helper.setRegularFilterSupported(true); - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - Parameters parametersResponse = performOperation(myServerBase + ourQuery, - EncodingEnum.JSON, inputParameters); - - validateMemberIdentifier(parametersResponse); - } - - /** - * Validates that second resource from the response is same as the received coverage - */ - private void validateNewCoverage(Parameters theResponse, Coverage theOriginalCoverage) { - List patientList = ParametersUtil.getNamedParameters(this.getFhirContext(), theResponse, COVERAGE_TO_LINK); - assertEquals(1, patientList.size()); - Coverage respCoverage = (Coverage) theResponse.getParameter().get(1).getResource(); - - assertEquals("Coverage/" + theOriginalCoverage.getId(), respCoverage.getId()); - assertEquals(theOriginalCoverage.getIdentifierFirstRep().getSystem(), respCoverage.getIdentifierFirstRep().getSystem()); - assertEquals(theOriginalCoverage.getIdentifierFirstRep().getValue(), respCoverage.getIdentifierFirstRep().getValue()); - } - - private void validateConsentPatientAndPerformerRef(Patient thePatient, Consent theConsent) { - String patientRef = thePatient.getIdElement().toUnqualifiedVersionless().getValue(); - assertEquals(patientRef, theConsent.getPatient().getReference()); - assertEquals(patientRef, theConsent.getPerformer().get(0).getReference()); - } - - private void validateMemberPatient(Parameters response) { -// parameter MemberPatient must have a new identifier with: -// { -// "use": "usual", -// "type": { -// "coding": [ -// { -// "system": "http://terminology.hl7.org/CodeSystem/v2-0203", -// "code": "UMB", -// "display": "Member Number", -// "userSelected": false -// } -// ], -// "text": "Member Number" -// }, -// "system": COVERAGE_PATIENT_IDENT_SYSTEM, -// "value": COVERAGE_PATIENT_IDENT_VALUE -// } - List patientList = ParametersUtil.getNamedParameters(this.getFhirContext(), response, PARAM_MEMBER_PATIENT); - assertEquals(1, patientList.size()); - Patient resultPatient = (Patient) response.getParameter().get(0).getResource(); - - assertNotNull(resultPatient.getIdentifier()); - assertEquals(1, resultPatient.getIdentifier().size()); - Identifier addedIdentifier = resultPatient.getIdentifier().get(0); - assertEquals(Identifier.IdentifierUse.USUAL, addedIdentifier.getUse()); - checkCoding(addedIdentifier.getType()); - assertEquals(EXISTING_COVERAGE_PATIENT_IDENT_SYSTEM, addedIdentifier.getSystem()); - assertEquals(EXISTING_COVERAGE_PATIENT_IDENT_VALUE, addedIdentifier.getValue()); - } - - /** - * validates that the returned patient ID is correct - */ - private void validateMemberIdentifier(Parameters theResponse){ - assertTrue(theResponse.hasParameter(PARAM_MEMBER_IDENTIFIER)); - Optional memberIdentifierOptional = ParametersUtil.getNamedParameter(this.getFhirContext(), theResponse, PARAM_MEMBER_IDENTIFIER); - assertTrue(memberIdentifierOptional.isPresent()); - IdType memberIdentifier = (IdType) ((Parameters.ParametersParameterComponent) memberIdentifierOptional.get()).getValue(); - assertEquals(PATIENT_ID, memberIdentifier.getValue()); - } - - @Test - public void testNoCoverageMatchFound() throws Exception { - Parameters inputParameters = buildInputParameters(myPatient, coverageToMatch, coverageToLink, myConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Could not find coverage for member"); - } - - private Parameters buildInputParameters(Patient thePatient, Coverage theOldCoverage, Coverage theNewCoverage, Consent theConsent) { - Parameters p = new Parameters(); - ParametersUtil.addParameterToParameters(this.getFhirContext(), p, PARAM_MEMBER_PATIENT, thePatient); - ParametersUtil.addParameterToParameters(this.getFhirContext(), p, COVERAGE_TO_MATCH, theOldCoverage); - ParametersUtil.addParameterToParameters(this.getFhirContext(), p, COVERAGE_TO_LINK, theNewCoverage); - ParametersUtil.addParameterToParameters(this.getFhirContext(), p, PARAM_CONSENT, theConsent); - return p; - } - - private Parameters performOperation(String theUrl, - EncodingEnum theEncoding, Parameters theInputParameters) throws Exception { - - HttpPost post = new HttpPost(theUrl); - post.addHeader(Constants.HEADER_ACCEPT_ENCODING, theEncoding.toString()); - post.setEntity(new ResourceEntity(this.getFhirContext(), theInputParameters)); - ourLog.info("Request: {}", post); - try (CloseableHttpResponse response = ourHttpClient.execute(post)) { - String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); - ourLog.info("Response: {}", responseString); - assertEquals(200, response.getStatusLine().getStatusCode()); - - return theEncoding.newParser(myFhirContext).parseResource(Parameters.class, - responseString); - } - } - - private void performOperationExpecting422(String theUrl, EncodingEnum theEncoding, - Parameters theInputParameters, String theExpectedErrorMsg) throws Exception { - - HttpPost post = new HttpPost(theUrl); - post.addHeader(Constants.HEADER_ACCEPT_ENCODING, theEncoding.toString()); - post.setEntity(new ResourceEntity(this.getFhirContext(), theInputParameters)); - ourLog.info("Request: {}", post); - try (CloseableHttpResponse response = ourHttpClient.execute(post)) { - String responseString = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); - ourLog.info("Response: {}", responseString); - assertEquals(422, response.getStatusLine().getStatusCode()); - assertThat(responseString, containsString(theExpectedErrorMsg)); - } - } - - private void checkCoding(CodeableConcept theType) { - // must match: - // "coding": [ - // { - // "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - // "code": "MB", - // "display": "Member Number", - // "userSelected": false - // } - // * ] - Coding coding = theType.getCoding().get(0); - assertEquals("http://terminology.hl7.org/CodeSystem/v2-0203", coding.getSystem()); - assertEquals("MB", coding.getCode()); - assertEquals("Member Number", coding.getDisplay()); - assertFalse(coding.getUserSelected()); - } - - /** - * Validates that consent from the response is same as the received consent with additional identifier and extension - */ - private Consent validateResponseConsent(Parameters theResponse, Consent theOriginalConsent) { - List consentList = ParametersUtil.getNamedParameters(this.getFhirContext(), theResponse, PARAM_CONSENT); - assertEquals(1, consentList.size()); - Consent respConsent = (Consent) theResponse.getParameter().get(2).getResource(); - - assertEquals(theOriginalConsent.getScope().getCodingFirstRep().getSystem(), respConsent.getScope().getCodingFirstRep().getSystem()); - assertEquals(theOriginalConsent.getScope().getCodingFirstRep().getCode(), respConsent.getScope().getCodingFirstRep().getCode()); - assertEquals(myMemberMatcherR4Helper.CONSENT_IDENTIFIER_CODE_SYSTEM, respConsent.getIdentifier().get(0).getSystem()); - assertNotNull(respConsent.getIdentifier().get(0).getValue()); - return respConsent; - } - - @Nested - public class ValidateParameterErrors { - private Patient ourPatient; - private Coverage ourOldCoverage; - private Coverage ourNewCoverage; - private Consent ourConsent; - - @BeforeEach - public void beforeValidateParameterErrors() { - ourPatient = new Patient().setGender(Enumerations.AdministrativeGender.FEMALE); - - ourOldCoverage = new Coverage(); - ourOldCoverage.setId(EXISTING_COVERAGE_ID); - - ourNewCoverage = new Coverage(); - ourNewCoverage.setId("AA87654"); - ourNewCoverage.setIdentifier(Lists.newArrayList( - new Identifier().setSystem("http://newealthplan.example.com").setValue("234567"))); - - ourConsent = new Consent(); - ourConsent.setStatus(Consent.ConsentState.ACTIVE); - } - - @Test - public void testInvalidPatient() throws Exception { - Parameters inputParameters = buildInputParameters(new Patient(), ourOldCoverage, ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_MEMBER_PATIENT + "\\\" is required."); - } - - @Test - public void testInvalidOldCoverage() throws Exception { - Parameters inputParameters = buildInputParameters(ourPatient, new Coverage(), ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + COVERAGE_TO_MATCH + "\\\" is required."); - } - - @Test - public void testInvalidNewCoverage() throws Exception { - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, new Coverage(), ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + COVERAGE_TO_LINK + "\\\" is required."); - } - - @Test - public void testInvalidConsent() throws Exception { - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, ourNewCoverage, new Consent()); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_CONSENT + "\\\" is required."); - } - - @Test - public void testMissingPatientFamilyName() throws Exception { - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_MEMBER_PATIENT_NAME + "\\\" is required."); - } - - @Test - public void testMissingPatientBirthdate() throws Exception { - ourPatient.setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily("Person"))); - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_MEMBER_PATIENT_BIRTHDATE + "\\\" is required."); - } - - @Test - public void testMissingConsentPatientReference() throws Exception { - ourPatient.setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily("Person"))) - .setBirthDateElement(new DateType("2020-01-01")); - - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_CONSENT_PATIENT_REFERENCE + "\\\" is required."); - } - - @Test - public void testMissingConsentPerformerReference() throws Exception { - ourPatient.setName(Lists.newArrayList(new HumanName() - .setUse(HumanName.NameUse.OFFICIAL).setFamily("Person"))) - .setBirthDateElement(new DateType("2020-01-01")); - - ourConsent.setPatient(new Reference("Patient/1")); - Parameters inputParameters = buildInputParameters(ourPatient, ourOldCoverage, ourNewCoverage, ourConsent); - performOperationExpecting422(myServerBase + ourQuery, EncodingEnum.JSON, inputParameters, - "Parameter \\\"" + PARAM_CONSENT_PERFORMER_REFERENCE + "\\\" is required."); - } - } - -} diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/RemoteTerminologyServiceResourceProviderR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/RemoteTerminologyServiceResourceProviderR4Test.java index 4e543edd508..823438e450e 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/RemoteTerminologyServiceResourceProviderR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/RemoteTerminologyServiceResourceProviderR4Test.java @@ -5,13 +5,11 @@ import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.Operation; import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.annotation.RequiredParam; -import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum; import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; -import ca.uhn.fhir.rest.param.UriParam; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; +import jakarta.servlet.http.HttpServletRequest; import org.hl7.fhir.common.hapi.validation.support.RemoteTerminologyServiceValidationSupport; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.BooleanType; @@ -27,10 +25,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import jakarta.servlet.http.HttpServletRequest; -import java.util.List; - import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; /* @@ -45,18 +42,18 @@ public class RemoteTerminologyServiceResourceProviderR4Test { private static final String VALUE_SET_URL = "http://value.set/url"; private static final String SAMPLE_MESSAGE = "This is a sample message"; private static final FhirContext ourCtx = FhirContext.forR4Cached(); - private MyCodeSystemProvider myCodeSystemProvider = new MyCodeSystemProvider(); - private MyValueSetProvider myValueSetProvider = new MyValueSetProvider(); + private static final MyCodeSystemProvider ourCodeSystemProvider = new MyCodeSystemProvider(); + private static final MyValueSetProvider ourValueSetProvider = new MyValueSetProvider(); @RegisterExtension - public RestfulServerExtension myRestfulServerExtension = new RestfulServerExtension(ourCtx, myCodeSystemProvider, - myValueSetProvider); + public static RestfulServerExtension ourRestfulServerExtension = new RestfulServerExtension(ourCtx, ourCodeSystemProvider, + ourValueSetProvider); private RemoteTerminologyServiceValidationSupport mySvc; @BeforeEach public void before_ConfigureService() { - String myBaseUrl = "http://localhost:" + myRestfulServerExtension.getPort(); + String myBaseUrl = "http://localhost:" + ourRestfulServerExtension.getPort(); mySvc = new RemoteTerminologyServiceValidationSupport(ourCtx, myBaseUrl); mySvc.addClientInterceptor(new LoggingInterceptor(false).setLogRequestSummary(true).setLogResponseSummary(true)); } @@ -64,7 +61,7 @@ public class RemoteTerminologyServiceResourceProviderR4Test { @AfterEach public void after_UnregisterProviders() { ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.ONCE); - myRestfulServerExtension.getRestfulServer().getInterceptorService().unregisterAllInterceptors(); + ourRestfulServerExtension.getRestfulServer().getInterceptorService().unregisterAllInterceptors(); } @Test @@ -80,12 +77,13 @@ public class RemoteTerminologyServiceResourceProviderR4Test { IValidationSupport.CodeValidationResult outcome = mySvc .validateCode(null, null, CODE_SYSTEM, CODE, null, null); + assertNotNull(outcome); assertEquals(CODE, outcome.getCode()); - assertEquals(null, outcome.getSeverity()); - assertEquals(null, outcome.getMessage()); + assertNull(outcome.getSeverity()); + assertNull(outcome.getMessage()); - assertEquals(CODE, myCodeSystemProvider.myLastCode.getCode()); - assertEquals(CODE_SYSTEM, myCodeSystemProvider.myLastUrl.getValueAsString()); + assertEquals(CODE, ourCodeSystemProvider.myLastCode.getCode()); + assertEquals(CODE_SYSTEM, ourCodeSystemProvider.myLastUrl.getValueAsString()); } @Test @@ -94,15 +92,16 @@ public class RemoteTerminologyServiceResourceProviderR4Test { IValidationSupport.CodeValidationResult outcome = mySvc .validateCode(null, null, CODE_SYSTEM, CODE, DISPLAY, null); + assertNotNull(outcome); assertEquals(CODE, outcome.getCode()); assertEquals(DISPLAY, outcome.getDisplay()); - assertEquals(null, outcome.getSeverity()); - assertEquals(null, outcome.getMessage()); + assertNull(outcome.getSeverity()); + assertNull(outcome.getMessage()); - assertEquals(CODE, myCodeSystemProvider.myLastCode.getCode()); - assertEquals(DISPLAY, myCodeSystemProvider.myLastDisplay.getValue()); - assertEquals(CODE_SYSTEM, myCodeSystemProvider.myLastUrl.getValueAsString()); - assertEquals(SAMPLE_MESSAGE, myCodeSystemProvider.myNextReturnParams.getParameterValue("message").toString()); + assertEquals(CODE, ourCodeSystemProvider.myLastCode.getCode()); + assertEquals(DISPLAY, ourCodeSystemProvider.myLastDisplay.getValue()); + assertEquals(CODE_SYSTEM, ourCodeSystemProvider.myLastUrl.getValueAsString()); + assertEquals(SAMPLE_MESSAGE, ourCodeSystemProvider.myNextReturnParams.getParameterValue("message").toString()); } @Test @@ -111,65 +110,58 @@ public class RemoteTerminologyServiceResourceProviderR4Test { IValidationSupport.CodeValidationResult outcome = mySvc .validateCode(null, null, CODE_SYSTEM, CODE, null, null); + assertNotNull(outcome); assertEquals(IValidationSupport.IssueSeverity.ERROR, outcome.getSeverity()); assertEquals(SAMPLE_MESSAGE, outcome.getMessage()); - assertEquals(false, ((BooleanType)myCodeSystemProvider.myNextReturnParams.getParameterValue("result")).booleanValue()); + assertFalse(((BooleanType) ourCodeSystemProvider.myNextReturnParams.getParameterValue("result")).booleanValue()); } @Test public void testValidateCodeInValueSet_ProvidingMinimalInputs_ReturnsSuccess() { - createNextValueSetReturnParameters(true, null, null); + ourValueSetProvider.myNextReturnParams = new Parameters().addParameter("result", true); IValidationSupport.CodeValidationResult outcome = mySvc .validateCode(null, null, CODE_SYSTEM, CODE, null, VALUE_SET_URL); + assertNotNull(outcome); assertEquals(CODE, outcome.getCode()); - assertEquals(null, outcome.getSeverity()); - assertEquals(null, outcome.getMessage()); + assertNull(outcome.getSeverity()); + assertNull(outcome.getMessage()); - assertEquals(CODE, myValueSetProvider.myLastCode.getCode()); - assertEquals(VALUE_SET_URL, myValueSetProvider.myLastUrl.getValueAsString()); + assertEquals(CODE, ourValueSetProvider.myLastCode.getCode()); + assertEquals(VALUE_SET_URL, ourValueSetProvider.myLastUrl.getValueAsString()); } @Test public void testValidateCodeInValueSet_WithMessageValue_ReturnsMessage() { - createNextValueSetReturnParameters(true, DISPLAY, SAMPLE_MESSAGE); + ourValueSetProvider.myNextReturnParams = new Parameters().addParameter("result", true) + .addParameter("display", DISPLAY) + .addParameter("message", SAMPLE_MESSAGE); IValidationSupport.CodeValidationResult outcome = mySvc .validateCode(null, null, CODE_SYSTEM, CODE, DISPLAY, VALUE_SET_URL); + assertNotNull(outcome); assertEquals(CODE, outcome.getCode()); assertEquals(DISPLAY, outcome.getDisplay()); - assertEquals(null, outcome.getSeverity()); - assertEquals(null, outcome.getMessage()); + assertNull(outcome.getSeverity()); + assertNull(outcome.getMessage()); - assertEquals(CODE, myValueSetProvider.myLastCode.getCode()); - assertEquals(DISPLAY, myValueSetProvider.myLastDisplay.getValue()); - assertEquals(VALUE_SET_URL, myValueSetProvider.myLastUrl.getValueAsString()); - assertEquals(SAMPLE_MESSAGE, myValueSetProvider.myNextReturnParams.getParameterValue("message").toString()); + assertEquals(CODE, ourValueSetProvider.myLastCode.getCode()); + assertEquals(DISPLAY, ourValueSetProvider.myLastDisplay.getValue()); + assertEquals(VALUE_SET_URL, ourValueSetProvider.myLastUrl.getValueAsString()); + assertEquals(SAMPLE_MESSAGE, ourValueSetProvider.myNextReturnParams.getParameterValue("message").toString()); } private void createNextCodeSystemReturnParameters(boolean theResult, String theDisplay, String theMessage) { - myCodeSystemProvider.myNextReturnParams = new Parameters(); - myCodeSystemProvider.myNextReturnParams.addParameter("result", theResult); - myCodeSystemProvider.myNextReturnParams.addParameter("display", theDisplay); + ourCodeSystemProvider.myNextReturnParams = new Parameters(); + ourCodeSystemProvider.myNextReturnParams.addParameter("result", theResult); + ourCodeSystemProvider.myNextReturnParams.addParameter("display", theDisplay); if (theMessage != null) { - myCodeSystemProvider.myNextReturnParams.addParameter("message", theMessage); - } - } - - private void createNextValueSetReturnParameters(boolean theResult, String theDisplay, String theMessage) { - myValueSetProvider.myNextReturnParams = new Parameters(); - myValueSetProvider.myNextReturnParams.addParameter("result", theResult); - myValueSetProvider.myNextReturnParams.addParameter("display", theDisplay); - if (theMessage != null) { - myValueSetProvider.myNextReturnParams.addParameter("message", theMessage); + ourCodeSystemProvider.myNextReturnParams.addParameter("message", theMessage); } } private static class MyCodeSystemProvider implements IResourceProvider { - private UriParam myLastUrlParam; - private List myNextReturnCodeSystems; - private int myInvocationCount; private UriType myLastUrl; private CodeType myLastCode; private StringType myLastDisplay; @@ -187,7 +179,6 @@ public class RemoteTerminologyServiceResourceProviderR4Test { @OperationParam(name = "code", min = 0, max = 1) CodeType theCode, @OperationParam(name = "display", min = 0, max = 1) StringType theDisplay ) { - myInvocationCount++; myLastUrl = theCodeSystemUrl; myLastCode = theCode; myLastDisplay = theDisplay; @@ -195,13 +186,6 @@ public class RemoteTerminologyServiceResourceProviderR4Test { } - @Search - public List find(@RequiredParam(name = "url") UriParam theUrlParam) { - myLastUrlParam = theUrlParam; - assert myNextReturnCodeSystems != null; - return myNextReturnCodeSystems; - } - @Override public Class getResourceType() { return CodeSystem.class; @@ -211,14 +195,9 @@ public class RemoteTerminologyServiceResourceProviderR4Test { private static class MyValueSetProvider implements IResourceProvider { private Parameters myNextReturnParams; - private List myNextReturnValueSets; private UriType myLastUrl; private CodeType myLastCode; - private int myInvocationCount; - private UriType myLastSystem; private StringType myLastDisplay; - private ValueSet myLastValueSet; - private UriParam myLastUrlParam; @Operation(name = "validate-code", idempotent = true, returnParameters = { @OperationParam(name = "result", type = BooleanType.class, min = 1), @@ -234,22 +213,12 @@ public class RemoteTerminologyServiceResourceProviderR4Test { @OperationParam(name = "display", min = 0, max = 1) StringType theDisplay, @OperationParam(name = "valueSet") ValueSet theValueSet ) { - myInvocationCount++; myLastUrl = theValueSetUrl; myLastCode = theCode; - myLastSystem = theSystem; myLastDisplay = theDisplay; - myLastValueSet = theValueSet; return myNextReturnParams; } - @Search - public List find(@RequiredParam(name = "url") UriParam theUrlParam) { - myLastUrlParam = theUrlParam; - assert myNextReturnValueSets != null; - return myNextReturnValueSets; - } - @Override public Class getResourceType() { return ValueSet.class; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemPropertiesTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemPropertiesTest.java index 7338a0b4174..f96556ddc36 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemPropertiesTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4CodeSystemPropertiesTest.java @@ -5,8 +5,12 @@ import ca.uhn.fhir.jpa.provider.BaseResourceProviderR4Test; import ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil; import ca.uhn.fhir.rest.gclient.IOperationUntypedWithInputAndPartialOutput; import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent; import org.hl7.fhir.r4.model.CodeType; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.Parameters; +import org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; import org.junit.jupiter.params.ParameterizedTest; @@ -22,70 +26,74 @@ import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCod import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCodeSystemUrl; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyC; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCode; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCodeSystem; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyDisplay; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; public class ResourceProviderR4CodeSystemPropertiesTest extends BaseResourceProviderR4Test { - public static Stream parametersLookup() { - return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); - } + public static Stream parametersLookup() { + return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); + } - @ParameterizedTest - @MethodSource(value = "parametersLookup") - public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { - // setup - CodeSystem codeSystem = new CodeSystem(); - codeSystem.setId(ourCodeSystemId); - codeSystem.setUrl(ourCodeSystemUrl); - CodeSystem.ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode); - CodeSystem.ConceptPropertyComponent propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA)); - concept.addProperty(propertyComponent); - propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB)); - concept.addProperty(propertyComponent); - myCodeSystemDao.create(codeSystem, mySrd); + @ParameterizedTest + @MethodSource(value = "parametersLookup") + public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { + // setup + CodeSystem codeSystem = new CodeSystem(); + codeSystem.setId(ourCodeSystemId); + codeSystem.setUrl(ourCodeSystemUrl); + ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyC).setValue(new Coding(propertyCodeSystem, propertyCode, propertyDisplay))); - // test - IOperationUntypedWithInputAndPartialOutput respParam = myClient - .operation() - .onType(CodeSystem.class) - .named(JpaConstants.OPERATION_LOOKUP) - .withParameter(Parameters.class, "code", new CodeType(ourCode)) - .andParameter("system", new UriType(ourCodeSystemUrl)); + myCodeSystemDao.create(codeSystem, mySrd); - theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); - Parameters parameters = respParam.execute(); + // test + IOperationUntypedWithInputAndPartialOutput respParam = myClient + .operation() + .onType(CodeSystem.class) + .named(JpaConstants.OPERATION_LOOKUP) + .withParameter(Parameters.class, "code", new CodeType(ourCode)) + .andParameter("system", new UriType(ourCodeSystemUrl)); + theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); + Parameters parameters = respParam.execute(); - if (theExpectedReturnedProperties.isEmpty()) { - assertFalse(parameters.hasParameter("property")); - return; - } + // verify + if (theExpectedReturnedProperties.isEmpty()) { + assertFalse(parameters.hasParameter("property")); + return; + } - assertTrue(parameters.hasParameter("property")); - Iterator parameterPropertyIterator = parameters.getParameters("property").iterator(); + assertTrue(parameters.hasParameter("property")); + Iterator parameterPropertyIterator = parameters.getParameters("property").iterator(); - Iterator propertyIterator = concept.getProperty().stream() - .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); + Iterator propertyIterator = concept.getProperty().stream() + .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); - while (propertyIterator.hasNext()) { - CodeSystem.ConceptPropertyComponent property = propertyIterator.next(); + while (propertyIterator.hasNext()) { + ConceptPropertyComponent property = propertyIterator.next(); - assertTrue(parameterPropertyIterator.hasNext()); - Parameters.ParametersParameterComponent parameter = parameterPropertyIterator.next(); - Iterator parameterPartIterator = parameter.getPart().iterator(); + assertTrue(parameterPropertyIterator.hasNext()); + ParametersParameterComponent parameter = parameterPropertyIterator.next(); + Iterator parameterPartIterator = parameter.getPart().iterator(); - parameter = parameterPartIterator.next(); - assertEquals("code", parameter.getName()); - assertEquals(property.getCode(), ((CodeType)parameter.getValue()).getCode()); + parameter = parameterPartIterator.next(); + assertEquals("code", parameter.getName()); + assertEquals(property.getCode(), ((CodeType) parameter.getValue()).getValue()); - parameter = parameterPartIterator.next(); - assertEquals("value", parameter.getName()); - assertTrue(property.getValue().equalsShallow(parameter.getValue())); - } - } + parameter = parameterPartIterator.next(); + assertEquals("value", parameter.getName()); + assertTrue(property.getValue().equalsShallow(parameter.getValue())); + + assertFalse(parameterPartIterator.hasNext()); + } + } } diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java index b0a5e6ed236..837a41b68a2 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java @@ -173,7 +173,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetHSearchDisabledTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetHSearchDisabledTest.java index a71da858d22..7b69a0a49e9 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetHSearchDisabledTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetHSearchDisabledTest.java @@ -28,7 +28,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java index 35e96b1ea41..2ab6dd76bf7 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetNoVerCSNoVerTest.java @@ -55,7 +55,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java index 2ce02edde6a..7b56df6dbc8 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSNoVerTest.java @@ -49,7 +49,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSVerTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSVerTest.java index 57f71d85b37..cc8d09d8ff7 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSVerTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4ValueSetVerCSVerTest.java @@ -42,7 +42,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ServerCapabilityStatementProviderJpaR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ServerCapabilityStatementProviderJpaR4Test.java index d1a8a599a01..e64c5ddd7d7 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ServerCapabilityStatementProviderJpaR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/provider/r4/ServerCapabilityStatementProviderJpaR4Test.java @@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.List; import java.util.Set; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImplTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImplTest.java index e20101c3ef1..685890f16df 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImplTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/reindex/Batch2DaoSvcImplTest.java @@ -16,7 +16,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.time.LocalDate; import java.time.Month; import java.time.ZoneId; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/stresstest/GiantTransactionPerfTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/stresstest/GiantTransactionPerfTest.java index 4aceb1748cc..67aeca52c42 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/stresstest/GiantTransactionPerfTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/stresstest/GiantTransactionPerfTest.java @@ -77,8 +77,8 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.SimpleTransactionStatus; import org.springframework.transaction.support.TransactionSynchronizationManager; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.persistence.EntityGraph; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/FhirR4Util.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/FhirR4Util.java index 31f92581c61..d2e363ba1a6 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/FhirR4Util.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/FhirR4Util.java @@ -12,7 +12,7 @@ import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Subscription; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class FhirR4Util { diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR4Test.java index 29163d8018c..525f909a088 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR4Test.java @@ -5,7 +5,6 @@ import ca.uhn.fhir.jpa.api.config.JpaStorageSettings; import ca.uhn.fhir.jpa.subscription.BaseSubscriptionsR4Test; import ca.uhn.fhir.jpa.subscription.submit.svc.ResourceModifiedSubmitterSvc; import ca.uhn.fhir.jpa.test.util.StoppableSubscriptionDeliveringRestHookSubscriber; -import ca.uhn.fhir.jpa.test.util.SubscriptionTestUtil; import ca.uhn.fhir.jpa.topic.SubscriptionTopicDispatcher; import ca.uhn.fhir.jpa.topic.SubscriptionTopicRegistry; import ca.uhn.fhir.model.primitive.IdDt; @@ -15,6 +14,7 @@ import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.subscription.SubscriptionTestDataHelper; +import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.HapiExtensions; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IIdType; @@ -29,11 +29,12 @@ import org.hl7.fhir.r4.model.Meta; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.SearchParameter; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Subscription; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -42,6 +43,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; +import java.util.Optional; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -66,6 +68,8 @@ import static org.junit.jupiter.api.Assertions.fail; */ public class RestHookTestR4Test extends BaseSubscriptionsR4Test { private static final Logger ourLog = LoggerFactory.getLogger(RestHookTestR4Test.class); + public static final String TEST_PATIENT_ID = "topic-test-patient-id"; + public static final String PATIENT_REFERENCE = "Patient/" + TEST_PATIENT_ID; @Autowired ResourceModifiedSubmitterSvc myResourceModifiedSubmitterSvc; @@ -1306,8 +1310,73 @@ public class RestHookTestR4Test extends BaseSubscriptionsR4Test { } @Test - public void testTopicSubscription() throws Exception { - Subscription subscription = SubscriptionTestDataHelper.buildR4TopicSubscription(); + public void testRestHoodTopicSubscription_withEmptyPayloadContent_generateCorrectPayload() throws Exception { + String payloadContent = "empty"; + + // execute + Bundle bundle = createAndDispatchTopicSubscription(payloadContent); + + // verify Bundle size + assertEquals(1, bundle.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(myFhirContext, bundle, Resource.class); + assertEquals(1, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + Optional focus = getNotificationEventFocus(resources); + assertFalse(focus.isPresent()); + } + + @Test + public void testRestHoodTopicSubscription_withIdOnlyPayloadContent_generateCorrectPayload() throws Exception { + String payloadContent = "id-only"; + + // execute + Bundle bundle = createAndDispatchTopicSubscription(payloadContent); + + // verify Bundle size + assertEquals(2, bundle.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(myFhirContext, bundle, Resource.class); + assertEquals(1, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + Optional focus = getNotificationEventFocus(resources); + assertTrue(focus.isPresent()); + assertEquals(TEST_PATIENT_ID, ((Reference) focus.get().getValue()).getReference()); + + // verify Patient Entry + Bundle.BundleEntryComponent patientEntry = bundle.getEntry().get(1); + validateRequestParameters(patientEntry); + Patient bundlePatient = (Patient) patientEntry.getResource(); + assertNull(bundlePatient); + } + + @Test + public void testRestHoodTopicSubscription_withFullResourcePayloadContent_generateCorrectPayload() throws Exception { + String payloadContent = "full-resource"; + + // execute + Bundle bundle = createAndDispatchTopicSubscription(payloadContent); + + // verify Bundle size + assertEquals(2, bundle.getEntry().size()); + List resources = BundleUtil.toListOfResourcesOfType(myFhirContext, bundle, Resource.class); + assertEquals(2, resources.size()); + + // verify SubscriptionStatus.notificationEvent.focus + Optional focus = getNotificationEventFocus(resources); + assertTrue(focus.isPresent()); + assertEquals(PATIENT_REFERENCE, ((Reference) focus.get().getValue()).getReference()); + + // verify Patient Entry + Bundle.BundleEntryComponent patientEntry = bundle.getEntry().get(1); + validateRequestParameters(patientEntry); + Patient bundlePatient = (Patient) patientEntry.getResource(); + assertTrue(bundlePatient.getActive()); + assertEquals(Enumerations.AdministrativeGender.FEMALE, bundlePatient.getGender()); + } + + private Bundle createAndDispatchTopicSubscription(String thePayloadContent) throws Exception { + Subscription subscription = SubscriptionTestDataHelper.buildR4TopicSubscriptionWithContent(thePayloadContent); subscription.setIdElement(null); subscription.setStatus(Subscription.SubscriptionStatus.REQUESTED); Subscription.SubscriptionChannelComponent channel = subscription.getChannel(); @@ -1319,9 +1388,8 @@ public class RestHookTestR4Test extends BaseSubscriptionsR4Test { mySubscriptionIds.add(methodOutcome.getId()); waitForActivatedSubscriptionCount(1); - String patientId = "topic-test-patient-id"; Patient patient = new Patient(); - patient.setId(patientId); + patient.setId(TEST_PATIENT_ID); patient.setActive(true); patient.setGender(Enumerations.AdministrativeGender.FEMALE); @@ -1332,12 +1400,22 @@ public class RestHookTestR4Test extends BaseSubscriptionsR4Test { ourTransactionProvider.waitForTransactionCount(1); - Bundle bundle = ourTransactionProvider.getTransactions().get(0); - assertEquals(2, bundle.getEntry().size()); - Parameters parameters = (Parameters) bundle.getEntry().get(0).getResource(); - // WIP STR5 assert parameters contents - Patient bundlePatient = (Patient) bundle.getEntry().get(1).getResource(); - assertTrue(bundlePatient.getActive()); - assertEquals(Enumerations.AdministrativeGender.FEMALE, bundlePatient.getGender()); + return ourTransactionProvider.getTransactions().get(0); + } + + private Optional getNotificationEventFocus(List theResources) { + assertEquals("Parameters", theResources.get(0).getResourceType().name()); + Parameters parameters = (Parameters) theResources.get(0); + Parameters.ParametersParameterComponent notificationEvent = parameters.getParameter("notification-event"); + assertNotNull(notificationEvent); + return notificationEvent.getPart().stream() + .filter(part -> part.getName().equals("focus")) + .findFirst(); + } + + private void validateRequestParameters(Bundle.BundleEntryComponent thePatientEntry) { + assertNotNull(thePatientEntry.getRequest()); + assertEquals("POST", thePatientEntry.getRequest().getMethod().name()); + assertEquals("Patient", thePatientEntry.getRequest().getUrl()); } } diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/BaseTermR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/BaseTermR4Test.java index 9b0f3063a8f..ca7a9ba63a7 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/BaseTermR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/BaseTermR4Test.java @@ -17,7 +17,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; public abstract class BaseTermR4Test extends BaseJpaR4Test { diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TermConceptMappingSvcImplTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TermConceptMappingSvcImplTest.java index 6af60b7d6a0..a4a18667b1c 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TermConceptMappingSvcImplTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TermConceptMappingSvcImplTest.java @@ -31,7 +31,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcDeltaR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcDeltaR4Test.java index 7ab96037c26..24b0673fd16 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcDeltaR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcDeltaR4Test.java @@ -510,7 +510,7 @@ public class TerminologySvcDeltaR4Test extends BaseJpaR4Test { List properties = output.getParameter().stream().filter(t -> t.getName().equals("property")).collect(Collectors.toList()); assertEquals("code", properties.get(0).getPart().get(0).getName()); - assertEquals("flavour", ((CodeType) properties.get(0).getPart().get(0).getValue()).getValueAsString()); + assertEquals("flavour", ((StringType) properties.get(0).getPart().get(0).getValue()).getValueAsString()); assertEquals("value", properties.get(0).getPart().get(1).getName()); assertEquals("Hints of lime", ((StringType) properties.get(0).getPart().get(1).getValue()).getValueAsString()); diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplR4Test.java index 2edf0f57ee5..b74959b785a 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/TerminologySvcImplR4Test.java @@ -27,7 +27,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java index 2509c25d18a..365af4839e8 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/term/ValueSetExpansionR4Test.java @@ -43,7 +43,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.List; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-test-r4b/pom.xml b/hapi-fhir-jpaserver-test-r4b/pom.xml index e2d784822f9..fc9a0d3a742 100644 --- a/hapi-fhir-jpaserver-test-r4b/pom.xml +++ b/hapi-fhir-jpaserver-test-r4b/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-r4b/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR4BTest.java b/hapi-fhir-jpaserver-test-r4b/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR4BTest.java index d645cd43e0f..86a71394cdd 100644 --- a/hapi-fhir-jpaserver-test-r4b/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR4BTest.java +++ b/hapi-fhir-jpaserver-test-r4b/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR4BTest.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.RegisterExtension; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import java.util.ArrayList; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-test-r5/pom.xml b/hapi-fhir-jpaserver-test-r5/pom.xml index ec884ead8bb..df1d9fc41e3 100644 --- a/hapi-fhir-jpaserver-test-r5/pom.xml +++ b/hapi-fhir-jpaserver-test-r5/pom.xml @@ -6,7 +6,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -29,7 +29,7 @@ test - net.sourceforge.htmlunit + org.htmlunit htmlunit test diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/CrossPartitionReferencesTest.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/CrossPartitionReferencesTest.java index e5aea038ccf..c1d6bb2e381 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/CrossPartitionReferencesTest.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/CrossPartitionReferencesTest.java @@ -34,7 +34,7 @@ import org.mockito.Mock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Propagation; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5HistoryDisabledTest.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5HistoryDisabledTest.java index d3cb0806d8d..d663e8bbb75 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5HistoryDisabledTest.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirResourceDaoR5HistoryDisabledTest.java @@ -18,7 +18,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirSystemDaoTransactionR5Test.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirSystemDaoTransactionR5Test.java index 308d97c70f6..75bc00c23c9 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirSystemDaoTransactionR5Test.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/FhirSystemDaoTransactionR5Test.java @@ -19,7 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.UUID; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/UpliftedRefchainsAndChainedSortingR5Test.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/UpliftedRefchainsAndChainedSortingR5Test.java index b2ce084ef63..453b541eebb 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/UpliftedRefchainsAndChainedSortingR5Test.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/dao/r5/UpliftedRefchainsAndChainedSortingR5Test.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import static org.apache.commons.lang3.StringUtils.countMatches; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5CodeSystemPropertiesTest.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5CodeSystemPropertiesTest.java index e8b5be13fb4..5a9f26f8c1c 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5CodeSystemPropertiesTest.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5CodeSystemPropertiesTest.java @@ -1,11 +1,14 @@ package ca.uhn.fhir.jpa.provider.r5; import ca.uhn.fhir.jpa.model.util.JpaConstants; -import ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil; import ca.uhn.fhir.rest.gclient.IOperationUntypedWithInputAndPartialOutput; +import ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil; import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.Parameters; +import org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.r5.model.StringType; import org.hl7.fhir.r5.model.UriType; import org.junit.jupiter.params.ParameterizedTest; @@ -21,69 +24,73 @@ import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCod import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourCodeSystemUrl; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyC; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueA; import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.ourPropertyValueB; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCode; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyCodeSystem; +import static ca.uhn.fhir.jpa.provider.CodeSystemLookupWithPropertiesUtil.propertyDisplay; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; public class ResourceProviderR5CodeSystemPropertiesTest extends BaseResourceProviderR5Test { - public static Stream parametersLookup() { - return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); - } - @ParameterizedTest - @MethodSource(value = "parametersLookup") - public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { - // setup - CodeSystem codeSystem = new CodeSystem(); - codeSystem.setId(ourCodeSystemId); - codeSystem.setUrl(ourCodeSystemUrl); - CodeSystem.ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode); - CodeSystem.ConceptPropertyComponent propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA)); - concept.addProperty(propertyComponent); - propertyComponent = new CodeSystem.ConceptPropertyComponent() - .setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB)); - concept.addProperty(propertyComponent); - myCodeSystemDao.create(codeSystem, mySrd); + public static Stream parametersLookup() { + return CodeSystemLookupWithPropertiesUtil.parametersLookupWithProperties(); + } - // test - IOperationUntypedWithInputAndPartialOutput respParam = myClient - .operation() - .onType(CodeSystem.class) - .named(JpaConstants.OPERATION_LOOKUP) - .withParameter(Parameters.class, "code", new CodeType(ourCode)) - .andParameter("system", new UriType(ourCodeSystemUrl)); + @ParameterizedTest + @MethodSource(value = "parametersLookup") + public void testLookup_withProperties_returnsCorrectParameters(List theLookupProperties, List theExpectedReturnedProperties) { + // setup + CodeSystem codeSystem = new CodeSystem(); + codeSystem.setId(ourCodeSystemId); + codeSystem.setUrl(ourCodeSystemUrl); + CodeSystem.ConceptDefinitionComponent concept = codeSystem.addConcept().setCode(ourCode) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyA).setValue(new StringType(ourPropertyValueA))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyB).setValue(new StringType(ourPropertyValueB))) + .addProperty(new ConceptPropertyComponent().setCode(ourPropertyC).setValue(new Coding(propertyCodeSystem, propertyCode, propertyDisplay))); + myCodeSystemDao.create(codeSystem, mySrd); - theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); - Parameters parameters = respParam.execute(); + // test + IOperationUntypedWithInputAndPartialOutput respParam = myClient + .operation() + .onType(CodeSystem.class) + .named(JpaConstants.OPERATION_LOOKUP) + .withParameter(Parameters.class, "code", new CodeType(ourCode)) + .andParameter("system", new UriType(ourCodeSystemUrl)); + theLookupProperties.forEach(p -> respParam.andParameter("property", new CodeType(p))); + Parameters parameters = respParam.execute(); - if (theExpectedReturnedProperties.isEmpty()) { - assertFalse(parameters.hasParameter("property")); - return; - } + // verify + if (theExpectedReturnedProperties.isEmpty()) { + assertFalse(parameters.hasParameter("property")); + return; + } - assertTrue(parameters.hasParameter("property")); - Iterator parameterPropertyIterator = parameters.getParameters("property").iterator(); + assertTrue(parameters.hasParameter("property")); + Iterator parameterPropertyIterator = parameters.getParameters("property").iterator(); - Iterator propertyIterator = concept.getProperty().stream() - .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); + Iterator propertyIterator = concept.getProperty().stream() + .filter(property -> theExpectedReturnedProperties.contains(property.getCode())).iterator(); - while (propertyIterator.hasNext()) { - CodeSystem.ConceptPropertyComponent property = propertyIterator.next(); + while (propertyIterator.hasNext()) { + ConceptPropertyComponent property = propertyIterator.next(); - assertTrue(parameterPropertyIterator.hasNext()); - Parameters.ParametersParameterComponent parameter = parameterPropertyIterator.next(); - Iterator parameterPartIterator = parameter.getPart().iterator(); + assertTrue(parameterPropertyIterator.hasNext()); + ParametersParameterComponent parameter = parameterPropertyIterator.next(); + Iterator parameterPartIterator = parameter.getPart().iterator(); - parameter = parameterPartIterator.next(); - assertEquals("code", parameter.getName()); - assertEquals(property.getCode(), ((CodeType)parameter.getValue()).getCode()); + parameter = parameterPartIterator.next(); + assertEquals("code", parameter.getName()); + assertEquals(property.getCode(), ((CodeType) parameter.getValue()).getValue()); - parameter = parameterPartIterator.next(); - assertEquals("value", parameter.getName()); - assertTrue(property.getValue().equalsShallow(parameter.getValue())); - } - } + parameter = parameterPartIterator.next(); + assertEquals("value", parameter.getName()); + assertTrue(property.getValue().equalsShallow(parameter.getValue())); + + assertFalse(parameterPartIterator.hasNext()); + } + } } diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetTest.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetTest.java index a40eddf4e05..f5f882e38ff 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetTest.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetTest.java @@ -48,7 +48,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.List; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetVersionedTest.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetVersionedTest.java index 95f1cb3d62d..824384e57c4 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetVersionedTest.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/provider/r5/ResourceProviderR5ValueSetVersionedTest.java @@ -40,7 +40,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplNarrativeR5Test.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplNarrativeR5Test.java index f523b6e2243..472d68df121 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplNarrativeR5Test.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplNarrativeR5Test.java @@ -16,8 +16,8 @@ import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.SearchParamPresentEntity; import ca.uhn.fhir.jpa.searchparam.extractor.ResourceIndexedSearchParams; import ca.uhn.fhir.test.utilities.HtmlUtil; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTable; +import org.htmlunit.html.HtmlPage; +import org.htmlunit.html.HtmlTable; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.StringType; @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.math.BigDecimal; import java.util.Collections; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplR5Test.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplR5Test.java index c8e4d6fe47f..18c32173d39 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplR5Test.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/search/reindex/InstanceReindexServiceImplR5Test.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.Set; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR5Test.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR5Test.java index ea35ecdf076..44dd5e99568 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR5Test.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionsR5Test.java @@ -44,7 +44,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import jakarta.servlet.http.HttpServletRequest; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR5IT.java b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR5IT.java index 86c779a5a50..c943839c189 100644 --- a/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR5IT.java +++ b/hapi-fhir-jpaserver-test-r5/src/test/java/ca/uhn/fhir/jpa/subscription/resthook/RestHookTestR5IT.java @@ -33,7 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; diff --git a/hapi-fhir-jpaserver-test-utilities/pom.xml b/hapi-fhir-jpaserver-test-utilities/pom.xml index 8b56c9eac09..9a2166c22ea 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/dao/TestDaoSearch.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/dao/TestDaoSearch.java index b80f19b9e4d..0609fb32fe8 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/dao/TestDaoSearch.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/dao/TestDaoSearch.java @@ -32,6 +32,7 @@ import ca.uhn.fhir.rest.server.IPagingProvider; import ca.uhn.fhir.rest.server.IRestfulServerDefaults; import ca.uhn.fhir.rest.server.method.SortParameter; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; +import jakarta.annotation.Nonnull; import org.hamcrest.Matcher; import org.hamcrest.MatcherAssert; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -44,7 +45,6 @@ import org.springframework.web.util.UriComponentsBuilder; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.ArrayUtils.EMPTY_STRING_ARRAY; import static org.hamcrest.Matchers.contains; diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/provider/CodeSystemLookupWithPropertiesUtil.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/provider/CodeSystemLookupWithPropertiesUtil.java index baf2b8c623f..d68fcee92ba 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/provider/CodeSystemLookupWithPropertiesUtil.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/provider/CodeSystemLookupWithPropertiesUtil.java @@ -31,13 +31,19 @@ public class CodeSystemLookupWithPropertiesUtil { public static final String ourCodeSystemId = "CodeSystem-Example", ourCodeSystemUrl = "http://example/" + ourCodeSystemId; public static final String ourCode = "Code-WithProperties"; - public static final String ourPropertyA = "Property-A", ourPropertyB = "Property-B"; + public static final String ourPropertyA = "Property-A", ourPropertyB = "Property-B", ourPropertyC = "Property-C"; public static final String ourPropertyValueA = "Value-A", ourPropertyValueB = "Value-B"; + public static final String propertyCodeSystem = "CodeSystem-C", + propertyCode = "Code-C", + propertyDisplay = "Display-C"; public static Stream parametersLookupWithProperties() { return Stream.of( + arguments(Collections.emptyList(), List.of(ourPropertyA, ourPropertyB, ourPropertyC)), arguments(List.of(ourPropertyB), List.of(ourPropertyB)), - arguments(List.of(ourPropertyA, ourPropertyB), List.of(ourPropertyA, ourPropertyB)), + arguments( + List.of(ourPropertyA, ourPropertyB, ourPropertyC), + List.of(ourPropertyA, ourPropertyB, ourPropertyC)), arguments(List.of(ourPropertyB, ourPropertyA), List.of(ourPropertyB, ourPropertyA)), arguments(List.of(ourPropertyA, ourPropertyA), List.of(ourPropertyA, ourPropertyA)), arguments(List.of(ourPropertyB, "ABC"), List.of(ourPropertyB)), diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/svc/MockHapiTransactionService.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/svc/MockHapiTransactionService.java index 8f7a5b86aad..1ad996ca623 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/svc/MockHapiTransactionService.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/svc/MockHapiTransactionService.java @@ -20,12 +20,11 @@ package ca.uhn.fhir.jpa.svc; import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; +import jakarta.annotation.Nullable; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.SimpleTransactionStatus; import org.springframework.transaction.support.TransactionCallback; -import javax.annotation.Nullable; - public class MockHapiTransactionService extends HapiTransactionService { private TransactionStatus myTransactionStatus; diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaTest.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaTest.java index 4dcc9189da1..ee74e496737 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/test/BaseJpaTest.java @@ -129,7 +129,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import java.io.IOException; import java.time.Duration; diff --git a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/ValueSetTestUtil.java b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/ValueSetTestUtil.java index c5d72f13825..809d9d39c56 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/ValueSetTestUtil.java +++ b/hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/util/ValueSetTestUtil.java @@ -21,13 +21,13 @@ package ca.uhn.fhir.jpa.util; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.ValueSet; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.HapiExtensions.EXT_VALUESET_EXPANSION_MESSAGE; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/FhirQueryRuleImplTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/FhirQueryRuleImplTest.java index 6b6d5bb746d..930b20367b9 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/FhirQueryRuleImplTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/FhirQueryRuleImplTest.java @@ -25,7 +25,7 @@ import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoSettings; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashSet; import static ca.uhn.fhir.rest.server.interceptor.auth.IAuthorizationSearchParamMatcher.MatchResult.buildMatched; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/TestRuleApplier.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/TestRuleApplier.java index 20646fa3eab..abaaad4314e 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/TestRuleApplier.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/auth/TestRuleApplier.java @@ -12,8 +12,8 @@ import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; /** * Empty implementation to base a stub. diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchCoreTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchCoreTest.java index 1da0afb4e49..d9bffba1cc9 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchCoreTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/patch/FhirPatchCoreTest.java @@ -14,7 +14,7 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import javax.xml.transform.TransformerException; import java.io.IOException; import java.util.ArrayList; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/BaseSearchQueryBuilderDialectTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/BaseSearchQueryBuilderDialectTest.java index 2546214bec9..26448d72544 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/BaseSearchQueryBuilderDialectTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/BaseSearchQueryBuilderDialectTest.java @@ -17,7 +17,7 @@ import org.mockito.Mock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectMySqlTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectMySqlTest.java index 3a77f72a620..4f4a9afecaf 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectMySqlTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectMySqlTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectPostgresTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectPostgresTest.java index 6e0c1933963..37aa38fdb42 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectPostgresTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectPostgresTest.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectSqlServerTest.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectSqlServerTest.java index f88e60cf7f6..afb1805d51c 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectSqlServerTest.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/search/builder/sql/SearchQueryBuilderDialectSqlServerTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Locale; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/term/LoincFullLoadR4SandboxIT.java b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/term/LoincFullLoadR4SandboxIT.java index 8396aaab023..3e21618a1f3 100644 --- a/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/term/LoincFullLoadR4SandboxIT.java +++ b/hapi-fhir-jpaserver-test-utilities/src/test/java/ca/uhn/fhir/jpa/term/LoincFullLoadR4SandboxIT.java @@ -51,7 +51,7 @@ import org.springframework.transaction.PlatformTransactionManager; import org.springframework.util.CollectionUtils; import org.springframework.util.ResourceUtils; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import jakarta.persistence.Query; import java.io.File; diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml index 4acc1750f21..0409211c054 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/FhirTestBalpAuditContextServices.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/FhirTestBalpAuditContextServices.java index 144aad7c2fb..2a454340628 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/FhirTestBalpAuditContextServices.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/FhirTestBalpAuditContextServices.java @@ -3,10 +3,9 @@ package ca.uhn.fhirtest.config; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.storage.interceptor.balp.IBalpAuditContextServices; +import jakarta.annotation.Nonnull; import org.hl7.fhir.r4.model.Reference; -import javax.annotation.Nonnull; - import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server-cds-hooks/pom.xml b/hapi-fhir-server-cds-hooks/pom.xml index 9e017d981b0..dd01ffff387 100644 --- a/hapi-fhir-server-cds-hooks/pom.xml +++ b/hapi-fhir-server-cds-hooks/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/ICdsConfigService.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/ICdsConfigService.java index c3104ab5171..f709daef3d8 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/ICdsConfigService.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/ICdsConfigService.java @@ -28,11 +28,10 @@ import ca.uhn.fhir.rest.api.server.SystemRestfulResponse; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrSettings; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.opencds.cqf.fhir.utility.Ids; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public interface ICdsConfigService { @Nonnull FhirContext getFhirContext(); diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/json/CdsServiceRequestJson.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/json/CdsServiceRequestJson.java index eb3e9a5f887..4ff00180895 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/json/CdsServiceRequestJson.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/api/json/CdsServiceRequestJson.java @@ -21,6 +21,7 @@ package ca.uhn.hapi.fhir.cdshooks.api.json; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collections; @@ -28,7 +29,6 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import javax.annotation.Nonnull; /** * Represents a CDS Hooks Service Request diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/BaseDynamicCdsServiceMethod.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/BaseDynamicCdsServiceMethod.java index e545a12b752..66f429a0697 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/BaseDynamicCdsServiceMethod.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/BaseDynamicCdsServiceMethod.java @@ -24,9 +24,9 @@ import ca.uhn.hapi.fhir.cdshooks.api.ICdsMethod; import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson; import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; import java.util.function.Function; -import javax.annotation.Nonnull; abstract class BaseDynamicCdsServiceMethod implements ICdsMethod { private final Function myFunction; diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsConfigServiceImpl.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsConfigServiceImpl.java index bf107a08166..dd0f79b62f3 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsConfigServiceImpl.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsConfigServiceImpl.java @@ -26,9 +26,8 @@ import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.hapi.fhir.cdshooks.api.ICdsConfigService; import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrSettings; import com.fasterxml.jackson.databind.ObjectMapper; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; public class CdsConfigServiceImpl implements ICdsConfigService { private final FhirContext myFhirContext; diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceRegistryImpl.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceRegistryImpl.java index 3155e16ea0f..a421f2d3757 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceRegistryImpl.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceRegistryImpl.java @@ -35,13 +35,13 @@ import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.ICrDiscoveryServiceFactory; import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.function.Function; -import javax.annotation.Nonnull; public class CdsServiceRegistryImpl implements ICdsServiceRegistry { private static final Logger ourLog = LoggerFactory.getLogger(CdsServiceRegistryImpl.class); diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/CdsCrServiceRegistry.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/CdsCrServiceRegistry.java index f8804ede21e..8c7e32ab8ea 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/CdsCrServiceRegistry.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/CdsCrServiceRegistry.java @@ -20,11 +20,11 @@ package ca.uhn.hapi.fhir.cdshooks.svc.cr; import ca.uhn.fhir.context.FhirVersionEnum; +import jakarta.annotation.Nonnull; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import javax.annotation.Nonnull; public class CdsCrServiceRegistry implements ICdsCrServiceRegistry { private final Map> myCdsCrServices; diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/ICdsCrServiceRegistry.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/ICdsCrServiceRegistry.java index 10969ae138e..1b5465bade6 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/ICdsCrServiceRegistry.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/ICdsCrServiceRegistry.java @@ -20,9 +20,9 @@ package ca.uhn.hapi.fhir.cdshooks.svc.cr; import ca.uhn.fhir.context.FhirVersionEnum; +import jakarta.annotation.Nonnull; import java.util.Optional; -import javax.annotation.Nonnull; public interface ICdsCrServiceRegistry { void register(@Nonnull FhirVersionEnum theFhirVersion, @Nonnull Class theCdsCrService); diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/CdsCrDiscoveryServiceRegistry.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/CdsCrDiscoveryServiceRegistry.java index a62a17e494d..d2dda2f73a0 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/CdsCrDiscoveryServiceRegistry.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/CdsCrDiscoveryServiceRegistry.java @@ -20,11 +20,11 @@ package ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery; import ca.uhn.fhir.context.FhirVersionEnum; +import jakarta.annotation.Nonnull; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import javax.annotation.Nonnull; public class CdsCrDiscoveryServiceRegistry implements ICdsCrDiscoveryServiceRegistry { private final Map> myCrDiscoveryServices; diff --git a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/ICdsCrDiscoveryServiceRegistry.java b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/ICdsCrDiscoveryServiceRegistry.java index 6c5e2c093fb..34f55015220 100644 --- a/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/ICdsCrDiscoveryServiceRegistry.java +++ b/hapi-fhir-server-cds-hooks/src/main/java/ca/uhn/hapi/fhir/cdshooks/svc/cr/discovery/ICdsCrDiscoveryServiceRegistry.java @@ -20,9 +20,9 @@ package ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery; import ca.uhn.fhir.context.FhirVersionEnum; +import jakarta.annotation.Nonnull; import java.util.Optional; -import javax.annotation.Nonnull; public interface ICdsCrDiscoveryServiceRegistry { void register( diff --git a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/controller/CdsHooksControllerTest.java b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/controller/CdsHooksControllerTest.java index 8347de11ad4..0349fd27957 100644 --- a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/controller/CdsHooksControllerTest.java +++ b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/controller/CdsHooksControllerTest.java @@ -34,7 +34,7 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.UUID; import java.util.function.Function; diff --git a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceCacheTest.java b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceCacheTest.java index d604b83c7b4..ac94e684985 100644 --- a/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceCacheTest.java +++ b/hapi-fhir-server-cds-hooks/src/test/java/ca/uhn/hapi/fhir/cdshooks/svc/CdsServiceCacheTest.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.mockito.InjectMocks; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.function.Function; import static ca.uhn.test.util.LogbackCaptureTestExtension.eventWithLevelAndMessageContains; diff --git a/hapi-fhir-server-mdm/pom.xml b/hapi-fhir-server-mdm/pom.xml index 0a008f0fe86..6e163215517 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmControllerSvc.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmControllerSvc.java index dc6051daa13..e9c86871cf1 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmControllerSvc.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmControllerSvc.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.mdm.model.mdmevents.MdmLinkJson; import ca.uhn.fhir.mdm.model.mdmevents.MdmLinkWithRevisionJson; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -37,7 +38,6 @@ import org.springframework.data.domain.Page; import java.math.BigDecimal; import java.util.List; -import javax.annotation.Nullable; public interface IMdmControllerSvc { @Deprecated diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmMatchFinderSvc.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmMatchFinderSvc.java index 9d94270d192..0acc5d12946 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmMatchFinderSvc.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmMatchFinderSvc.java @@ -20,10 +20,10 @@ package ca.uhn.fhir.mdm.api; import ca.uhn.fhir.interceptor.model.RequestPartitionId; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import java.util.List; -import javax.annotation.Nonnull; public interface IMdmMatchFinderSvc { diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmSubmitSvc.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmSubmitSvc.java index ec1181f2238..24ca6045289 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmSubmitSvc.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/IMdmSubmitSvc.java @@ -20,10 +20,9 @@ package ca.uhn.fhir.mdm.api; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nullable; - public interface IMdmSubmitSvc { /** diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java index 64c5667c3d9..982a54b5c4f 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java @@ -21,12 +21,11 @@ package ca.uhn.fhir.mdm.api.paging; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.springframework.data.domain.PageRequest; -import javax.annotation.Nullable; - import static ca.uhn.fhir.rest.api.Constants.PARAM_COUNT; import static ca.uhn.fhir.rest.api.Constants.PARAM_OFFSET; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmHistorySearchParameters.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmHistorySearchParameters.java index c16c3ecdeea..fb11027d86d 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmHistorySearchParameters.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmHistorySearchParameters.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.mdm.api.params; import ca.uhn.fhir.mdm.provider.MdmControllerUtil; import ca.uhn.fhir.rest.server.provider.ProviderConstants; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IIdType; @@ -29,8 +31,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class MdmHistorySearchParameters { private List myGoldenResourceIds = new ArrayList<>(); diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmQuerySearchParameters.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmQuerySearchParameters.java index 6deeb0c2d46..3b42afcacb2 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmQuerySearchParameters.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/params/MdmQuerySearchParameters.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.rest.api.SortOrderEnum; import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IIdType; import java.util.ArrayList; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; import static org.hibernate.internal.util.StringHelper.isBlank; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/BaseMdmProvider.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/BaseMdmProvider.java index 710d1da5bc2..c4abecfe614 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/BaseMdmProvider.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/BaseMdmProvider.java @@ -34,6 +34,8 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -45,8 +47,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public abstract class BaseMdmProvider { diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmControllerHelper.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmControllerHelper.java index 03c67a66f50..0c815a79508 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmControllerHelper.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmControllerHelper.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.validation.IResourceLoader; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBackboneElement; @@ -53,7 +54,6 @@ import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.UUID; -import javax.annotation.Nonnull; @Service public class MdmControllerHelper { diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java index f62427e46d2..e58136c72d4 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java @@ -46,6 +46,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBundle; @@ -61,7 +62,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.api.Constants.PARAM_OFFSET; import static org.apache.commons.lang3.ObjectUtils.isNotEmpty; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmFieldMatchJson.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmFieldMatchJson.java index d809d0f122b..9a70b6b947e 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmFieldMatchJson.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmFieldMatchJson.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.mdm.rules.json; import ca.uhn.fhir.mdm.rules.matcher.models.MatchTypeEnum; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * Contains all business data for determining if a match exists on a particular field, given: diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmSimilarityJson.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmSimilarityJson.java index fc122d2148a..3d21b9e86d9 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmSimilarityJson.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/MdmSimilarityJson.java @@ -24,10 +24,9 @@ import ca.uhn.fhir.mdm.api.MdmMatchEvaluation; import ca.uhn.fhir.mdm.rules.similarity.MdmSimilarityEnum; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; -import javax.annotation.Nullable; - public class MdmSimilarityJson implements IModelJson { @JsonProperty(value = "algorithm", required = true) MdmSimilarityEnum myAlgorithm; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/VectorMatchResultMap.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/VectorMatchResultMap.java index 93bc658c8d7..654b00b06cd 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/VectorMatchResultMap.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/json/VectorMatchResultMap.java @@ -22,12 +22,12 @@ package ca.uhn.fhir.mdm.rules.json; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.mdm.api.MdmMatchResultEnum; +import jakarta.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.annotation.Nonnull; public class VectorMatchResultMap { private final MdmRulesJson myMdmRulesJson; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/similarity/MdmSimilarityEnum.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/similarity/MdmSimilarityEnum.java index a1460c2ff68..7ef286c916a 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/similarity/MdmSimilarityEnum.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/rules/similarity/MdmSimilarityEnum.java @@ -26,10 +26,9 @@ import info.debatty.java.stringsimilarity.Jaccard; import info.debatty.java.stringsimilarity.JaroWinkler; import info.debatty.java.stringsimilarity.NormalizedLevenshtein; import info.debatty.java.stringsimilarity.SorensenDice; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBase; -import javax.annotation.Nullable; - public enum MdmSimilarityEnum { JARO_WINKLER(new HapiStringSimilarity(new JaroWinkler())), COSINE(new HapiStringSimilarity(new Cosine())), diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmLinkExpandSvc.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmLinkExpandSvc.java index 0b2c4294669..1d5428da059 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmLinkExpandSvc.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmLinkExpandSvc.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.model.MdmPidTuple; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; @@ -38,7 +39,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; @Service @Transactional diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSearchParamSvc.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSearchParamSvc.java index 39bbdd3ac98..ca85dd77d22 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSearchParamSvc.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSearchParamSvc.java @@ -31,13 +31,13 @@ import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.extractor.SearchParamExtractorService; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.util.SearchParameterUtil; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; -import javax.annotation.Nullable; @Service public class MdmSearchParamSvc { diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSubmitSvcImpl.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSubmitSvcImpl.java index 9c6150c5d24..1b81732196a 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSubmitSvcImpl.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/svc/MdmSubmitSvcImpl.java @@ -37,6 +37,8 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; @@ -49,8 +51,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class MdmSubmitSvcImpl implements IMdmSubmitSvc { diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/GoldenResourceHelper.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/GoldenResourceHelper.java index 75be805220f..a08b04b251b 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/GoldenResourceHelper.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/GoldenResourceHelper.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.mdm.model.CanonicalEID; import ca.uhn.fhir.mdm.model.MdmTransactionContext; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.util.FhirTerser; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -46,7 +47,6 @@ import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.context.FhirVersionEnum.DSTU3; import static ca.uhn.fhir.context.FhirVersionEnum.R4; diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmResourceUtil.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmResourceUtil.java index 4e7faf9d523..3ede05c5741 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmResourceUtil.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmResourceUtil.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.mdm.util; import ca.uhn.fhir.mdm.api.MdmConstants; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Optional; -import javax.annotation.Nonnull; public final class MdmResourceUtil { diff --git a/hapi-fhir-server-mdm/src/test/java/ca/uhn/fhir/mdm/rules/matcher/StringMatcherR4Test.java b/hapi-fhir-server-mdm/src/test/java/ca/uhn/fhir/mdm/rules/matcher/StringMatcherR4Test.java index 646641f8966..d596bb2375b 100644 --- a/hapi-fhir-server-mdm/src/test/java/ca/uhn/fhir/mdm/rules/matcher/StringMatcherR4Test.java +++ b/hapi-fhir-server-mdm/src/test/java/ca/uhn/fhir/mdm/rules/matcher/StringMatcherR4Test.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/hapi-fhir-server-openapi/pom.xml b/hapi-fhir-server-openapi/pom.xml index 8031d59df4d..dfe33aeeb93 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -88,7 +88,7 @@ test - net.sourceforge.htmlunit + org.htmlunit htmlunit test 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 1463ea3484a..00185920370 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 @@ -56,6 +56,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.tags.Tag; +import jakarta.annotation.Nonnull; import jakarta.servlet.ServletContext; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -112,7 +113,6 @@ import java.util.Properties; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.server.util.NarrativeUtil.sanitizeHtmlFragment; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; 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 5ba2667e959..3ea0ddea35a 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 @@ -26,9 +26,9 @@ import ca.uhn.fhir.test.utilities.HtmlUtil; import ca.uhn.fhir.test.utilities.HttpClientExtension; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; import ca.uhn.fhir.util.ExtensionConstants; -import com.gargoylesoftware.htmlunit.html.DomElement; -import com.gargoylesoftware.htmlunit.html.HtmlDivision; -import com.gargoylesoftware.htmlunit.html.HtmlPage; +import org.htmlunit.html.DomElement; +import org.htmlunit.html.HtmlDivision; +import org.htmlunit.html.HtmlPage; import io.swagger.v3.core.util.Yaml; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.PathItem; @@ -53,7 +53,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml index b3286ce44ec..3a521cd7eae 100644 --- a/hapi-fhir-server/pom.xml +++ b/hapi-fhir-server/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java index 77c02105714..9cd0b3c8793 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.rest.api.server; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.method.ResponsePage; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -30,8 +32,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IBundleProvider { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IRestfulResponse.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IRestfulResponse.java index fbca9e1add9..3c60366adad 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IRestfulResponse.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IRestfulResponse.java @@ -19,14 +19,15 @@ */ package ca.uhn.fhir.rest.api.server; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; + import java.io.Closeable; import java.io.IOException; import java.io.OutputStream; import java.io.Writer; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Implementations of this interface represent a response back to the client from the server. It is diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/SystemRestfulResponse.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/SystemRestfulResponse.java index 2d5863fd027..caa41d07de0 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/SystemRestfulResponse.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/SystemRestfulResponse.java @@ -21,6 +21,8 @@ package ca.uhn.fhir.rest.api.server; import ca.uhn.fhir.rest.server.BaseRestfulResponse; import ca.uhn.fhir.util.IoUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.io.ByteArrayOutputStream; @@ -29,8 +31,6 @@ import java.io.IOException; import java.io.OutputStream; import java.io.StringWriter; import java.io.Writer; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * A default RestfulResponse that returns the body as an IBaseResource and ignores everything else. diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/storage/TransactionDetails.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/storage/TransactionDetails.java index 3c769e0f915..8c44beb626d 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/storage/TransactionDetails.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/storage/TransactionDetails.java @@ -27,6 +27,8 @@ import ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -42,8 +44,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Supplier; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This object contains runtime information that is gathered and relevant to a single database transaction. diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviderWithNamedPages.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviderWithNamedPages.java index 7f7adc1ab62..7663d7a54b8 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviderWithNamedPages.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviderWithNamedPages.java @@ -20,11 +20,11 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.rest.server.method.ResponsePage; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.List; -import javax.annotation.Nonnull; /** * Bundle provider that uses named pages instead of counts diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java index f8933f50640..95c47a4dd0e 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/BundleProviders.java @@ -23,11 +23,11 @@ import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.server.method.ResponsePage; import ca.uhn.fhir.util.CoverageIgnore; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; /** * Utility methods for working with {@link IBundleProvider} diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IPagingProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IPagingProvider.java index 58300d2be11..310f09a0534 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IPagingProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/IPagingProvider.java @@ -21,9 +21,8 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; public interface IPagingProvider { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 30d5548e869..9a7f4768216 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -65,6 +65,8 @@ import ca.uhn.fhir.util.UrlPathTokenizer; import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.VersionUtil; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.ServletException; import jakarta.servlet.UnavailableException; import jakarta.servlet.http.HttpServlet; @@ -102,8 +104,6 @@ import java.util.Set; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.jar.Manifest; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.util.StringUtil.toUtf8String; import static java.util.stream.Collectors.toList; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerConfiguration.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerConfiguration.java index 55050b6fbc3..c9d25488b02 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerConfiguration.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerConfiguration.java @@ -33,6 +33,8 @@ import ca.uhn.fhir.rest.server.util.ResourceSearchParams; import ca.uhn.fhir.util.VersionUtil; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -55,8 +57,6 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java index b364ca14bb4..36e5944e0ad 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java @@ -52,6 +52,8 @@ import ca.uhn.fhir.util.DateUtils; import ca.uhn.fhir.util.UrlUtil; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -83,8 +85,6 @@ import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/ServletRequestTracing.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/ServletRequestTracing.java index 89c3b333956..886a31bad1e 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/ServletRequestTracing.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/ServletRequestTracing.java @@ -20,14 +20,13 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.rest.api.Constants; +import jakarta.annotation.Nullable; import jakarta.servlet.ServletRequest; import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.lang3.RandomStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/SimpleBundleProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/SimpleBundleProvider.java index 588f1909e7a..7916ec7922f 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/SimpleBundleProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/SimpleBundleProvider.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.rest.server; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.server.method.ResponsePage; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -30,7 +31,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; public class SimpleBundleProvider implements IBundleProvider { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BaseResponseTerminologyInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BaseResponseTerminologyInterceptor.java index cca85d6242b..638f17b0690 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BaseResponseTerminologyInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BaseResponseTerminologyInterceptor.java @@ -23,13 +23,13 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.BundleUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; public abstract class BaseResponseTerminologyInterceptor { protected final IValidationSupport myValidationSupport; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptor.java index a003ab59f14..b6c61a1b47b 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptor.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.server.method.BaseMethodBinding; import ca.uhn.fhir.rest.server.method.OperationMethodBinding; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +35,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.TreeSet; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java index 34a10d6f94a..7052517262b 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java @@ -45,6 +45,8 @@ import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.StopWatch; import ca.uhn.fhir.util.UrlUtil; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.ServletRequest; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -67,8 +69,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java index 5db02636da9..88b89c7c945 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.rest.server.interceptor; import ca.uhn.fhir.interceptor.api.Hook; import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import java.io.IOException; @@ -29,7 +30,6 @@ import java.io.Writer; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import javax.annotation.Nonnull; /** * This interceptor captures and makes diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyTranslationSvc.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyTranslationSvc.java index 8b54c02186c..88639d4bde3 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyTranslationSvc.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseTerminologyTranslationSvc.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.IModelVisitor; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; @@ -43,7 +44,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import javax.annotation.Nonnull; public class ResponseTerminologyTranslationSvc { private BaseRuntimeChildDefinition myCodingSystemChild; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java index 00dfd8a6dbf..4a729bc63ab 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/SearchPreferHandlingInterceptor.java @@ -36,6 +36,8 @@ import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.method.SearchMethodBinding; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.Validate; @@ -43,8 +45,6 @@ import org.apache.commons.lang3.Validate; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ValidationResultEnrichingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ValidationResultEnrichingInterceptor.java index 3adefa98466..19753fab55e 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ValidationResultEnrichingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ValidationResultEnrichingInterceptor.java @@ -24,13 +24,13 @@ import ca.uhn.fhir.interceptor.api.Interceptor; import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.validation.ValidationResult; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; @Interceptor public class ValidationResultEnrichingInterceptor { 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 index 661495f782b..9f5f563148d 100644 --- 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 @@ -20,13 +20,13 @@ package ca.uhn.fhir.rest.server.interceptor.auth; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.annotation.Nonnull; /** * This class is used in RuleBuilder, as a way to provide a compartment permission additional resource search params that diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AllowedCodeInValueSet.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AllowedCodeInValueSet.java index 2f7f217259a..36c04799488 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AllowedCodeInValueSet.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AllowedCodeInValueSet.java @@ -19,7 +19,7 @@ */ package ca.uhn.fhir.rest.server.interceptor.auth; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java index 853a90c6f7e..57175a84db3 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java @@ -32,6 +32,8 @@ import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; import ca.uhn.fhir.rest.server.exceptions.ForbiddenOperationException; import ca.uhn.fhir.rest.server.interceptor.consent.ConsentInterceptor; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -52,8 +54,6 @@ import java.util.IdentityHashMap; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizedList.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizedList.java index d49ec122d68..b781e388e6c 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizedList.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizedList.java @@ -20,12 +20,12 @@ package ca.uhn.fhir.rest.server.interceptor.auth; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Return type for {@link SearchNarrowingInterceptor#buildAuthorizedList(RequestDetails)} diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleBulkExport.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleBulkExport.java index 448e9bd2512..87491b033b9 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleBulkExport.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleBuilderRuleBulkExport.java @@ -19,10 +19,9 @@ */ package ca.uhn.fhir.rest.server.interceptor.auth; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nonnull; - /** * @since 5.5.0 */ 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 328fd530dc5..27b63223b75 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 @@ -19,10 +19,10 @@ */ package ca.uhn.fhir.rest.server.interceptor.auth; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IIdType; import java.util.Collection; -import javax.annotation.Nonnull; public interface IAuthRuleBuilderRuleOpClassifier { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleFinished.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleFinished.java index 5a3d2397cd6..9ab7f5b6995 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleFinished.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleFinished.java @@ -19,8 +19,9 @@ */ package ca.uhn.fhir.rest.server.interceptor.auth; +import jakarta.annotation.Nullable; + import java.util.List; -import javax.annotation.Nullable; public interface IAuthRuleFinished { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleTester.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleTester.java index 05eabea9f0e..7bfa152aae2 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleTester.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthRuleTester.java @@ -21,13 +21,12 @@ package ca.uhn.fhir.rest.server.interceptor.auth; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /** * Allows user-supplied logic for authorization rules. *

diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthorizationSearchParamMatcher.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthorizationSearchParamMatcher.java index 7b941dc6165..7c5c7719d18 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthorizationSearchParamMatcher.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IAuthorizationSearchParamMatcher.java @@ -19,11 +19,10 @@ */ package ca.uhn.fhir.rest.server.interceptor.auth; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /** * Adapt the InMemoryMatcher to support authorization filters in {@link FhirQueryRuleTester}. * Exists because filters may be applied to resources that don't support all paramters, and UNSUPPORTED diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IRuleApplier.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IRuleApplier.java index 7f88de3b9ac..4dbb76516a5 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IRuleApplier.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/IRuleApplier.java @@ -24,13 +24,12 @@ import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.interceptor.auth.AuthorizationInterceptor.Verdict; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public interface IRuleApplier { @Nonnull diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java index f9c14953462..1dff7f1217a 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.interceptor.auth.AuthorizationInterceptor.Verdict; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -31,7 +32,6 @@ import org.hl7.fhir.instance.model.api.IIdType; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; class OperationRule extends BaseRule implements IAuthRule { private String myOperationName; 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 804465dc069..c8f8396ab90 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 @@ -26,6 +26,7 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -39,7 +40,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; 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 5b108b982c4..782573e8942 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 @@ -37,6 +37,8 @@ import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.bundle.BundleEntryParts; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IBaseBundle; @@ -53,8 +55,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingConsentService.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingConsentService.java index ff8855b6596..01225b39543 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingConsentService.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingConsentService.java @@ -27,13 +27,13 @@ import ca.uhn.fhir.rest.server.interceptor.consent.IConsentContextServices; import ca.uhn.fhir.rest.server.interceptor.consent.IConsentService; import ca.uhn.fhir.rest.server.util.FhirContextSearchParamRegistry; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; -import javax.annotation.Nonnull; public class SearchNarrowingConsentService implements IConsentService { private static final Logger ourLog = LoggerFactory.getLogger(SearchNarrowingConsentService.class); diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java index affa0936f39..db87b01b2aa 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java @@ -45,6 +45,7 @@ import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.ValidateUtil; import ca.uhn.fhir.util.bundle.ModifiableBundleEntry; import com.google.common.collect.ArrayListMultimap; +import jakarta.annotation.Nullable; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.collections4.ListUtils; @@ -63,7 +64,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nullable; /** * This interceptor can be used to automatically narrow the scope of searches in order to diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchParameterAndValueSetRuleImpl.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchParameterAndValueSetRuleImpl.java index 6008304c3ab..e0d211c2f7e 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchParameterAndValueSetRuleImpl.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchParameterAndValueSetRuleImpl.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.util.FhirTerser; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -40,7 +41,6 @@ import org.slf4j.Logger; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java index 512f6b47731..8f2a16e63c9 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java @@ -38,6 +38,8 @@ import ca.uhn.fhir.rest.server.interceptor.auth.AuthorizationConstants; import ca.uhn.fhir.rest.server.util.ICachedSearchDetails; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.IModelVisitor2; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBundle; @@ -53,8 +55,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.api.Constants.URL_TOKEN_METADATA; import static ca.uhn.fhir.rest.server.provider.ProviderConstants.OPERATION_META; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java index 8e035e5a2d0..500e29fdd10 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java @@ -28,8 +28,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.tenant.ITenantIdentificationStrategy; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/validation/address/impl/LoquateAddressValidator.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/validation/address/impl/LoquateAddressValidator.java index 3cb331d777b..302025326a5 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/validation/address/impl/LoquateAddressValidator.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/validation/address/impl/LoquateAddressValidator.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.http.entity.ContentType; @@ -44,7 +45,6 @@ import java.math.BigDecimal; import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.server.interceptor.validation.address.IAddressValidator.ADDRESS_QUALITY_EXTENSION_URL; import static ca.uhn.fhir.rest.server.interceptor.validation.address.IAddressValidator.ADDRESS_VERIFICATION_CODE_EXTENSION_URL; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/IMailSvc.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/IMailSvc.java index 53526b4ffe8..42f37636b54 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/IMailSvc.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/IMailSvc.java @@ -19,11 +19,11 @@ */ package ca.uhn.fhir.rest.server.mail; +import jakarta.annotation.Nonnull; import org.simplejavamail.api.email.Email; import org.simplejavamail.api.mailer.AsyncResponse; import java.util.List; -import javax.annotation.Nonnull; public interface IMailSvc { void sendMail(@Nonnull List theEmails); diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/MailSvc.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/MailSvc.java index e635414d151..be21c3df3e8 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/MailSvc.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/mail/MailSvc.java @@ -19,6 +19,7 @@ */ package ca.uhn.fhir.rest.server.mail; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.simplejavamail.MailException; import org.simplejavamail.api.email.Email; @@ -33,7 +34,6 @@ import org.slf4j.LoggerFactory; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class MailSvc implements IMailSvc { private static final Logger ourLog = LoggerFactory.getLogger(MailSvc.class); diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java index 66283ec0682..1fdddf93cef 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceMessage.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.Validate; @@ -31,7 +32,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceModifiedMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceModifiedMessage.java index bda74f798d7..3fc0e27e713 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceModifiedMessage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/BaseResourceModifiedMessage.java @@ -29,14 +29,14 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.ResourceReferenceInfo; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessage.java index b914fd1bbdf..f2ee8e35ce1 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessage.java @@ -21,11 +21,10 @@ package ca.uhn.fhir.rest.server.messaging.json; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; -import javax.annotation.Nullable; - import static java.util.Objects.isNull; import static org.apache.commons.lang3.StringUtils.defaultString; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/ResourceOperationJsonMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/ResourceOperationJsonMessage.java index 7b90f8c0461..b27db0de2a0 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/ResourceOperationJsonMessage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/json/ResourceOperationJsonMessage.java @@ -21,10 +21,9 @@ package ca.uhn.fhir.rest.server.messaging.json; import ca.uhn.fhir.rest.server.messaging.ResourceOperationMessage; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; -import javax.annotation.Nullable; - public class ResourceOperationJsonMessage extends BaseJsonMessage { @JsonProperty("payload") diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseMethodBinding.java index e6fa8df04f2..6d3600486eb 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseMethodBinding.java @@ -50,6 +50,7 @@ import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.ReflectionUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -64,7 +65,6 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ConformanceMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ConformanceMethodBinding.java index 3d6dab05c5d..1b7bfeec4dd 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ConformanceMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ConformanceMethodBinding.java @@ -39,6 +39,7 @@ import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.system.HapiSystemProperties; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseConformance; import java.lang.reflect.Method; @@ -49,7 +50,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import javax.annotation.Nonnull; public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding { public static final String CACHE_THREAD_PREFIX = "capabilitystatement-cache-"; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/CreateMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/CreateMethodBinding.java index c281da37bfd..30956fc268d 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/CreateMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/CreateMethodBinding.java @@ -26,13 +26,13 @@ import ca.uhn.fhir.rest.annotation.Create; import ca.uhn.fhir.rest.api.RequestTypeEnum; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import java.lang.reflect.Method; import java.util.Collections; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/DeleteMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/DeleteMethodBinding.java index ecb730951c7..3539fa13b3c 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/DeleteMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/DeleteMethodBinding.java @@ -24,11 +24,11 @@ import ca.uhn.fhir.rest.annotation.Delete; import ca.uhn.fhir.rest.api.RequestTypeEnum; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import java.lang.reflect.Method; import java.util.Collections; import java.util.Set; -import javax.annotation.Nonnull; public class DeleteMethodBinding extends BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/GraphQLMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/GraphQLMethodBinding.java index 9a19db59c55..3e111bf66d3 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/GraphQLMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/GraphQLMethodBinding.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.rest.api.server.ResponseDetails; import ca.uhn.fhir.rest.param.ParameterUtil; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.Validate; @@ -43,7 +44,6 @@ import java.io.Writer; import java.lang.reflect.Method; import java.util.Collections; import java.util.Set; -import javax.annotation.Nonnull; public class GraphQLMethodBinding extends OperationMethodBinding { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/HistoryMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/HistoryMethodBinding.java index 2a7ea30cd82..cc50af9654b 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/HistoryMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/HistoryMethodBinding.java @@ -35,6 +35,7 @@ import ca.uhn.fhir.rest.param.ParameterUtil; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -43,7 +44,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/OperationMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/OperationMethodBinding.java index 4addaf9ee80..095eabfc1a7 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/OperationMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/OperationMethodBinding.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.rest.param.ParameterUtil; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.hl7.fhir.instance.model.api.IBase; @@ -51,7 +52,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PageMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PageMethodBinding.java index ecf91cd264b..38192741daf 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PageMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PageMethodBinding.java @@ -38,12 +38,12 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ReflectionUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PatchMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PatchMethodBinding.java index 8c2a4318b4f..de528c51648 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PatchMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/PatchMethodBinding.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.rest.api.PatchTypeEnum; import ca.uhn.fhir.rest.api.RequestTypeEnum; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IIdType; import java.lang.annotation.Annotation; @@ -36,7 +37,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.ListIterator; import java.util.Set; -import javax.annotation.Nonnull; /** * Base class for an operation that has a resource type but not a resource body in the diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ReadMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ReadMethodBinding.java index 098b36c006a..30ad9f13081 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ReadMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ReadMethodBinding.java @@ -41,6 +41,7 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.NotModifiedException; import ca.uhn.fhir.util.DateUtils; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -51,7 +52,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResourceParameter.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResourceParameter.java index 4165d16e959..4a9ca1452fb 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResourceParameter.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResourceParameter.java @@ -34,6 +34,7 @@ import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.BinaryUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseBinary; @@ -47,7 +48,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.nio.charset.Charset; import java.util.Collection; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java index f8987491af3..33307f2d556 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/SearchMethodBinding.java @@ -35,6 +35,7 @@ import ca.uhn.fhir.rest.param.QualifierDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -45,7 +46,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/TransactionMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/TransactionMethodBinding.java index 59e9eb52300..ec5e9c90a90 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/TransactionMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/TransactionMethodBinding.java @@ -34,11 +34,11 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.method.TransactionParameter.ParamStyle; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import java.lang.reflect.Method; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/UpdateMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/UpdateMethodBinding.java index 0b42bc547a2..bce13fa7c3d 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/UpdateMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/UpdateMethodBinding.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.param.ParameterUtil; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import java.lang.reflect.Method; import java.util.Collections; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java index 71e2b8d8be3..a154e878439 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/HashMapResourceProvider.java @@ -57,6 +57,7 @@ import ca.uhn.fhir.rest.server.method.ResponsePage; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.ValidateUtil; import com.google.common.collect.Lists; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -77,7 +78,6 @@ import java.util.Map; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static java.lang.Math.max; import static java.lang.Math.min; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/IResourceProviderFactoryObserver.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/IResourceProviderFactoryObserver.java index 0256d43ebac..fbaa949074b 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/IResourceProviderFactoryObserver.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/IResourceProviderFactoryObserver.java @@ -19,8 +19,9 @@ */ package ca.uhn.fhir.rest.server.provider; +import jakarta.annotation.Nonnull; + import java.util.function.Supplier; -import javax.annotation.Nonnull; public interface IResourceProviderFactoryObserver { void update(@Nonnull Supplier theSupplier); 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 7e0e4235a44..0d7cd66aaff 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 @@ -213,11 +213,6 @@ public class ProviderConstants { */ public static final String OPERATION_REINDEX_RESPONSE_JOB_ID = "jobId"; - /** - * Operation name for the $member-match operation - */ - public static final String OPERATION_MEMBER_MATCH = "$member-match"; - /** * Operation name for the $reindex-terminology operation */ diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ResourceProviderFactory.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ResourceProviderFactory.java index 1a9fd7dcfc5..9caf01839e3 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ResourceProviderFactory.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ResourceProviderFactory.java @@ -19,13 +19,14 @@ */ package ca.uhn.fhir.rest.server.provider; +import jakarta.annotation.Nonnull; + import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.function.Supplier; -import javax.annotation.Nonnull; public class ResourceProviderFactory { private Set myObservers = Collections.synchronizedSet(new HashSet<>()); diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java index 1cbb83bebba..771d199649f 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/provider/ServerCapabilityStatementProvider.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.util.ExtensionUtil; import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.HapiExtensions; import com.google.common.collect.TreeMultimap; +import jakarta.annotation.Nonnull; import jakarta.servlet.ServletContext; import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.text.WordUtils; @@ -76,7 +77,6 @@ import java.util.Set; import java.util.TreeSet; import java.util.UUID; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRequestDetails.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRequestDetails.java index d8ee5d57e48..0879221f341 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRequestDetails.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRequestDetails.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; @@ -47,7 +48,6 @@ import java.util.List; import java.util.Map; import java.util.StringTokenizer; import java.util.zip.GZIPInputStream; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.trim; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRestfulResponse.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRestfulResponse.java index b51d6ca2960..26105e5f548 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRestfulResponse.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/servlet/ServletRestfulResponse.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.rest.server.servlet; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.BaseRestfulResponse; import ca.uhn.fhir.util.IoUtil; +import jakarta.annotation.Nonnull; import jakarta.servlet.ServletOutputStream; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; @@ -36,7 +37,6 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map.Entry; import java.util.zip.GZIPOutputStream; -import javax.annotation.Nonnull; public class ServletRestfulResponse extends BaseRestfulResponse { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/BaseServerCapabilityStatementProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/BaseServerCapabilityStatementProvider.java index 612f3afca2c..fea0f63a29e 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/BaseServerCapabilityStatementProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/BaseServerCapabilityStatementProvider.java @@ -22,10 +22,9 @@ package ca.uhn.fhir.rest.server.util; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.rest.server.RestfulServerConfiguration; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; -import javax.annotation.Nullable; - public abstract class BaseServerCapabilityStatementProvider { private RestfulServerConfiguration myConfiguration; diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/CompositeInterceptorBroadcaster.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/CompositeInterceptorBroadcaster.java index c33928452f1..5cfd8dfb4a5 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/CompositeInterceptorBroadcaster.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/CompositeInterceptorBroadcaster.java @@ -23,8 +23,7 @@ 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.rest.api.server.RequestDetails; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class CompositeInterceptorBroadcaster { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/FhirContextSearchParamRegistry.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/FhirContextSearchParamRegistry.java index a98872fec87..b321574bc5d 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/FhirContextSearchParamRegistry.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/FhirContextSearchParamRegistry.java @@ -25,6 +25,8 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeSearchParam; import ca.uhn.fhir.context.phonetic.IPhoneticEncoder; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IIdType; @@ -32,8 +34,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class FhirContextSearchParamRegistry implements ISearchParamRegistry { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/ISearchParamRegistry.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/ISearchParamRegistry.java index d37ed620067..fe43823a31a 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/ISearchParamRegistry.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/util/ISearchParamRegistry.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.context.phonetic.IPhoneticEncoder; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -34,7 +35,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.TreeSet; -import javax.annotation.Nullable; // TODO: JA remove default methods public interface ISearchParamRegistry { diff --git a/hapi-fhir-server/src/test/java/ca/uhn/fhir/rest/server/mail/MailSvcIT.java b/hapi-fhir-server/src/test/java/ca/uhn/fhir/rest/server/mail/MailSvcIT.java index 87f039401cb..9e6e2099520 100644 --- a/hapi-fhir-server/src/test/java/ca/uhn/fhir/rest/server/mail/MailSvcIT.java +++ b/hapi-fhir-server/src/test/java/ca/uhn/fhir/rest/server/mail/MailSvcIT.java @@ -10,7 +10,7 @@ import org.simplejavamail.MailException; import org.simplejavamail.api.email.Email; import org.simplejavamail.email.EmailBuilder; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import javax.mail.internet.MimeMessage; import java.util.Arrays; import java.util.List; diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml index 153d21bec27..717dc503b22 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-api/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml index 577b77c3056..4892de65b91 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-caffeine/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml @@ -21,7 +21,7 @@ ca.uhn.hapi.fhir hapi-fhir-caching-api - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml index 789346cd68a..4ac7744f800 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-guava/pom.xml @@ -7,7 +7,7 @@ hapi-fhir-serviceloaders ca.uhn.hapi.fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml index 26a01f302a4..68182ea7940 100644 --- a/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml +++ b/hapi-fhir-serviceloaders/hapi-fhir-caching-testing/pom.xml @@ -7,7 +7,7 @@ hapi-fhir ca.uhn.hapi.fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../pom.xml diff --git a/hapi-fhir-serviceloaders/pom.xml b/hapi-fhir-serviceloaders/pom.xml index 830172b35a3..45d0307e9d7 100644 --- a/hapi-fhir-serviceloaders/pom.xml +++ b/hapi-fhir-serviceloaders/pom.xml @@ -5,7 +5,7 @@ hapi-deployable-pom ca.uhn.hapi.fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml 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 11e06f6bf2b..4e76a3e78e7 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 - 6.11.5-SNAPSHOT + 6.11.7-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 f7e1fc2f252..2b50aacd7ef 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 - 6.11.5-SNAPSHOT + 6.11.7-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 ed42f43c5bb..4f5bae777e6 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT 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 14c6b0a2b61..6ac1fcffe05 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT 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 2de95d71325..213031cf9f9 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT 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 e833cf5256a..4c620fb3e24 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-spring-boot/pom.xml b/hapi-fhir-spring-boot/pom.xml index 6824520b126..08ebc710049 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 - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml diff --git a/hapi-fhir-sql-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml index dbbbc4b1d7a..5152c3ba85f 100644 --- a/hapi-fhir-sql-migrate/pom.xml +++ b/hapi-fhir-sql-migrate/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -35,6 +35,10 @@ org.hibernate.orm hibernate-core + + jakarta.annotation + jakarta.annotation-api + jakarta.transaction jakarta.transaction-api diff --git a/hapi-fhir-sql-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 index 1eadeca435b..00e909afe9a 100644 --- a/hapi-fhir-sql-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 @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.migrate; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nonnull; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; @@ -35,7 +36,6 @@ import org.springframework.transaction.support.TransactionTemplate; import java.lang.reflect.InvocationTargetException; import java.sql.Connection; import java.sql.SQLException; -import javax.annotation.Nonnull; import javax.sql.DataSource; public enum DriverTypeEnum { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrator.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrator.java index 6b0fecdd89c..72e2bcf5a55 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrator.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrator.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.jpa.migrate.taskdef.InitializeSchemaTask; import ca.uhn.fhir.system.HapiSystemProperties; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +35,6 @@ import java.sql.SQLException; import java.util.Collections; import java.util.List; import java.util.Objects; -import javax.annotation.Nonnull; import javax.sql.DataSource; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-sql-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 index 551407f8e05..95c21f2af17 100644 --- a/hapi-fhir-sql-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 @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.migrate; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.migrate.taskdef.ColumnTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -62,7 +63,6 @@ import java.util.Locale; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; import javax.sql.DataSource; public class JdbcUtils { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java index 1275412c875..afc3a003fa6 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.migrate; import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; +import jakarta.annotation.Nonnull; import org.flywaydb.core.api.MigrationVersion; import java.util.ArrayList; @@ -29,7 +30,6 @@ import java.util.List; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class MigrationTaskList implements Iterable { private final List myTasks; diff --git a/hapi-fhir-sql-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 index d39bc434614..4ecd8a92dee 100644 --- a/hapi-fhir-sql-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 @@ -31,6 +31,10 @@ public class AddColumnTask extends BaseTableColumnTypeTask { private static final Logger ourLog = LoggerFactory.getLogger(AddColumnTask.class); + public static AddColumnTask lowerCase(Set theColumnDriverMappingOverrides) { + return new AddColumnTask(null, null, ColumnNameCase.ALL_LOWER, theColumnDriverMappingOverrides); + } + public AddColumnTask() { this(null, null); setDryRun(true); @@ -41,6 +45,14 @@ public class AddColumnTask extends BaseTableColumnTypeTask { super(theProductVersion, theSchemaVersion); } + private AddColumnTask( + String theProductVersion, + String theSchemaVersion, + ColumnNameCase theColumnNameCase, + Set theColumnDriverMappingOverrides) { + super(theProductVersion, theSchemaVersion, theColumnNameCase, theColumnDriverMappingOverrides); + } + @Override public void validate() { super.validate(); diff --git a/hapi-fhir-sql-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 index d05b6784e06..5349436f29f 100644 --- a/hapi-fhir-sql-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 @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.JdbcUtils; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -33,7 +34,6 @@ import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Set; -import javax.annotation.Nonnull; public class AddIndexTask extends BaseTableTask { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java index 45e254bce89..bf17e6def25 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java @@ -29,7 +29,9 @@ import org.slf4j.LoggerFactory; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; public class AddTableByColumnTask extends BaseTableTask { @@ -38,15 +40,26 @@ public class AddTableByColumnTask extends BaseTableTask { private final List myAddColumnTasks = new ArrayList<>(); private List myPkColumns; private final List myFKColumns = new ArrayList<>(); + private final Comparator myColumnSortingRules; public AddTableByColumnTask() { - this(null, null); + this(null); + } + + public AddTableByColumnTask(Comparator theColumnSortingRules) { + this(null, null, theColumnSortingRules); setDryRun(true); myCheckForExistingTables = false; } public AddTableByColumnTask(String theProductVersion, String theSchemaVersion) { + this(theProductVersion, theSchemaVersion, null); + } + + private AddTableByColumnTask( + String theProductVersion, String theSchemaVersion, Comparator theColumnSortingRules) { super(theProductVersion, theSchemaVersion); + myColumnSortingRules = theColumnSortingRules; } @Override @@ -83,7 +96,7 @@ public class AddTableByColumnTask extends BaseTableTask { sb.append(" "); } - for (AddColumnTask next : myAddColumnTasks) { + for (AddColumnTask next : getOrderedAddColumnTasks()) { next.setDriverType(getDriverType()); next.setTableName(getTableName()); next.validate(); @@ -194,4 +207,12 @@ public class AddTableByColumnTask extends BaseTableTask { theBuilder.append(myAddColumnTasks); theBuilder.append(myPkColumns); } + + private List getOrderedAddColumnTasks() { + if (myColumnSortingRules == null) { + return myAddColumnTasks; + } + + return myAddColumnTasks.stream().sorted(myColumnSortingRules).collect(Collectors.toUnmodifiableList()); + } } diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java index c7616bde567..36fcb164543 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTask.java @@ -19,12 +19,15 @@ */ package ca.uhn.fhir.jpa.migrate.taskdef; +import ca.uhn.fhir.i18n.Msg; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Set; import java.util.function.Function; public abstract class BaseTableColumnTask extends BaseTableTask { @@ -35,8 +38,19 @@ public abstract class BaseTableColumnTask extends BaseTableTask { // If a concrete class decides to, they can define a custom WHERE clause for the task. protected String myWhereClause; + private final ColumnNameCase myColumnNameCase; + public BaseTableColumnTask(String theProductVersion, String theSchemaVersion) { - super(theProductVersion, theSchemaVersion); + this(theProductVersion, theSchemaVersion, ColumnNameCase.ALL_UPPER, Collections.emptySet()); + } + + BaseTableColumnTask( + String theProductVersion, + String theSchemaVersion, + ColumnNameCase theColumnNameCase, + Set theColumnDriverMappingOverrides) { + super(theProductVersion, theSchemaVersion, theColumnDriverMappingOverrides); + myColumnNameCase = theColumnNameCase; } public String getColumnName() { @@ -44,7 +58,17 @@ public abstract class BaseTableColumnTask extends BaseTableTask { } public BaseTableColumnTask setColumnName(String theColumnName) { - myColumnName = theColumnName.toUpperCase(); + switch (myColumnNameCase) { + case ALL_UPPER: + myColumnName = theColumnName.toUpperCase(); + break; + case ALL_LOWER: + myColumnName = theColumnName.toLowerCase(); + break; + default: + throw new IllegalArgumentException(Msg.code(2448) + + " Unknown ColumnNameCase was passed when setting column name case: " + myColumnNameCase); + } return this; } diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java index 50abfa63d33..75dc343f2af 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableColumnTypeTask.java @@ -19,11 +19,12 @@ */ package ca.uhn.fhir.jpa.migrate.taskdef; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; -import javax.annotation.Nullable; +import java.util.Set; public abstract class BaseTableColumnTypeTask extends BaseTableColumnTask { private ColumnTypeEnum myColumnType; @@ -37,6 +38,14 @@ public abstract class BaseTableColumnTypeTask extends BaseTableColumnTask { super(theProductVersion, theSchemaVersion); } + BaseTableColumnTypeTask( + String theProductVersion, + String theSchemaVersion, + ColumnNameCase theColumnNameCase, + Set theColumnDriverMappingOverrides) { + super(theProductVersion, theSchemaVersion, theColumnNameCase, theColumnDriverMappingOverrides); + } + public ColumnTypeEnum getColumnType() { return myColumnType; } diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java index 049ed847d35..5ffd6c38569 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTableTask.java @@ -19,17 +19,37 @@ */ package ca.uhn.fhir.jpa.migrate.taskdef; +import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; public abstract class BaseTableTask extends BaseTask { + private static final Logger ourLog = LoggerFactory.getLogger(BaseTableTask.class); private String myTableName; + private final List myColumnDriverMappingOverrides; + public BaseTableTask(String theProductVersion, String theSchemaVersion) { + this(theProductVersion, theSchemaVersion, Collections.emptySet()); + } + + public BaseTableTask( + String theProductVersion, + String theSchemaVersion, + Set theColumnDriverMappingOverrides) { super(theProductVersion, theSchemaVersion); + myColumnDriverMappingOverrides = new ArrayList<>(theColumnDriverMappingOverrides); } public String getTableName() { @@ -54,13 +74,12 @@ public abstract class BaseTableTask extends BaseTask { } protected String getSqlType(ColumnTypeEnum theColumnType, Long theColumnLength) { - String retVal = ColumnTypeToDriverTypeToSqlType.getColumnTypeToDriverTypeToSqlType() - .get(theColumnType) - .get(getDriverType()); + final String retVal = getColumnSqlWithToken(theColumnType); + Objects.requireNonNull(retVal); if (theColumnType == ColumnTypeEnum.STRING) { - retVal = retVal.replace("?", Long.toString(theColumnLength)); + return retVal.replace("?", Long.toString(theColumnLength)); } return retVal; @@ -70,4 +89,29 @@ public abstract class BaseTableTask extends BaseTask { protected void generateHashCode(HashCodeBuilder theBuilder) { theBuilder.append(myTableName); } + + @Nonnull + private String getColumnSqlWithToken(ColumnTypeEnum theColumnType) { + final List eligibleOverrides = myColumnDriverMappingOverrides.stream() + .filter(override -> override.getColumnType() == theColumnType) + .filter(override -> override.getDriverType() == getDriverType()) + .collect(Collectors.toUnmodifiableList()); + + if (eligibleOverrides.size() > 1) { + ourLog.info("There is more than one eligible override: {}. Picking the first one", eligibleOverrides); + } + + if (eligibleOverrides.size() == 1) { + return eligibleOverrides.get(0).getColumnTypeSql(); + } + + if (!ColumnTypeToDriverTypeToSqlType.getColumnTypeToDriverTypeToSqlType() + .containsKey(theColumnType)) { + throw new IllegalArgumentException(Msg.code(2449) + "Column type does not exist: " + theColumnType); + } + + return ColumnTypeToDriverTypeToSqlType.getColumnTypeToDriverTypeToSqlType() + .get(theColumnType) + .get(getDriverType()); + } } diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnDriverMappingOverride.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnDriverMappingOverride.java new file mode 100644 index 00000000000..8a669bad7e3 --- /dev/null +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnDriverMappingOverride.java @@ -0,0 +1,88 @@ +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2023 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% + */ +package ca.uhn.fhir.jpa.migrate.taskdef; + +import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; +import jakarta.annotation.Nonnull; + +import java.util.Objects; +import java.util.StringJoiner; + +/** + * Capture a single SQL column type text override to the logic in {@link ColumnDriverMappingOverride}, namely, + * by column type and driver type. + *

+ * Several overrides can be passed down together at the same time to override said logic. + */ +public class ColumnDriverMappingOverride { + private final ColumnTypeEnum myColumnType; + private final DriverTypeEnum myDriverType; + + private final String myColumnTypeSql; + + public ColumnDriverMappingOverride( + @Nonnull ColumnTypeEnum theColumnType, + @Nonnull DriverTypeEnum theDriverType, + @Nonnull String theColumnTypeSql) { + myColumnType = theColumnType; + myDriverType = theDriverType; + myColumnTypeSql = theColumnTypeSql; + } + + public ColumnTypeEnum getColumnType() { + return myColumnType; + } + + public DriverTypeEnum getDriverType() { + return myDriverType; + } + + public String getColumnTypeSql() { + return myColumnTypeSql; + } + + @Override + public boolean equals(Object theO) { + if (this == theO) { + return true; + } + if (theO == null || getClass() != theO.getClass()) { + return false; + } + ColumnDriverMappingOverride that = (ColumnDriverMappingOverride) theO; + return myColumnType == that.myColumnType + && myDriverType == that.myDriverType + && Objects.equals(myColumnTypeSql, that.myColumnTypeSql); + } + + @Override + public int hashCode() { + return Objects.hash(myColumnType, myDriverType, myColumnTypeSql); + } + + @Override + public String toString() { + return new StringJoiner(", ", ColumnDriverMappingOverride.class.getSimpleName() + "[", "]") + .add("myColumnType=" + myColumnType) + .add("myDriverType=" + myDriverType) + .add("myColumnTypeSql='" + myColumnTypeSql + "'") + .toString(); + } +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IMemberMatchConsentHook.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnNameCase.java similarity index 69% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IMemberMatchConsentHook.java rename to hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnNameCase.java index 8c2f59f4023..47b243e0a59 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/IMemberMatchConsentHook.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ColumnNameCase.java @@ -1,6 +1,6 @@ /*- * #%L - * HAPI FHIR JPA Server + * HAPI FHIR Server - SQL Migration * %% * Copyright (C) 2014 - 2023 Smile CDR, Inc. * %% @@ -17,13 +17,12 @@ * limitations under the License. * #L% */ -package ca.uhn.fhir.jpa.provider.r4; - -import org.hl7.fhir.instance.model.api.IBaseResource; - -import java.util.function.Consumer; +package ca.uhn.fhir.jpa.migrate.taskdef; /** - * Pre-save hook for Consent saved during $member-match. + * Determine whether to display column names in upper case, lower case, or eventually some form of mixed case. */ -public interface IMemberMatchConsentHook extends Consumer {} +public enum ColumnNameCase { + ALL_UPPER, + ALL_LOWER +} diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java index b8f99f221ef..c5db9820eb5 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.JdbcUtils; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -32,7 +33,6 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java index 8689efaec96..8ee052f776e 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.JdbcUtils; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -37,7 +38,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Set; -import javax.annotation.Nonnull; import javax.sql.DataSource; public class DropIndexTask extends BaseTableTask { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ForeignKeyContainer.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ForeignKeyContainer.java index b0846ee464c..345e79a963d 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ForeignKeyContainer.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ForeignKeyContainer.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class ForeignKeyContainer { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java index 68b3b51733b..9feddafa381 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.tasks.api.ISchemaInitializationProvider; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -33,7 +34,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.trim; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java index e5976112e0c..bc8fa10689d 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java @@ -24,12 +24,12 @@ import ca.uhn.fhir.jpa.migrate.MigrationTaskList; import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.EnumUtils; import org.apache.commons.lang3.Validate; import org.flywaydb.core.api.MigrationVersion; import java.util.Collection; -import javax.annotation.Nonnull; public class BaseMigrationTasks { MigrationVersion lastVersion; diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/HapiMigratorIT.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/HapiMigratorIT.java index 47ebb9cfbab..f8ad7225e96 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/HapiMigratorIT.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/HapiMigratorIT.java @@ -16,7 +16,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jdbc.core.JdbcTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipperTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipperTest.java index 2c1fa653e6e..cc660122408 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipperTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/MigrationTaskSkipperTest.java @@ -5,7 +5,7 @@ import ca.uhn.fhir.jpa.migrate.taskdef.DropIndexTask; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java index df2d9cfa02b..0df4e68d27e 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java @@ -12,7 +12,7 @@ import org.hamcrest.Matchers; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.sql.SQLException; import java.util.List; import java.util.Properties; diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTest.java index f22a01fb5a5..7cae6c1ae7e 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTest.java @@ -77,7 +77,7 @@ public class AddColumnTest extends BaseTest { @ParameterizedTest(name = "{index}: {0}") @MethodSource("data") - public void testAddColumnToNonExistantTable_Failing(Supplier theTestDatabaseDetails) { + public void testAddColumnToNonExistentTable_Failing(Supplier theTestDatabaseDetails) { before(theTestDatabaseDetails); BaseMigrationTasks tasks = new BaseMigrationTasks<>(); @@ -93,7 +93,7 @@ public class AddColumnTest extends BaseTest { getMigrator().migrate(); fail(); } catch (HapiMigrationException e) { - assertThat(e.getMessage(), startsWith("HAPI-0047: Failure executing task \"Add column foo_column on table FOO_TABLE\", aborting! Cause: ca.uhn.fhir.jpa.migrate.HapiMigrationException: HAPI-0061: Failed during task 4.0.0.2001.01: ")); + assertThat(e.getMessage(), startsWith("HAPI-0047: Failure executing task \"Add column FOO_COLUMN on table FOO_TABLE\", aborting! Cause: ca.uhn.fhir.jpa.migrate.HapiMigrationException: HAPI-0061: Failed during task 4.0.0.2001.01: ")); } } diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java index 06e1bbbf766..f416ed8f66e 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java @@ -5,16 +5,20 @@ import ca.uhn.fhir.jpa.migrate.JdbcUtils; import ca.uhn.fhir.jpa.migrate.tasks.api.BaseMigrationTasks; import ca.uhn.fhir.jpa.migrate.tasks.api.Builder; import ca.uhn.fhir.util.VersionEnum; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import java.sql.SQLException; +import java.util.Collections; +import java.util.Comparator; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; public class AddTableByColumnTaskTest extends BaseTest { @@ -42,6 +46,96 @@ public class AddTableByColumnTaskTest extends BaseTest { assertThat(indexes.toString(), indexes, containsInAnyOrder("IDX_BONJOUR")); } + @Test + public void testLowercaseColumnsNoOverridesDefaultSorting() { + final String tableName = "table_3_columns"; + final String columnName1 = "a_column"; + final String columnName3 = "z_column"; + final String columnNameId = "id"; + final DriverTypeEnum driverType = DriverTypeEnum.MSSQL_2012; + final ColumnTypeEnum columnType = ColumnTypeEnum.STRING; + + final AddTableByColumnTask addTableByColumnTask = new AddTableByColumnTask(); + addTableByColumnTask.setTableName(tableName); + addTableByColumnTask.setDriverType(driverType); + addTableByColumnTask.setPkColumns(Collections.singletonList(columnNameId)); + + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName3, true, 10, Collections.emptySet())); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnNameId, false, 25, Collections.emptySet())); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName1, true, 20, Collections.emptySet())); + + final String actualCreateTableSql = addTableByColumnTask.generateSQLCreateScript(); + assertThat("CREATE TABLE table_3_columns ( z_column varchar(10), id varchar(25) not null, a_column varchar(20), PRIMARY KEY (id) )", is(actualCreateTableSql));; + } + + @Test + public void testLowercaseColumnsNvarcharOverrideDefaultSorting() { + final String tableName = "table_3_columns"; + final String columnName1 = "a_column"; + final String columnName3 = "z_column"; + final String columnNameId = "id"; + final DriverTypeEnum driverType = DriverTypeEnum.MSSQL_2012; + final ColumnTypeEnum columnType = ColumnTypeEnum.STRING; + final ColumnDriverMappingOverride override = new ColumnDriverMappingOverride(columnType, driverType, "nvarchar(?)"); + + final AddTableByColumnTask addTableByColumnTask = new AddTableByColumnTask(); + addTableByColumnTask.setTableName(tableName); + addTableByColumnTask.setDriverType(driverType); + addTableByColumnTask.setPkColumns(Collections.singletonList(columnNameId)); + + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName3, true, 10, Collections.singleton(override))); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnNameId, false, 25, Collections.singleton(override))); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName1, true, 20, Collections.singleton(override))); + + final String actualCreateTableSql = addTableByColumnTask.generateSQLCreateScript(); + assertThat("CREATE TABLE table_3_columns ( z_column nvarchar(10), id nvarchar(25) not null, a_column nvarchar(20), PRIMARY KEY (id) )", is(actualCreateTableSql));; + } + + @Test + public void testLowercaseColumnsNoOverridesCustomSorting() { + final String tableName = "table_4_columns"; + final String columnName1 = "a_column"; + final String columnName2 = "b_column"; + final String columnName3 = "z_column"; + final String columnNameId = "id"; + final DriverTypeEnum driverType = DriverTypeEnum.MSSQL_2012; + final ColumnTypeEnum columnType = ColumnTypeEnum.STRING; + final ColumnDriverMappingOverride override = new ColumnDriverMappingOverride(columnType, driverType, "nvarchar(?)"); + final Comparator comparator = (theTask1, theTask2) -> { + if (columnNameId.equals(theTask1.getColumnName())) { + return -1; + } + + return theTask1.getColumnName().compareTo(theTask2.getColumnName()); + }; + + final AddTableByColumnTask addTableByColumnTask = new AddTableByColumnTask(comparator); + addTableByColumnTask.setTableName(tableName); + addTableByColumnTask.setDriverType(driverType); + addTableByColumnTask.setPkColumns(Collections.singletonList(columnNameId)); + + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName3, true, 10, Collections.singleton(override))); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName2, false, 15, Collections.singleton(override))); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnName1, true, 20, Collections.singleton(override))); + addTableByColumnTask.addAddColumnTask(buildAddColumnTask(driverType, columnType, tableName, columnNameId, false, 25, Collections.singleton(override))); + + final String actualCreateTableSql = addTableByColumnTask.generateSQLCreateScript(); + assertThat("CREATE TABLE table_4_columns ( id nvarchar(25) not null, a_column nvarchar(20), b_column nvarchar(15) not null, z_column nvarchar(10), PRIMARY KEY (id) )", is(actualCreateTableSql));; + } + + private static AddColumnTask buildAddColumnTask(DriverTypeEnum theDriverTypeEnum, ColumnTypeEnum theColumnTypeEnum, String theTableName, String theColumnName, boolean theNullable, int theColumnLength, Set theColumnDriverMappingOverrides) { + final AddColumnTask task = AddColumnTask.lowerCase(theColumnDriverMappingOverrides); + + task.setTableName(theTableName); + task.setColumnName(theColumnName); + task.setColumnType(theColumnTypeEnum); + task.setDriverType(theDriverTypeEnum); + task.setNullable(theNullable); + task.setColumnLength(theColumnLength); + + return task; + } + private static class MyMigrationTasks extends BaseMigrationTasks { public MyMigrationTasks() { Builder v = forVersion(VersionEnum.V3_5_0); diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTest.java index d9119765cf4..ce34d2fb6f0 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTest.java @@ -6,7 +6,7 @@ import ca.uhn.fhir.jpa.migrate.JdbcUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.sql.SQLException; import java.util.function.Supplier; diff --git a/hapi-fhir-storage-batch2-jobs/pom.xml b/hapi-fhir-storage-batch2-jobs/pom.xml index 6b5bfb0f4cc..a7f5d8ecbaf 100644 --- a/hapi-fhir-storage-batch2-jobs/pom.xml +++ b/hapi-fhir-storage-batch2-jobs/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportCreateReportStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportCreateReportStep.java index 41a2f600f2a..868f744ed15 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportCreateReportStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportCreateReportStep.java @@ -31,13 +31,13 @@ import ca.uhn.fhir.batch2.model.ChunkOutcome; import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.jpa.api.model.BulkExportJobResults; import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportJobParametersValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportJobParametersValidator.java index caa330197a6..cace5dda943 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportJobParametersValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/BulkExportJobParametersValidator.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java index 15e2f052b72..63542528297 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourceAndWriteBinaryStep.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.FhirTerser; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseExtension; @@ -79,7 +80,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.api.Constants.PARAM_ID; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java index f0b228993b3..a06439c952f 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/ExpandResourcesStep.java @@ -50,6 +50,7 @@ import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +62,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.rest.api.Constants.PARAM_ID; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java index 62626d7e424..982f35894da 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/FetchResourceIdsStep.java @@ -33,6 +33,7 @@ import ca.uhn.fhir.jpa.bulk.export.api.IBulkExportProcessor; import ca.uhn.fhir.jpa.bulk.export.model.ExportPIDIteratorParameters; import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +43,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; public class FetchResourceIdsStep implements IFirstJobStepWorker { private static final Logger ourLog = LoggerFactory.getLogger(FetchResourceIdsStep.class); diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/WriteBinaryStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/WriteBinaryStep.java index 265bf9a0b80..f639d31eb15 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/WriteBinaryStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/export/WriteBinaryStep.java @@ -41,6 +41,7 @@ import ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.FhirTerser; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseExtension; @@ -52,7 +53,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeJobParametersValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeJobParametersValidator.java index 8ac32866735..dd347ae0eb8 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeJobParametersValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeJobParametersValidator.java @@ -26,10 +26,10 @@ import ca.uhn.fhir.jpa.api.svc.IDeleteExpungeSvc; import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class DeleteExpungeJobParametersValidator implements IJobParametersValidator { private final IUrlListValidator myUrlListValidator; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeStep.java index 44bff8ef4ab..70abd6440c7 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/expunge/DeleteExpungeStep.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.jpa.model.dao.JpaPid; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import java.util.List; -import javax.annotation.Nonnull; public class DeleteExpungeStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/BulkImportParameterValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/BulkImportParameterValidator.java index 0a287f635eb..fa5b6b7ef9a 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/BulkImportParameterValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/BulkImportParameterValidator.java @@ -24,13 +24,13 @@ import ca.uhn.fhir.batch2.importpull.models.Batch2BulkImportPullJobParameters; import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc; import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobJson; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.slf4j.LoggerFactory.getLogger; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/FetchPartitionedFilesStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/FetchPartitionedFilesStep.java index e1e9b2a595e..fcf2f53501b 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/FetchPartitionedFilesStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/FetchPartitionedFilesStep.java @@ -29,10 +29,9 @@ import ca.uhn.fhir.batch2.importpull.models.Batch2BulkImportPullJobParameters; import ca.uhn.fhir.batch2.importpull.models.BulkImportFilePartitionResult; import ca.uhn.fhir.jpa.bulk.imprt.api.IBulkDataImportSvc; import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobJson; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; -import javax.annotation.Nonnull; - import static org.slf4j.LoggerFactory.getLogger; public class FetchPartitionedFilesStep diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/ReadInResourcesFromFileStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/ReadInResourcesFromFileStep.java index f62e3aeaa15..88c57c7a90c 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/ReadInResourcesFromFileStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/ReadInResourcesFromFileStep.java @@ -33,12 +33,12 @@ import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobFileJson; import ca.uhn.fhir.jpa.bulk.imprt.model.JobFileRowProcessingModeEnum; import ca.uhn.fhir.util.IoUtil; import com.google.common.io.LineReader; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.StringReader; -import javax.annotation.Nonnull; public class ReadInResourcesFromFileStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/WriteBundleForImportStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/WriteBundleForImportStep.java index ee028fa5300..bab95053c7c 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/WriteBundleForImportStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/importpull/WriteBundleForImportStep.java @@ -33,12 +33,11 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.bulk.imprt.model.JobFileRowProcessingModeEnum; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.api.server.SystemRequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; - public class WriteBundleForImportStep implements ILastJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProvider.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProvider.java index ecef4c12c05..1de6c2476be 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProvider.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProvider.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.util.OperationOutcomeUtil; import ca.uhn.fhir.util.ParametersUtil; import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.ValidateUtil; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; @@ -57,7 +58,6 @@ import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import static ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider.validatePreferAsyncHeader; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkImportJobParameters.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkImportJobParameters.java index 4a40f45b09f..4b4294cda39 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkImportJobParameters.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/BulkImportJobParameters.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.batch2.jobs.imprt; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; @@ -30,7 +31,6 @@ import org.apache.commons.lang3.Validate; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; /** * This class is the parameters model object for starting a diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/ConsumeFilesStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/ConsumeFilesStep.java index 40edfd65ad7..81056e98540 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/ConsumeFilesStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/ConsumeFilesStep.java @@ -41,6 +41,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; +import jakarta.annotation.Nonnull; import org.apache.commons.io.LineIterator; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -53,7 +54,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/FetchFilesStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/FetchFilesStep.java index d16285363d2..2163f8dd109 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/FetchFilesStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/imprt/FetchFilesStep.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.client.impl.HttpBasicAuthInterceptor; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.FileUtil; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nonnull; import org.apache.commons.io.FileUtils; import org.apache.commons.io.LineIterator; import org.apache.commons.lang3.Validate; @@ -47,7 +48,6 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexGenerateRangeChunksStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexGenerateRangeChunksStep.java index 6def68e4997..c127f741f10 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexGenerateRangeChunksStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexGenerateRangeChunksStep.java @@ -26,11 +26,10 @@ import ca.uhn.fhir.batch2.api.StepExecutionDetails; import ca.uhn.fhir.batch2.api.VoidModel; import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson; import ca.uhn.fhir.batch2.jobs.step.GenerateRangeChunksStep; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; - public class ReindexGenerateRangeChunksStep extends GenerateRangeChunksStep { private static final Logger ourLog = LoggerFactory.getLogger(ReindexGenerateRangeChunksStep.class); diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParameters.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParameters.java index 9ba7802e8ed..5480a65b45c 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParameters.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParameters.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.batch2.jobs.reindex; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrlListJobParameters; import ca.uhn.fhir.jpa.api.dao.ReindexParameters; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParametersValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParametersValidator.java index ce00a180973..e9142c1a741 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParametersValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexJobParametersValidator.java @@ -23,11 +23,11 @@ import ca.uhn.fhir.batch2.api.IJobParametersValidator; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrl; import ca.uhn.fhir.batch2.jobs.parameters.UrlListValidator; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class ReindexJobParametersValidator implements IJobParametersValidator { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexStep.java index 0b301e55a77..45b1c440a98 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/reindex/ReindexStep.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -48,7 +49,6 @@ import org.springframework.transaction.support.TransactionCallback; import java.util.List; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; public class ReindexStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemConceptsByVersionStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemConceptsByVersionStep.java index 798d795f3d9..ebdcf0d8f97 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemConceptsByVersionStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemConceptsByVersionStep.java @@ -27,8 +27,7 @@ import ca.uhn.fhir.batch2.api.StepExecutionDetails; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class DeleteCodeSystemConceptsByVersionStep implements IJobStepWorker< diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemStep.java index 9627546b191..411776db0a0 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemStep.java @@ -30,8 +30,7 @@ import ca.uhn.fhir.batch2.model.ChunkOutcome; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class DeleteCodeSystemStep implements IReductionStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemVersionStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemVersionStep.java index 91e0bc8ea49..b4c8c2604b7 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemVersionStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/DeleteCodeSystemVersionStep.java @@ -27,8 +27,7 @@ import ca.uhn.fhir.batch2.api.StepExecutionDetails; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class DeleteCodeSystemVersionStep implements IJobStepWorker< diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/ReadTermConceptVersionsStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/ReadTermConceptVersionsStep.java index a8a5a309c21..7f87fb4b78c 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/ReadTermConceptVersionsStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/ReadTermConceptVersionsStep.java @@ -28,9 +28,9 @@ import ca.uhn.fhir.batch2.api.VoidModel; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteJobParameters; +import jakarta.annotation.Nonnull; import java.util.Iterator; -import javax.annotation.Nonnull; public class ReadTermConceptVersionsStep implements IFirstJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/TermCodeSystemDeleteJobParametersValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/TermCodeSystemDeleteJobParametersValidator.java index e9e33d7cf0c..044e5d0eda0 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/TermCodeSystemDeleteJobParametersValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemdelete/TermCodeSystemDeleteJobParametersValidator.java @@ -22,11 +22,11 @@ package ca.uhn.fhir.batch2.jobs.termcodesystem.codesystemdelete; import ca.uhn.fhir.batch2.api.IJobParametersValidator; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteJobParameters; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class TermCodeSystemDeleteJobParametersValidator implements IJobParametersValidator { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFinalStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFinalStep.java index 2785fa08189..7744a5b3373 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFinalStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFinalStep.java @@ -28,8 +28,7 @@ import ca.uhn.fhir.batch2.api.VoidModel; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteVersionJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class DeleteCodeSystemVersionFinalStep implements ILastJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFirstStep.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFirstStep.java index 55049ed5272..db8f7e16bf5 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFirstStep.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionFirstStep.java @@ -28,8 +28,7 @@ import ca.uhn.fhir.batch2.api.VoidModel; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemDeleteJobSvc; import ca.uhn.fhir.jpa.term.models.CodeSystemVersionPIDResult; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteVersionJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class DeleteCodeSystemVersionFirstStep implements IFirstJobStepWorker { diff --git a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionParameterValidator.java b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionParameterValidator.java index 7e7ad78d5cb..2533adcd361 100644 --- a/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionParameterValidator.java +++ b/hapi-fhir-storage-batch2-jobs/src/main/java/ca/uhn/fhir/batch2/jobs/termcodesystem/codesystemversiondelete/DeleteCodeSystemVersionParameterValidator.java @@ -22,11 +22,11 @@ package ca.uhn.fhir.batch2.jobs.termcodesystem.codesystemversiondelete; import ca.uhn.fhir.batch2.api.IJobParametersValidator; import ca.uhn.fhir.jpa.term.models.TermCodeSystemDeleteVersionJobParameters; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class DeleteCodeSystemVersionParameterValidator implements IJobParametersValidator { diff --git a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProviderTest.java b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProviderTest.java index 69aea5aed76..4d79239db44 100644 --- a/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProviderTest.java +++ b/hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/imprt/BulkDataImportProviderTest.java @@ -50,7 +50,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Date; diff --git a/hapi-fhir-storage-batch2-test-utilities/pom.xml b/hapi-fhir-storage-batch2-test-utilities/pom.xml index 57f9d4347cf..38658c74f86 100644 --- a/hapi-fhir-storage-batch2-test-utilities/pom.xml +++ b/hapi-fhir-storage-batch2-test-utilities/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-batch2-test-utilities/src/main/java/ca/uhn/hapi/fhir/batch2/test/AbstractIJobPersistenceSpecificationTest.java b/hapi-fhir-storage-batch2-test-utilities/src/main/java/ca/uhn/hapi/fhir/batch2/test/AbstractIJobPersistenceSpecificationTest.java index 30b09c1ce8a..7e188e624b2 100644 --- a/hapi-fhir-storage-batch2-test-utilities/src/main/java/ca/uhn/hapi/fhir/batch2/test/AbstractIJobPersistenceSpecificationTest.java +++ b/hapi-fhir-storage-batch2-test-utilities/src/main/java/ca/uhn/hapi/fhir/batch2/test/AbstractIJobPersistenceSpecificationTest.java @@ -53,7 +53,7 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/hapi-fhir-storage-batch2/pom.xml b/hapi-fhir-storage-batch2/pom.xml index 803455a67d2..42541c03098 100644 --- a/hapi-fhir-storage-batch2/pom.xml +++ b/hapi-fhir-storage-batch2/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobCoordinator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobCoordinator.java index 46d38ff13b2..3fb685c34bf 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobCoordinator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobCoordinator.java @@ -27,12 +27,12 @@ import ca.uhn.fhir.jpa.batch.models.Batch2JobStartResponse; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.data.domain.Page; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IJobCoordinator { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobParametersValidator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobParametersValidator.java index 98ebb948adf..f1a8aa7c238 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobParametersValidator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobParametersValidator.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This interface can be used to validate the parameters diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java index 5f4c50e5b79..05c2b489536 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.batch2.model.StatusEnum; import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.batch2.model.WorkChunkCreateEvent; import ca.uhn.fhir.batch2.models.JobInstanceFetchRequest; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +42,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Stream; -import javax.annotation.Nonnull; /** * diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobStepWorker.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobStepWorker.java index 3ce89138632..0ce95bc7789 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobStepWorker.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobStepWorker.java @@ -20,8 +20,7 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.model.api.IModelJson; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * This interface is implemented by step workers within the Batch2 framework. It will be called diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IReductionStepWorker.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IReductionStepWorker.java index 78e0519fc5c..c68b513ba0c 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IReductionStepWorker.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IReductionStepWorker.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.batch2.model.ChunkOutcome; import ca.uhn.fhir.model.api.IModelJson; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * Reduction step worker. diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/JobCompletionDetails.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/JobCompletionDetails.java index ca3d04a259c..e7e99327b16 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/JobCompletionDetails.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/JobCompletionDetails.java @@ -21,10 +21,9 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.model.api.IModelJson; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; -import javax.annotation.Nonnull; - public class JobCompletionDetails { private final PT myParameters; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/ReductionStepExecutionDetails.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/ReductionStepExecutionDetails.java index 620a8414b5e..8da61f1bf2c 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/ReductionStepExecutionDetails.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/ReductionStepExecutionDetails.java @@ -22,9 +22,8 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IModelJson; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; /** * This class is used for Reduction Step for Batch2 Jobs. diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/StepExecutionDetails.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/StepExecutionDetails.java index 93261940461..7617f6e9444 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/StepExecutionDetails.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/StepExecutionDetails.java @@ -21,11 +21,10 @@ package ca.uhn.fhir.batch2.api; import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.model.api.IModelJson; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public class StepExecutionDetails { private final PT myParameters; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/channel/BatchJobSender.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/channel/BatchJobSender.java index f7272a0d2de..2754119214a 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/channel/BatchJobSender.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/channel/BatchJobSender.java @@ -22,11 +22,10 @@ package ca.uhn.fhir.batch2.channel; import ca.uhn.fhir.batch2.model.JobWorkNotification; import ca.uhn.fhir.batch2.model.JobWorkNotificationJsonMessage; import ca.uhn.fhir.jpa.subscription.channel.api.IChannelProducer; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; - public class BatchJobSender { private static final Logger ourLog = LoggerFactory.getLogger(BatchJobSender.class); private final IChannelProducer myWorkChannelProducer; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/FinalStepDataSink.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/FinalStepDataSink.java index 14335a5d2c1..30d2638fe82 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/FinalStepDataSink.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/FinalStepDataSink.java @@ -26,10 +26,9 @@ import ca.uhn.fhir.batch2.model.WorkChunkData; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; -import javax.annotation.Nonnull; - class FinalStepDataSink extends BaseDataSink { private static final Logger ourLog = Logs.getBatchTroubleshootingLog(); diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImpl.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImpl.java index adc1f4e9fe7..d41742eac72 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImpl.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImpl.java @@ -39,6 +39,8 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import org.apache.commons.lang3.Validate; @@ -53,8 +55,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDataSink.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDataSink.java index 5881e349779..4e093d27df9 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDataSink.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDataSink.java @@ -32,12 +32,12 @@ import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.JsonUtil; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.springframework.transaction.annotation.Propagation; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import javax.annotation.Nonnull; class JobDataSink extends BaseDataSink { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDefinitionRegistry.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDefinitionRegistry.java index 407f5d7906a..9f322519414 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDefinitionRegistry.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDefinitionRegistry.java @@ -28,6 +28,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.Logs; import com.google.common.collect.ImmutableSortedMap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; @@ -41,7 +42,6 @@ import java.util.Set; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public class JobDefinitionRegistry { private static final Logger ourLog = Logs.getBatchTroubleshootingLog(); diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobParameterJsonValidator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobParameterJsonValidator.java index abf03a8a1df..639feb92f92 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobParameterJsonValidator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobParameterJsonValidator.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; import jakarta.validation.Validator; @@ -35,7 +36,6 @@ import java.util.Collections; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobQuerySvc.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobQuerySvc.java index d5507d66b22..facf62ec93d 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobQuerySvc.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobQuerySvc.java @@ -32,14 +32,14 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.JsonUtil; import ca.uhn.fhir.util.UrlUtil; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.data.domain.Page; import java.lang.reflect.Field; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Job Query services intended for end-users querying the status of jobs diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutor.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutor.java index 1347d0d4dd2..c509b07a01b 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutor.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutor.java @@ -29,10 +29,10 @@ import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.batch2.progress.JobInstanceStatusUpdater; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.Date; -import javax.annotation.Nonnull; public class JobStepExecutor { private static final Logger ourLog = Logs.getBatchTroubleshootingLog(); diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutorFactory.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutorFactory.java index 867436cbee0..d0c49dc4e83 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutorFactory.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobStepExecutorFactory.java @@ -26,8 +26,7 @@ import ca.uhn.fhir.batch2.model.JobInstance; import ca.uhn.fhir.batch2.model.JobWorkCursor; import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.model.api.IModelJson; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class JobStepExecutorFactory { private final IJobPersistence myJobPersistence; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/ReductionStepExecutorServiceImpl.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/ReductionStepExecutorServiceImpl.java index 21d00887907..882e18251b2 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/ReductionStepExecutorServiceImpl.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/ReductionStepExecutorServiceImpl.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.time.DateUtils; import org.quartz.JobExecutionContext; import org.slf4j.Logger; @@ -61,7 +62,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; -import javax.annotation.Nonnull; import static ca.uhn.fhir.batch2.model.StatusEnum.ERRORED; import static ca.uhn.fhir.batch2.model.StatusEnum.FINALIZE; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChannelMessageHandler.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChannelMessageHandler.java index 7f9ccd6ac3a..5aa81a34f62 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChannelMessageHandler.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChannelMessageHandler.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.batch2.model.JobWorkNotificationJsonMessage; import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandler; @@ -37,7 +38,6 @@ import org.springframework.messaging.MessagingException; import java.util.Optional; import java.util.function.Supplier; -import javax.annotation.Nonnull; /** * This handler receives batch work request messages and performs the batch work requested by the message diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChunkProcessor.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChunkProcessor.java index a68d7dbbcc9..0d87ecb17e1 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChunkProcessor.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/WorkChunkProcessor.java @@ -32,11 +32,11 @@ import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import java.util.Optional; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/ChunkRangeJson.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/ChunkRangeJson.java index ec9fdf1ec87..0efc48a5863 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/ChunkRangeJson.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/ChunkRangeJson.java @@ -25,9 +25,9 @@ import ca.uhn.fhir.rest.server.util.JsonDateSerializer; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import jakarta.annotation.Nonnull; import java.util.Date; -import javax.annotation.Nonnull; public class ChunkRangeJson implements IModelJson { @JsonSerialize(using = JsonDateSerializer.class) diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/PartitionedUrlChunkRangeJson.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/PartitionedUrlChunkRangeJson.java index c2fc509632d..13358b5a948 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/PartitionedUrlChunkRangeJson.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/chunk/PartitionedUrlChunkRangeJson.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.batch2.jobs.chunk; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrl; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class PartitionedUrlChunkRangeJson extends ChunkRangeJson { @Nullable diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/IUrlListValidator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/IUrlListValidator.java index 9b04957a2b6..bc108092584 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/IUrlListValidator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/IUrlListValidator.java @@ -19,9 +19,10 @@ */ package ca.uhn.fhir.batch2.jobs.parameters; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; + import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IUrlListValidator { @Nullable diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedJobParameters.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedJobParameters.java index 097daa08a49..3aa9657a589 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedJobParameters.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedJobParameters.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.batch2.jobs.parameters; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class PartitionedJobParameters implements IModelJson { @JsonProperty(value = "partitionId") diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedUrlListJobParameters.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedUrlListJobParameters.java index b5de120c791..0355fa4e0d3 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedUrlListJobParameters.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedUrlListJobParameters.java @@ -20,12 +20,12 @@ package ca.uhn.fhir.batch2.jobs.parameters; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class PartitionedUrlListJobParameters extends PartitionedJobParameters { @JsonProperty("partitionedUrl") diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/UrlListValidator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/UrlListValidator.java index 83dbf5d59e3..d4dbda52bfc 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/UrlListValidator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/UrlListValidator.java @@ -20,12 +20,12 @@ package ca.uhn.fhir.batch2.jobs.parameters; import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class UrlListValidator implements IUrlListValidator { private final String myOperationName; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/GenerateRangeChunksStep.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/GenerateRangeChunksStep.java index 23e590f6009..971ca7fdb82 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/GenerateRangeChunksStep.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/GenerateRangeChunksStep.java @@ -29,10 +29,10 @@ import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrl; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrlListJobParameters; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.Date; -import javax.annotation.Nonnull; import static ca.uhn.fhir.batch2.util.Batch2Constants.BATCH_START_DATE; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/IIdChunkProducer.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/IIdChunkProducer.java index 730996fa597..9ed4a9d23c7 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/IIdChunkProducer.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/IIdChunkProducer.java @@ -22,9 +22,9 @@ package ca.uhn.fhir.batch2.jobs.step; import ca.uhn.fhir.batch2.jobs.chunk.ChunkRangeJson; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; +import jakarta.annotation.Nullable; import java.util.Date; -import javax.annotation.Nullable; /** * A service that produces pages of resource pids based on the data provided by a previous batch step. Typically the diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStep.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStep.java index abc285b51bd..8209ca89fdf 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStep.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStep.java @@ -28,10 +28,9 @@ import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson; import ca.uhn.fhir.batch2.jobs.chunk.ResourceIdListWorkChunkJson; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedUrlListJobParameters; import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; -import javax.annotation.Nonnull; - import static org.slf4j.LoggerFactory.getLogger; public class LoadIdsStep diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/PartitionedUrlListIdChunkProducer.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/PartitionedUrlListIdChunkProducer.java index 23f5cb4e202..991a71152ff 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/PartitionedUrlListIdChunkProducer.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/PartitionedUrlListIdChunkProducer.java @@ -25,10 +25,10 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nullable; import org.slf4j.Logger; import java.util.Date; -import javax.annotation.Nullable; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/ResourceIdListStep.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/ResourceIdListStep.java index 1b4e464af2e..86b7a0dbd99 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/ResourceIdListStep.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/step/ResourceIdListStep.java @@ -31,13 +31,13 @@ import ca.uhn.fhir.batch2.jobs.parameters.PartitionedJobParameters; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.Collection; import java.util.Date; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.StreamUtil.partition; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobChunkProgressAccumulator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobChunkProgressAccumulator.java index 64709b227d6..e9b21e0f72d 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobChunkProgressAccumulator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobChunkProgressAccumulator.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.batch2.model.WorkChunkStatusEnum; import ca.uhn.fhir.util.Logs; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; @@ -32,7 +33,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static java.util.Collections.emptyList; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobMaintenanceServiceImpl.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobMaintenanceServiceImpl.java index 899cf55ad60..b4fb6714312 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobMaintenanceServiceImpl.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/maintenance/JobMaintenanceServiceImpl.java @@ -34,6 +34,7 @@ import ca.uhn.fhir.jpa.model.sched.ISchedulerService; import ca.uhn.fhir.jpa.model.sched.ScheduledJobDefinition; import ca.uhn.fhir.util.Logs; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.time.DateUtils; import org.quartz.JobExecutionContext; @@ -45,7 +46,6 @@ import java.util.List; import java.util.Set; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; /** * This class performs regular polls of the stored jobs in order to diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/FetchJobInstancesRequest.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/FetchJobInstancesRequest.java index a29e24754fe..dc719163856 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/FetchJobInstancesRequest.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/FetchJobInstancesRequest.java @@ -19,9 +19,10 @@ */ package ca.uhn.fhir.batch2.model; +import jakarta.annotation.Nonnull; + import java.util.HashSet; import java.util.Set; -import javax.annotation.Nonnull; public class FetchJobInstancesRequest { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinition.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinition.java index a2777a2bcbd..aced7d86fc5 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinition.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinition.java @@ -28,6 +28,8 @@ import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.model.api.IModelJson; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; @@ -35,8 +37,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class JobDefinition { private static final Logger ourLog = Logs.getBatchTroubleshootingLog(); diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionReductionStep.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionReductionStep.java index 93cd06ca461..90f4878ff54 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionReductionStep.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionReductionStep.java @@ -22,8 +22,7 @@ package ca.uhn.fhir.batch2.model; import ca.uhn.fhir.batch2.api.IJobStepWorker; import ca.uhn.fhir.batch2.api.IReductionStepWorker; import ca.uhn.fhir.model.api.IModelJson; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class JobDefinitionReductionStep extends JobDefinitionStep { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionStep.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionStep.java index 47b5e6a32a6..2ec27a81ec4 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionStep.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobDefinitionStep.java @@ -21,10 +21,9 @@ package ca.uhn.fhir.batch2.model; import ca.uhn.fhir.batch2.api.IJobStepWorker; import ca.uhn.fhir.model.api.IModelJson; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; -import javax.annotation.Nonnull; - import static ca.uhn.fhir.batch2.model.JobDefinition.ID_MAX_LENGTH; public class JobDefinitionStep { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotification.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotification.java index 55246403af3..bd53df05ee3 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotification.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotification.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.batch2.model; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class JobWorkNotification implements IModelJson { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotificationJsonMessage.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotificationJsonMessage.java index f5413b63210..8c32b032371 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotificationJsonMessage.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobWorkNotificationJsonMessage.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.batch2.model; import ca.uhn.fhir.rest.server.messaging.json.BaseJsonMessage; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class JobWorkNotificationJsonMessage extends BaseJsonMessage { diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/StatusEnum.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/StatusEnum.java index 2526b352a3e..a99df83142e 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/StatusEnum.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/StatusEnum.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.batch2.model; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.util.Logs; import com.google.common.collect.Maps; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.Collections; @@ -29,7 +30,6 @@ import java.util.EnumMap; import java.util.EnumSet; import java.util.Map; import java.util.Set; -import javax.annotation.Nonnull; /** * Status of a Batch2 Job Instance. diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/WorkChunkCreateEvent.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/WorkChunkCreateEvent.java index c381711c5db..bdbf4e87983 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/WorkChunkCreateEvent.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/WorkChunkCreateEvent.java @@ -19,12 +19,11 @@ */ package ca.uhn.fhir.batch2.model; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /** * The data required for the create transition. * Payload for the work-chunk creation event including all the job coordinates, the chunk data, and a sequence within the step. diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/progress/JobInstanceProgressCalculator.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/progress/JobInstanceProgressCalculator.java index 1cfde264368..210df77d700 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/progress/JobInstanceProgressCalculator.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/progress/JobInstanceProgressCalculator.java @@ -25,10 +25,10 @@ import ca.uhn.fhir.batch2.maintenance.JobChunkProgressAccumulator; import ca.uhn.fhir.batch2.model.WorkChunk; import ca.uhn.fhir.util.Logs; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import java.util.Iterator; -import javax.annotation.Nonnull; public class JobInstanceProgressCalculator { private static final Logger ourLog = Logs.getBatchTroubleshootingLog(); diff --git a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/BaseBatch2Test.java b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/BaseBatch2Test.java index 25b6536e323..39c45190f55 100644 --- a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/BaseBatch2Test.java +++ b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/BaseBatch2Test.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.function.Consumer; @ExtendWith(MockitoExtension.class) diff --git a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImplTest.java b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImplTest.java index 983432c62b0..ebd682f2386 100644 --- a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImplTest.java +++ b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobCoordinatorImplTest.java @@ -41,7 +41,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.stubbing.Answer; import org.springframework.messaging.MessageDeliveryException; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; diff --git a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobDataSinkTest.java b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobDataSinkTest.java index a7e064f9e68..5b2f89dae96 100644 --- a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobDataSinkTest.java +++ b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/coordinator/JobDataSinkTest.java @@ -26,7 +26,7 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStepTest.java b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStepTest.java index de8304328fa..25a4967fcad 100644 --- a/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStepTest.java +++ b/hapi-fhir-storage-batch2/src/test/java/ca/uhn/fhir/batch2/jobs/step/LoadIdsStepTest.java @@ -22,7 +22,7 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/hapi-fhir-storage-cr/pom.xml b/hapi-fhir-storage-cr/pom.xml index c28054aa757..9ff0f31d888 100644 --- a/hapi-fhir-storage-cr/pom.xml +++ b/hapi-fhir-storage-cr/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/repo/SearchConverter.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/repo/SearchConverter.java index 991fc9e4522..6a36164642c 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/repo/SearchConverter.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/repo/SearchConverter.java @@ -27,12 +27,12 @@ import ca.uhn.fhir.model.api.IQueryParameterOr; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.param.TokenParam; +import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; /** * The IGenericClient API represents searches with OrLists, while the FhirRepository API uses nested diff --git a/hapi-fhir-storage-mdm/pom.xml b/hapi-fhir-storage-mdm/pom.xml index 0a0a3ba68ca..6612210e842 100644 --- a/hapi-fhir-storage-mdm/pom.xml +++ b/hapi-fhir-storage-mdm/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/LoadGoldenIdsStep.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/LoadGoldenIdsStep.java index 60d4bb98ade..df8f3e78d48 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/LoadGoldenIdsStep.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/LoadGoldenIdsStep.java @@ -29,8 +29,7 @@ import ca.uhn.fhir.batch2.jobs.step.IIdChunkProducer; import ca.uhn.fhir.batch2.jobs.step.ResourceIdListStep; import ca.uhn.fhir.jpa.api.svc.IGoldenResourceSearchSvc; import ca.uhn.fhir.mdm.batch2.clear.MdmClearJobParameters; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; public class LoadGoldenIdsStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmChunkRangeJson.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmChunkRangeJson.java index 54a89cd63b9..bc6678ac135 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmChunkRangeJson.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmChunkRangeJson.java @@ -21,9 +21,8 @@ package ca.uhn.fhir.mdm.batch2; import ca.uhn.fhir.batch2.jobs.chunk.ChunkRangeJson; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; public class MdmChunkRangeJson extends ChunkRangeJson { @Nonnull diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmGenerateRangeChunksStep.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmGenerateRangeChunksStep.java index 9b4b2002e63..12245841e40 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmGenerateRangeChunksStep.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmGenerateRangeChunksStep.java @@ -27,11 +27,11 @@ import ca.uhn.fhir.batch2.api.StepExecutionDetails; import ca.uhn.fhir.batch2.api.VoidModel; import ca.uhn.fhir.batch2.util.Batch2Constants; import ca.uhn.fhir.mdm.batch2.clear.MdmClearJobParameters; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Date; -import javax.annotation.Nonnull; public class MdmGenerateRangeChunksStep implements IFirstJobStepWorker { private static final Logger ourLog = LoggerFactory.getLogger(MdmGenerateRangeChunksStep.class); diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmIdChunkProducer.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmIdChunkProducer.java index fcc4967c07d..90ad9e236cf 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmIdChunkProducer.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/MdmIdChunkProducer.java @@ -23,11 +23,11 @@ import ca.uhn.fhir.batch2.jobs.step.IIdChunkProducer; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; import ca.uhn.fhir.jpa.api.svc.IGoldenResourceSearchSvc; +import jakarta.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Date; -import javax.annotation.Nullable; public class MdmIdChunkProducer implements IIdChunkProducer { private static final Logger ourLog = LoggerFactory.getLogger(MdmIdChunkProducer.class); diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParameters.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParameters.java index 3219c11152f..40330274b9f 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParameters.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParameters.java @@ -21,12 +21,12 @@ package ca.uhn.fhir.mdm.batch2.clear; import ca.uhn.fhir.batch2.jobs.parameters.PartitionedJobParameters; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import jakarta.validation.constraints.Pattern; import org.apache.commons.lang3.Validate; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; public class MdmClearJobParameters extends PartitionedJobParameters { @JsonProperty("resourceType") diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParametersValidator.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParametersValidator.java index 2c805ea87c4..da562aa8084 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParametersValidator.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearJobParametersValidator.java @@ -23,12 +23,12 @@ import ca.uhn.fhir.batch2.api.IJobParametersValidator; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.mdm.api.IMdmSettings; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class MdmClearJobParametersValidator implements IJobParametersValidator { diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStep.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStep.java index cc8d020a9f7..d6b4c16783e 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStep.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/clear/MdmClearStep.java @@ -38,6 +38,7 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.StopWatch; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -46,7 +47,6 @@ import org.springframework.transaction.support.TransactionCallback; import java.util.List; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; @SuppressWarnings("rawtypes") public class MdmClearStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmInflateAndSubmitResourcesStep.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmInflateAndSubmitResourcesStep.java index 67e7e9f3d2a..386881adb57 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmInflateAndSubmitResourcesStep.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmInflateAndSubmitResourcesStep.java @@ -34,13 +34,13 @@ import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.interceptor.ResponseTerminologyTranslationSvc; import ca.uhn.fhir.util.Logs; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; public class MdmInflateAndSubmitResourcesStep implements IJobStepWorker { diff --git a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmSubmitJobParametersValidator.java b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmSubmitJobParametersValidator.java index d67d3f03f87..b6db1d8a375 100644 --- a/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmSubmitJobParametersValidator.java +++ b/hapi-fhir-storage-mdm/src/main/java/ca/uhn/fhir/mdm/batch2/submit/MdmSubmitJobParametersValidator.java @@ -27,10 +27,10 @@ import ca.uhn.fhir.jpa.searchparam.MatchUrlService; import ca.uhn.fhir.mdm.api.IMdmSettings; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; public class MdmSubmitJobParametersValidator implements IJobParametersValidator { diff --git a/hapi-fhir-storage-test-utilities/pom.xml b/hapi-fhir-storage-test-utilities/pom.xml index 4c7ab58eb6c..d58ac7db8c2 100644 --- a/hapi-fhir-storage-test-utilities/pom.xml +++ b/hapi-fhir-storage-test-utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage-test-utilities/src/test/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessageTest.java b/hapi-fhir-storage-test-utilities/src/test/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessageTest.java index 43f2b0801cd..1154568b04a 100644 --- a/hapi-fhir-storage-test-utilities/src/test/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessageTest.java +++ b/hapi-fhir-storage-test-utilities/src/test/java/ca/uhn/fhir/rest/server/messaging/json/BaseJsonMessageTest.java @@ -13,7 +13,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Patient; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/hapi-fhir-storage/pom.xml b/hapi-fhir-storage/pom.xml index f199f69626a..c4059235dcf 100644 --- a/hapi-fhir-storage/pom.xml +++ b/hapi-fhir-storage/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/cache/BaseResourceCacheSynchronizer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/cache/BaseResourceCacheSynchronizer.java index 197f19e6572..6073c8dc222 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/cache/BaseResourceCacheSynchronizer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/cache/BaseResourceCacheSynchronizer.java @@ -32,6 +32,7 @@ import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.subscription.SubscriptionConstants; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import org.apache.commons.lang3.time.DateUtils; @@ -48,7 +49,6 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.Semaphore; import java.util.stream.Collectors; -import javax.annotation.Nonnull; public abstract class BaseResourceCacheSynchronizer implements IResourceChangeListener { private static final Logger ourLog = LoggerFactory.getLogger(BaseResourceCacheSynchronizer.class); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/JpaStorageSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/JpaStorageSettings.java index 23f7451be70..53faa3d2c6c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/JpaStorageSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/config/JpaStorageSettings.java @@ -29,6 +29,8 @@ import ca.uhn.fhir.system.HapiSystemProperties; import ca.uhn.fhir.util.HapiExtensions; import ca.uhn.fhir.validation.FhirValidator; import com.google.common.collect.Sets; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -43,8 +45,6 @@ import java.util.Collections; import java.util.List; import java.util.Set; import java.util.TreeSet; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; @SuppressWarnings("JavadocLinkAsPlainText") public class JpaStorageSettings extends StorageSettings { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java index 82bbd2cfe7c..c6285b9c183 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/DaoRegistry.java @@ -25,6 +25,7 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.api.IDaoRegistry; import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.BeansException; @@ -41,7 +42,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; public class DaoRegistry implements ApplicationContextAware, IDaoRegistry { private ApplicationContext myAppCtx; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java index 35a87a736d1..53ad3feebf7 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDao.java @@ -42,6 +42,8 @@ import ca.uhn.fhir.rest.param.HistorySearchDateRangeParam; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.http.HttpServletResponse; import org.hl7.fhir.instance.model.api.IBaseMetaType; import org.hl7.fhir.instance.model.api.IBaseParameters; @@ -53,8 +55,6 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Note that this interface is not considered a stable interface. While it is possible to build applications diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java index 3ac4d312cd1..813739ac0be 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirResourceDaoCodeSystem.java @@ -23,6 +23,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseCoding; import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseParameters; @@ -34,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Collection; import java.util.List; -import javax.annotation.Nonnull; public interface IFhirResourceDaoCodeSystem extends IFhirResourceDao { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java index 9c4b2713ba1..cf63693824a 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/dao/IFhirSystemDao.java @@ -25,13 +25,13 @@ import ca.uhn.fhir.jpa.api.model.ExpungeOutcome; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; import java.util.Map; -import javax.annotation.Nullable; /** * Note that this interface is not considered a stable interface. While it is possible to build applications diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java index 825a4cc69e7..b5de2225856 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/model/DeleteConflictList.java @@ -114,7 +114,7 @@ public class DeleteConflictList implements Iterable { @Override public void remove() { - Assert.isTrue(myLastOperationWasNext); + Assert.isTrue(myLastOperationWasNext, "myLastOperationWasNext is not true"); myNextIndex--; myList.remove(myNextIndex); myLastOperationWasNext = false; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/AutoClosingStreamTemplate.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/AutoClosingStreamTemplate.java index 46064abdf2b..659dcc5521c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/AutoClosingStreamTemplate.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/AutoClosingStreamTemplate.java @@ -19,11 +19,12 @@ */ package ca.uhn.fhir.jpa.api.pid; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; + import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Template for wrapping access to stream supplier in a try-with-resources block. diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/BaseResourcePidList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/BaseResourcePidList.java index 00a792fcda4..da279a6b903 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/BaseResourcePidList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/BaseResourcePidList.java @@ -21,14 +21,14 @@ package ca.uhn.fhir.jpa.api.pid; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public abstract class BaseResourcePidList implements IResourcePidList { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/EmptyResourcePidList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/EmptyResourcePidList.java index 2881a0d0d78..f06f2c11a68 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/EmptyResourcePidList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/EmptyResourcePidList.java @@ -22,11 +22,11 @@ package ca.uhn.fhir.jpa.api.pid; import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import java.util.Collections; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; /** * An empty resource pid list diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/HomogeneousResourcePidList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/HomogeneousResourcePidList.java index 5e3a857c37e..bc5b06a2f8d 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/HomogeneousResourcePidList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/HomogeneousResourcePidList.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.jpa.api.pid; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import java.util.Collection; import java.util.Date; -import javax.annotation.Nonnull; /** * A resource pid list where all pids have the same resource type diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/IResourcePidList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/IResourcePidList.java index d57a4e3c20d..4583165c9af 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/IResourcePidList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/IResourcePidList.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.jpa.api.pid; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; /** * List of IResourcePersistentId along with a resource type each id diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/MixedResourcePidList.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/MixedResourcePidList.java index 7eba87c4886..f8397be79c7 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/MixedResourcePidList.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/MixedResourcePidList.java @@ -21,11 +21,11 @@ package ca.uhn.fhir.jpa.api.pid; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nonnull; import java.util.Collection; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; /** * A resource pid list where the pids can have different resource types diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/StreamTemplate.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/StreamTemplate.java index 2559597fba6..4f1f72c4240 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/StreamTemplate.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/StreamTemplate.java @@ -19,13 +19,13 @@ */ package ca.uhn.fhir.jpa.api.pid; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.transaction.support.TransactionOperations; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * A template for stream queries, like JDBCTemplate and friends. diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/TransactionWrappingStreamTemplate.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/TransactionWrappingStreamTemplate.java index 359b34d72bd..2b4d97cae6f 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/TransactionWrappingStreamTemplate.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/pid/TransactionWrappingStreamTemplate.java @@ -19,12 +19,12 @@ */ package ca.uhn.fhir.jpa.api.pid; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.transaction.support.TransactionOperations; import java.util.function.Function; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Wrap a StreamTemplate with transaction advice. diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IBatch2DaoSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IBatch2DaoSvc.java index fd400883042..96c125849d5 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IBatch2DaoSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IBatch2DaoSvc.java @@ -24,10 +24,10 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidList; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; import ca.uhn.fhir.jpa.api.pid.ListWrappingPidStream; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IBatch2DaoSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IGoldenResourceSearchSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IGoldenResourceSearchSvc.java index 200c1e220c4..9085343eae6 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IGoldenResourceSearchSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IGoldenResourceSearchSvc.java @@ -21,10 +21,10 @@ package ca.uhn.fhir.jpa.api.svc; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.pid.IResourcePidStream; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public interface IGoldenResourceSearchSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IIdHelperService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IIdHelperService.java index 7d48096cb60..a0dc27012d0 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IIdHelperService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/IIdHelperService.java @@ -26,6 +26,8 @@ import ca.uhn.fhir.jpa.api.model.PersistentIdToForcedIdMap; import ca.uhn.fhir.jpa.model.cross.IResourceLookup; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -35,8 +37,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This interface is used to translate between {@link IResourcePersistentId} diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java index a15b0876289..2a4c5c7a87c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/api/svc/ISearchCoordinatorSvc.java @@ -26,10 +26,10 @@ import ca.uhn.fhir.rest.api.CacheControlDirective; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; public interface ISearchCoordinatorSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/models/Batch2BaseJobParameters.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/models/Batch2BaseJobParameters.java index 686823ef83a..c419eaaaf2d 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/models/Batch2BaseJobParameters.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/batch/models/Batch2BaseJobParameters.java @@ -19,7 +19,7 @@ */ package ca.uhn.fhir.jpa.batch.models; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * Base parameters for StartJob as well as other requests diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/IBinaryStorageSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/IBinaryStorageSvc.java index 399f2bc588e..85833cbc92e 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/IBinaryStorageSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/IBinaryStorageSvc.java @@ -21,13 +21,13 @@ package ca.uhn.fhir.jpa.binary.api; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IIdType; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import javax.annotation.Nonnull; public interface IBinaryStorageSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/StoredDetails.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/StoredDetails.java index bbca43085e0..489d0d93a68 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/StoredDetails.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/api/StoredDetails.java @@ -26,10 +26,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.hash.HashingInputStream; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import java.util.Date; -import javax.annotation.Nonnull; public class StoredDetails implements IModelJson { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/interceptor/BinaryStorageInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/interceptor/BinaryStorageInterceptor.java index bf32c4a758f..be86acd3c83 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/interceptor/BinaryStorageInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/interceptor/BinaryStorageInterceptor.java @@ -43,6 +43,7 @@ import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.HapiExtensions; import ca.uhn.fhir.util.IModelVisitor2; +import jakarta.annotation.Nonnull; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBase; @@ -66,7 +67,6 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.HapiExtensions.EXT_EXTERNALIZED_BINARY_ID; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/provider/BinaryAccessProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/provider/BinaryAccessProvider.java index 6c776110764..d189484a72a 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/provider/BinaryAccessProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/provider/BinaryAccessProvider.java @@ -42,6 +42,7 @@ import ca.uhn.fhir.util.BinaryUtil; import ca.uhn.fhir.util.DateUtils; import ca.uhn.fhir.util.HapiExtensions; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; @@ -61,7 +62,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.Optional; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.UrlUtil.sanitizeUrlPart; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/BaseBinaryStorageSvcImpl.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/BaseBinaryStorageSvcImpl.java index 4d1cb164ee2..72e44bb7959 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/BaseBinaryStorageSvcImpl.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/BaseBinaryStorageSvcImpl.java @@ -37,6 +37,8 @@ import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; import com.google.common.hash.HashingInputStream; import com.google.common.io.ByteStreams; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -50,8 +52,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; import java.io.InputStream; import java.util.Optional; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/NullBinaryStorageSvcImpl.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/NullBinaryStorageSvcImpl.java index 3509be83924..0334c467815 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/NullBinaryStorageSvcImpl.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binary/svc/NullBinaryStorageSvcImpl.java @@ -23,12 +23,12 @@ import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.binary.api.IBinaryStorageSvc; import ca.uhn.fhir.jpa.binary.api.StoredDetails; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IIdType; import java.io.InputStream; import java.io.OutputStream; -import javax.annotation.Nonnull; public class NullBinaryStorageSvcImpl implements IBinaryStorageSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/FilesystemBinaryStorageSvcImpl.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/FilesystemBinaryStorageSvcImpl.java index 3d1ed467240..0fef2b6735c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/FilesystemBinaryStorageSvcImpl.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/FilesystemBinaryStorageSvcImpl.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.common.base.Charsets; import com.google.common.hash.HashingInputStream; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.CountingInputStream; @@ -50,8 +52,6 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.io.Reader; import java.util.Date; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class FilesystemBinaryStorageSvcImpl extends BaseBinaryStorageSvcImpl { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/MemoryBinaryStorageSvcImpl.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/MemoryBinaryStorageSvcImpl.java index a5f6dd3d4af..e742db5221b 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/MemoryBinaryStorageSvcImpl.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/binstore/MemoryBinaryStorageSvcImpl.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.binary.api.StoredDetails; import ca.uhn.fhir.jpa.binary.svc.BaseBinaryStorageSvcImpl; import ca.uhn.fhir.rest.api.server.RequestDetails; import com.google.common.hash.HashingInputStream; +import jakarta.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.CountingInputStream; import org.hl7.fhir.instance.model.api.IIdType; @@ -33,7 +34,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Date; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nonnull; /** * Purely in-memory implementation of binary storage service. This is really diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java index d7f2d6e14b8..aa7969a4505 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/api/IBulkDataImportSvc.java @@ -23,10 +23,10 @@ import ca.uhn.fhir.jpa.bulk.imprt.model.ActivateJobResult; import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobFileJson; import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobJson; import ca.uhn.fhir.jpa.bulk.imprt.model.BulkImportJobStatusEnum; +import jakarta.annotation.Nonnull; import java.util.Date; import java.util.List; -import javax.annotation.Nonnull; public interface IBulkDataImportSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ActivateJobResult.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ActivateJobResult.java index da558d26693..171c222215e 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ActivateJobResult.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/imprt/model/ActivateJobResult.java @@ -19,7 +19,7 @@ */ package ca.uhn.fhir.jpa.bulk.imprt.model; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class ActivateJobResult { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java index 4c3e398bff4..6642f2e339e 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageDao.java @@ -65,6 +65,8 @@ import ca.uhn.fhir.util.ResourceReferenceInfo; import ca.uhn.fhir.util.StopWatch; import ca.uhn.fhir.util.UrlUtil; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseReference; @@ -84,8 +86,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Supplier; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageResourceDao.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageResourceDao.java index 46d2c2fb925..e782e1c9789 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageResourceDao.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseStorageResourceDao.java @@ -44,6 +44,7 @@ import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -53,7 +54,6 @@ import org.springframework.transaction.support.TransactionSynchronizationManager import java.util.Collections; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java index 3604cd2cd8d..1db5396a8ac 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java @@ -84,6 +84,7 @@ import ca.uhn.fhir.util.UrlUtil; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.dstu3.model.Bundle; @@ -124,7 +125,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.StringUtil.toUtf8String; import static java.util.Objects.isNull; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ISearchBuilder.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ISearchBuilder.java index 51ac6b736b6..0d1b741ba25 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ISearchBuilder.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/ISearchBuilder.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId; import ca.uhn.fhir.rest.param.DateRangeParam; +import jakarta.annotation.Nonnull; import jakarta.persistence.EntityManager; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collection; import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; public interface ISearchBuilder> { String SEARCH_BUILDER_BEAN_NAME = "SearchBuilder"; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java index c04eadb174c..91c711bc7d6 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java @@ -43,6 +43,7 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.StopWatch; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; @@ -56,7 +57,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; @Service public class MatchResourceUrlService { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IExpungeEverythingService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IExpungeEverythingService.java index c2e75e14c03..cbab0273c79 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IExpungeEverythingService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/IExpungeEverythingService.java @@ -20,8 +20,7 @@ package ca.uhn.fhir.jpa.dao.expunge; import ca.uhn.fhir.rest.api.server.RequestDetails; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public interface IExpungeEverythingService { void expungeEverything(@Nullable RequestDetails theRequest); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionAwareSupplier.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionAwareSupplier.java index 7d627254c08..933ae17e118 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionAwareSupplier.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionAwareSupplier.java @@ -21,9 +21,9 @@ package ca.uhn.fhir.jpa.dao.expunge; import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import java.util.function.Supplier; -import javax.annotation.Nonnull; /** * Utility class wrapping a supplier in a transaction with the purpose of performing the supply operation with a diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java index f729babddd3..90dc98c1f0e 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/expunge/PartitionRunner.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import ca.uhn.fhir.util.StopWatch; import com.google.common.collect.Lists; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +45,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.stream.Collectors; -import javax.annotation.Nullable; public class PartitionRunner { private static final Logger ourLog = LoggerFactory.getLogger(PartitionRunner.class); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java index a2df3b9a415..302c3a1f20c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/index/DaoResourceLinkResolver.java @@ -46,6 +46,8 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry; import ca.uhn.fhir.util.CanonicalIdentifier; import ca.uhn.fhir.util.HapiExtensions; import ca.uhn.fhir.util.TerserUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URLEncodedUtils; import org.hl7.fhir.instance.model.api.IBase; @@ -61,8 +63,6 @@ import java.nio.charset.StandardCharsets; import java.util.Date; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class DaoResourceLinkResolver implements IResourceLinkResolver { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(DaoResourceLinkResolver.class); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java index ed9a68289d8..990ef103309 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/HapiTransactionService.java @@ -38,6 +38,8 @@ import ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster; import ca.uhn.fhir.util.ICallable; import ca.uhn.fhir.util.TestUtil; import com.google.common.annotations.VisibleForTesting; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.exception.ExceptionUtils; import org.hibernate.exception.ConstraintViolationException; @@ -59,8 +61,6 @@ import org.springframework.transaction.support.TransactionTemplate; import java.util.Objects; import java.util.concurrent.Callable; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * @see IHapiTransactionService for an explanation of this class diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/IHapiTransactionService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/IHapiTransactionService.java index 5ac40e274b9..2b56a725169 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/IHapiTransactionService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/IHapiTransactionService.java @@ -23,14 +23,14 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.storage.TransactionDetails; import ca.uhn.fhir.util.ICallable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionOperations; import java.util.concurrent.Callable; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This class is used to execute code within the context of a database transaction, diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/NonTransactionalHapiTransactionService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/NonTransactionalHapiTransactionService.java index f2b9209ba5b..d4fdaec4ae9 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/NonTransactionalHapiTransactionService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/tx/NonTransactionalHapiTransactionService.java @@ -19,11 +19,10 @@ */ package ca.uhn.fhir.jpa.dao.tx; +import jakarta.annotation.Nullable; import org.springframework.transaction.support.SimpleTransactionStatus; import org.springframework.transaction.support.TransactionCallback; -import javax.annotation.Nullable; - /** * A transaction service implementation that does not actually * wrap any transactions. This is mostly intended for tests but diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProvider.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProvider.java index 4136e40f846..13145488c87 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProvider.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProvider.java @@ -38,6 +38,8 @@ import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.UnclassifiedServerFailureException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -51,8 +53,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.function.Supplier; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class GraphQLProvider { private static final Logger ourLog = LoggerFactory.getLogger(GraphQLProvider.class); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/PatientIdPartitionInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/PatientIdPartitionInterceptor.java index 4036aa79c03..049b462b1c6 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/PatientIdPartitionInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/PatientIdPartitionInterceptor.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.param.ReferenceParam; import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -47,7 +48,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java index 2cbd1830440..54b4eb9dc51 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/BaseTypedRule.java @@ -20,10 +20,9 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.FhirContext; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; -import javax.annotation.Nonnull; - abstract class BaseTypedRule implements IRepositoryValidatingRule { private final String myResourceType; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java index 4bbeb1af078..7914dee69b9 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/IRepositoryValidatingRule.java @@ -20,12 +20,11 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; -import javax.annotation.Nonnull; - /** * This is an internal API for HAPI FHIR. It is subject to change without warning. */ diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java index f59ab1bc605..f20cc492826 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingInterceptor.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.util.ExtensionUtil; import ca.uhn.fhir.util.OperationOutcomeUtil; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.slf4j.Logger; @@ -38,7 +39,6 @@ import org.slf4j.LoggerFactory; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import static ca.uhn.fhir.util.HapiExtensions.EXT_RESOURCE_PLACEHOLDER; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java index a7b8671e295..f924c942624 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RepositoryValidatingRuleBuilder.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.jpa.validation.ValidatorPolicyAdvisor; import ca.uhn.fhir.jpa.validation.ValidatorResourceFetcher; import ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor; import ca.uhn.fhir.validation.ResultSeverityEnum; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.text.WordUtils; import org.hl7.fhir.r5.utils.validation.constants.BestPracticeWarningLevel; @@ -35,7 +36,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import javax.annotation.Nonnull; import static com.google.common.base.Ascii.toLowerCase; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java index eab7f12bbe8..fcb95ee733f 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RequireValidationRule.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.SingleValidationMessage; import ca.uhn.fhir.validation.ValidationResult; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -41,7 +42,6 @@ import org.hl7.fhir.r5.utils.validation.constants.BestPracticeWarningLevel; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; class RequireValidationRule extends BaseTypedRule { private final FhirInstanceValidator myValidator; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java index 5ae5a036563..174f8c29117 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleDisallowProfile.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -30,7 +31,6 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.HashSet; import java.util.Set; -import javax.annotation.Nonnull; class RuleDisallowProfile extends BaseTypedRule { private final Set myProfileUrls; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java index 55f51b8ec4d..e2d9d64128c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/interceptor/validation/RuleRequireProfileDeclaration.java @@ -21,13 +21,13 @@ package ca.uhn.fhir.jpa.interceptor.validation; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.hl7.fhir.instance.model.api.IBaseResource; import java.util.Collection; import java.util.Optional; -import javax.annotation.Nonnull; class RuleRequireProfileDeclaration extends BaseTypedRule { private final Collection myProfileOptions; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java index e5b925da3bd..f00b69ec5f1 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.jpa.model.search; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.util.StopWatch; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; /** * This class contains a runtime in-memory description of a search operation, diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/BaseRequestPartitionHelperSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/BaseRequestPartitionHelperSvc.java index b532571ab52..e4832dec545 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/BaseRequestPartitionHelperSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/partition/BaseRequestPartitionHelperSvc.java @@ -34,6 +34,8 @@ import ca.uhn.fhir.rest.api.server.SystemRequestDetails; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; @@ -42,8 +44,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster.doCallHooks; import static ca.uhn.fhir.rest.server.util.CompositeInterceptorBroadcaster.doCallHooksAndReturnObject; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/patch/FhirPatch.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/patch/FhirPatch.java index 310e856e7c2..2786221f34e 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/patch/FhirPatch.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/patch/FhirPatch.java @@ -28,6 +28,8 @@ import ca.uhn.fhir.parser.path.EncodeContextPath; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.IModelVisitor2; import ca.uhn.fhir.util.ParametersUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseEnumeration; @@ -45,8 +47,6 @@ import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/searchparam/submit/interceptor/SearchParamValidatingInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/searchparam/submit/interceptor/SearchParamValidatingInterceptor.java index 98c377fa6bd..b955cb18c7d 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/searchparam/submit/interceptor/SearchParamValidatingInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/searchparam/submit/interceptor/SearchParamValidatingInterceptor.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.util.HapiExtensions; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseExtension; import org.hl7.fhir.instance.model.api.IBaseResource; import org.springframework.beans.factory.annotation.Autowired; @@ -45,7 +46,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.collections4.CollectionUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.isBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java index c42fea383c7..a28c63f5935 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannel.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.subscription.channel.impl; import ca.uhn.fhir.jpa.subscription.channel.api.IChannelProducer; import ca.uhn.fhir.jpa.subscription.channel.api.IChannelReceiver; +import jakarta.annotation.Nonnull; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.support.ExecutorSubscribableChannel; @@ -28,7 +29,6 @@ import java.util.ArrayList; import java.util.Optional; import java.util.concurrent.Executor; import java.util.function.Supplier; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java index f69a42a0df8..0b9a1518b40 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactory.java @@ -28,13 +28,13 @@ import ca.uhn.fhir.jpa.subscription.channel.api.IChannelSettings; import ca.uhn.fhir.jpa.subscription.channel.subscription.IChannelNamer; import ca.uhn.fhir.subscription.SubscriptionConstants; import ca.uhn.fhir.util.ThreadPoolUtil; +import jakarta.annotation.Nonnull; import jakarta.annotation.PreDestroy; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; public class LinkedBlockingChannelFactory implements IChannelFactory { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/RetryingMessageHandlerWrapper.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/RetryingMessageHandlerWrapper.java index 6c88ae84f2f..b5a88222bbb 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/RetryingMessageHandlerWrapper.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/impl/RetryingMessageHandlerWrapper.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.subscription.channel.impl; import ca.uhn.fhir.util.BaseUnrecoverableRuntimeException; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.time.DateUtils; import org.slf4j.Logger; @@ -36,8 +37,6 @@ import org.springframework.retry.policy.TimeoutRetryPolicy; import org.springframework.retry.support.RetryTemplate; import org.springframework.transaction.CannotCreateTransactionException; -import javax.annotation.Nonnull; - class RetryingMessageHandlerWrapper implements MessageHandler { private static final Logger ourLog = LoggerFactory.getLogger(RetryingMessageHandlerWrapper.class); private final MessageHandler myWrap; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java index 79470188949..7801d9a7993 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizer.java @@ -38,6 +38,8 @@ import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; import ca.uhn.fhir.subscription.SubscriptionConstants; import ca.uhn.fhir.util.HapiExtensions; import ca.uhn.fhir.util.SubscriptionUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.instance.model.api.IBaseHasExtensions; import org.hl7.fhir.instance.model.api.IBaseMetaType; @@ -56,10 +58,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.util.HapiExtensions.EX_SEND_DELETE_MESSAGES; +import static java.util.Objects.nonNull; import static java.util.stream.Collectors.mapping; import static java.util.stream.Collectors.toList; @@ -305,8 +306,6 @@ public class SubscriptionCanonicalizer { CanonicalTopicSubscription topicSubscription = retVal.getTopicSubscription(); topicSubscription.setTopic(getCriteria(theSubscription)); - // WIP STR5 support other content types - topicSubscription.setContent(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE); retVal.setEndpointUrl(channel.getEndpoint()); retVal.setChannelType(getChannelType(subscription)); @@ -320,31 +319,37 @@ public class SubscriptionCanonicalizer { } if (channel.hasExtension(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_HEARTBEAT_PERIOD_URL)) { - org.hl7.fhir.r4.model.Extension timeoutExtension = channel.getExtensionByUrl( + org.hl7.fhir.r4.model.Extension channelHeartbeatPeriotUrlExtension = channel.getExtensionByUrl( SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_HEARTBEAT_PERIOD_URL); - topicSubscription.setHeartbeatPeriod( - Integer.valueOf(timeoutExtension.getValue().primitiveValue())); + topicSubscription.setHeartbeatPeriod(Integer.valueOf( + channelHeartbeatPeriotUrlExtension.getValue().primitiveValue())); } if (channel.hasExtension(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_TIMEOUT_URL)) { - org.hl7.fhir.r4.model.Extension timeoutExtension = + org.hl7.fhir.r4.model.Extension channelTimeoutUrlExtension = channel.getExtensionByUrl(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_TIMEOUT_URL); topicSubscription.setTimeout( - Integer.valueOf(timeoutExtension.getValue().primitiveValue())); + Integer.valueOf(channelTimeoutUrlExtension.getValue().primitiveValue())); } if (channel.hasExtension(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_MAX_COUNT)) { - org.hl7.fhir.r4.model.Extension timeoutExtension = + org.hl7.fhir.r4.model.Extension channelMaxCountExtension = channel.getExtensionByUrl(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_MAX_COUNT); topicSubscription.setMaxCount( - Integer.valueOf(timeoutExtension.getValue().primitiveValue())); - } - if (channel.getPayloadElement() - .hasExtension(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT)) { - org.hl7.fhir.r4.model.Extension timeoutExtension = channel.getPayloadElement() - .getExtensionByUrl(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT); - topicSubscription.setContent(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.fromCode( - timeoutExtension.getValue().primitiveValue())); + Integer.valueOf(channelMaxCountExtension.getValue().primitiveValue())); } + // setting full-resource PayloadContent if backport-payload-content is not provided + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent payloadContent = + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE; + + org.hl7.fhir.r4.model.Extension channelPayloadContentExtension = channel.getPayloadElement() + .getExtensionByUrl(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT); + + if (nonNull(channelPayloadContentExtension)) { + payloadContent = org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.fromCode( + channelPayloadContentExtension.getValue().primitiveValue()); + } + + topicSubscription.setContent(payloadContent); } else { retVal.setCriteriaString(getCriteria(theSubscription)); retVal.setEndpointUrl(channel.getEndpoint()); @@ -423,13 +428,25 @@ public class SubscriptionCanonicalizer { } if (retVal.isTopicSubscription()) { - retVal.getTopicSubscription().setTopic(getCriteria(theSubscription)); + CanonicalTopicSubscription topicSubscription = retVal.getTopicSubscription(); + topicSubscription.setTopic(getCriteria(theSubscription)); - // WIP STR5 support other content types - retVal.getTopicSubscription() - .setContent(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE); retVal.setEndpointUrl(channel.getEndpoint()); retVal.setChannelType(getChannelType(subscription)); + + // setting full-resource PayloadContent if backport-payload-content is not provided + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent payloadContent = + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE; + + org.hl7.fhir.r4b.model.Extension channelPayloadContentExtension = channel.getPayloadElement() + .getExtensionByUrl(SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT); + + if (nonNull(channelPayloadContentExtension)) { + payloadContent = org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.fromCode( + channelPayloadContentExtension.getValue().primitiveValue()); + } + + topicSubscription.setContent(payloadContent); } else { retVal.setCriteriaString(getCriteria(theSubscription)); retVal.setEndpointUrl(channel.getEndpoint()); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java index 5dce9dae0ef..50462d02c04 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscription.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.jpa.subscription.model; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -36,8 +38,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java index 58b0f725a2d..d200b09e2df 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/CanonicalSubscriptionChannelType.java @@ -20,12 +20,11 @@ package ca.uhn.fhir.jpa.subscription.model; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.dstu2.model.Subscription; import org.hl7.fhir.exceptions.FHIRException; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.StringUtils.isBlank; public enum CanonicalSubscriptionChannelType { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java index 4f1482fafd7..3c3c3f79ab8 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryJsonMessage.java @@ -23,10 +23,9 @@ import ca.uhn.fhir.rest.server.messaging.json.BaseJsonMessage; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; -import javax.annotation.Nullable; - public class ResourceDeliveryJsonMessage extends BaseJsonMessage { private static final ObjectMapper ourObjectMapper = new ObjectMapper().registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java index 04cf84a0cc6..6e9d4cd0505 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceDeliveryMessage.java @@ -27,13 +27,12 @@ import ca.uhn.fhir.rest.server.messaging.BaseResourceMessage; import ca.uhn.fhir.rest.server.messaging.IResourceMessage; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.StringUtils.isNotBlank; @SuppressWarnings("WeakerAccess") diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java index 14ebe68293a..9a103d41d08 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/model/ResourceModifiedJsonMessage.java @@ -21,10 +21,9 @@ package ca.uhn.fhir.jpa.subscription.model; import ca.uhn.fhir.rest.server.messaging.json.BaseJsonMessage; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.builder.ToStringBuilder; -import javax.annotation.Nullable; - public class ResourceModifiedJsonMessage extends BaseJsonMessage { @JsonProperty("payload") diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java index aaac3a2ce35..6740ffddeef 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/triggering/ISubscriptionTriggeringSvc.java @@ -19,12 +19,12 @@ */ package ca.uhn.fhir.jpa.subscription.triggering; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IBaseParameters; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IPrimitiveType; import java.util.List; -import javax.annotation.Nullable; public interface ISubscriptionTriggeringSvc { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java index 6ec1911b70c..ba825fcbf52 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/BaseCaptureQueriesListener.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.util; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.dao.tx.HapiTransactionService; +import jakarta.annotation.Nullable; import net.ttddyy.dsproxy.ExecutionInfo; import net.ttddyy.dsproxy.QueryInfo; import net.ttddyy.dsproxy.listener.MethodExecutionContext; @@ -32,7 +33,6 @@ import java.util.List; import java.util.Queue; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.trim; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java index beb038ab49c..294f2f0ca86 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/CircularQueueCaptureQueriesListener.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.util; import ca.uhn.fhir.util.StopWatch; import com.google.common.collect.Queues; +import jakarta.annotation.Nonnull; import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder; import org.apache.commons.collections4.queue.CircularFifoQueue; import org.hl7.fhir.r4.model.InstantType; @@ -38,7 +39,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; /** * This is a query listener designed to be plugged into a {@link ProxyDataSourceBuilder proxy DataSource}. diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java index 6cf8ce63220..105a59a7bc3 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.api.model.TranslationQuery; import ca.uhn.fhir.jpa.model.entity.TagTypeEnum; import ca.uhn.fhir.sl.cache.Cache; import ca.uhn.fhir.sl.cache.CacheFactory; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.springframework.transaction.support.TransactionSynchronization; @@ -33,7 +34,6 @@ import java.util.Collection; import java.util.EnumMap; import java.util.Map; import java.util.function.Function; -import javax.annotation.Nonnull; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java index 9f0fef49289..39620b45478 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/validation/ValidationSettings.java @@ -19,11 +19,10 @@ */ package ca.uhn.fhir.jpa.validation; +import jakarta.annotation.Nonnull; import org.hl7.fhir.r5.utils.validation.constants.ReferenceValidationPolicy; import org.thymeleaf.util.Validate; -import javax.annotation.Nonnull; - public class ValidationSettings { private ReferenceValidationPolicy myLocalReferenceValidationDefaultPolicy = ReferenceValidationPolicy.IGNORE; diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/AsyncMemoryQueueBackedFhirClientBalpSink.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/AsyncMemoryQueueBackedFhirClientBalpSink.java index d95da46a49e..be6ca1a6130 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/AsyncMemoryQueueBackedFhirClientBalpSink.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/AsyncMemoryQueueBackedFhirClientBalpSink.java @@ -24,6 +24,8 @@ import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.ThreadPoolUtil; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.annotation.PreDestroy; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; @@ -34,8 +36,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * This implementation of the {@link IBalpAuditEventSink} transmits audit events to diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptor.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptor.java index 59855cc987a..305d7cdb246 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptor.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptor.java @@ -29,13 +29,13 @@ import ca.uhn.fhir.rest.api.server.IPreResourceShowDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.FhirTerser; import ca.uhn.fhir.util.UrlUtil; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.AuditEvent; import java.nio.charset.StandardCharsets; import java.util.*; -import javax.annotation.Nonnull; /** * The IHE Basic Audit Logging Pattern (BALP) interceptor can be used to autopmatically generate diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/FhirClientBalpSink.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/FhirClientBalpSink.java index 23911345825..6ed047bc6bd 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/FhirClientBalpSink.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/FhirClientBalpSink.java @@ -22,13 +22,13 @@ package ca.uhn.fhir.storage.interceptor.balp; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.hapi.converters.canonical.VersionCanonicalizer; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.AuditEvent; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class FhirClientBalpSink implements IBalpAuditEventSink { diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/IBalpAuditContextServices.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/IBalpAuditContextServices.java index 89003183c57..b4a4e8863ca 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/IBalpAuditContextServices.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/storage/interceptor/balp/IBalpAuditContextServices.java @@ -21,13 +21,12 @@ package ca.uhn.fhir.storage.interceptor.balp; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.AuditEvent; import org.hl7.fhir.r4.model.Reference; -import javax.annotation.Nonnull; - /** * This interface is intended to be implemented in order to supply implementation * strategy details to the {@link BalpAuditCaptureInterceptor}. diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java index f049eac59a0..c6d5f3dfb57 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java @@ -20,12 +20,11 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.jpa.search.reindex.BlockPolicy; +import jakarta.annotation.Nonnull; import org.apache.commons.lang3.Validate; import org.springframework.core.task.TaskDecorator; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import javax.annotation.Nonnull; - public final class ThreadPoolUtil { private ThreadPoolUtil() {} diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/SearchParameterValidatingInterceptorTest.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/SearchParameterValidatingInterceptorTest.java index 073a28d3e7a..398efb827b7 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/SearchParameterValidatingInterceptorTest.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/interceptor/validation/SearchParameterValidatingInterceptorTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicLong; diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactoryTest.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactoryTest.java index feef2646add..c23d19b10ed 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactoryTest.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/channel/impl/LinkedBlockingChannelFactoryTest.java @@ -12,7 +12,7 @@ import org.slf4j.LoggerFactory; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizerTest.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizerTest.java index b48e2ca5198..1c34a8e7e73 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizerTest.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/jpa/subscription/match/registry/SubscriptionCanonicalizerTest.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.subscription.model.CanonicalSubscriptionChannelType; import ca.uhn.fhir.jpa.subscription.model.CanonicalTopicSubscriptionFilter; import ca.uhn.fhir.model.api.ExtensionDt; import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.subscription.SubscriptionConstants; import ca.uhn.fhir.subscription.SubscriptionTestDataHelper; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.Extension; @@ -14,6 +15,8 @@ import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.Enumerations; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import static ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW; import static ca.uhn.fhir.util.HapiExtensions.EX_SEND_DELETE_MESSAGES; @@ -83,16 +86,12 @@ class SubscriptionCanonicalizerTest { assertTrue(canonicalize.getSendDeleteMessages()); } - @Test - public void testR5() { - // setup - SubscriptionCanonicalizer r5Canonicalizer = new SubscriptionCanonicalizer(FhirContext.forR5Cached()); + private org.hl7.fhir.r5.model.Subscription buildR5Subscription(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent thePayloadContent) { org.hl7.fhir.r5.model.Subscription subscription = new org.hl7.fhir.r5.model.Subscription(); subscription.setStatus(Enumerations.SubscriptionStatusCodes.ACTIVE); subscription.setContentType(CT_FHIR_JSON_NEW); - // WIP STR5 support different content types - subscription.setContent(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE); + subscription.setContent(thePayloadContent); subscription.setEndpoint("http://foo"); subscription.setTopic(SubscriptionTestDataHelper.TEST_TOPIC); Coding channelType = new Coding().setSystem("http://terminology.hl7.org/CodeSystem/subscription-channel-type").setCode("rest-hook"); @@ -102,13 +101,25 @@ class SubscriptionCanonicalizerTest { subscription.setHeartbeatPeriod(123); subscription.setMaxCount(456); + return subscription; + } + + @ParameterizedTest + @ValueSource(strings = {"full-resource", "id-only", "empty"}) + public void testR5Canonicalize_returnsCorrectCanonicalSubscription(String thePayloadContent) { + // setup + SubscriptionCanonicalizer r5Canonicalizer = new SubscriptionCanonicalizer(FhirContext.forR5Cached()); + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent payloadContent = + org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.fromCode(thePayloadContent); + org.hl7.fhir.r5.model.Subscription subscription = buildR5Subscription(payloadContent); + // execute CanonicalSubscription canonical = r5Canonicalizer.canonicalize(subscription); // verify assertEquals(Subscription.SubscriptionStatus.ACTIVE, canonical.getStatus()); assertEquals(CT_FHIR_JSON_NEW, canonical.getContentType()); - assertEquals(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE, canonical.getContent()); + assertEquals(payloadContent, canonical.getContent()); assertEquals("http://foo", canonical.getEndpointUrl()); assertEquals(SubscriptionTestDataHelper.TEST_TOPIC, canonical.getTopic()); assertEquals(CanonicalSubscriptionChannelType.RESTHOOK, canonical.getChannelType()); @@ -131,37 +142,72 @@ class SubscriptionCanonicalizerTest { assertEquals(456, canonical.getMaxCount()); } - @Test - void testR4Backport() { + @ParameterizedTest + @ValueSource(strings = {"full-resource", "id-only", "empty"}) + void testR4BCanonicalize_returnsCorrectCanonicalSubscription(String thePayloadContent) { + // Example drawn from http://build.fhir.org/ig/HL7/fhir-subscription-backport-ig/Subscription-subscription-zulip.json.html + + // setup + SubscriptionCanonicalizer r4bCanonicalizer = new SubscriptionCanonicalizer(FhirContext.forR4BCached()); + org.hl7.fhir.r4b.model.Subscription subscription = buildR4BSubscription(thePayloadContent); + + // execute + CanonicalSubscription canonical = r4bCanonicalizer.canonicalize(subscription); + + // verify + assertEquals(Subscription.SubscriptionStatus.ACTIVE, canonical.getStatus()); + verifyStandardSubscriptionParameters(canonical); + verifyChannelParameters(canonical, thePayloadContent); + } + + private org.hl7.fhir.r4b.model.Subscription buildR4BSubscription(String thePayloadContent) { + org.hl7.fhir.r4b.model.Subscription subscription = new org.hl7.fhir.r4b.model.Subscription(); + + subscription.setId("testId"); + subscription.getMeta().addTag("http://a", "b", "c"); + subscription.getMeta().addTag("http://d", "e", "f"); + subscription.setStatus(org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ACTIVE); + subscription.getChannel().setPayload(CT_FHIR_JSON_NEW); + subscription.getChannel().setType(org.hl7.fhir.r4b.model.Subscription.SubscriptionChannelType.RESTHOOK); + subscription.getChannel().setEndpoint(SubscriptionTestDataHelper.TEST_ENDPOINT); + + subscription.getMeta().addProfile(SubscriptionConstants.SUBSCRIPTION_TOPIC_PROFILE_URL); + subscription.setCriteria(SubscriptionTestDataHelper.TEST_TOPIC); + + subscription.getChannel().setPayload(CT_FHIR_JSON_NEW); + subscription.getChannel().addHeader(SubscriptionTestDataHelper.TEST_HEADER1); + subscription.getChannel().addHeader(SubscriptionTestDataHelper.TEST_HEADER2); + subscription.setStatus(org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ACTIVE); + + subscription + .getChannel() + .getPayloadElement() + .addExtension( + SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT, + new org.hl7.fhir.r4b.model.CodeType(thePayloadContent)); + + return subscription; + } + + @ParameterizedTest + @ValueSource(strings = {"full-resource", "id-only", "empty"}) + void testR4canonicalize_withBackPortedSubscription_returnsCorrectCanonicalSubscription(String thePayloadContent) { // Example drawn from http://build.fhir.org/ig/HL7/fhir-subscription-backport-ig/Subscription-subscription-zulip.json.html // setup SubscriptionCanonicalizer r4Canonicalizer = new SubscriptionCanonicalizer(FhirContext.forR4Cached()); // execute - - CanonicalSubscription canonical = r4Canonicalizer.canonicalize(SubscriptionTestDataHelper.buildR4TopicSubscription()); + Subscription subscription = SubscriptionTestDataHelper.buildR4TopicSubscriptionWithContent(thePayloadContent); + CanonicalSubscription canonical = r4Canonicalizer.canonicalize(subscription); // verify // Standard R4 stuff - assertEquals(2, canonical.getTags().size()); - assertEquals("b", canonical.getTags().get("http://a")); - assertEquals("e", canonical.getTags().get("http://d")); - assertEquals("testId", canonical.getIdPart()); - assertEquals("testId", canonical.getIdElementString()); - assertEquals(SubscriptionTestDataHelper.TEST_ENDPOINT, canonical.getEndpointUrl()); - assertEquals(CT_FHIR_JSON_NEW, canonical.getContentType()); - assertThat(canonical.getHeaders(), hasSize(2)); - assertEquals(SubscriptionTestDataHelper.TEST_HEADER1, canonical.getHeaders().get(0)); - assertEquals(SubscriptionTestDataHelper.TEST_HEADER2, canonical.getHeaders().get(1)); + verifyStandardSubscriptionParameters(canonical); assertEquals(Subscription.SubscriptionStatus.ACTIVE, canonical.getStatus()); + verifyChannelParameters(canonical, thePayloadContent); - assertEquals(CT_FHIR_JSON_NEW, canonical.getContentType()); - assertEquals(org.hl7.fhir.r5.model.Subscription.SubscriptionPayloadContent.FULLRESOURCE, canonical.getContent()); - assertEquals(SubscriptionTestDataHelper.TEST_ENDPOINT, canonical.getEndpointUrl()); - assertEquals(SubscriptionTestDataHelper.TEST_TOPIC, canonical.getTopic()); - assertEquals(CanonicalSubscriptionChannelType.RESTHOOK, canonical.getChannelType()); assertThat(canonical.getFilters(), hasSize(2)); CanonicalTopicSubscriptionFilter filter1 = canonical.getFilters().get(0); @@ -183,6 +229,26 @@ class SubscriptionCanonicalizerTest { assertEquals(20, canonical.getMaxCount()); } + private void verifyChannelParameters(CanonicalSubscription theCanonicalSubscriptions, String thePayloadContent) { + assertThat(theCanonicalSubscriptions.getHeaders(), hasSize(2)); + assertEquals(SubscriptionTestDataHelper.TEST_HEADER1, theCanonicalSubscriptions.getHeaders().get(0)); + assertEquals(SubscriptionTestDataHelper.TEST_HEADER2, theCanonicalSubscriptions.getHeaders().get(1)); + + assertEquals(CT_FHIR_JSON_NEW, theCanonicalSubscriptions.getContentType()); + assertEquals(thePayloadContent, theCanonicalSubscriptions.getContent().toCode()); + assertEquals(SubscriptionTestDataHelper.TEST_ENDPOINT, theCanonicalSubscriptions.getEndpointUrl()); + assertEquals(SubscriptionTestDataHelper.TEST_TOPIC, theCanonicalSubscriptions.getTopic()); + assertEquals(CanonicalSubscriptionChannelType.RESTHOOK, theCanonicalSubscriptions.getChannelType()); + } + + private void verifyStandardSubscriptionParameters(CanonicalSubscription theCanonicalSubscription) { + assertEquals(2, theCanonicalSubscription.getTags().size()); + assertEquals("b", theCanonicalSubscription.getTags().get("http://a")); + assertEquals("e", theCanonicalSubscription.getTags().get("http://d")); + assertEquals("testId", theCanonicalSubscription.getIdPart()); + assertEquals("testId", theCanonicalSubscription.getIdElementString()); + } + @NotNull private static org.hl7.fhir.r5.model.Subscription.SubscriptionFilterByComponent buildFilter(String theResourceType, String theParam, String theValue) { org.hl7.fhir.r5.model.Subscription.SubscriptionFilterByComponent filter = new org.hl7.fhir.r5.model.Subscription.SubscriptionFilterByComponent(); diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/rest/server/method/ResponseBundleBuilderTest.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/rest/server/method/ResponseBundleBuilderTest.java index 9c2ecc222d6..4150a04d9e7 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/rest/server/method/ResponseBundleBuilderTest.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/rest/server/method/ResponseBundleBuilderTest.java @@ -26,7 +26,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptorTest.java b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptorTest.java index 3e324882f51..d08642b77c7 100644 --- a/hapi-fhir-storage/src/test/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptorTest.java +++ b/hapi-fhir-storage/src/test/java/ca/uhn/fhir/storage/interceptor/balp/BalpAuditCaptureInterceptorTest.java @@ -31,7 +31,7 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; diff --git a/hapi-fhir-structures-dstu2.1/pom.xml b/hapi-fhir-structures-dstu2.1/pom.xml index 32c2507e9ba..dac3392fc7e 100644 --- a/hapi-fhir-structures-dstu2.1/pom.xml +++ b/hapi-fhir-structures-dstu2.1/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -224,13 +224,6 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - - true - - org.apache.felix maven-bundle-plugin diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java index be6e75ff6b7..8eaf848f8f0 100644 --- a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/rest/server/Dstu2_1BundleFactory.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.rest.api.BundleLinks; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.dstu2016may.model.Bundle; import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent; @@ -48,7 +49,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-dstu2/pom.xml b/hapi-fhir-structures-dstu2/pom.xml index be3795ef8ba..4532fb82ccf 100644 --- a/hapi-fhir-structures-dstu2/pom.xml +++ b/hapi-fhir-structures-dstu2/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java index a64ae6236fa..3dfa2f4ccda 100644 --- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java +++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java @@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.api.BundleLinks; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -46,7 +47,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java index 159424fbb0e..542b490ee4c 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java @@ -72,7 +72,7 @@ import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java index 1235ae59f4d..e4a9c1fbfe3 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchDstu2Test.java @@ -51,7 +51,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/util/FhirTerserDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/util/FhirTerserDstu2Test.java index b7e149e007f..64bff5e51fa 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/util/FhirTerserDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/util/FhirTerserDstu2Test.java @@ -863,17 +863,19 @@ public class FhirTerserDstu2Test { /** * See http://stackoverflow.com/questions/182636/how-to-determine-the-class-of-a-generic-type */ + @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) private static Class> getListClass(Class theClass) { - return new ClassGetter>() { - }.get(); + Class listClass = List.class; + return listClass; } /** * See http://stackoverflow.com/questions/182636/how-to-determine-the-class-of-a-generic-type */ + @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) private static Class>> getListClass2() { - return new ClassGetter>>() { - }.get(); + Class listClass = List.class; + return listClass; } /** diff --git a/hapi-fhir-structures-dstu3/pom.xml b/hapi-fhir-structures-dstu3/pom.xml index 02408c1f044..f4cfda0fd24 100644 --- a/hapi-fhir-structures-dstu3/pom.xml +++ b/hapi-fhir-structures-dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FhirPathDstu3.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FhirPathDstu3.java index 076481df481..e7dfd0d1c9b 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FhirPathDstu3.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/fluentpath/FhirPathDstu3.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.fhirpath.FhirPathExecutionException; import ca.uhn.fhir.fhirpath.IFhirPath; import ca.uhn.fhir.fhirpath.IFhirPathEvaluationContext; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.hl7.fhir.dstu3.hapi.ctx.HapiWorkerContext; import org.hl7.fhir.dstu3.model.Base; import org.hl7.fhir.dstu3.model.ExpressionNode; @@ -19,7 +20,6 @@ import org.hl7.fhir.instance.model.api.IBase; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public class FhirPathDstu3 implements IFhirPath { diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/Dstu3BundleFactory.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/Dstu3BundleFactory.java index 6608644db94..af435eefe5f 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/Dstu3BundleFactory.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/Dstu3BundleFactory.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent; @@ -49,7 +50,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative2/ThymeleafNarrativeGeneratorTest.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative2/ThymeleafNarrativeGeneratorTest.java index c19baf9d3c6..03eca5a2315 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative2/ThymeleafNarrativeGeneratorTest.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative2/ThymeleafNarrativeGeneratorTest.java @@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java index bcff5de5fb3..cfa190aa1db 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java @@ -9,6 +9,7 @@ import ca.uhn.fhir.parser.XmlParserDstu3Test.TestPatientFor327; import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType; import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType; import ca.uhn.fhir.util.ClasspathUtil; +import ca.uhn.fhir.util.JsonUtil; import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ValidationResult; @@ -157,7 +158,7 @@ public class JsonParserDstu3Test { fail(); } catch (DataFormatException e) { assertEquals(Msg.code(1861) + "Failed to parse JSON encoded FHIR content: Unexpected character ('=' (code 61)): was expecting a colon to separate field name and value\n" + - " at [Source: UNKNOWN; line: 4, column: 18]", e.getMessage()); + " at [line: 4, column: 18]", e.getMessage()); } } @@ -2324,8 +2325,10 @@ public class JsonParserDstu3Test { ourCtx.newJsonParser().parseResource(Bundle.class, bundle); fail(); } catch (DataFormatException e) { - assertEquals(Msg.code(1861) + "Failed to parse JSON encoded FHIR content: Unexpected close marker '}': expected ']' (for root starting at [Source: UNKNOWN; line: 1])\n" + - " at [Source: UNKNOWN; line: 4, column: 3]", e.getMessage()); + // I'm hoping at some point we can get rid of the REDACTED message entirely. + // Request filed with Jackson: https://github.com/FasterXML/jackson-core/issues/1158 + assertEquals(Msg.code(1861) + "Failed to parse JSON encoded FHIR content: Unexpected close marker '}': expected ']' (for root starting at [line: 1])\n" + + " at [line: 4, column: 3]", e.getMessage()); } } diff --git a/hapi-fhir-structures-hl7org-dstu2/pom.xml b/hapi-fhir-structures-hl7org-dstu2/pom.xml index 1b297a905e9..91c113e8e84 100644 --- a/hapi-fhir-structures-hl7org-dstu2/pom.xml +++ b/hapi-fhir-structures-hl7org-dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -235,13 +235,6 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - - true - - org.apache.felix maven-bundle-plugin diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java index 172f3bc3162..90b50bea114 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.dstu2.model.Bundle; import org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent; @@ -50,7 +51,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java index ccc5109eb02..7b034d381b6 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/hapi-fhir-structures-r4/pom.xml b/hapi-fhir-structures-r4/pom.xml index 5aa456fa37a..f2d1ae5e412 100644 --- a/hapi-fhir-structures-r4/pom.xml +++ b/hapi-fhir-structures-r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -179,8 +179,8 @@ - com.google.code.findbugs - jsr305 + jakarta.annotation + jakarta.annotation-api @@ -303,13 +303,6 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - - true - - org.apache.felix maven-bundle-plugin diff --git a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/fluentpath/FhirPathR4.java b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/fluentpath/FhirPathR4.java index 9b867892b7f..5c492e158e3 100644 --- a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/fluentpath/FhirPathR4.java +++ b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/fluentpath/FhirPathR4.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.fhirpath.FhirPathExecutionException; import ca.uhn.fhir.fhirpath.IFhirPath; import ca.uhn.fhir.fhirpath.IFhirPathEvaluationContext; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.PathEngineException; import org.hl7.fhir.instance.model.api.IBase; @@ -20,7 +21,6 @@ import org.hl7.fhir.r4.utils.FHIRPathUtilityClasses.FunctionDetails; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public class FhirPathR4 implements IFhirPath { diff --git a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/R4BundleFactory.java b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/R4BundleFactory.java index 58a179e211c..73cd64314b1 100644 --- a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/R4BundleFactory.java +++ b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/R4BundleFactory.java @@ -31,6 +31,8 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -49,8 +51,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/helper/BatchHelperR4.java b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/helper/BatchHelperR4.java index ff3ce1796c3..1affa8a03d0 100644 --- a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/helper/BatchHelperR4.java +++ b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/helper/BatchHelperR4.java @@ -1,12 +1,11 @@ package org.hl7.fhir.r4.hapi.rest.server.helper; import ca.uhn.fhir.rest.server.provider.ProviderConstants; +import jakarta.annotation.Nonnull; import org.hl7.fhir.r4.model.DecimalType; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.StringType; -import javax.annotation.Nonnull; - public class BatchHelperR4 { @Nonnull diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/CustomTypeR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/CustomTypeR4Test.java index 18215244fdf..76ce4a8f3c6 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/CustomTypeR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/CustomTypeR4Test.java @@ -28,7 +28,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/OperationServerInvalidDefinitionTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/OperationServerInvalidDefinitionTest.java index ed0c6ed9405..9e41be33e59 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/OperationServerInvalidDefinitionTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/OperationServerInvalidDefinitionTest.java @@ -5,11 +5,10 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.rest.annotation.Operation; import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Parameters; -import org.hl7.fhir.r4.model.Patient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -26,11 +25,11 @@ public class OperationServerInvalidDefinitionTest { class OperationProvider { - @Operation(name = ProviderConstants.OPERATION_MEMBER_MATCH, idempotent = false, returnParameters = { - @OperationParam(name = "MemberIdentifier", type = StringDt.class) + @Operation(name = ProviderConstants.MDM_MATCH, idempotent = false, returnParameters = { + @OperationParam(name = "matchResult", type = StringDt.class) }) - public Parameters patientMemberMatch( - @OperationParam(name = Constants.PARAM_MEMBER_PATIENT, min = 1, max = 1) Patient theMemberPatient + public Parameters mdmMatch( + @OperationParam(name = ProviderConstants.MDM_MATCH_RESOURCE, min = 1, max = 1) IBaseResource theResource ) { return null; } @@ -41,7 +40,7 @@ public class OperationServerInvalidDefinitionTest { myRestfulServerExtension.registerProvider(new OperationProvider()); fail(); } catch (ConfigurationException e) { - assertEquals("HAPI-0288: Failure scanning class OperationProvider: HAPI-0360: Incorrect use of type StringDt as return type for method when theContext is for version R4 in method: public org.hl7.fhir.r4.model.Parameters ca.uhn.fhir.rest.server.OperationServerInvalidDefinitionTest$1OperationProvider.patientMemberMatch(org.hl7.fhir.r4.model.Patient)", e.getMessage()); + assertEquals("HAPI-0288: Failure scanning class OperationProvider: HAPI-0360: Incorrect use of type StringDt as return type for method when theContext is for version R4 in method: public org.hl7.fhir.r4.model.Parameters ca.uhn.fhir.rest.server.OperationServerInvalidDefinitionTest$1OperationProvider.mdmMatch(org.hl7.fhir.instance.model.api.IBaseResource)", e.getMessage()); } } diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerConcurrencyTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerConcurrencyTest.java index ec77302fa1c..950f625b55a 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerConcurrencyTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerConcurrencyTest.java @@ -23,7 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.Assert; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.servlet.ReadListener; import jakarta.servlet.ServletInputStream; import jakarta.servlet.http.HttpServletRequest; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptorTest.java index 014cab2d84f..f3dca63a60f 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/InteractionBlockingInterceptorTest.java @@ -22,7 +22,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Set; import java.util.TreeSet; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptorTest.java index 22230e56334..fca01b61bef 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptorTest.java @@ -56,7 +56,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.springframework.web.cors.CorsConfiguration; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/SearchNarrowingWithConsentAndAuthInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/SearchNarrowingWithConsentAndAuthInterceptorTest.java index 0622f784d82..fd18c87ac10 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/SearchNarrowingWithConsentAndAuthInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/SearchNarrowingWithConsentAndAuthInterceptorTest.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptorTest.java index 074c80f98af..67c810f8bda 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptorTest.java @@ -44,7 +44,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.net.URLEncoder; import java.util.Collections; import java.util.List; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/validation/address/AddressValidatingInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/validation/address/AddressValidatingInterceptorTest.java index 8a79791d8a9..bbd2ab7f04c 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/validation/address/AddressValidatingInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/validation/address/AddressValidatingInterceptorTest.java @@ -14,7 +14,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Arrays; import java.util.HashMap; import java.util.Properties; diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/FhirTerserR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/FhirTerserR4Test.java index 5182d2491a9..42ee74b22fb 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/FhirTerserR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/FhirTerserR4Test.java @@ -1553,17 +1553,19 @@ public class FhirTerserR4Test { /** * See http://stackoverflow.com/questions/182636/how-to-determine-the-class-of-a-generic-type */ + @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) private static Class> getListClass(Class theClass) { - return new ClassGetter>() { - }.get(); + Class listClass = List.class; + return listClass; } /** * See http://stackoverflow.com/questions/182636/how-to-determine-the-class-of-a-generic-type */ + @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) private static Class>> getListClass2() { - return new ClassGetter>>() { - }.get(); + Class listClass = List.class; + return listClass; } } diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/bundle/BundleUtilTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/bundle/BundleUtilTest.java index 9af769d8fbf..ea057c97623 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/bundle/BundleUtilTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/bundle/BundleUtilTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.Collections; import java.util.List; import java.util.function.Consumer; diff --git a/hapi-fhir-structures-r4b/pom.xml b/hapi-fhir-structures-r4b/pom.xml index 77e3fa40b7f..937f228073f 100644 --- a/hapi-fhir-structures-r4b/pom.xml +++ b/hapi-fhir-structures-r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -230,8 +230,8 @@ test - com.google.code.findbugs - jsr305 + jakarta.annotation + jakarta.annotation-api @@ -287,13 +287,6 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - - true - - org.apache.felix maven-bundle-plugin diff --git a/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/fhirpath/FhirPathR4B.java b/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/fhirpath/FhirPathR4B.java index 04eb7422c45..8d7d3c5ff9d 100644 --- a/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/fhirpath/FhirPathR4B.java +++ b/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/fhirpath/FhirPathR4B.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.fhirpath.FhirPathExecutionException; import ca.uhn.fhir.fhirpath.IFhirPath; import ca.uhn.fhir.fhirpath.IFhirPathEvaluationContext; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.PathEngineException; import org.hl7.fhir.instance.model.api.IBase; @@ -20,7 +21,6 @@ import org.hl7.fhir.r4b.utils.FHIRPathUtilityClasses.FunctionDetails; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public class FhirPathR4B implements IFhirPath { diff --git a/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/rest/server/R4BBundleFactory.java b/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/rest/server/R4BBundleFactory.java index c1ac46d65b8..01933a7e756 100644 --- a/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/rest/server/R4BBundleFactory.java +++ b/hapi-fhir-structures-r4b/src/main/java/org/hl7/fhir/r4b/hapi/rest/server/R4BBundleFactory.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -49,7 +50,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-structures-r5/pom.xml b/hapi-fhir-structures-r5/pom.xml index 7fec94afda2..2c4111ad99a 100644 --- a/hapi-fhir-structures-r5/pom.xml +++ b/hapi-fhir-structures-r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -234,8 +234,8 @@ test - com.google.code.findbugs - jsr305 + jakarta.annotation + jakarta.annotation-api @@ -276,13 +276,6 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - - true - - org.apache.felix maven-bundle-plugin diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/fhirpath/FhirPathR5.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/fhirpath/FhirPathR5.java index 239efa1efea..6321e9a9bb2 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/fhirpath/FhirPathR5.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/fhirpath/FhirPathR5.java @@ -6,6 +6,7 @@ import ca.uhn.fhir.fhirpath.FhirPathExecutionException; import ca.uhn.fhir.fhirpath.IFhirPath; import ca.uhn.fhir.fhirpath.IFhirPathEvaluationContext; import ca.uhn.fhir.i18n.Msg; +import jakarta.annotation.Nonnull; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.PathEngineException; import org.hl7.fhir.instance.model.api.IBase; @@ -20,7 +21,6 @@ import org.hl7.fhir.r5.utils.FHIRPathUtilityClasses; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; public class FhirPathR5 implements IFhirPath { diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/R5BundleFactory.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/R5BundleFactory.java index a98bb028a5b..8b974912923 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/R5BundleFactory.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/R5BundleFactory.java @@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.util.ResourceReferenceInfo; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; @@ -49,7 +50,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import javax.annotation.Nonnull; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-test-utilities/pom.xml b/hapi-fhir-test-utilities/pom.xml index 5b27906aa4e..dcbb597eae8 100644 --- a/hapi-fhir-test-utilities/pom.xml +++ b/hapi-fhir-test-utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -102,22 +102,8 @@ - net.sourceforge.htmlunit + org.htmlunit htmlunit - - - xml-apis - xml-apis - - - xerces - xercesImpl - - - org.eclipse.jetty.websocket - websocket-client - - diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/jpa/conformance/DateSearchTestCase.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/jpa/conformance/DateSearchTestCase.java index 4bc5c03265c..c4fd00eea27 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/jpa/conformance/DateSearchTestCase.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/jpa/conformance/DateSearchTestCase.java @@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.conformance; import ca.uhn.fhir.util.CollectionUtil; +import jakarta.annotation.Nonnull; import org.junit.jupiter.params.provider.Arguments; import java.io.IOException; @@ -33,7 +34,6 @@ import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nonnull; /** * Collection of test cases for date type search. diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/subscription/SubscriptionTestDataHelper.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/subscription/SubscriptionTestDataHelper.java index 5edbd951d3a..19ba45e2fd8 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/subscription/SubscriptionTestDataHelper.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/subscription/SubscriptionTestDataHelper.java @@ -36,6 +36,10 @@ public class SubscriptionTestDataHelper { public static final String TEST_HEADER2 = "X-Bar: BAR"; public static Subscription buildR4TopicSubscription() { + return buildR4TopicSubscriptionWithContent("full-resource"); + } + + public static Subscription buildR4TopicSubscriptionWithContent(String theChannelPayloadContent) { Subscription subscription = new Subscription(); // Standard R4 stuff @@ -75,7 +79,7 @@ public class SubscriptionTestDataHelper { .getPayloadElement() .addExtension( SubscriptionConstants.SUBSCRIPTION_TOPIC_CHANNEL_PAYLOAD_CONTENT, - new CodeType("full-resource")); + new CodeType(theChannelPayloadContent)); return subscription; } diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/HtmlUtil.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/HtmlUtil.java index 2f90b77abe0..beee282dd1b 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/HtmlUtil.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/HtmlUtil.java @@ -19,14 +19,14 @@ */ package ca.uhn.fhir.test.utilities; -import com.gargoylesoftware.htmlunit.BrowserVersion; -import com.gargoylesoftware.htmlunit.StringWebResponse; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlInput; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser; import org.awaitility.Awaitility; +import org.htmlunit.BrowserVersion; +import org.htmlunit.StringWebResponse; +import org.htmlunit.WebClient; +import org.htmlunit.html.HtmlForm; +import org.htmlunit.html.HtmlInput; +import org.htmlunit.html.HtmlPage; +import org.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser; import java.io.IOException; import java.net.URL; diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/ITestDataBuilder.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/ITestDataBuilder.java index 0a84a443a57..e5027a7b85b 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/ITestDataBuilder.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/ITestDataBuilder.java @@ -38,8 +38,8 @@ import org.hl7.fhir.r4.model.InstantType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Collection; import java.util.Date; import java.util.function.Consumer; diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/JettyUtil.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/JettyUtil.java index 1485648ff78..10ebf6f1695 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/JettyUtil.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/JettyUtil.java @@ -27,8 +27,8 @@ import org.eclipse.jetty.server.handler.StatisticsHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; public class JettyUtil { diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/MockMvcWebConnectionForHtmlUnit3.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/MockMvcWebConnectionForHtmlUnit3.java new file mode 100644 index 00000000000..2614c9e1338 --- /dev/null +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/test/utilities/MockMvcWebConnectionForHtmlUnit3.java @@ -0,0 +1,763 @@ +/*- + * #%L + * HAPI FHIR Test Utilities + * %% + * Copyright (C) 2014 - 2023 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% + */ +package ca.uhn.fhir.test.utilities; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; + +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; +import org.htmlunit.CookieManager; +import org.htmlunit.FormEncodingType; +import org.htmlunit.WebClient; +import org.htmlunit.WebConnection; +import org.htmlunit.WebRequest; +import org.htmlunit.WebResponse; +import org.htmlunit.WebResponseData; +import org.htmlunit.util.Cookie; +import org.apache.http.impl.cookie.BasicClientCookie; + +import org.htmlunit.util.KeyDataPair; +import org.htmlunit.util.NameValuePair; +import org.springframework.beans.Mergeable; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.lang.Nullable; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.mock.web.MockHttpSession; +import org.springframework.mock.web.MockPart; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.RequestBuilder; +import org.springframework.test.web.servlet.ResultActions; +import org.springframework.test.web.servlet.SmartRequestBuilder; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.request.RequestPostProcessor; +import org.springframework.util.Assert; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.UriUtils; + +/** + * This class is just a duplication or the Spring class by the same name + * (MockMvcWebConnection). It exists to use the new org.htmlunit namespace. + * + * This should no longer be necessary once this is fixed: + * https://github.com/spring-projects/spring-framework/issues/30392 + */ +public final class MockMvcWebConnectionForHtmlUnit3 implements WebConnection { + + private final Map sessions = new HashMap<>(); + + private final MockMvc mockMvc; + + @Nullable + private final String contextPath; + + private WebClient webClient; + + private static final int MAX_FORWARDS = 100; + + + /** + * Create a new instance that assumes the context path of the application + * is {@code ""} (i.e., the root context). + *

For example, the URL {@code http://localhost/test/this} would use + * {@code ""} as the context path. + * @param mockMvc the {@code MockMvc} instance to use; never {@code null} + * @param webClient the {@link WebClient} to use. never {@code null} + */ + public MockMvcWebConnectionForHtmlUnit3(MockMvc mockMvc, WebClient webClient) { + this(mockMvc, webClient, ""); + } + + /** + * Create a new instance with the specified context path. + *

The path may be {@code null} in which case the first path segment + * of the URL is turned into the contextPath. Otherwise it must conform + * to {@link jakarta.servlet.http.HttpServletRequest#getContextPath()} + * which states that it can be an empty string and otherwise must start + * with a "/" character and not end with a "/" character. + * @param mockMvc the {@code MockMvc} instance to use (never {@code null}) + * @param webClient the {@link WebClient} to use (never {@code null}) + * @param contextPath the contextPath to use + */ + public MockMvcWebConnectionForHtmlUnit3(MockMvc mockMvc, WebClient webClient, @Nullable String contextPath) { + Assert.notNull(mockMvc, "MockMvc must not be null"); + Assert.notNull(webClient, "WebClient must not be null"); + validateContextPath(contextPath); + + this.webClient = webClient; + this.mockMvc = mockMvc; + this.contextPath = contextPath; + } + + /** + * Validate the supplied {@code contextPath}. + *

If the value is not {@code null}, it must conform to + * {@link jakarta.servlet.http.HttpServletRequest#getContextPath()} which + * states that it can be an empty string and otherwise must start with + * a "/" character and not end with a "/" character. + * @param contextPath the path to validate + */ + static void validateContextPath(@Nullable String contextPath) { + if (contextPath == null || contextPath.isEmpty()) { + return; + } + Assert.isTrue(contextPath.startsWith("/"), () -> "contextPath '" + contextPath + "' must start with '/'."); + Assert.isTrue(!contextPath.endsWith("/"), () -> "contextPath '" + contextPath + "' must not end with '/'."); + } + + + public void setWebClient(WebClient webClient) { + Assert.notNull(webClient, "WebClient must not be null"); + this.webClient = webClient; + } + + + @Override + public WebResponse getResponse(WebRequest webRequest) throws IOException { + long startTime = System.currentTimeMillis(); + HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest); + requestBuilder.setContextPath(this.contextPath); + + MockHttpServletResponse httpServletResponse = getResponse(requestBuilder); + String forwardedUrl = httpServletResponse.getForwardedUrl(); + int forwards = 0; + while (forwardedUrl != null && forwards < MAX_FORWARDS) { + requestBuilder.setForwardPostProcessor(new ForwardRequestPostProcessor(forwardedUrl)); + httpServletResponse = getResponse(requestBuilder); + forwardedUrl = httpServletResponse.getForwardedUrl(); + forwards += 1; + } + if (forwards == MAX_FORWARDS) { + throw new IllegalStateException("Forwarded " + forwards + " times in a row, potential infinite forward loop"); + } + storeCookies(webRequest, httpServletResponse.getCookies()); + + return new MockWebResponseBuilder(startTime, webRequest, httpServletResponse).build(); + } + + private MockHttpServletResponse getResponse(RequestBuilder requestBuilder) throws IOException { + ResultActions resultActions; + try { + resultActions = this.mockMvc.perform(requestBuilder); + } + catch (Exception ex) { + throw new IOException(ex); + } + + return resultActions.andReturn().getResponse(); + } + + private void storeCookies(WebRequest webRequest, jakarta.servlet.http.Cookie[] cookies) { + Date now = new Date(); + CookieManager cookieManager = this.webClient.getCookieManager(); + for (jakarta.servlet.http.Cookie cookie : cookies) { + if (cookie.getDomain() == null) { + cookie.setDomain(webRequest.getUrl().getHost()); + } + Cookie toManage = createCookie(cookie); + Date expires = toManage.getExpires(); + if (expires == null || expires.after(now)) { + cookieManager.addCookie(toManage); + } + else { + cookieManager.removeCookie(toManage); + } + } + } + + @SuppressWarnings("removal") + private static org.htmlunit.util.Cookie createCookie(jakarta.servlet.http.Cookie cookie) { + Date expires = null; + if (cookie.getMaxAge() > -1) { + expires = new Date(System.currentTimeMillis() + cookie.getMaxAge() * 1000); + } + BasicClientCookie result = new BasicClientCookie(cookie.getName(), cookie.getValue()); + result.setDomain(cookie.getDomain()); + result.setComment(cookie.getComment()); + result.setExpiryDate(expires); + result.setPath(cookie.getPath()); + result.setSecure(cookie.getSecure()); + if (cookie.isHttpOnly()) { + result.setAttribute("httponly", "true"); + } + return new org.htmlunit.util.Cookie(result); + } + + @Override + public void close() { + } + + + + + final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable { + + private final Map sessions; + + private final WebClient webClient; + + private final WebRequest webRequest; + + @Nullable + private String contextPath; + + @Nullable + private RequestBuilder parentBuilder; + + @Nullable + private SmartRequestBuilder parentPostProcessor; + + @Nullable + private RequestPostProcessor forwardPostProcessor; + + + /** + * Construct a new {@code HtmlUnitRequestBuilder}. + * @param sessions a {@link Map} from session {@linkplain HttpSession#getId() IDs} + * to currently managed {@link HttpSession} objects; never {@code null} + * @param webClient the WebClient for retrieving cookies + * @param webRequest the {@link WebRequest} to transform into a + * {@link MockHttpServletRequest}; never {@code null} + */ + public HtmlUnitRequestBuilder(Map sessions, WebClient webClient, WebRequest webRequest) { + Assert.notNull(sessions, "Sessions Map must not be null"); + Assert.notNull(webClient, "WebClient must not be null"); + Assert.notNull(webRequest, "WebRequest must not be null"); + this.sessions = sessions; + this.webClient = webClient; + this.webRequest = webRequest; + } + + + /** + * Set the contextPath to be used. + *

The value may be null in which case the first path segment of the + * URL is turned into the contextPath. Otherwise it must conform to + * {@link HttpServletRequest#getContextPath()} which states it can be + * an empty string, or it must start with a "/" and not end with a "/". + * @param contextPath a valid contextPath + * @throws IllegalArgumentException if the contextPath is not a valid + * {@link HttpServletRequest#getContextPath()} + */ + public void setContextPath(@Nullable String contextPath) { + validateContextPath(contextPath); + this.contextPath = contextPath; + } + + public void setForwardPostProcessor(RequestPostProcessor forwardPostProcessor) { + this.forwardPostProcessor = forwardPostProcessor; + } + + + @Override + public MockHttpServletRequest buildRequest(ServletContext servletContext) { + String httpMethod = this.webRequest.getHttpMethod().name(); + UriComponents uri = UriComponentsBuilder.fromUriString(this.webRequest.getUrl().toExternalForm()).build(); + + MockHttpServletRequest request = new HtmlUnitRequestBuilder.HtmlUnitMockHttpServletRequest( + servletContext, httpMethod, (uri.getPath() != null ? uri.getPath() : "")); + + parent(request, this.parentBuilder); + + request.setProtocol("HTTP/1.1"); + request.setScheme(uri.getScheme() != null ? uri.getScheme() : ""); + request.setServerName(uri.getHost() != null ? uri.getHost() : ""); // needs to be first for additional headers + ports(uri, request); + authType(request); + contextPath(request, uri); + servletPath(uri, request); + request.setPathInfo(null); + + Charset charset = this.webRequest.getCharset(); + charset = (charset != null ? charset : StandardCharsets.ISO_8859_1); + request.setCharacterEncoding(charset.name()); + content(request, charset); + contentType(request); + + cookies(request); + this.webRequest.getAdditionalHeaders().forEach(request::addHeader); + locales(request); + params(request); + request.setQueryString(uri.getQuery()); + + return postProcess(request); + } + + private void parent(MockHttpServletRequest request, @Nullable RequestBuilder parent) { + if (parent == null) { + return; + } + + MockHttpServletRequest parentRequest = parent.buildRequest(request.getServletContext()); + + // session + HttpSession parentSession = parentRequest.getSession(false); + if (parentSession != null) { + HttpSession localSession = request.getSession(); + Assert.state(localSession != null, "No local HttpSession"); + Enumeration attrNames = parentSession.getAttributeNames(); + while (attrNames.hasMoreElements()) { + String attrName = attrNames.nextElement(); + Object attrValue = parentSession.getAttribute(attrName); + localSession.setAttribute(attrName, attrValue); + } + } + + // header + Enumeration headerNames = parentRequest.getHeaderNames(); + while (headerNames.hasMoreElements()) { + String attrName = headerNames.nextElement(); + Enumeration attrValues = parentRequest.getHeaders(attrName); + while (attrValues.hasMoreElements()) { + String attrValue = attrValues.nextElement(); + request.addHeader(attrName, attrValue); + } + } + + // parameter + Map parentParams = parentRequest.getParameterMap(); + parentParams.forEach(request::addParameter); + + // cookie + jakarta.servlet.http.Cookie[] parentCookies = parentRequest.getCookies(); + if (!ObjectUtils.isEmpty(parentCookies)) { + request.setCookies(parentCookies); + } + + // request attribute + Enumeration parentAttrNames = parentRequest.getAttributeNames(); + while (parentAttrNames.hasMoreElements()) { + String parentAttrName = parentAttrNames.nextElement(); + request.setAttribute(parentAttrName, parentRequest.getAttribute(parentAttrName)); + } + } + + private void ports(UriComponents uriComponents, MockHttpServletRequest request) { + int serverPort = uriComponents.getPort(); + request.setServerPort(serverPort); + if (serverPort == -1) { + int portConnection = this.webRequest.getUrl().getDefaultPort(); + request.setLocalPort(serverPort); + request.setRemotePort(portConnection); + } + else { + request.setRemotePort(serverPort); + } + } + + private void authType(MockHttpServletRequest request) { + String authorization = getHeader("Authorization"); + String[] authSplit = StringUtils.split(authorization, ": "); + if (authSplit != null) { + request.setAuthType(authSplit[0]); + } + } + + @Nullable + private String getHeader(String headerName) { + return this.webRequest.getAdditionalHeaders().get(headerName); + } + + private void contextPath(MockHttpServletRequest request, UriComponents uriComponents) { + if (this.contextPath == null) { + List pathSegments = uriComponents.getPathSegments(); + if (pathSegments.isEmpty()) { + request.setContextPath(""); + } + else { + request.setContextPath("/" + pathSegments.get(0)); + } + } + else { + String path = uriComponents.getPath(); + Assert.isTrue(path != null && path.startsWith(this.contextPath), + () -> "\"" + uriComponents.getPath() + + "\" should start with context path \"" + this.contextPath + "\""); + request.setContextPath(this.contextPath); + } + } + + private void servletPath(UriComponents uriComponents, MockHttpServletRequest request) { + String path = uriComponents.getPath(); + String requestPath = (path != null ? path : ""); + String servletPath = requestPath.substring(request.getContextPath().length()); + servletPath = UriUtils.decode(servletPath, StandardCharsets.UTF_8); + request.setServletPath(servletPath); + } + + private void content(MockHttpServletRequest request, Charset charset) { + String requestBody = this.webRequest.getRequestBody(); + if (requestBody == null) { + return; + } + request.setContent(requestBody.getBytes(charset)); + } + + private void contentType(MockHttpServletRequest request) { + String contentType = getHeader("Content-Type"); + if (contentType == null) { + FormEncodingType encodingType = this.webRequest.getEncodingType(); + if (encodingType != null) { + contentType = encodingType.getName(); + } + } + request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE); + } + + private void cookies(MockHttpServletRequest request) { + List cookies = new ArrayList<>(); + + String cookieHeaderValue = getHeader("Cookie"); + if (cookieHeaderValue != null) { + StringTokenizer tokens = new StringTokenizer(cookieHeaderValue, "=;"); + while (tokens.hasMoreTokens()) { + String cookieName = tokens.nextToken().trim(); + Assert.isTrue(tokens.hasMoreTokens(), + () -> "Expected value for cookie name '" + cookieName + + "': full cookie header was [" + cookieHeaderValue + "]"); + String cookieValue = tokens.nextToken().trim(); + processCookie(request, cookies, new jakarta.servlet.http.Cookie(cookieName, cookieValue)); + } + } + + Set managedCookies = this.webClient.getCookies(this.webRequest.getUrl()); + for (org.htmlunit.util.Cookie cookie : managedCookies) { + processCookie(request, cookies, new jakarta.servlet.http.Cookie(cookie.getName(), cookie.getValue())); + } + + jakarta.servlet.http.Cookie[] parentCookies = request.getCookies(); + if (parentCookies != null) { + Collections.addAll(cookies, parentCookies); + } + + if (!ObjectUtils.isEmpty(cookies)) { + request.setCookies(cookies.toArray(new jakarta.servlet.http.Cookie[0])); + } + } + + private void processCookie(MockHttpServletRequest request, List cookies, jakarta.servlet.http.Cookie cookie) { + cookies.add(cookie); + if ("JSESSIONID".equals(cookie.getName())) { + request.setRequestedSessionId(cookie.getValue()); + request.setSession(httpSession(request, cookie.getValue())); + } + } + + private MockHttpSession httpSession(MockHttpServletRequest request, final String sessionid) { + MockHttpSession session; + synchronized (this.sessions) { + session = this.sessions.get(sessionid); + if (session == null) { + session = new HtmlUnitRequestBuilder.HtmlUnitMockHttpSession(request, sessionid); + session.setNew(true); + synchronized (this.sessions) { + this.sessions.put(sessionid, session); + } + addSessionCookie(request, sessionid); + } + else { + session.setNew(false); + } + } + return session; + } + + private void addSessionCookie(MockHttpServletRequest request, String sessionid) { + this.webClient.getCookieManager().addCookie(createCookie(request, sessionid)); + } + + private void removeSessionCookie(MockHttpServletRequest request, String sessionid) { + this.webClient.getCookieManager().removeCookie(createCookie(request, sessionid)); + } + + private org.htmlunit.util.Cookie createCookie(MockHttpServletRequest request, String sessionid) { + return new org.htmlunit.util.Cookie(request.getServerName(), "JSESSIONID", sessionid, + request.getContextPath() + "/", null, request.isSecure(), true); + } + + private void locales(MockHttpServletRequest request) { + String locale = getHeader("Accept-Language"); + if (locale == null) { + request.addPreferredLocale(Locale.getDefault()); + } + } + + private void params(MockHttpServletRequest request) { + for (NameValuePair param : this.webRequest.getParameters()) { + addRequestParameter(request, param); + } + } + + private void addRequestParameter(MockHttpServletRequest request, NameValuePair param) { + if (param instanceof KeyDataPair pair) { + File file = pair.getFile(); + MockPart part; + if (file != null) { + part = new MockPart(pair.getName(), file.getName(), readAllBytes(file)); + } + else { + // Support empty file upload OR file upload via setData(). + // For an empty file upload, getValue() returns an empty string, and + // getData() returns null. + // For a file upload via setData(), getData() returns the file data, and + // getValue() returns the file name (if set) or an empty string. + part = new MockPart(pair.getName(), pair.getValue(), pair.getData()); + } + MediaType mediaType = (pair.getMimeType() != null ? MediaType.valueOf(pair.getMimeType()) : + MediaType.APPLICATION_OCTET_STREAM); + part.getHeaders().setContentType(mediaType); + request.addPart(part); + } + else { + request.addParameter(param.getName(), param.getValue()); + } + } + + private byte[] readAllBytes(File file) { + try { + return Files.readAllBytes(file.toPath()); + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + } + + private MockHttpServletRequest postProcess(MockHttpServletRequest request) { + if (this.parentPostProcessor != null) { + request = this.parentPostProcessor.postProcessRequest(request); + } + if (this.forwardPostProcessor != null) { + request = this.forwardPostProcessor.postProcessRequest(request); + } + return request; + } + + + /* Mergeable methods */ + + @Override + public boolean isMergeEnabled() { + return true; + } + + @Override + public Object merge(@Nullable Object parent) { + if (parent instanceof RequestBuilder requestBuilder) { + if (parent instanceof MockHttpServletRequestBuilder) { + MockHttpServletRequestBuilder copiedParent = MockMvcRequestBuilders.get("/"); + copiedParent.merge(parent); + this.parentBuilder = copiedParent; + } + else { + this.parentBuilder = requestBuilder; + } + if (parent instanceof SmartRequestBuilder smartRequestBuilder) { + this.parentPostProcessor = smartRequestBuilder; + } + } + return this; + } + + + /** + * An extension to {@link MockHttpServletRequest} that ensures that when a + * new {@link HttpSession} is created, it is added to the managed sessions. + */ + private final class HtmlUnitMockHttpServletRequest extends MockHttpServletRequest { + + public HtmlUnitMockHttpServletRequest(ServletContext servletContext, String method, String requestURI) { + super(servletContext, method, requestURI); + } + + @Override + public HttpSession getSession(boolean create) { + HttpSession session = super.getSession(false); + if (session == null && create) { + HtmlUnitRequestBuilder.HtmlUnitMockHttpSession newSession = new HtmlUnitRequestBuilder.HtmlUnitMockHttpSession(this); + setSession(newSession); + newSession.setNew(true); + String sessionid = newSession.getId(); + synchronized (HtmlUnitRequestBuilder.this.sessions) { + HtmlUnitRequestBuilder.this.sessions.put(sessionid, newSession); + } + addSessionCookie(this, sessionid); + session = newSession; + } + return session; + } + } + + + /** + * An extension to {@link MockHttpSession} that ensures when + * {@link #invalidate()} is called that the {@link HttpSession} + * is removed from the managed sessions. + */ + private final class HtmlUnitMockHttpSession extends MockHttpSession { + + private final MockHttpServletRequest request; + + public HtmlUnitMockHttpSession(MockHttpServletRequest request) { + super(request.getServletContext()); + this.request = request; + } + + private HtmlUnitMockHttpSession(MockHttpServletRequest request, String id) { + super(request.getServletContext(), id); + this.request = request; + } + + @Override + public void invalidate() { + super.invalidate(); + synchronized (HtmlUnitRequestBuilder.this.sessions) { + HtmlUnitRequestBuilder.this.sessions.remove(getId()); + } + removeSessionCookie(this.request, getId()); + } + } + + } + + + final class MockWebResponseBuilder { + + private static final String DEFAULT_STATUS_MESSAGE = "N/A"; + + + private final long startTime; + + private final WebRequest webRequest; + + private final MockHttpServletResponse response; + + + public MockWebResponseBuilder(long startTime, WebRequest webRequest, MockHttpServletResponse response) { + Assert.notNull(webRequest, "WebRequest must not be null"); + Assert.notNull(response, "HttpServletResponse must not be null"); + this.startTime = startTime; + this.webRequest = webRequest; + this.response = response; + } + + + public WebResponse build() throws IOException { + WebResponseData webResponseData = webResponseData(); + long endTime = System.currentTimeMillis(); + return new WebResponse(webResponseData, this.webRequest, endTime - this.startTime); + } + + private WebResponseData webResponseData() throws IOException { + List responseHeaders = responseHeaders(); + int statusCode = (this.response.getRedirectedUrl() != null ? + HttpStatus.MOVED_PERMANENTLY.value() : this.response.getStatus()); + String statusMessage = statusMessage(statusCode); + return new WebResponseData(this.response.getContentAsByteArray(), statusCode, statusMessage, responseHeaders); + } + + private String statusMessage(int statusCode) { + String errorMessage = this.response.getErrorMessage(); + if (StringUtils.hasText(errorMessage)) { + return errorMessage; + } + + try { + return HttpStatus.valueOf(statusCode).getReasonPhrase(); + } + catch (IllegalArgumentException ex) { + // ignore + } + + return DEFAULT_STATUS_MESSAGE; + } + + private List responseHeaders() { + Collection headerNames = this.response.getHeaderNames(); + List responseHeaders = new ArrayList<>(headerNames.size()); + for (String headerName : headerNames) { + List headerValues = this.response.getHeaderValues(headerName); + for (Object value : headerValues) { + responseHeaders.add(new NameValuePair(headerName, String.valueOf(value))); + } + } + String location = this.response.getRedirectedUrl(); + if (location != null) { + responseHeaders.add(new NameValuePair("Location", location)); + } + return responseHeaders; + } + + } + + + + final class ForwardRequestPostProcessor implements RequestPostProcessor { + + private final String forwardedUrl; + + + public ForwardRequestPostProcessor(String forwardedUrl) { + Assert.hasText(forwardedUrl, "Forwarded URL must not be null or empty"); + this.forwardedUrl = forwardedUrl; + } + + @Override + public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) { + request.setRequestURI(this.forwardedUrl); + request.setServletPath(initServletPath(request.getContextPath())); + return request; + } + + private String initServletPath(String contextPath) { + if (StringUtils.hasText(contextPath)) { + Assert.state(this.forwardedUrl.startsWith(contextPath), "Forward supported to same contextPath only"); + return (this.forwardedUrl.length() > contextPath.length() ? + this.forwardedUrl.substring(contextPath.length()) : ""); + } + else { + return this.forwardedUrl; + } + } + + } + + +} diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/HasGetterOrSetterForAllJsonFields.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/HasGetterOrSetterForAllJsonFields.java index 1e33d6fc5ab..abaef311e08 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/HasGetterOrSetterForAllJsonFields.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/HasGetterOrSetterForAllJsonFields.java @@ -28,7 +28,7 @@ import org.hamcrest.TypeSafeMatcher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.beans.BeanInfo; import java.beans.FeatureDescriptor; import java.beans.IntrospectionException; diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackCaptureTestExtension.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackCaptureTestExtension.java index 4b31d2045b7..43c7f85f6af 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackCaptureTestExtension.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackCaptureTestExtension.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackEventMatcher.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackEventMatcher.java index 663d3d7556c..61d49135757 100644 --- a/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackEventMatcher.java +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/test/util/LogbackEventMatcher.java @@ -23,8 +23,8 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; import org.hamcrest.CustomTypeSafeMatcher; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; /** * A Hamcrest matcher for junit assertions. diff --git a/hapi-fhir-test-utilities/src/test/java/ca/uhn/test/concurrency/LockstepEnumPhaserTest.java b/hapi-fhir-test-utilities/src/test/java/ca/uhn/test/concurrency/LockstepEnumPhaserTest.java index 4b9ddbb12a8..8d19c047b57 100644 --- a/hapi-fhir-test-utilities/src/test/java/ca/uhn/test/concurrency/LockstepEnumPhaserTest.java +++ b/hapi-fhir-test-utilities/src/test/java/ca/uhn/test/concurrency/LockstepEnumPhaserTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; diff --git a/hapi-fhir-testpage-overlay/pom.xml b/hapi-fhir-testpage-overlay/pom.xml index 3b9136a2bd5..e16f86ae51f 100644 --- a/hapi-fhir-testpage-overlay/pom.xml +++ b/hapi-fhir-testpage-overlay/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../pom.xml @@ -201,7 +201,7 @@ test - net.sourceforge.htmlunit + org.htmlunit htmlunit test diff --git a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java index 3e56b5c400d..5db555798a5 100644 --- a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java +++ b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java @@ -37,6 +37,8 @@ import ca.uhn.fhir.to.model.TransactionRequest; import ca.uhn.fhir.to.util.HfqlRenderingUtil; import ca.uhn.fhir.util.StopWatch; import com.google.gson.stream.JsonWriter; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; @@ -63,8 +65,6 @@ import java.util.Collections; import java.util.List; import java.util.TreeSet; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import static ca.uhn.fhir.rest.server.provider.ProviderConstants.DIFF_OPERATION_NAME; import static ca.uhn.fhir.util.UrlUtil.sanitizeUrlPart; diff --git a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/FhirTesterMvcConfig.java b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/FhirTesterMvcConfig.java index b4bdafae869..c3f6fa2516d 100644 --- a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/FhirTesterMvcConfig.java +++ b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/FhirTesterMvcConfig.java @@ -2,6 +2,7 @@ package ca.uhn.fhir.to; import ca.uhn.fhir.to.mvc.AnnotationMethodHandlerAdapterConfigurer; import ca.uhn.fhir.to.util.WebUtil; +import jakarta.annotation.Nonnull; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -15,8 +16,6 @@ import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.spring6.view.ThymeleafViewResolver; import org.thymeleaf.templatemode.TemplateMode; -import javax.annotation.Nonnull; - @Configuration @EnableWebMvc @ComponentScan(basePackages = "ca.uhn.fhir.to") diff --git a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/model/HomeRequest.java b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/model/HomeRequest.java index 1c1cac7efd9..7962dddaa5b 100644 --- a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/model/HomeRequest.java +++ b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/model/HomeRequest.java @@ -14,11 +14,10 @@ import ca.uhn.fhir.rest.server.IncomingRequestAddressStrategy; import ca.uhn.fhir.rest.server.util.ITestingUiClientFactory; import ca.uhn.fhir.to.Controller; import ca.uhn.fhir.to.TesterConfig; +import jakarta.annotation.Nullable; import jakarta.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.ModelAttribute; -import javax.annotation.Nullable; - import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java index a83e394bcfa..9e721e5ed95 100644 --- a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java +++ b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java @@ -29,7 +29,7 @@ import org.hl7.fhir.r4.model.DiagnosticReport; import org.hl7.fhir.r4.model.Patient; import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.ArrayList; import java.util.EventListener; import java.util.List; diff --git a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebTest.java b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebTest.java index 0fec091de1c..8c39d6e7fb5 100644 --- a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebTest.java +++ b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebTest.java @@ -7,40 +7,34 @@ import ca.uhn.fhir.jpa.fql.executor.StaticHfqlExecutionResult; import ca.uhn.fhir.jpa.fql.provider.HfqlRestProvider; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.Validate; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; -import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.test.utilities.JettyUtil; +import ca.uhn.fhir.test.utilities.MockMvcWebConnectionForHtmlUnit3; import ca.uhn.fhir.test.utilities.server.HashMapResourceProviderExtension; import ca.uhn.fhir.test.utilities.server.RestfulServerExtension; -import com.gargoylesoftware.css.parser.CSSErrorHandler; -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.SilentCssErrorHandler; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlAnchor; -import com.gargoylesoftware.htmlunit.html.HtmlButton; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTable; -import com.gargoylesoftware.htmlunit.html.HtmlTableCell; -import com.gargoylesoftware.htmlunit.html.HtmlTableRow; -import com.gargoylesoftware.htmlunit.html.HtmlTextArea; -import com.gargoylesoftware.htmlunit.html.XHtmlPage; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.ee10.servlet.ServletContextHandler; import org.eclipse.jetty.ee10.servlet.ServletHandler; import org.eclipse.jetty.ee10.servlet.ServletHolder; +import org.eclipse.jetty.server.Server; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Composition; -import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.r4.model.HumanName; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.InstantType; import org.hl7.fhir.r4.model.OperationOutcome; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.Patient; +import org.htmlunit.SilentCssErrorHandler; +import org.htmlunit.WebClient; +import org.htmlunit.cssparser.parser.CSSErrorHandler; +import org.htmlunit.html.HtmlAnchor; +import org.htmlunit.html.HtmlButton; +import org.htmlunit.html.HtmlPage; +import org.htmlunit.html.HtmlTable; +import org.htmlunit.html.HtmlTableCell; +import org.htmlunit.html.HtmlTableRow; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; @@ -119,7 +113,7 @@ public class WebTest { } myWebClient = new WebClient(); - myWebClient.setWebConnection(new MockMvcWebConnection(ourMockMvc, myWebClient)); + myWebClient.setWebConnection(new MockMvcWebConnectionForHtmlUnit3(ourMockMvc, myWebClient)); myWebClient.getOptions().setJavaScriptEnabled(true); myWebClient.getOptions().setCssEnabled(false); CSSErrorHandler errorHandler = new SilentCssErrorHandler(); diff --git a/hapi-fhir-validation-resources-dstu2.1/pom.xml b/hapi-fhir-validation-resources-dstu2.1/pom.xml index 768a6bc5b4b..83a66052cab 100644 --- a/hapi-fhir-validation-resources-dstu2.1/pom.xml +++ b/hapi-fhir-validation-resources-dstu2.1/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-dstu2/pom.xml b/hapi-fhir-validation-resources-dstu2/pom.xml index e3103fff8e1..8ada6af4694 100644 --- a/hapi-fhir-validation-resources-dstu2/pom.xml +++ b/hapi-fhir-validation-resources-dstu2/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-dstu3/pom.xml b/hapi-fhir-validation-resources-dstu3/pom.xml index 0911ed6ebdc..c40a055b673 100644 --- a/hapi-fhir-validation-resources-dstu3/pom.xml +++ b/hapi-fhir-validation-resources-dstu3/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r4/pom.xml b/hapi-fhir-validation-resources-r4/pom.xml index 603ce794a66..09851ccaae7 100644 --- a/hapi-fhir-validation-resources-r4/pom.xml +++ b/hapi-fhir-validation-resources-r4/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r4b/pom.xml b/hapi-fhir-validation-resources-r4b/pom.xml index 53c3665072c..6f76cc68bfa 100644 --- a/hapi-fhir-validation-resources-r4b/pom.xml +++ b/hapi-fhir-validation-resources-r4b/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation-resources-r5/pom.xml b/hapi-fhir-validation-resources-r5/pom.xml index b6fd6440949..8d2eb9d4a2a 100644 --- a/hapi-fhir-validation-resources-r5/pom.xml +++ b/hapi-fhir-validation-resources-r5/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml diff --git a/hapi-fhir-validation/pom.xml b/hapi-fhir-validation/pom.xml index 3b5d6bbbd04..d9c0db5bf70 100644 --- a/hapi-fhir-validation/pom.xml +++ b/hapi-fhir-validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-deployable-pom - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../hapi-deployable-pom/pom.xml @@ -94,8 +94,8 @@ - com.google.code.findbugs - jsr305 + jakarta.annotation + jakarta.annotation-api 8.11.2 2.2 8.0.0.Final 4.4.13 4.5.13 - 2.15.3 - 2.15.3 + 2.16.0 + 2.16.0 3.3.0 1.8 4.10.0 @@ -959,27 +959,27 @@ 6.2.5.Final 7.1.2 9.5.4 - 2.9.0 + 2.13.0 0.9.11 9.8.0-15 1.2_5 - 2.1.12 - 2.0.3 + 2.2.19 + 2.0.9 2.19.0 - 6.0.12 - 2023.0.4 + 6.1.1 + 2023.1.0 4.3.3 - 3.1.4 - 1.2.2.RELEASE + 3.2.0 + 2.0.4 3.1.4 - 1.19.0 + 1.19.3 3.1.2.RELEASE 4.4.1 UTF-8 1.0.1 - 1.28.4 - 8.9.2 + 1.44.0 + 8.11.1 1.0.8 @@ -993,6 +993,7 @@ 17 17 17 + 3.3.1 @@ -1365,7 +1366,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.2.0.jre11 + 12.4.2.jre11 - org.eclipse.jetty.websocket - websocket-client - - - net.sf.json-lib json-lib @@ -1434,7 +1423,7 @@ net.ttddyy datasource-proxy - 1.7 + 1.9 org.antlr @@ -1442,15 +1431,27 @@ 4.0.8 + org.apache.commons commons-dbcp2 - 2.9.0 + 2.11.0 org.apache.commons commons-lang3 ${commons_lang3_version} + + org.apache.commons + commons-pool2 + + 2.12.0 + org.apache.commons commons-text @@ -1736,7 +1737,7 @@ org.fusesource.jansi jansi - 2.4.0 + 2.4.1 org.glassfish @@ -1805,6 +1806,26 @@ hamcrest ${hamcrest_version} + + org.htmlunit + htmlunit + 3.9.0 + + + xml-apis + xml-apis + + + xerces + xercesImpl + + + + org.eclipse.jetty.websocket + websocket-client + + + org.exparity hamcrest-date @@ -1958,12 +1979,12 @@ org.postgresql postgresql - 42.5.1 + 42.7.1 com.oracle.database.jdbc ojdbc11 - 21.5.0.0 + 23.3.0.23.09 org.quartz-scheduler @@ -2311,7 +2332,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.0 + ${maven_checkstyle_version} org.apache.maven.plugins @@ -2328,6 +2349,27 @@ true 500m 2000m + + -XDcompilePolicy=simple + -Xplugin:ErrorProne -Xep:MissingSummary:OFF + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.errorprone + error_prone_core + ${error_prone_core_version} + + @@ -2348,7 +2390,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.6.3 org.apache.maven.plugins @@ -3052,41 +3094,6 @@ - - ERRORPRONE - - - - org.apache.maven.plugins - maven-compiler-plugin - - true - - -XDcompilePolicy=simple - -Xplugin:ErrorProne - -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED - - - - com.google.errorprone - error_prone_core - ${error_prone_core_version} - - - - - - - FASTINSTALL diff --git a/release-pipeline.yml b/release-pipeline.yml index 318b008cd3b..62a3475771a 100644 --- a/release-pipeline.yml +++ b/release-pipeline.yml @@ -170,7 +170,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: '-P JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true' + options: '-P JACOCO,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true' # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 diff --git a/test-job-template.yml b/test-job-template.yml index 40b0322182e..8ea5be78a42 100644 --- a/test-job-template.yml +++ b/test-job-template.yml @@ -60,7 +60,7 @@ jobs: mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml' goals: 'clean verify jacoco:report -pl ${{ p.module }}' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: '-P JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true' + options: '-P JACOCO,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true' # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 diff --git a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml index f4bc6f81ca6..2909352b306 100644 --- a/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml +++ b/tests/hapi-fhir-base-test-jaxrsserver-kotlin/pom.xml @@ -7,7 +7,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../pom.xml diff --git a/tests/hapi-fhir-base-test-mindeps-client/pom.xml b/tests/hapi-fhir-base-test-mindeps-client/pom.xml index 0a80267dcc7..6fa67a8ec2a 100644 --- a/tests/hapi-fhir-base-test-mindeps-client/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-client/pom.xml @@ -4,7 +4,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../pom.xml diff --git a/tests/hapi-fhir-base-test-mindeps-server/pom.xml b/tests/hapi-fhir-base-test-mindeps-server/pom.xml index cd8be76f568..55eed794a47 100644 --- a/tests/hapi-fhir-base-test-mindeps-server/pom.xml +++ b/tests/hapi-fhir-base-test-mindeps-server/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT ../../pom.xml