Package org.hl7.fhir.r5.utils.validation
Interface IResourceValidator
public interface IResourceValidator
Interface to the instance validator. This takes a resource, in one of many forms, and
checks whether it is valid
- Author:
- Grahame Grieve
-
Method Summary
Modifier and TypeMethodDescriptionwhether the validator should enforce best practice guidelines as defined by various HL7 committeesBundle validation rules allow for requesting particular entries in a bundle get validated against particular profiles Typically this is used from the command line to avoid having to construct profile just to validate a particular resource in a bundle against a particular profilehow much to check displays for coded elementswhether the resource must have an id or not (depends on context)boolean
if this is true, the validator will accept extensions and references to example.org and acme.com as valid, on the basis that they are understood to be references to content that could exist in priniple but can't in practiceboolean
It's common to see references such as Patient/234234 - these usually mean a reference to a Patient resource.boolean
CrumbTrail - whether the validator creates hints toboolean
Whether being unable to resolve a profile in found in Resource.meta.profile or ElementDefinition.type.profile or targetProfile is an error or just a warningboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
this is used internally in the publishing stack to ensure that everything is water tight, but this check is not necessary or appropriate at run time when the validator is hosted in HAPIboolean
boolean
void
setAllowExamples
(boolean value) void
setAssumeValidRestReferences
(boolean value) void
setCheckDisplay
(CheckDisplayOption checkDisplay) void
setCrumbTrails
(boolean crumbTrails) void
setErrorForUnknownProfiles
(boolean errorForUnknownProfiles) setExample
(boolean example) setForPublication
(boolean forPublication) setJurisdiction
(Coding jurisdiction) setNoBindingMsgSuppressed
(boolean noBindingMsgSuppressed) void
setNoCheckAggregation
(boolean value) setNoExtensibleWarnings
(boolean noExtensibleWarnings) setNoInvariantChecks
(boolean value) setNoTerminologyChecks
(boolean noTerminologyChecks) void
setNoUnicodeBiDiControlChars
(boolean noUnicodeBiDiControlChars) void
setPolicyAdvisor
(IValidationPolicyAdvisor advisor) void
setResourceIdRule
(IdStatus resourceIdRule) void
setShowMessagesFromReferences
(boolean value) void
setValidateValueSetCodesOnTxServer
(boolean value) void
setWantCheckSnapshotUnchanged
(boolean wantCheckSnapshotUnchanged) setWantInvariantInMessage
(boolean wantInvariantInMessage) setWarnOnDraftOrExperimental
(boolean warnOnDraftOrExperimental) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, String profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, List<StructureDefinition> profiles) void
validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element) Validate suite you can validate one of the following representations of resources: stream - provide a format - this is the preferred choice Use one of these two if the content is known to be valid XML/JSON, and already parsed - a DOM element or Document - a Json Object In order to use these, the content must already be parsed - e.g.void
validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element, String profile) void
validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element, List<StructureDefinition> profiles) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, String profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, List<StructureDefinition> profiles) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object, String profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object, List<StructureDefinition> profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, String profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, List<StructureDefinition> profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, String profile) validate
(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, List<StructureDefinition> profile)
-
Method Details
-
getContext
-
getCheckDisplay
how much to check displays for coded elements -
setCheckDisplay
-
getResourceIdRule
whether the resource must have an id or not (depends on context) -
setResourceIdRule
-
getBestPracticeWarningLevel
whether the validator should enforce best practice guidelines as defined by various HL7 committees -
setBestPracticeWarningLevel
-
getFetcher
-
setFetcher
-
getPolicyAdvisor
-
setPolicyAdvisor
-
getTracker
-
setTracker
-
isNoBindingMsgSuppressed
boolean isNoBindingMsgSuppressed() -
setNoBindingMsgSuppressed
-
isNoInvariantChecks
boolean isNoInvariantChecks() -
setNoInvariantChecks
-
isWantInvariantInMessage
boolean isWantInvariantInMessage() -
setWantInvariantInMessage
-
isNoTerminologyChecks
boolean isNoTerminologyChecks() -
setNoTerminologyChecks
-
isNoExtensibleWarnings
boolean isNoExtensibleWarnings() -
setNoExtensibleWarnings
-
isNoUnicodeBiDiControlChars
boolean isNoUnicodeBiDiControlChars() -
setNoUnicodeBiDiControlChars
-
isForPublication
boolean isForPublication() -
setForPublication
-
isExample
boolean isExample() -
setExample
-
getUsageContexts
-
isWarnOnDraftOrExperimental
boolean isWarnOnDraftOrExperimental() -
setWarnOnDraftOrExperimental
-
isErrorForUnknownProfiles
boolean isErrorForUnknownProfiles()Whether being unable to resolve a profile in found in Resource.meta.profile or ElementDefinition.type.profile or targetProfile is an error or just a warning -
setErrorForUnknownProfiles
-
isShowMessagesFromReferences
boolean isShowMessagesFromReferences() -
setShowMessagesFromReferences
-
isWantCheckSnapshotUnchanged
boolean isWantCheckSnapshotUnchanged()this is used internally in the publishing stack to ensure that everything is water tight, but this check is not necessary or appropriate at run time when the validator is hosted in HAPI- Returns:
-
setWantCheckSnapshotUnchanged
-
isAssumeValidRestReferences
boolean isAssumeValidRestReferences()It's common to see references such as Patient/234234 - these usually mean a reference to a Patient resource. But there's no actual technical rule that it does, so the validator doesn't enforce that unless this setting is set to true- Returns:
-
setAssumeValidRestReferences
-
isAllowExamples
boolean isAllowExamples()if this is true, the validator will accept extensions and references to example.org and acme.com as valid, on the basis that they are understood to be references to content that could exist in priniple but can't in practice -
setAllowExamples
-
isNoCheckAggregation
boolean isNoCheckAggregation() -
setNoCheckAggregation
-
isCrumbTrails
boolean isCrumbTrails()CrumbTrail - whether the validator creates hints to- Returns:
-
setCrumbTrails
-
isValidateValueSetCodesOnTxServer
boolean isValidateValueSetCodesOnTxServer() -
setValidateValueSetCodesOnTxServer
-
getJurisdiction
-
setJurisdiction
-
getBundleValidationRules
Bundle validation rules allow for requesting particular entries in a bundle get validated against particular profiles Typically this is used from the command line to avoid having to construct profile just to validate a particular resource in a bundle against a particular profile- Returns:
-
validate
void validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element) throws org.hl7.fhir.exceptions.FHIRException Validate suite you can validate one of the following representations of resources: stream - provide a format - this is the preferred choice Use one of these two if the content is known to be valid XML/JSON, and already parsed - a DOM element or Document - a Json Object In order to use these, the content must already be parsed - e.g. it must syntactically valid - a native resource - a elementmodel resource in addition, you can pass one or more profiles ti validate beyond the base standard - as structure definitions or canonical URLs- Throws:
IOException
org.hl7.fhir.exceptions.FHIRException
-
validate
void validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
void validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element, List<StructureDefinition> profiles) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, List<StructureDefinition> profiles) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, List<StructureDefinition> profiles) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, List<StructureDefinition> profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, List<StructureDefinition> profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object, String profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validate
Element validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, org.hl7.fhir.utilities.json.model.JsonObject object, List<StructureDefinition> profile) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-