Skip to content

Commit

Permalink
Bumping Core to 6.5.11
Browse files Browse the repository at this point in the history
  • Loading branch information
madduci committed Feb 27, 2025
1 parent f3c09d6 commit c5fa0ec
Show file tree
Hide file tree
Showing 23 changed files with 706 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ public class InterceptorService extends BaseInterceptorService<Pointcut>
* Constructor which uses a default name of "default"
*/
public InterceptorService() {
this("default");
super(Pointcut.class);
}

/**
* Constructor
*
* @param theName The name for this registry (useful for troubleshooting)
*/
@Deprecated(since = "8.0.0", forRemoval = true)
public InterceptorService(String theName) {
super(Pointcut.class, theName);
super(Pointcut.class);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public interface IGenericClient extends IRestfulClient {
*
* @deprecated As of HAPI 3.0.0 this method has been deprecated, as the operation is now called "capabilities". Use {@link #capabilities()} instead
*/
@Deprecated(since = "3.0.0", forRemoval = true)
IFetchConformanceUntyped fetchConformance();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
import static org.apache.commons.lang3.StringUtils.isBlank;

/**
* Utilities for dealing with parameters resources in a version indepenedent way
* Utilities for dealing with parameters resources in a version independent way
*/
public class ParametersUtil {

private ParametersUtil() {}

public static Optional<String> getNamedParameterValueAsString(
FhirContext theCtx, IBaseParameters theParameters, String theParameterName) {
Function<IPrimitiveType<?>, String> mapper = t -> defaultIfBlank(t.getValueAsString(), null);
Expand Down Expand Up @@ -323,7 +325,7 @@ public static IBaseParameters newInstance(FhirContext theContext) {
@SuppressWarnings("unchecked")
public static void addParameterToParametersBoolean(
FhirContext theCtx, IBaseParameters theParameters, String theName, boolean theValue) {
addParameterToParameters(theCtx, theParameters, theName, theCtx.getPrimitiveBoolean(theValue));
addParameterToParameters(theCtx, theParameters, theName, theCtx.newPrimitiveBoolean(theValue));
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -429,7 +431,7 @@ public static void addPartUrl(FhirContext theContext, IBase theParameter, String
}

public static void addPartBoolean(FhirContext theContext, IBase theParameter, String theName, Boolean theValue) {
addPart(theContext, theParameter, theName, theContext.getPrimitiveBoolean(theValue));
addPart(theContext, theParameter, theName, theContext.newPrimitiveBoolean(theValue));
}

public static void addPartDecimal(FhirContext theContext, IBase theParameter, String theName, Double theValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@
}, {
"code": "SUCCESSFUL_CONDITIONAL_PATCH_NO_CHANGE",
"display": "Conditional patch succeeded: No changes were detected so no action was taken."
}, {
"code": "AUTOMATICALLY_CREATED_PLACEHOLDER_RESOURCE",
"display": "Automatically created placeholder resource."
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public HapiTransactionService hapiTransactionService() {

@Bean
public IInterceptorService jpaInterceptorService() {
return new InterceptorService("JPA");
return new InterceptorService();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,10 @@ public boolean conformsToProfile(FHIRPathEngine engine, Object appContext, Base
public ValueSet resolveValueSet(FHIRPathEngine engine, Object appContext, String url) {
return null;
}

@Override
public boolean paramIsType(String name, int index) {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1017,11 +1017,6 @@ public void assertHasNoErrors(OperationOutcome theOperationOutcome) {
}

public class ValidationPolicyAdvisor implements IValidationPolicyAdvisor {
@Override
public ReferenceValidationPolicy policyForReference(IResourceValidator validator, Object appContext, String path, String url) {
return ReferenceValidationPolicy.CHECK_VALID;
}

@Override
public EnumSet<ResourceValidationAction> policyForResource(IResourceValidator validator, Object appContext,
org.hl7.fhir.r5.model.StructureDefinition type, String path) {
Expand All @@ -1046,6 +1041,11 @@ public EnumSet<CodedContentValidationAction> policyForCodedContent(IResourceVali
return EnumSet.allOf(CodedContentValidationAction.class);
}

@Override
public SpecialValidationAction policyForSpecialValidation(IResourceValidator validator, Object appContext, SpecialValidationRule rule, String stackPath, Element resource, Element element) {
return null;
}

@Override
public List<org.hl7.fhir.r5.model.StructureDefinition> getImpliedProfilesForResource(IResourceValidator validator, Object appContext, String stackPath, ElementDefinition definition, org.hl7.fhir.r5.model.StructureDefinition structure, Element resource, boolean valid, IMessagingServices msgServices, List<ValidationMessage> messages) {
return List.of();
Expand All @@ -1069,6 +1069,21 @@ public boolean isSuppressMessageId(String path, String messageId) {
return false;
}

@Override
public ReferenceValidationPolicy policyForReference(IResourceValidator validator, Object appContext, String path, String url, ReferenceDestinationType destinationType) {
return ReferenceValidationPolicy.CHECK_VALID;
}

@Override
public IValidationPolicyAdvisor getPolicyAdvisor() {
return this;
}

@Override
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
return this;
}

@Override
public ReferenceValidationPolicy getReferencePolicy() {
return ReferenceValidationPolicy.IGNORE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public RestfulServer() {
* Constructor
*/
public RestfulServer(FhirContext theCtx) {
this(theCtx, new InterceptorService("RestfulServer"));
this(theCtx, new InterceptorService());
}

public RestfulServer(FhirContext theCtx, IInterceptorService theInterceptorService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ public class ValidatorPolicyAdvisor implements IValidationPolicyAdvisor {
@Autowired
private FhirContext myFhirContext;

@Override
public ReferenceValidationPolicy policyForReference(
IResourceValidator validator, Object appContext, String path, String url) {
int slashIdx = url.indexOf("/");
if (slashIdx > 0 && myFhirContext.getResourceTypes().contains(url.substring(0, slashIdx))) {
return myValidationSettings.getLocalReferenceValidationDefaultPolicy();
}

return ReferenceValidationPolicy.IGNORE;
}

@Override
public EnumSet<ResourceValidationAction> policyForResource(
IResourceValidator validator, Object appContext, StructureDefinition type, String path) {
Expand Down Expand Up @@ -90,6 +79,17 @@ public EnumSet<CodedContentValidationAction> policyForCodedContent(
return EnumSet.allOf(CodedContentValidationAction.class);
}

@Override
public SpecialValidationAction policyForSpecialValidation(
IResourceValidator validator,
Object appContext,
SpecialValidationRule rule,
String stackPath,
Element resource,
Element element) {
return null;
}

@Override
public ContainedReferenceValidationPolicy policyForContained(
IResourceValidator validator,
Expand Down Expand Up @@ -123,6 +123,30 @@ public boolean isSuppressMessageId(String path, String messageId) {
return false;
}

@Override
public ReferenceValidationPolicy policyForReference(
IResourceValidator validator,
Object appContext,
String path,
String url,
ReferenceDestinationType destinationType) {
int slashIdx = url.indexOf("/");
if (slashIdx > 0 && myFhirContext.getResourceTypes().contains(url.substring(0, slashIdx))) {
return myValidationSettings.getLocalReferenceValidationDefaultPolicy();
}
return ReferenceValidationPolicy.IGNORE;
}

@Override
public IValidationPolicyAdvisor getPolicyAdvisor() {
return this;
}

@Override
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
return this;
}

@Override
public ReferenceValidationPolicy getReferencePolicy() {
return ReferenceValidationPolicy.IGNORE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r5.elementmodel.Element;
import org.hl7.fhir.r5.utils.XVerExtensionManager;
import org.hl7.fhir.r5.utils.validation.ValidatorSession;
import org.hl7.fhir.validation.instance.InstanceValidator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -53,10 +54,12 @@ public void checkFetchByUrl() {
ourCtx.newJsonParser().parseResource(resource)
))).when(mockResourceDao).search(any(),any());
VersionSpecificWorkerContextWrapper wrappedWorkerContext = VersionSpecificWorkerContextWrapper.newVersionSpecificWorkerContextWrapper(myDefaultValidationSupport);
InstanceValidator v = new InstanceValidator(
wrappedWorkerContext,
new FhirInstanceValidator.NullEvaluationContext(),
new XVerExtensionManager(null));
InstanceValidator v =
new InstanceValidator(
wrappedWorkerContext,
new FhirInstanceValidator.NullEvaluationContext(),
new XVerExtensionManager(null),
new ValidatorSession());
RequestDetails r = new SystemRequestDetails();
// test
Element returnedResource = fetcher.fetch(v, r,"http://www.test-url-for-questionnaire.com/Questionnaire/test-id|1.0.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ public StructureDefinition fetchTypeDefinition(String theTypeName) {
return fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + theTypeName);
}

@Override
public List<StructureDefinition> fetchTypeDefinitions(String s) {
return List.of(fetchTypeDefinition(s));
}

@Override
public String getLinkForUrl(String corePath, String url) {
throw new UnsupportedOperationException(Msg.code(279));
Expand Down Expand Up @@ -439,6 +444,11 @@ public <T extends org.hl7.fhir.r4.model.Resource> T fetchResource(
return fetchResource(theClass, theUri + "|" + theVersion);
}

@Override
public <T extends Resource> T fetchResource(Class<T> theClass, String theUri, Resource resource) {
return fetchResource(theClass, theUri);
}

@Override
public <T extends org.hl7.fhir.r4.model.Resource> T fetchResourceWithException(Class<T> theClass, String theUri)
throws FHIRException {
Expand All @@ -449,6 +459,11 @@ public <T extends org.hl7.fhir.r4.model.Resource> T fetchResourceWithException(C
return retVal;
}

@Override
public <T extends Resource> List<T> fetchResourcesByType(Class<T> aClass) {
return List.of();
}

@Override
public org.hl7.fhir.r4.model.Resource fetchResourceById(String theType, String theUri) {
throw new UnsupportedOperationException(Msg.code(282));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public boolean conformsToProfile(FHIRPathEngine engine, Object appContext, Base
public ValueSet resolveValueSet(FHIRPathEngine engine, Object appContext, String url) {
return null;
}

@Override
public boolean paramIsType(String name, int index) {
return true;
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ public ValueSetExpansionOutcome expandVS(
return null;
}

@Override
public ValueSetExpansionOutcome expandVS(String s, boolean b, boolean b1, int i) {
return null;
}

@Override
public ValidationResult validateCode(
ValidationOptions theOptions, String theSystem, String theVersion, String theCode, String theDisplay) {
Expand Down Expand Up @@ -297,6 +302,11 @@ public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk,
}

@Override
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk, boolean theHierarchical, int i) {
throw new UnsupportedOperationException(Msg.code(2128));
}

/*1@Override
public ValueSetExpansionOutcome expandVS(ConceptSetComponent theInc, boolean theHierarchical, boolean theNoInactive)
throws TerminologyServiceException {
ValueSet input = new ValueSet();
Expand All @@ -306,7 +316,7 @@ public ValueSetExpansionOutcome expandVS(ConceptSetComponent theInc, boolean the
myValidationSupport.expandValueSet(new ValidationSupportContext(myValidationSupport), null, input);
return new ValueSetExpansionOutcome(
(ValueSet) output.getValueSet(), output.getError(), null, output.getErrorIsFromServer());
}
}*/

@Override
public Locale getLocale() {
Expand Down Expand Up @@ -495,6 +505,16 @@ public ValueSetExpansionOutcome expandVS(
throw new UnsupportedOperationException(Msg.code(230));
}

@Override
public ValueSetExpansionOutcome expandVS(
ITerminologyOperationDetails iTerminologyOperationDetails,
ConceptSetComponent conceptSetComponent,
boolean b,
boolean b1)
throws TerminologyServiceException {
return null;
}

@Override
public Set<String> getBinaryKeysAsSet() {
throw new UnsupportedOperationException(Msg.code(2115));
Expand Down
Loading

0 comments on commit c5fa0ec

Please sign in to comment.