-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1814 from hapifhir/2024-11-gg-vs-filter-fix
2024 11 gg vs filter fix
- Loading branch information
Showing
18 changed files
with
257 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
...n/src/main/java/org/hl7/fhir/validation/cli/services/DisabledValidationPolicyAdvisor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package org.hl7.fhir.validation.cli.services; | ||
|
||
import java.util.EnumSet; | ||
import java.util.List; | ||
|
||
import org.hl7.fhir.r5.elementmodel.Element; | ||
import org.hl7.fhir.r5.elementmodel.Element.SpecialElement; | ||
import org.hl7.fhir.r5.model.ElementDefinition; | ||
import org.hl7.fhir.r5.model.StructureDefinition; | ||
import org.hl7.fhir.r5.model.ValueSet; | ||
import org.hl7.fhir.r5.utils.validation.IMessagingServices; | ||
import org.hl7.fhir.r5.utils.validation.IResourceValidator; | ||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor; | ||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.AdditionalBindingPurpose; | ||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.CodedContentValidationAction; | ||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.ElementValidationAction; | ||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.ResourceValidationAction; | ||
import org.hl7.fhir.r5.utils.validation.constants.BindingKind; | ||
import org.hl7.fhir.r5.utils.validation.constants.ContainedReferenceValidationPolicy; | ||
import org.hl7.fhir.r5.utils.validation.constants.ReferenceValidationPolicy; | ||
import org.hl7.fhir.utilities.validation.ValidationMessage; | ||
|
||
public class DisabledValidationPolicyAdvisor implements IValidationPolicyAdvisor { | ||
|
||
private IValidationPolicyAdvisor policyAdvisor; | ||
|
||
@Override | ||
public ReferenceValidationPolicy getReferencePolicy() { | ||
return ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS; | ||
} | ||
|
||
@Override | ||
public boolean isSuppressMessageId(String path, String messageId) { | ||
return policyAdvisor.isSuppressMessageId(path, messageId); | ||
} | ||
|
||
@Override | ||
public ContainedReferenceValidationPolicy policyForContained(IResourceValidator validator, Object appContext, | ||
StructureDefinition structure, ElementDefinition element, String containerType, String containerId, | ||
SpecialElement containingResourceType, String path, String url) { | ||
return policyAdvisor.policyForContained(validator, appContext, structure, element, containerType, containerId, containingResourceType, path, url); | ||
} | ||
|
||
@Override | ||
public EnumSet<ResourceValidationAction> policyForResource(IResourceValidator validator, Object appContext, | ||
StructureDefinition type, String path) { | ||
return policyAdvisor.policyForResource(validator, appContext, type, path); | ||
} | ||
|
||
@Override | ||
public EnumSet<ElementValidationAction> policyForElement(IResourceValidator validator, Object appContext, | ||
StructureDefinition structure, ElementDefinition element, String path) { | ||
return policyAdvisor.policyForElement(validator, appContext, structure, element, path); | ||
} | ||
|
||
@Override | ||
public EnumSet<CodedContentValidationAction> policyForCodedContent(IResourceValidator validator, Object appContext, | ||
String stackPath, ElementDefinition definition, StructureDefinition structure, BindingKind kind, | ||
AdditionalBindingPurpose purpose, ValueSet valueSet, List<String> systems) { | ||
return policyAdvisor.policyForCodedContent(validator, appContext, stackPath, definition, structure, kind, purpose, valueSet, systems); | ||
} | ||
|
||
@Override | ||
public List<StructureDefinition> getImpliedProfilesForResource(IResourceValidator validator, Object appContext, | ||
String stackPath, ElementDefinition definition, StructureDefinition structure, Element resource, boolean valid, | ||
IMessagingServices msgServices, List<ValidationMessage> messages) { | ||
return policyAdvisor.getImpliedProfilesForResource(validator, appContext, stackPath, definition, structure, resource, valid, msgServices, messages); | ||
} | ||
|
||
public IValidationPolicyAdvisor getPolicyAdvisor() { | ||
return policyAdvisor; | ||
} | ||
|
||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) { | ||
this.policyAdvisor = policyAdvisor; | ||
return this; | ||
} | ||
|
||
@Override | ||
public ReferenceValidationPolicy policyForReference(IResourceValidator validator, | ||
Object appContext, | ||
String path, | ||
String url) { | ||
return ReferenceValidationPolicy.IGNORE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.