From 3fbb505722c6b003f310a9ac9105a16c54b2cbd2 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 10 Sep 2022 15:02:48 +1000 Subject: [PATCH] Fix concept link rendering problem --- .../fhir/r5/renderers/TerminologyRenderer.java | 6 +++++- .../hl7/fhir/r5/renderers/ValueSetRenderer.java | 17 +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java index bc288eba6..c8b2302ef 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java @@ -115,7 +115,11 @@ public abstract class TerminologyRenderer extends ResourceRenderer { for (UsedConceptMap m : maps) { XhtmlNode td = tr.td(); XhtmlNode b = td.b(); - XhtmlNode a = b.ah(getContext().getSpecificationLink()+m.getLink()); + String link = m.getLink(); + if (!Utilities.isAbsoluteUrl(link)) { + link = getContext().getSpecificationLink()+link; + } + XhtmlNode a = b.ah(link); a.addText(m.getDetails().getName()); if (m.getDetails().isDoDescription() && m.getMap().hasDescription()) addMarkdown(td, m.getMap().getDescription()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java index 485d8eb5e..5cd90ccdc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java @@ -844,14 +844,15 @@ public class ValueSetRenderer extends TerminologyRenderer { } private void addRefToCode(XhtmlNode td, String target, String vslink, String code) { - CodeSystem cs = getContext().getWorker().fetchCodeSystem(target); - String cslink = getCsRef(cs); - XhtmlNode a = null; - if (cslink != null) - a = td.ah(getContext().getSpecificationLink()+cslink+"#"+cs.getId()+"-"+code); - else - a = td.ah(getContext().getSpecificationLink()+vslink+"#"+code); - a.addText(code); + addCodeToTable(false, target, code, null, td); +// CodeSystem cs = getContext().getWorker().fetchCodeSystem(target); +// String cslink = getCsRef(cs); +// String link = cslink != null ? cslink+"#"+cs.getId()+"-"+code : vslink+"#"+code; +// if (!Utilities.isAbsoluteUrl(link)) { +// link = getContext().getSpecificationLink()+link; +// } +// XhtmlNode a = td.ah(link); +// a.addText(code); } private boolean generateComposition(XhtmlNode x, ValueSet vs, boolean header, List maps) throws FHIRException, IOException {