
Class RemoteTerminologyServiceValidationSupport
java.lang.Object
org.hl7.fhir.common.hapi.validation.support.BaseValidationSupport
org.hl7.fhir.common.hapi.validation.support.RemoteTerminologyServiceValidationSupport
- All Implemented Interfaces:
ca.uhn.fhir.context.support.IValidationSupport
public class RemoteTerminologyServiceValidationSupport
extends BaseValidationSupport
implements ca.uhn.fhir.context.support.IValidationSupport
This class is an implementation of
IValidationSupport that fetches validation codes
from a remote FHIR based terminology server. It will invoke the FHIR
ValueSet/$validate-code
operation in order to validate codes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNested classes/interfaces inherited from interface ca.uhn.fhir.context.support.IValidationSupport
ca.uhn.fhir.context.support.IValidationSupport.BaseConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.BooleanConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssue, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueCode, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueCoding, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueDetails, 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.GroupConceptProperty, 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
FieldsFields inherited from class org.hl7.fhir.common.hapi.validation.support.BaseValidationSupport
myCtxFields inherited from interface ca.uhn.fhir.context.support.IValidationSupport
TYPE_BOOLEAN, TYPE_CODING, TYPE_GROUP, TYPE_STRING, URL_PREFIX_STRUCTURE_DEFINITION, URL_PREFIX_VALUE_SET -
Constructor Summary
ConstructorsConstructorDescriptionRemoteTerminologyServiceValidationSupport(ca.uhn.fhir.context.FhirContext theFhirContext) ConstructorRemoteTerminologyServiceValidationSupport(ca.uhn.fhir.context.FhirContext theFhirContext, String theBaseUrl) ConstructorRemoteTerminologyServiceValidationSupport(ca.uhn.fhir.context.FhirContext theFhirContext, String theBaseUrl, ca.uhn.fhir.rest.client.api.IRestfulClientFactory theRestfulClientFactory) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientInterceptor(Object theClientInterceptor) Adds an interceptor that will be registered to all clients.protected org.hl7.fhir.instance.model.api.IBaseParametersbuildValidateCodeInputParameters(String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) static Optional<Collection<ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssue>> createCodeValidationIssues(org.hl7.fhir.instance.model.api.IBaseOperationOutcome theOperationOutcome, ca.uhn.fhir.context.FhirVersionEnum theFhirVersion) Creates a list ofIValidationSupport.CodeValidationIssuefrom the issues returned by the $validate-code operation.static ca.uhn.fhir.context.support.IValidationSupport.BaseConceptPropertycreateConceptProperty(String theName, org.hl7.fhir.instance.model.api.IBaseDatatype theValue) org.hl7.fhir.instance.model.api.IBaseResourcefetchCodeSystem(String theSystem) org.hl7.fhir.instance.model.api.IBaseResourcefetchValueSet(String theValueSetUrl) protected StringgetErrorMessage(String errorCode, Object... theParams) getName()protected ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResultinvokeRemoteValidateCode(String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) booleanisCodeSystemSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem) booleanisValueSetSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl) ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResultlookupCode(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.LookupCodeRequest theLookupCodeRequest) voidsetBaseUrl(String theBaseUrl) Sets the FHIR Terminology Server base URLca.uhn.fhir.context.support.TranslateConceptResultstranslateConcept(ca.uhn.fhir.context.support.IValidationSupport.TranslateCodeRequest theRequest) ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResultvalidateCode(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.CodeValidationResultvalidateCodeInValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) Methods inherited from class org.hl7.fhir.common.hapi.validation.support.BaseValidationSupport
getFhirContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.context.support.IValidationSupport
expandValueSet, expandValueSet, fetchAllConformanceResources, fetchAllNonBaseStructureDefinitions, fetchAllSearchParameters, fetchAllStructureDefinitions, fetchBinary, fetchResource, fetchStructureDefinition, generateSnapshot, getFhirContext, invalidateCaches, isCodeableConceptValidationSuccessfulIfNotAllCodingsAreValid, isRemoteTerminologyServiceConfigured, lookupCode, lookupCode
-
Field Details
-
ERROR_CODE_UNKNOWN_CODE_IN_CODE_SYSTEM
- See Also:
-
ERROR_CODE_UNKNOWN_CODE_IN_VALUE_SET
- See Also:
-
-
Constructor Details
-
RemoteTerminologyServiceValidationSupport
Constructor- Parameters:
theFhirContext- The FhirContext. Will be used to create a FHIR client for remote terminology requests.
-
RemoteTerminologyServiceValidationSupport
public RemoteTerminologyServiceValidationSupport(ca.uhn.fhir.context.FhirContext theFhirContext, String theBaseUrl) Constructor- Parameters:
theFhirContext- The FhirContext. Will be used to create a FHIR client for remote terminology requests.theBaseUrl- The url used for the remote terminology FHIR client.
-
RemoteTerminologyServiceValidationSupport
public RemoteTerminologyServiceValidationSupport(ca.uhn.fhir.context.FhirContext theFhirContext, String theBaseUrl, @Nullable ca.uhn.fhir.rest.client.api.IRestfulClientFactory theRestfulClientFactory) Constructor- Parameters:
theFhirContext- The FhirContext.theBaseUrl- The url used for the remote terminology FHIR client.theRestfulClientFactory- Used to create the remote terminology FHIR client. If this is not supplied, a client will be created from the FhirContext
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceca.uhn.fhir.context.support.IValidationSupport
-
validateCode
public 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) - Specified by:
validateCodein interfaceca.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 theCodeSystem, String theCode, String theDisplay, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theValueSet) - Specified by:
validateCodeInValueSetin interfaceca.uhn.fhir.context.support.IValidationSupport
-
fetchCodeSystem
- Specified by:
fetchCodeSystemin interfaceca.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:
lookupCodein interfaceca.uhn.fhir.context.support.IValidationSupport
-
getErrorMessage
-
createConceptProperty
public static ca.uhn.fhir.context.support.IValidationSupport.BaseConceptProperty createConceptProperty(String theName, org.hl7.fhir.instance.model.api.IBaseDatatype theValue) -
fetchValueSet
- Specified by:
fetchValueSetin interfaceca.uhn.fhir.context.support.IValidationSupport
-
isCodeSystemSupported
public boolean isCodeSystemSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem) - Specified by:
isCodeSystemSupportedin interfaceca.uhn.fhir.context.support.IValidationSupport
-
isValueSetSupported
public boolean isValueSetSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl) - Specified by:
isValueSetSupportedin interfaceca.uhn.fhir.context.support.IValidationSupport
-
translateConcept
public ca.uhn.fhir.context.support.TranslateConceptResults translateConcept(ca.uhn.fhir.context.support.IValidationSupport.TranslateCodeRequest theRequest) - Specified by:
translateConceptin interfaceca.uhn.fhir.context.support.IValidationSupport
-
getBaseUrl
-
invokeRemoteValidateCode
protected ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult invokeRemoteValidateCode(String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) -
createCodeValidationIssues
public static Optional<Collection<ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssue>> createCodeValidationIssues(org.hl7.fhir.instance.model.api.IBaseOperationOutcome theOperationOutcome, ca.uhn.fhir.context.FhirVersionEnum theFhirVersion) Creates a list ofIValidationSupport.CodeValidationIssuefrom the issues returned by the $validate-code operation. Please note that this method should only be used for Remote Terminology for now as it only translates issues text/message and assumes all other fields. When issues will be supported across all validators in hapi-fhir, a proper generic conversion method should be available and this method will be deleted.- Parameters:
theOperationOutcome- the outcome of the $validate-code operationtheFhirVersion- the FHIR version- Returns:
- the list of
IValidationSupport.CodeValidationIssue
-
buildValidateCodeInputParameters
protected org.hl7.fhir.instance.model.api.IBaseParameters buildValidateCodeInputParameters(String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) -
setBaseUrl
Sets the FHIR Terminology Server base URL- Parameters:
theBaseUrl- The base URL, e.g. "..."
-
addClientInterceptor
Adds an interceptor that will be registered to all clients.Note that this method is not thread-safe and should only be called prior to this module being used.
- Parameters:
theClientInterceptor- The interceptor (must not be null)
-