diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java index 8c2890026..c947c6d44 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java @@ -139,7 +139,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon } public interface IValidatorFactory { -// IResourceValidator makeValidator(IWorkerContext ctxt) throws FHIRException; + IResourceValidator makeValidator(IWorkerContext ctxt) throws FHIRException; IResourceValidator makeValidator(IWorkerContext ctxts, XVerExtensionManager xverManager) throws FHIRException; } @@ -252,14 +252,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon return res; } -// public static SimpleWorkerContext fromDefinitions(Map source) throws IOException, FHIRException { -// SimpleWorkerContext res = new SimpleWorkerContext(); -// for (String name : source.keySet()) { -// res.loadDefinitionItem(name, new ByteArrayInputStream(source.get(name)), null, null); -// } -// return res; -// } - public static SimpleWorkerContext fromDefinitions(Map source, IContextResourceLoader loader, PackageVersion pi) throws FileNotFoundException, IOException, FHIRException { SimpleWorkerContext res = new SimpleWorkerContext(); for (String name : source.keySet()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 0715af5db..17b33fb27 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -57,6 +57,7 @@ import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.MarkDownProcessor; import org.hl7.fhir.utilities.MarkDownProcessor.Dialect; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.validation.ValidationOptions; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -219,10 +220,14 @@ public class DataRenderer extends Renderer { private boolean isCanonical(String path) { if (!path.endsWith(".url")) return false; - StructureDefinition sd = getContext().getWorker().fetchTypeDefinition(path.substring(0, path.length()-4)); + String t = path.substring(0, path.length()-4); + StructureDefinition sd = getContext().getWorker().fetchTypeDefinition(t); if (sd == null) return false; - if (Utilities.existsInList(path.substring(0, path.length()-4), + if (Utilities.existsInList(t, VersionUtilities.getCanonicalResourceNames(getContext().getWorker().getVersion()))) { + return true; + } + if (Utilities.existsInList(t, "ActivityDefinition", "CapabilityStatement", "CapabilityStatement2", "ChargeItemDefinition", "Citation", "CodeSystem", "CompartmentDefinition", "ConceptMap", "ConditionDefinition", "EventDefinition", "Evidence", "EvidenceReport", "EvidenceVariable", "ExampleScenario", "GraphDefinition", "ImplementationGuide", "Library", "Measure", "MessageDefinition", "NamingSystem", "PlanDefinition"