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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BestPracticeWarningLevelgetBestPracticeWarningLevel()whether the validator should enforce best practice guidelines as defined by various HL7 committeesList<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 profileCheckDisplayOptiongetCheckDisplay()how much to check displays for coded elementsIValidatorResourceFetchergetFetcher()IValidationPolicyAdvisorgetPolicyAdvisor()IdStatusgetResourceIdRule()whether the resource must have an id or not (depends on context)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()booleanisNoUnicodeBiDiControlChars()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 HAPIbooleanisWantInvariantInMessage()voidsetAllowExamples(boolean value)voidsetAssumeValidRestReferences(boolean value)IResourceValidatorsetBestPracticeWarningLevel(BestPracticeWarningLevel value)voidsetCheckDisplay(CheckDisplayOption checkDisplay)voidsetCrumbTrails(boolean crumbTrails)voidsetErrorForUnknownProfiles(boolean errorForUnknownProfiles)IResourceValidatorsetFetcher(IValidatorResourceFetcher value)IResourceValidatorsetNoBindingMsgSuppressed(boolean noBindingMsgSuppressed)voidsetNoCheckAggregation(boolean value)IResourceValidatorsetNoExtensibleWarnings(boolean noExtensibleWarnings)IResourceValidatorsetNoInvariantChecks(boolean value)IResourceValidatorsetNoTerminologyChecks(boolean noTerminologyChecks)voidsetNoUnicodeBiDiControlChars(boolean noUnicodeBiDiControlChars)IResourceValidatorsetPolicyAdvisor(IValidationPolicyAdvisor advisor)voidsetResourceIdRule(IdStatus resourceIdRule)voidsetShowMessagesFromReferences(boolean value)IResourceValidatorsetTracker(IValidationProfileUsageTracker value)voidsetValidateValueSetCodesOnTxServer(boolean value)voidsetWantCheckSnapshotUnchanged(boolean wantCheckSnapshotUnchanged)IResourceValidatorsetWantInvariantInMessage(boolean wantInvariantInMessage)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, 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.voidvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, Element element, String profile)voidvalidate(Object Context, List<org.hl7.fhir.utilities.validation.ValidationMessage> errors, String initialPath, 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
CheckDisplayOption getCheckDisplay()
how much to check displays for coded elements
-
setCheckDisplay
void setCheckDisplay(CheckDisplayOption checkDisplay)
-
getResourceIdRule
IdStatus getResourceIdRule()
whether the resource must have an id or not (depends on context)
-
setResourceIdRule
void setResourceIdRule(IdStatus resourceIdRule)
-
getBestPracticeWarningLevel
BestPracticeWarningLevel getBestPracticeWarningLevel()
whether the validator should enforce best practice guidelines as defined by various HL7 committees
-
setBestPracticeWarningLevel
IResourceValidator setBestPracticeWarningLevel(BestPracticeWarningLevel value)
-
getFetcher
IValidatorResourceFetcher getFetcher()
-
setFetcher
IResourceValidator setFetcher(IValidatorResourceFetcher value)
-
getPolicyAdvisor
IValidationPolicyAdvisor getPolicyAdvisor()
-
setPolicyAdvisor
IResourceValidator setPolicyAdvisor(IValidationPolicyAdvisor advisor)
-
getTracker
IValidationProfileUsageTracker getTracker()
-
setTracker
IResourceValidator setTracker(IValidationProfileUsageTracker value)
-
isNoBindingMsgSuppressed
boolean isNoBindingMsgSuppressed()
-
setNoBindingMsgSuppressed
IResourceValidator setNoBindingMsgSuppressed(boolean noBindingMsgSuppressed)
-
isNoInvariantChecks
boolean isNoInvariantChecks()
-
setNoInvariantChecks
IResourceValidator setNoInvariantChecks(boolean value)
-
isWantInvariantInMessage
boolean isWantInvariantInMessage()
-
setWantInvariantInMessage
IResourceValidator setWantInvariantInMessage(boolean wantInvariantInMessage)
-
isNoTerminologyChecks
boolean isNoTerminologyChecks()
-
setNoTerminologyChecks
IResourceValidator setNoTerminologyChecks(boolean noTerminologyChecks)
-
isNoExtensibleWarnings
boolean isNoExtensibleWarnings()
-
setNoExtensibleWarnings
IResourceValidator setNoExtensibleWarnings(boolean noExtensibleWarnings)
-
isNoUnicodeBiDiControlChars
boolean isNoUnicodeBiDiControlChars()
-
setNoUnicodeBiDiControlChars
void setNoUnicodeBiDiControlChars(boolean noUnicodeBiDiControlChars)
-
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
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<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, 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:
IOExceptionorg.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, 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
-
-