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 beb38579e..8e79ce9f1 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 @@ -720,6 +720,15 @@ public abstract class BaseWorkerContext implements IWorkerContext { return (T) transforms.get(uri); if (questionnaires.containsKey(uri)) return (T) questionnaires.get(uri); + for (Map rt : allResourcesById.values()) { + for (Resource r : rt.values()) { + if (r instanceof MetadataResource) { + MetadataResource mr = (MetadataResource) r; + if (uri.equals(mr.getUrl())) + return (T) mr; + } + } + } return null; } else if (class_ == ImplementationGuide.class) { return (T) guides.get(uri); diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java index 64a9e9872..bccf9c666 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java @@ -881,7 +881,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat else if (s.getSeverity() == IssueSeverity.WARNING) txWarning(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage()); else - return txRule(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage()); + return txRule(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage()+" for '"+system+"#"+code+"'"); return true; } else if (system.startsWith("http://hl7.org/fhir")) { if (Utilities.existsInList(system, "http://hl7.org/fhir/sid/icd-10", "http://hl7.org/fhir/sid/cvx", "http://hl7.org/fhir/sid/icd-10-cm","http://hl7.org/fhir/sid/icd-9","http://hl7.org/fhir/sid/ndc","http://hl7.org/fhir/sid/srt"))