Package ca.uhn.fhir.context.support
Interface IContextValidationSupport<EVS_IN,EVS_OUT,SDT,CST,CDCT,IST>
-
public interface IContextValidationSupport<EVS_IN,EVS_OUT,SDT,CST,CDCT,IST>
This interface is a version-independent representation of the various functions that can be provided by validation and terminology services.Implementations are not required to implement all of the functions in this interface; in fact it is expected that most won't. Any methods which are not implemented may simply return
nulland calling code is expected to be able to handle this.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIContextValidationSupport.BaseConceptPropertystatic classIContextValidationSupport.CodeValidationResultstatic classIContextValidationSupport.CodingConceptPropertystatic classIContextValidationSupport.ConceptDesignationstatic classIContextValidationSupport.LookupCodeResultstatic classIContextValidationSupport.StringConceptProperty
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EVS_OUTexpandValueSet(FhirContext theContext, EVS_IN theInclude)Expands the given portion of a ValueSetList<IBaseResource>fetchAllConformanceResources(FhirContext theContext)Load and return all conformance resources associated with this validation support module.List<SDT>fetchAllStructureDefinitions(FhirContext theContext)Load and return all possible structure definitionsCSTfetchCodeSystem(FhirContext theContext, String theSystem)Fetch a code system by ID<T extends IBaseResource>
TfetchResource(FhirContext theContext, Class<T> theClass, String theUri)Loads a resource needed by the validation (a StructureDefinition, or a ValueSet)SDTfetchStructureDefinition(FhirContext theCtx, String theUrl)IBaseResourcefetchValueSet(FhirContext theContext, String theValueSetUrl)Fetch the given ValueSet by URLbooleanisCodeSystemSupported(FhirContext theContext, String theSystem)Returnstrueif codes in the given code system can be expanded or validatedIContextValidationSupport.LookupCodeResultlookupCode(FhirContext theContext, String theSystem, String theCode)Look up a code using the system and code valueIContextValidationSupport.CodeValidationResultvalidateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl)Validates that the given code exists and if possible returns a display name.default IContextValidationSupport.CodeValidationResultvalidateCodeInValueSet(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay, IBaseResource theValueSet)Validates that the given code exists and if possible returns a display name.
-
-
-
Method Detail
-
expandValueSet
EVS_OUT expandValueSet(FhirContext theContext, EVS_IN theInclude)
Expands the given portion of a ValueSet- Parameters:
theInclude- The portion to include- Returns:
- The expansion
-
fetchAllConformanceResources
List<IBaseResource> fetchAllConformanceResources(FhirContext theContext)
Load and return all conformance resources associated with this validation support module. This method may return null if it doesn't make sense for a given module.
-
fetchAllStructureDefinitions
List<SDT> fetchAllStructureDefinitions(FhirContext theContext)
Load and return all possible structure definitions
-
fetchCodeSystem
CST fetchCodeSystem(FhirContext theContext, String theSystem)
Fetch a code system by ID- Parameters:
theSystem- The code system- Returns:
- The valueset (must not be null, but can be an empty ValueSet)
-
fetchResource
<T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri)
Loads a resource needed by the validation (a StructureDefinition, or a ValueSet)- Parameters:
theContext- The HAPI FHIR Context object current in use by the validatortheClass- The type of the resource to loadtheUri- The resource URI- Returns:
- Returns the resource, or
nullif no resource with the given URI can be found
-
fetchStructureDefinition
SDT fetchStructureDefinition(FhirContext theCtx, String theUrl)
-
isCodeSystemSupported
boolean isCodeSystemSupported(FhirContext theContext, String theSystem)
Returnstrueif codes in the given code system can be expanded or validated- Parameters:
theSystem- The URI for the code system, e.g."http://loinc.org"- Returns:
- Returns
trueif codes in the given code system can be validated
-
fetchValueSet
IBaseResource fetchValueSet(FhirContext theContext, String theValueSetUrl)
Fetch the given ValueSet by URL
-
validateCode
IContextValidationSupport.CodeValidationResult validateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl)
Validates that the given code exists and if possible returns a display name. This method is called to check codes which are found in "example" binding fields (e.g.Observation.codein the default profile.- Parameters:
theCodeSystem- The code system, e.g. "http://loinc.org"theCode- The code, e.g. "1234-5"theDisplay- The display name, if it should also be validated- Returns:
- Returns a validation result object
-
validateCodeInValueSet
default IContextValidationSupport.CodeValidationResult validateCodeInValueSet(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay, @Nonnull IBaseResource theValueSet)
Validates that the given code exists and if possible returns a display name. This method is called to check codes which are found in "example" binding fields (e.g.Observation.codein the default profile.- Parameters:
theCodeSystem- The code system, e.g. "http://loinc.org"theCode- The code, e.g. "1234-5"theDisplay- The display name, if it should also be validatedtheValueSet- The ValueSet to validate against. Must not be null, and must be a ValueSet resource.- Returns:
- Returns a validation result object, or
nullif this validation support module can not handle this kind of request
-
lookupCode
IContextValidationSupport.LookupCodeResult lookupCode(FhirContext theContext, String theSystem, String theCode)
Look up a code using the system and code value- Parameters:
theContext- The FHIR contexttheSystem- The CodeSystem URLtheCode- The code
-
-