diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java index 6676b62ae..4034cf79c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java @@ -1303,6 +1303,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte // ok, first we try to validate locally try { ValueSetValidator vsc = constructValueSetCheckerSimple(options, vs, ctxt); + vsc.getOpContext().note("Validate "+code.toString()+" @ "+path+" against "+vs.getVersionedUrl()); vsc.setUnknownSystems(unknownSystems); vsc.setThrowToServer(options.isUseServer() && terminologyClientManager.hasClient()); if (!ValueSetUtilities.isServerSide(code.getSystem())) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/ValueSetProcessBase.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/ValueSetProcessBase.java index a547327d5..406127929 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/ValueSetProcessBase.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/ValueSetProcessBase.java @@ -49,7 +49,7 @@ public class ValueSetProcessBase { protected IWorkerContext context; protected TerminologyOperationContext opContext; protected List requiredSupplements = new ArrayList<>(); - + protected ValueSetProcessBase(IWorkerContext context, TerminologyOperationContext opContext) { super(); this.context = context; @@ -229,7 +229,11 @@ public class ValueSetProcessBase { } } } - + + public TerminologyOperationContext getOpContext() { + return opContext; + } + protected AlternateCodesProcessingRules altCodeParams = new AlternateCodesProcessingRules(false); protected AlternateCodesProcessingRules allAltCodes = new AlternateCodesProcessingRules(true); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java index 159c7eb69..44e55cbc8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java @@ -433,7 +433,7 @@ public class ValueSetValidator extends ValueSetProcessBase { private int checkValueSetLoad(ConceptSetComponent inc, ValidationProcessInfo info) { int serverCount = 0; for (UriType uri : inc.getValueSet()) { - ValueSetValidator vsv = getVSVal(uri, info); + ValueSetValidator vsv = getVs(uri.getValue(), info); serverCount += vsv.getServerLoad(info); } CodeSystem cs = resolveCodeSystem(inc.getSystem(), inc.getVersion()); @@ -1345,19 +1345,19 @@ public class ValueSetValidator extends ValueSetProcessBase { if (isValueSetUnionImports()) { ok = false; for (UriType uri : vsi.getValueSet()) { - if (inImport(path, uri, system, version, code, info)) { + if (inImport(path, uri.getValue(), system, version, code, info)) { return true; } } } else { - Boolean bok = inImport(path, vsi.getValueSet().get(0), system, version, code, info); + Boolean bok = inImport(path, vsi.getValueSet().get(0).getValue(), system, version, code, info); if (bok == null) { return bok; } ok = bok; for (int i = 1; i < vsi.getValueSet().size(); i++) { UriType uri = vsi.getValueSet().get(i); - ok = ok && inImport(path, uri, system, version, code, info); + ok = ok && inImport(path, uri.getValue(), system, version, code, info); } } } @@ -1633,18 +1633,9 @@ public class ValueSetValidator extends ValueSetProcessBase { inner.put(url, vsc); return vsc; } - - private ValueSetValidator getVSVal(UriType uri, ValidationProcessInfo info) { - ValueSetValidator vs = (ValueSetValidator) uri.getUserData("tx-fhir-cache"); - if (vs == null) { - vs = getVs(uri.getValue(), info); - uri.setUserData("tx-fhir-cache", vs); - } - return vs; - } - private Boolean inImport(String path, UriType uri, String system, String version, String code, ValidationProcessInfo info) throws FHIRException { - ValueSetValidator vs = getVSVal(uri, info); + private Boolean inImport(String path, String uri, String system, String version, String code, ValidationProcessInfo info) throws FHIRException { + ValueSetValidator vs = getVs(uri, info); if (vs == null) { return false; } else {