Class InMemoryTerminologyServerValidationSupport

java.lang.Object
org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport
All Implemented Interfaces:
ca.uhn.fhir.context.support.IValidationSupport

public class InMemoryTerminologyServerValidationSupport extends Object implements ca.uhn.fhir.context.support.IValidationSupport
This class is a basic in-memory terminology service, designed to expand ValueSets and validate codes completely in-memory. It is suitable for runtime validation purposes where no dedicated terminology service exists (either an internal one such as the HAPI FHIR JPA terminology service, or an external term service API)
  • Nested Class Summary

    Nested Classes

    Nested classes/interfaces inherited from interface ca.uhn.fhir.context.support.IValidationSupport

    ca.uhn.fhir.context.support.IValidationSupport.BaseConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult, ca.uhn.fhir.context.support.IValidationSupport.CodingConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.ConceptDesignation, ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity, ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult, ca.uhn.fhir.context.support.IValidationSupport.StringConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.TranslateCodeRequest, ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome
  • Field Summary

    Fields inherited from interface ca.uhn.fhir.context.support.IValidationSupport

    TYPE_CODING, TYPE_STRING, URL_PREFIX_VALUE_SET
  • Constructor Summary

    Constructors
    Constructor
    Description
    InMemoryTerminologyServerValidationSupport(ca.uhn.fhir.context.FhirContext theCtx)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    static ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
    createResultForDisplayMismatch(ca.uhn.fhir.context.FhirContext theFhirContext, String theCode, String theDisplay, String theExpectedDisplay, String theCodeSystemVersion, ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity theIssueSeverityForCodeDisplayMismatch)
     
    ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome
    expandValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand)
     
    void
    expandValueSetIncludeOrExclude(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, Consumer<ca.uhn.fhir.util.FhirVersionIndependentConcept> theConsumer, org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent theIncludeOrExclude)
    Use with caution - this is not a stable API
    ca.uhn.fhir.context.FhirContext
     
    ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity
    This setting controls the validation issue severity to report when a code validation finds that the code is present in the given CodeSystem, but the display name being validated doesn't match the expected value(s).
     
    boolean
    isCodeSystemSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem)
     
    boolean
    isValueSetSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl)
     
    ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
    lookupCode(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.LookupCodeRequest theLookupCodeRequest)
     
    void
    setIssueSeverityForCodeDisplayMismatch(ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity theIssueSeverityForCodeDisplayMismatch)
    This setting controls the validation issue severity to report when a code validation finds that the code is present in the given CodeSystem, but the display name being validated doesn't match the expected value(s).
    ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
    validateCode(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl)
     
    ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
    validateCodeInValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystemUrlAndVersion, String theCode, String theDisplay, org.hl7.fhir.instance.model.api.IBaseResource theValueSet)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ca.uhn.fhir.context.support.IValidationSupport

    expandValueSet, fetchAllConformanceResources, fetchAllNonBaseStructureDefinitions, fetchAllSearchParameters, fetchAllStructureDefinitions, fetchBinary, fetchCodeSystem, fetchResource, fetchStructureDefinition, fetchValueSet, generateSnapshot, invalidateCaches, isEnabledValidationForCodingsLogicalAnd, isRemoteTerminologyServiceConfigured, lookupCode, lookupCode, translateConcept
  • Constructor Details

    • InMemoryTerminologyServerValidationSupport

      public InMemoryTerminologyServerValidationSupport(ca.uhn.fhir.context.FhirContext theCtx)
      Constructor
      Parameters:
      theCtx - A FhirContext for the FHIR version being validated
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface ca.uhn.fhir.context.support.IValidationSupport
    • getIssueSeverityForCodeDisplayMismatch

      public ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity getIssueSeverityForCodeDisplayMismatch()
      This setting controls the validation issue severity to report when a code validation finds that the code is present in the given CodeSystem, but the display name being validated doesn't match the expected value(s). Defaults to IValidationSupport.IssueSeverity.WARNING. Set this value to IValidationSupport.IssueSeverity.INFORMATION if you don't want to see display name validation issues at all in resource validation outcomes.
      Since:
      7.0.0
    • setIssueSeverityForCodeDisplayMismatch

      public void setIssueSeverityForCodeDisplayMismatch(@Nonnull ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity theIssueSeverityForCodeDisplayMismatch)
      This setting controls the validation issue severity to report when a code validation finds that the code is present in the given CodeSystem, but the display name being validated doesn't match the expected value(s). Defaults to IValidationSupport.IssueSeverity.WARNING. Set this value to IValidationSupport.IssueSeverity.INFORMATION if you don't want to see display name validation issues at all in resource validation outcomes.
      Parameters:
      theIssueSeverityForCodeDisplayMismatch - The severity. Must not be null.
      Since:
      7.0.0
    • getFhirContext

      public ca.uhn.fhir.context.FhirContext getFhirContext()
      Specified by:
      getFhirContext in interface ca.uhn.fhir.context.support.IValidationSupport
    • expandValueSet

      public ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome expandValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand)
      Specified by:
      expandValueSet in interface ca.uhn.fhir.context.support.IValidationSupport
    • validateCodeInValueSet

      public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCodeInValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystemUrlAndVersion, String theCode, String theDisplay, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theValueSet)
      Specified by:
      validateCodeInValueSet in interface ca.uhn.fhir.context.support.IValidationSupport
    • validateCode

      @Nullable public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCode(@Nonnull ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, @Nonnull ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl)
      Specified by:
      validateCode in interface ca.uhn.fhir.context.support.IValidationSupport
    • lookupCode

      public ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult lookupCode(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, @Nonnull ca.uhn.fhir.context.support.LookupCodeRequest theLookupCodeRequest)
      Specified by:
      lookupCode in interface ca.uhn.fhir.context.support.IValidationSupport
    • isCodeSystemSupported

      public boolean isCodeSystemSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem)
      Specified by:
      isCodeSystemSupported in interface ca.uhn.fhir.context.support.IValidationSupport
    • isValueSetSupported

      public boolean isValueSetSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl)
      Specified by:
      isValueSetSupported in interface ca.uhn.fhir.context.support.IValidationSupport
    • expandValueSetIncludeOrExclude

      public void expandValueSetIncludeOrExclude(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, Consumer<ca.uhn.fhir.util.FhirVersionIndependentConcept> theConsumer, org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent theIncludeOrExclude) throws InMemoryTerminologyServerValidationSupport.ExpansionCouldNotBeCompletedInternallyException
      Use with caution - this is not a stable API
      Throws:
      InMemoryTerminologyServerValidationSupport.ExpansionCouldNotBeCompletedInternallyException
      Since:
      5.6.0
    • createResultForDisplayMismatch

      public static ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult createResultForDisplayMismatch(ca.uhn.fhir.context.FhirContext theFhirContext, String theCode, String theDisplay, String theExpectedDisplay, String theCodeSystemVersion, ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity theIssueSeverityForCodeDisplayMismatch)