Fix wrong URL links + txCache errors + questionnaire rendering at root

This commit is contained in:
Grahame Grieve 2022-02-16 13:14:55 +11:00
parent fd36a5b0d2
commit 0f1d9db24f
5 changed files with 16 additions and 10 deletions

View File

@ -2523,7 +2523,8 @@ public class ProfileUtilities extends TranslatingUtilities {
// disabled 7-Dec 2021 GDG - we don't want to fool with relative URLs at all?
// re-enabled 11-Feb 2022 GDG - we do want to do this. At least, $assemble in davinci-dtr, where the markdown comes from the SDC IG, and an SDC local reference must be changed to point to SDC. in this case, it's called when generating snapshots
// added processRelatives parameter to deal with this (well, to try)
if (processRelatives) {
if (processRelatives && webUrl != null) {
System.out.println("Making "+url+" relative to '"+webUrl+"'");
b.append(webUrl);
} else {
System.out.println("Not making "+url+" relative to '"+webUrl+"'");
@ -4785,10 +4786,10 @@ public class ProfileUtilities extends TranslatingUtilities {
private void renderAdditionalBinding(HierarchicalTableGenerator gen, Cell c, Extension ext) {
// <nsbp>2 <sp> purpose <sp> value-set-link ([context]) {documentation}
// String purpose = ext.getExtensionString("purpose");
// String valueSet = ext.getExtensionString("valueSet");
// String doco = ext.getExtensionString("documentation");
// UsageContext usage = (ext.hasExtension("usage")) ? ext.getExtensionByUrl("usage").getValueUsageContext() : null;
String purpose = ext.getExtensionString("purpose");
String valueSet = ext.getExtensionString("valueSet");
String doco = ext.getExtensionString("documentation");
UsageContext usage = (ext.hasExtension("usage")) ? ext.getExtensionByUrl("usage").getValueUsageContext() : null;
//
// purpose: code - defines how the binding is used
// usage : UsageContext - defines the contexts in which this binding is used for it's purpose

View File

@ -600,7 +600,8 @@ public class TerminologyCache {
caches.put(nc.name, nc);
}
} catch (Exception e) {
throw new FHIRException("Error loading "+fn+": "+e.getMessage()+" entry "+c, e);
System.out.println("Error loading "+fn+": "+e.getMessage()+" entry "+c+" - ignoring it");
e.printStackTrace();
}
}

View File

@ -202,13 +202,13 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
r.setIcon("icon_q_root.gif", "QuestionnaireRoot");
r.getCells().add(gen.new Cell(null, null, q.getName(), null, null));
r.getCells().add(gen.new Cell(null, null, "", null, null));
r.getCells().add(gen.new Cell(null, null, q.getDescription(), null, null));
r.getCells().add(gen.new Cell(null, null, "", null, null));
r.getCells().add(gen.new Cell(null, null, "Questionnaire", null, null));
if (hasFlags) {
r.getCells().add(gen.new Cell(null, null, "", null, null));
}
r.getCells().add(gen.new Cell(null, null, q.getDescription(), null, null));
r.getCells().add(gen.new Cell(null, null, q.hasUrl() ? q.hasVersion() ? q.getUrl()+"#"+q.getVersion() : q.getUrl() : "", null, null));
return r;
}

View File

@ -795,8 +795,9 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
if (p.getHint() != null)
tag.setAttribute("title", p.getHint());
addStyle(tag, p);
if (p.hasChildren())
if (p.hasChildren()) {
tag.getChildNodes().addAll(p.getChildren());
}
} else if (!Utilities.noString(p.getReference())) {
XhtmlNode a = addStyle(tc.addTag("a"), p);
a.setAttribute("href", p.getReference());
@ -818,6 +819,9 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
s.addText(p.getText());
} else
tc.addText(p.getText());
if (p.hasChildren()) {
tc.getChildNodes().addAll(p.getChildren());
}
}
}
if (makeTargets && !Utilities.noString(anchor))

View File

@ -77,7 +77,7 @@ public class StructureDefinitionValidator extends BaseValidator {
List<ValidationMessage> msgs = new ArrayList<>();
ProfileUtilities pu = new ProfileUtilities(context, msgs, null);
pu.setXver(xverManager);
pu.generateSnapshot(base, sd, sd.getUrl(), "http://hl7.org/fhir", sd.getName());
pu.generateSnapshot(base, sd, sd.getUrl(), "http://hl7.org/fhir/R4/", sd.getName());
if (msgs.size() > 0) {
for (ValidationMessage msg : msgs) {
// we need to set the location for the context