001package org.hl7.fhir.dstu3.hapi.ctx;
002
003import ca.uhn.fhir.context.FhirContext;
004import org.hl7.fhir.dstu3.model.CodeSystem;
005import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent;
006import org.hl7.fhir.dstu3.model.StructureDefinition;
007import org.hl7.fhir.dstu3.model.ValueSet;
008import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
009import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent;
010import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
011
012import java.util.List;
013
014public interface IValidationSupport
015  extends ca.uhn.fhir.context.support.IContextValidationSupport<ConceptSetComponent, ValueSetExpansionComponent, StructureDefinition, CodeSystem, ConceptDefinitionComponent, IssueSeverity> {
016
017  /**
018   * Expands the given portion of a ValueSet
019   *
020   * @param theInclude The portion to include
021   * @return The expansion
022   */
023  @Override
024  ValueSetExpansionComponent expandValueSet(FhirContext theContext, ConceptSetComponent theInclude);
025
026  /**
027   * Load and return all possible structure definitions
028   */
029  @Override
030  List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext);
031
032  /**
033   * Fetch a code system by Uri
034   *
035   * @param uri Canonical Uri of the code system
036   * @return The valueset (must not be null, but can be an empty ValueSet)
037   */
038  @Override
039  CodeSystem fetchCodeSystem(FhirContext theContext, String uri);
040
041  /**
042   * Fetch a valueset by Uri
043   *
044   * @param uri Canonical Uri of the ValueSet
045   * @return The valueset (must not be null, but can be an empty ValueSet)
046   */
047  @Override
048  ValueSet fetchValueSet(FhirContext theContext, String uri);
049
050  @Override
051  StructureDefinition fetchStructureDefinition(FhirContext theCtx, String theUrl);
052
053  /**
054   * Returns <code>true</code> if codes in the given code system can be expanded
055   * or validated
056   *
057   * @param theSystem The URI for the code system, e.g. <code>"http://loinc.org"</code>
058   * @return Returns <code>true</code> if codes in the given code system can be
059   * validated
060   */
061  @Override
062  boolean isCodeSystemSupported(FhirContext theContext, String theSystem);
063
064  /**
065   * Generate a snapshot from the given differential profile.
066   *
067   * @return Returns null if this module does not know how to handle this request
068   */
069  StructureDefinition generateSnapshot(StructureDefinition theInput, String theUrl, String theName);
070
071
072
073}