Package org.hl7.fhir.r4b.utils
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIResourceValidator.BestPracticeWarningLevelstatic classIResourceValidator.BundleValidationRulestatic classIResourceValidator.CheckDisplayOptionstatic classIResourceValidator.IdStatusstatic interfaceIResourceValidator.IValidationProfileUsageTrackerstatic interfaceIResourceValidator.IValidatorResourceFetcherstatic classIResourceValidator.ReferenceValidationPolicy
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IResourceValidator.BestPracticeWarningLevelgetBestPracticeWarningLevel()whether the validator should enforce best practice guidelines as defined by various HL7 committeesList<IResourceValidator.BundleValidationRule>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 profileIResourceValidator.CheckDisplayOptiongetCheckDisplay()how much to check displays for coded elementsIResourceValidator.IValidatorResourceFetchergetFetcher()IResourceValidator.IdStatusgetResourceIdRule()whether the resource must have an id or not (depends on context)IResourceValidator.IValidationProfileUsageTrackergetTracker()booleanisAllowExamples()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 practicebooleanisAssumeValidRestReferences()It's common to see references such as Patient/234234 - these usually mean a reference to a Patient resource.booleanisCrumbTrails()CrumbTrail - whether the validator creates hints tobooleanisErrorForUnknownProfiles()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 warningbooleanisNoBindingMsgSuppressed()booleanisNoCheckAggregation()booleanisNoExtensibleWarnings()booleanisNoInvariantChecks()booleanisNoTerminologyChecks()booleanisShowMessagesFromReferences()booleanisValidateValueSetCodesOnTxServer()booleanisWantCheckSnapshotUnchanged()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 HAPIvoidsetAllowExamples(boolean value)voidsetAssumeValidRestReferences(boolean value)IResourceValidatorsetBestPracticeWarningLevel(IResourceValidator.BestPracticeWarningLevel value)voidsetCheckDisplay(IResourceValidator.CheckDisplayOption checkDisplay)voidsetCrumbTrails(boolean crumbTrails)voidsetErrorForUnknownProfiles(boolean errorForUnknownProfiles)IResourceValidatorsetFetcher(IResourceValidator.IValidatorResourceFetcher value)IResourceValidatorsetNoBindingMsgSuppressed(boolean noBindingMsgSuppressed)voidsetNoCheckAggregation(boolean value)IResourceValidatorsetNoExtensibleWarnings(boolean noExtensibleWarnings)IResourceValidatorsetNoInvariantChecks(boolean value)IResourceValidatorsetNoTerminologyChecks(boolean noTerminologyChecks)voidsetResourceIdRule(IResourceValidator.IdStatus resourceIdRule)voidsetShowMessagesFromReferences(boolean value)IResourceValidatorsetTracker(IResourceValidator.IValidationProfileUsageTracker value)voidsetValidateValueSetCodesOnTxServer(boolean value)voidsetWantCheckSnapshotUnchanged(boolean wantCheckSnapshotUnchanged)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, com.google.gson.JsonObject object)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, com.google.gson.JsonObject object, String profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, com.google.gson.JsonObject object, List<StructureDefinition> profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, String profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, InputStream stream, Manager.FhirFormat format, List<StructureDefinition> profiles)voidvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, 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.voidvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, String profile)voidvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, List<StructureDefinition> profiles)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, String profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Resource resource, List<StructureDefinition> profiles)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, String profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Document document, List<StructureDefinition> profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, String profile)Elementvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, Element element, List<StructureDefinition> profile)
-
-
-
Method Detail
-
getCheckDisplay
IResourceValidator.CheckDisplayOption getCheckDisplay()
how much to check displays for coded elements- Returns:
-
setCheckDisplay
void setCheckDisplay(IResourceValidator.CheckDisplayOption checkDisplay)
-
getResourceIdRule
IResourceValidator.IdStatus getResourceIdRule()
whether the resource must have an id or not (depends on context)- Returns:
-
setResourceIdRule
void setResourceIdRule(IResourceValidator.IdStatus resourceIdRule)
-
getBestPracticeWarningLevel
IResourceValidator.BestPracticeWarningLevel getBestPracticeWarningLevel()
whether the validator should enforce best practice guidelines as defined by various HL7 committees
-
setBestPracticeWarningLevel
IResourceValidator setBestPracticeWarningLevel(IResourceValidator.BestPracticeWarningLevel value)
-
getFetcher
IResourceValidator.IValidatorResourceFetcher getFetcher()
-
setFetcher
IResourceValidator setFetcher(IResourceValidator.IValidatorResourceFetcher value)
-
setTracker
IResourceValidator setTracker(IResourceValidator.IValidationProfileUsageTracker value)
-
isNoBindingMsgSuppressed
boolean isNoBindingMsgSuppressed()
-
setNoBindingMsgSuppressed
IResourceValidator setNoBindingMsgSuppressed(boolean noBindingMsgSuppressed)
-
isNoInvariantChecks
boolean isNoInvariantChecks()
-
setNoInvariantChecks
IResourceValidator setNoInvariantChecks(boolean value)
-
isNoTerminologyChecks
boolean isNoTerminologyChecks()
-
setNoTerminologyChecks
IResourceValidator setNoTerminologyChecks(boolean noTerminologyChecks)
-
isNoExtensibleWarnings
boolean isNoExtensibleWarnings()
-
setNoExtensibleWarnings
IResourceValidator setNoExtensibleWarnings(boolean noExtensibleWarnings)
-
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- Returns:
-
setErrorForUnknownProfiles
void setErrorForUnknownProfiles(boolean errorForUnknownProfiles)
-
isShowMessagesFromReferences
boolean isShowMessagesFromReferences()
-
setShowMessagesFromReferences
void setShowMessagesFromReferences(boolean value)
-
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
void setWantCheckSnapshotUnchanged(boolean wantCheckSnapshotUnchanged)
-
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
void setAssumeValidRestReferences(boolean value)
-
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
void setAllowExamples(boolean value)
-
isNoCheckAggregation
boolean isNoCheckAggregation()
-
setNoCheckAggregation
void setNoCheckAggregation(boolean value)
-
isCrumbTrails
boolean isCrumbTrails()
CrumbTrail - whether the validator creates hints to- Returns:
-
setCrumbTrails
void setCrumbTrails(boolean crumbTrails)
-
isValidateValueSetCodesOnTxServer
boolean isValidateValueSetCodesOnTxServer()
-
setValidateValueSetCodesOnTxServer
void setValidateValueSetCodesOnTxServer(boolean value)
-
getBundleValidationRules
List<IResourceValidator.BundleValidationRule> 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, 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:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
validate
void 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
void validate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, 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, com.google.gson.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, com.google.gson.JsonObject object, String profile) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
-