suppress debug messaging if instructed and control lazy loading

This commit is contained in:
Grahame Grieve 2022-09-20 04:48:56 -04:00
parent 7f74b4521a
commit b5d828b0dc
1 changed files with 25 additions and 11 deletions

View File

@ -408,6 +408,13 @@ public class ProfileUtilities extends TranslatingUtilities {
public interface ProfileKnowledgeProvider { public interface ProfileKnowledgeProvider {
class BindingResolution { class BindingResolution {
public BindingResolution(String display, String url) {
this.display = display;
this.url = url;
}
public BindingResolution() {
// TODO Auto-generated constructor stub
}
public String display; public String display;
public String url; public String url;
} }
@ -735,14 +742,16 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
if (!Utilities.noString(b.toString())) { if (!Utilities.noString(b.toString())) {
String msg = "The profile "+derived.getUrl()+" has "+ce+" "+Utilities.pluralize("element", ce)+" in the differential ("+b.toString()+") that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)"; String msg = "The profile "+derived.getUrl()+" has "+ce+" "+Utilities.pluralize("element", ce)+" in the differential ("+b.toString()+") that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)";
System.out.println("Error in snapshot generation: "+msg); if (debug) {
if (!debug) { System.out.println("Error in snapshot generation: "+msg);
System.out.println("Differential: "); if (!debug) {
for (ElementDefinition ed : derived.getDifferential().getElement()) System.out.println("Differential: ");
System.out.println(" "+ed.getId()+" = "+ed.getPath()+" : "+typeSummaryWithProfile(ed)+"["+ed.getMin()+".."+ed.getMax()+"]"+sliceSummary(ed)+" "+constraintSummary(ed)); for (ElementDefinition ed : derived.getDifferential().getElement())
System.out.println("Snapshot: "); System.out.println(" "+ed.getId()+" = "+ed.getPath()+" : "+typeSummaryWithProfile(ed)+"["+ed.getMin()+".."+ed.getMax()+"]"+sliceSummary(ed)+" "+constraintSummary(ed));
for (ElementDefinition ed : derived.getSnapshot().getElement()) System.out.println("Snapshot: ");
System.out.println(" "+ed.getId()+" = "+ed.getPath()+" : "+typeSummaryWithProfile(ed)+"["+ed.getMin()+".."+ed.getMax()+"]"+sliceSummary(ed)+" "+constraintSummary(ed)); for (ElementDefinition ed : derived.getSnapshot().getElement())
System.out.println(" "+ed.getId()+" = "+ed.getPath()+" : "+typeSummaryWithProfile(ed)+"["+ed.getMin()+".."+ed.getMax()+"]"+sliceSummary(ed)+" "+constraintSummary(ed));
}
} }
if (exception) if (exception)
throw new DefinitionException(msg); throw new DefinitionException(msg);
@ -2507,8 +2516,12 @@ public class ProfileUtilities extends TranslatingUtilities {
generateSnapshot(context.fetchTypeDefinition("Extension"), sd, sd.getUrl(), webUrl, sd.getName()); generateSnapshot(context.fetchTypeDefinition("Extension"), sd, sd.getUrl(), webUrl, sd.getName());
} }
} }
if (sd == null) if (sd == null) {
System.out.println("Failed to find referenced profile: " + type.getProfile()); if (debug) {
System.out.println("Failed to find referenced profile: " + type.getProfile());
}
}
} }
if (sd == null) if (sd == null)
sd = context.fetchTypeDefinition(type.getWorkingCode()); sd = context.fetchTypeDefinition(type.getWorkingCode());
@ -6694,8 +6707,9 @@ public class ProfileUtilities extends TranslatingUtilities {
} }
public void setNewSlicingProcessing(boolean newSlicingProcessing) { public ProfileUtilities setNewSlicingProcessing(boolean newSlicingProcessing) {
this.newSlicingProcessing = newSlicingProcessing; this.newSlicingProcessing = newSlicingProcessing;
return this;
} }