From 590a4d48b14f4cbf0a99d0714033e3b4eaeaa7ad Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 30 May 2019 13:29:25 +1000 Subject: [PATCH] add debugging for terminology cache issue --- .../java/org/hl7/fhir/r5/conformance/ProfileUtilities.java | 2 +- .../main/java/org/hl7/fhir/r5/context/TerminologyCache.java | 3 +++ .../src/main/java/org/hl7/fhir/utilities/Utilities.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java index 5c989fa51..0c0fa040e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java @@ -3304,7 +3304,7 @@ public class ProfileUtilities extends TranslatingUtilities { p = Utilities.uncapitalize(p); StructureDefinition sd = context.fetchResource(StructureDefinition.class, sdNs(p)); if (sd == null) - throw new Error("Unable to find profile "+p); + throw new Error("Unable to find profile '"+p+"' at "+ed.getId()); ccmp = new ElementDefinitionComparer(false, sd.getSnapshot().getElement(), p, child.getSelf().getPath().length(), cmp.name); } else if (child.getSelf().hasType() && child.getSelf().getType().get(0).getCode().equals("Reference")) { for (TypeRefComponent t: child.getSelf().getType()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java index 5fa965b87..e8bbcd9f8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java @@ -327,12 +327,14 @@ public class TerminologyCache { NamedCache nc = new NamedCache(); nc.name = title; caches.put(title, nc); + System.out.print(" - load "+title+".cache"); String src = TextFile.fileToString(Utilities.path(folder, fn)); if (src.startsWith("?")) src = src.substring(1); int i = src.indexOf(ENTRY_MARKER); while (i > -1) { String s = src.substring(0, i); + System.out.print("."); src = src.substring(i+ENTRY_MARKER.length()+1); i = src.indexOf(ENTRY_MARKER); if (!Utilities.noString(s)) { @@ -360,6 +362,7 @@ public class TerminologyCache { nc.list.add(ce); } } + System.out.println("done"); } catch (Exception e) { throw new FHIRException("Error loading "+fn+": "+e.getMessage(), e); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index ebabdb07e..af27fe8f1 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -569,7 +569,7 @@ public class Utilities { for(String arg: args) { if (!d) d = !noString(arg); - else if (!s.toString().endsWith("/")) + else if (!s.toString().endsWith("/") && !arg.startsWith("/")) s.append("/"); s.append(arg); }