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 null and calling code is expected to be able to handle this.

    • 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
      • 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 validator
        theClass - The type of the resource to load
        theUri - The resource URI
        Returns:
        Returns the resource, or null if no resource with the given URI can be found
      • isCodeSystemSupported

        boolean isCodeSystemSupported​(FhirContext theContext,
                                      String theSystem)
        Returns true if 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 true if codes in the given code system can be validated
      • 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.code in 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.code in 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
        theValueSet - The ValueSet to validate against. Must not be null, and must be a ValueSet resource.
        Returns:
        Returns a validation result object, or null if this validation support module can not handle this kind of request