public class PrePopulatedValidationSupport extends Object implements IValidationSupport
IValidationSupport which may be pre-populated
with a collection of validation resources to be used by the validator.IValidationSupport.CodeValidationResult| Constructor and Description |
|---|
PrePopulatedValidationSupport()
Constructor
|
PrePopulatedValidationSupport(Map<String,StructureDefinition> theStructureDefinitions,
Map<String,ValueSet> theValueSets,
Map<String,CodeSystem> theCodeSystems)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCodeSystem(CodeSystem theCodeSystem)
Add a new CodeSystem resource which will be available to the validator.
|
void |
addStructureDefinition(StructureDefinition theStructureDefinition)
Add a new StructureDefinition resource which will be available to the validator.
|
void |
addValueSet(ValueSet theValueSet)
Add a new ValueSet resource which will be available to the validator.
|
ValueSet.ValueSetExpansionComponent |
expandValueSet(FhirContext theContext,
ValueSet.ConceptSetComponent theInclude)
Expands the given portion of a ValueSet
|
List<StructureDefinition> |
fetchAllStructureDefinitions(FhirContext theContext)
Load and return all possible structure definitions
|
CodeSystem |
fetchCodeSystem(FhirContext theContext,
String theSystem)
Fetch a code system by ID
|
<T extends IBaseResource> |
fetchResource(FhirContext theContext,
Class<T> theClass,
String theUri)
Loads a resource needed by the validation (a StructureDefinition, or a
ValueSet)
|
StructureDefinition |
fetchStructureDefinition(FhirContext theCtx,
String theUrl) |
boolean |
isCodeSystemSupported(FhirContext theContext,
String theSystem)
Returns
true if codes in the given code system can be expanded
or validated |
IValidationSupport.CodeValidationResult |
validateCode(FhirContext theContext,
String theCodeSystem,
String theCode,
String theDisplay)
Validates that the given code exists and if possible returns a display
name.
|
public PrePopulatedValidationSupport()
public PrePopulatedValidationSupport(Map<String,StructureDefinition> theStructureDefinitions, Map<String,ValueSet> theValueSets, Map<String,CodeSystem> theCodeSystems)
theStructureDefinitions - The StructureDefinitions to be returned by this module. Keys are the logical URL for the resource, and
values are the resource itself.theValueSets - The ValueSets to be returned by this module. Keys are the logical URL for the resource, and values are
the resource itself.theCodeSystems - The CodeSystems to be returned by this module. Keys are the logical URL for the resource, and values are
the resource itself.public void addStructureDefinition(StructureDefinition theStructureDefinition)
public void addValueSet(ValueSet theValueSet)
public void addCodeSystem(CodeSystem theCodeSystem)
public ValueSet.ValueSetExpansionComponent expandValueSet(FhirContext theContext, ValueSet.ConceptSetComponent theInclude)
IValidationSupportexpandValueSet in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>expandValueSet in interface IValidationSupporttheInclude - The portion to includepublic List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext)
IValidationSupportfetchAllStructureDefinitions in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>fetchAllStructureDefinitions in interface IValidationSupportpublic CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem)
IValidationSupportfetchCodeSystem in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>fetchCodeSystem in interface IValidationSupporttheSystem - The code systempublic <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri)
IValidationSupportfetchResource in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>fetchResource in interface IValidationSupporttheContext - The HAPI FHIR Context object current in use by the validatortheClass - The type of the resource to loadtheUri - The resource URInull if no resource with the
given URI can be foundpublic StructureDefinition fetchStructureDefinition(FhirContext theCtx, String theUrl)
fetchStructureDefinition in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>fetchStructureDefinition in interface IValidationSupportpublic boolean isCodeSystemSupported(FhirContext theContext, String theSystem)
IValidationSupporttrue if codes in the given code system can be expanded
or validatedisCodeSystemSupported in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>isCodeSystemSupported in interface IValidationSupporttheSystem - The URI for the code system, e.g. "http://loinc.org"true if codes in the given code system can be
validatedpublic IValidationSupport.CodeValidationResult validateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay)
IValidationSupportObservation.code in the default profile.validateCode in interface IContextValidationSupport<ValueSet.ConceptSetComponent,ValueSet.ValueSetExpansionComponent,StructureDefinition,CodeSystem,CodeSystem.ConceptDefinitionComponent,ValidationMessage.IssueSeverity>validateCode in interface IValidationSupporttheCodeSystem - The code system, e.g. "http://loinc.org"theCode - The code, e.g. "1234-5"theDisplay - The display name, if it should also be validatedCopyright © 2014–2017 University Health Network. All rights reserved.