added more missing methods

This commit is contained in:
patrick-werner 2019-03-30 15:36:06 +01:00
parent 2f3ac9d734
commit 41a032ae9f
5 changed files with 48 additions and 15 deletions

View File

@ -41,8 +41,13 @@ public class CachingValidationSupport implements IValidationSupport {
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) {
return myWrap.fetchCodeSystem(theContext, theSystem);
public CodeSystem fetchCodeSystem(FhirContext theContext, String uri) {
return myWrap.fetchCodeSystem(theContext, uri);
}
@Override
public ValueSet fetchValueSet(FhirContext theContext, String uri) {
return myWrap.fetchValueSet(theContext, uri);
}
@Override

View File

@ -146,11 +146,16 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) {
return myCodeSystems.get(theSystem);
}
public CodeSystem fetchCodeSystem(FhirContext theContext, String uri) {
return myCodeSystems.get(uri);
}
@SuppressWarnings("unchecked")
@Override
public ValueSet fetchValueSet(FhirContext theContext, String uri) {
return myValueSets.get(uri);
}
@SuppressWarnings("unchecked")
@Override
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
if (theClass.equals(StructureDefinition.class)) {

View File

@ -42,8 +42,13 @@ public class CachingValidationSupport implements IValidationSupport {
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) {
return myWrap.fetchCodeSystem(theContext, theSystem);
public CodeSystem fetchCodeSystem(FhirContext theContext, String uri) {
return myWrap.fetchCodeSystem(theContext, uri);
}
@Override
public ValueSet fetchValueSet(FhirContext theContext, String uri) {
return myWrap.fetchValueSet(theContext, uri);
}
@Override

View File

@ -146,12 +146,18 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
return new ArrayList<StructureDefinition>(myStructureDefinitions.values());
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) {
return myCodeSystems.get(theSystem);
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String uri) {
return myCodeSystems.get(uri);
}
@SuppressWarnings("unchecked")
@Override
public ValueSet fetchValueSet(FhirContext theContext, String uri) {
return myValueSets.get(uri);
}
@SuppressWarnings("unchecked")
@Override
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
if (theClass.equals(StructureDefinition.class)) {

View File

@ -7,6 +7,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.hapi.ctx.IValidationSupport;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent;
import org.hl7.fhir.r4.terminologies.ValueSetExpander;
@ -70,9 +71,20 @@ public class ValidationSupportChain implements IValidationSupport {
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theCtx, String theSystem) {
public CodeSystem fetchCodeSystem(FhirContext theCtx, String uri) {
for (IValidationSupport next : myChain) {
CodeSystem retVal = next.fetchCodeSystem(theCtx, theSystem);
CodeSystem retVal = next.fetchCodeSystem(theCtx, uri);
if (retVal != null) {
return retVal;
}
}
return null;
}
@Override
public ValueSet fetchValueSet(FhirContext theCtx, String uri) {
for (IValidationSupport next : myChain) {
ValueSet retVal = next.fetchValueSet(theCtx, uri);
if (retVal != null) {
return retVal;
}