Fix up conceptMap rendering (remove spurious summary table)

This commit is contained in:
Grahame Grieve 2024-08-11 22:30:34 +08:00
parent bf105ae179
commit 3f34fc1d91
3 changed files with 25 additions and 37 deletions

View File

@ -325,10 +325,15 @@ public class ConceptMapRenderer extends TerminologyRenderer {
public void render(RenderingStatus status, ResourceWrapper res, XhtmlNode x, ConceptMap cm, boolean header) throws FHIRFormatError, DefinitionException, IOException {
if (header) {
x.h2().addText(cm.getName()+" ("+cm.getUrl()+")");
}
if (context.isShowSummaryTable()) {
XhtmlNode h = x.h2();
h.addText(cm.hasTitle() ? cm.getTitle() : cm.getName());
addMarkdown(x, cm.getDescription());
if (cm.hasCopyright())
generateCopyright(x, res);
}
XhtmlNode p = x.para();
p.tx(context.formatPhrase(RenderingContext.CONC_MAP_FROM) + " ");
if (cm.hasSourceScope())
@ -341,38 +346,6 @@ public class ConceptMapRenderer extends TerminologyRenderer {
else
p.tx(context.formatPhrase(RenderingContext.CONC_MAP_NOT_SPEC));
p = x.para();
if (cm.getExperimental())
p.addText(Utilities.capitalize(cm.getStatus().toString())+" "+ (context.formatPhrase(RenderingContext.CONC_MAP_NO_PROD_USE) + " "));
else
p.addText(Utilities.capitalize(cm.getStatus().toString())+". ");
p.tx(context.formatPhrase(RenderingContext.CONC_MAP_PUB_ON, (cm.hasDate() ? displayDataType(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()) + " ");
if (!cm.getContact().isEmpty()) {
p.tx(" (");
boolean firsti = true;
for (ContactDetail ci : cm.getContact()) {
if (firsti)
firsti = false;
else
p.tx(", ");
if (ci.hasName())
p.addText(ci.getName()+": ");
boolean first = true;
for (ContactPoint c : ci.getTelecom()) {
if (first)
first = false;
else
p.tx(", ");
addTelecom(p, wrapWC(res, c));
}
}
p.tx(")");
}
p.tx(". ");
p.addText(cm.getCopyright());
if (!Utilities.noString(cm.getDescription()))
addMarkdown(x, cm.getDescription());
x.br();
int gc = 0;

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.XVerExtensionManager;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.DebugUtilities;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece;
@ -339,10 +339,17 @@ public abstract class ResourceRenderer extends DataRenderer {
actual = type;
}
if (actual != null && actual.hasPrimitiveValue()) {
if (actual.primitiveValue().equals("Patient/1")) {
DebugUtilities.breakpoint();
}
ResourceWithReference rr = resolveReference(actual);
if (rr == null) {
String disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : actual.primitiveValue();
x.ah(context.prefixLocalHref(actual.primitiveValue())).tx(disp);
if (Utilities.isAbsoluteUrl(actual.primitiveValue())) {
x.ah(context.prefixLocalHref(actual.primitiveValue())).tx(disp);
} else {
x.code().tx(disp);
}
} else if (rr.getResource() == null) {
String disp = display != null && display.hasPrimitiveValue() ? displayDataType(display) : "??";
x.ah(context.prefixLocalHref(rr.getWebPath())).tx(disp);

View File

@ -81,6 +81,14 @@ public class ValueSetRenderer extends TerminologyRenderer {
genSummaryTable(status, x, vs);
List<UsedConceptMap> maps = findReleventMaps(vs);
if (context.isShowSummaryTable()) {
XhtmlNode h = x.h2();
h.addText(vs.hasTitle() ? vs.getTitle() : vs.getName());
addMarkdown(x, vs.getDescription());
if (vs.hasCopyright())
generateCopyright(x, r);
}
if (vs.hasExpansion()) {
// for now, we just accept an expansion if there is one
generateExpansion(status, r, x, vs, false, maps);