From e43fb836931e0ca6b0acc9e555b4d988701edd99 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 23 Mar 2024 18:29:14 +1100 Subject: [PATCH] more refactoring rendering for i18n --- .../r5/renderers/ActorDefinitionRenderer.java | 10 +- .../renderers/AdditionalBindingsRenderer.java | 42 +- .../hl7/fhir/r5/renderers/BinaryRenderer.java | 4 +- .../hl7/fhir/r5/renderers/BundleRenderer.java | 8 +- .../CapabilityStatementRenderer.java | 80 +-- .../fhir/r5/renderers/CodeSystemRenderer.java | 26 +- .../fhir/r5/renderers/ConceptMapRenderer.java | 46 +- .../hl7/fhir/r5/renderers/DataRenderer.java | 238 +++++---- .../renderers/DiagnosticReportRenderer.java | 44 +- .../r5/renderers/ExampleScenarioRenderer.java | 62 +-- .../ImplementationGuideRenderer.java | 2 +- .../fhir/r5/renderers/LibraryRenderer.java | 42 +- .../hl7/fhir/r5/renderers/ListRenderer.java | 48 +- .../r5/renderers/NamingSystemRenderer.java | 34 +- .../r5/renderers/ObligationsRenderer.java | 12 +- .../OperationDefinitionRenderer.java | 28 +- .../renderers/OperationOutcomeRenderer.java | 18 +- .../fhir/r5/renderers/ParametersRenderer.java | 6 +- .../fhir/r5/renderers/PatientRenderer.java | 76 +-- .../r5/renderers/ProfileDrivenRenderer.java | 8 +- .../fhir/r5/renderers/ProvenanceRenderer.java | 30 +- .../r5/renderers/QuestionnaireRenderer.java | 206 ++++---- .../QuestionnaireResponseRenderer.java | 66 +-- .../org/hl7/fhir/r5/renderers/Renderer.java | 54 +- .../r5/renderers/RequirementsRenderer.java | 20 +- .../fhir/r5/renderers/ResourceRenderer.java | 48 +- .../r5/renderers/SearchParameterRenderer.java | 44 +- .../StructureDefinitionRenderer.java | 496 +++++++++--------- .../r5/renderers/StructureMapRenderer.java | 2 +- .../renderers/SubscriptionTopicRenderer.java | 44 +- .../r5/renderers/TerminologyRenderer.java | 6 +- .../fhir/r5/renderers/TestPlanRenderer.java | 54 +- .../fhir/r5/renderers/ValueSetRenderer.java | 164 +++--- .../xhtml/HierarchicalTableGenerator.java | 32 +- 34 files changed, 1048 insertions(+), 1052 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java index 8eb8629c1..f53ae08b9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java @@ -33,13 +33,13 @@ public class ActorDefinitionRenderer extends ResourceRenderer { public boolean render(XhtmlNode x, ActorDefinition acd) throws FHIRFormatError, DefinitionException, IOException { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Actor: "+acd.getName()); + tr.td().b().tx(/*!#*/"Actor: "+acd.getName()); tr.td().tx(acd.getTitle()); - tr.td().tx("Type: " + acd.getType().toCode()); + tr.td().tx(/*!#*/"Type: " + acd.getType().toCode()); XhtmlNode td = tbl.tr().td().colspan("3"); addMarkdown(td, acd.getDocumentation()); if (acd.hasReference()) { - tbl.tr().td().tx("References:"); + tbl.tr().td().tx(/*!#*/"References:"); td = tr.td().colspan("2"); boolean first = true; for (UrlType t : acd.getReference()) { @@ -48,7 +48,7 @@ public class ActorDefinitionRenderer extends ResourceRenderer { } } if (acd.hasCapabilities()) { - tbl.tr().td().tx("Capabilities:"); + tbl.tr().td().tx(/*!#*/"Capabilities:"); td = tr.td().colspan("2"); CapabilityStatement cs = context.getWorker().fetchResource(CapabilityStatement.class, acd.getCapabilities(), acd); if (cs != null) { @@ -58,7 +58,7 @@ public class ActorDefinitionRenderer extends ResourceRenderer { } } if (acd.hasDerivedFrom()) { - tbl.tr().td().tx("Derived from:"); + tbl.tr().td().tx(/*!#*/"Derived from:"); td = tr.td().colspan("2"); boolean first = true; for (UrlType t : acd.getReference()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java index ee08c40aa..5c97b45cc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java @@ -231,16 +231,16 @@ public class AdditionalBindingsRenderer { XhtmlNode tr = new XhtmlNode(NodeType.Element, "tr"); children.add(tr); - tr.td().style("font-size: 11px").b().tx("Additional Bindings"); - tr.td().style("font-size: 11px").tx("Purpose"); + tr.td().style("font-size: 11px").b().tx(/*!#*/"Additional Bindings"); + tr.td().style("font-size: 11px").tx(/*!#*/"Purpose"); if (usage) { - tr.td().style("font-size: 11px").tx("Usage"); + tr.td().style("font-size: 11px").tx(/*!#*/"Usage"); } if (any) { - tr.td().style("font-size: 11px").tx("Any"); + tr.td().style("font-size: 11px").tx(/*!#*/"Any"); } if (doco) { - tr.td().style("font-size: 11px").tx("Documentation"); + tr.td().style("font-size: 11px").tx(/*!#*/"Documentation"); } for (AdditionalBindingDetail binding : bindings) { tr = new XhtmlNode(NodeType.Element, "tr"); @@ -296,8 +296,8 @@ public class AdditionalBindingsRenderer { } } if (any) { - String newRepeat = binding.any ? "Any repeats" : "All repeats"; - String oldRepeat = binding.compare!=null && binding.compare.any ? "Any repeats" : "All repeats"; + String newRepeat = binding.any ? /*!#*/"Any repeats" : /*!#*/"All repeats"; + String oldRepeat = binding.compare!=null && binding.compare.any ? /*!#*/"Any repeats" : /*!#*/"All repeats"; compareString(tr.td().style("font-size: 11px"), newRepeat, oldRepeat); } if (doco) { @@ -338,54 +338,54 @@ public class AdditionalBindingsRenderer { boolean r5 = context == null || context.getWorker() == null ? false : VersionUtilities.isR5Plus(context.getWorker().getVersion()); switch (purpose) { case "maximum": - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", "A required binding, for use when the binding strength is 'extensible' or 'preferred'").tx("Max Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", /*!#*/"A required binding, for use when the binding strength is 'extensible' or 'preferred'").tx(/*!#*/"Max Binding"); break; case "minimum": - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", "The minimum allowable value set - any conformant system SHALL support all these codes").tx("Min Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", /*!#*/"The minimum allowable value set - any conformant system SHALL support all these codes").tx(/*!#*/"Min Binding"); break; case "required" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", "Validators will check this binding (strength = required)").tx("Required Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", /*!#*/"Validators will check this binding (strength = required)").tx(/*!#*/"Required Binding"); break; case "extensible" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", "Validators will check this binding (strength = extensible)").tx("Extensible Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", /*!#*/"Validators will check this binding (strength = extensible)").tx(/*!#*/"Extensible Binding"); break; case "current" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", "New records are required to use this value set, but legacy records may use other codes").tx("Current Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", /*!#*/"New records are required to use this value set, but legacy records may use other codes").tx(/*!#*/"Current Binding"); } else { - td.span(null, "New records are required to use this value set, but legacy records may use other codes").tx("Required"); + td.span(null, /*!#*/"New records are required to use this value set, but legacy records may use other codes").tx(/*!#*/"Required"); } break; case "preferred" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", "This is the value set that is recommended (documentation should explain why)").tx("Preferred Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", /*!#*/"This is the value set that is recommended (documentation should explain why)").tx(/*!#*/"Preferred Binding"); } else { - td.span(null, "This is the value set that is recommended (documentation should explain why)").tx("Recommended"); + td.span(null, /*!#*/"This is the value set that is recommended (documentation should explain why)").tx(/*!#*/"Recommended"); } break; case "ui" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", "This value set is provided to user look up in a given context").tx("UI Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", /*!#*/"This value set is provided to user look up in a given context").tx(/*!#*/"UI Binding"); } else { - td.span(null, "This value set is provided to user look up in a given context").tx("UI"); + td.span(null, /*!#*/"This value set is provided to user look up in a given context").tx(/*!#*/"UI"); } break; case "starter" : if (r5) { td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-starter" : corePath+"terminologies.html#strength", "This value set is a good set of codes to start with when designing your system").tx("Starter Set"); } else { - td.span(null, "This value set is a good set of codes to start with when designing your system").tx("Starter"); + td.span(null, /*!#*/"This value set is a good set of codes to start with when designing your system").tx(/*!#*/"Starter"); } break; case "component" : if (r5) { td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-component" : corePath+"terminologies.html#strength", "This value set is a component of the base value set").tx("Component"); } else { - td.span(null, "This value set is a component of the base value set").tx("Component"); + td.span(null, /*!#*/"This value set is a component of the base value set").tx(/*!#*/"Component"); } break; default: - td.span(null, "Unknown code for purpose").tx(purpose); + td.span(null, /*!#*/"Unknown code for purpose").tx(purpose); } } @@ -430,7 +430,7 @@ public class AdditionalBindingsRenderer { children.tx(" ("); boolean ffirst = !b.getAny(); if (b.getAny()) { - children.tx("any repeat"); + children.tx(/*!#*/"any repeat"); } for (UsageContext uc : b.getUsage()) { if (ffirst) ffirst = false; else children.tx(","); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java index acff38958..6d538d207 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java @@ -45,7 +45,7 @@ public class BinaryRenderer { public void render(XhtmlNode x, Binary bin) throws IOException { filenames.clear(); if (!bin.hasContentType()) { - error(x, "No Content Type"); + error(x, /*!#*/"No Content Type"); } else if (bin.getContentType().startsWith("image/")) { image(x, bin); } else if (isXml(bin.getContentType())) { @@ -75,7 +75,7 @@ public class BinaryRenderer { } if (ext == null) { - error(x, "The Image Type '"+bin.getContentType()+"' is not rendered in this context"); + error(x, /*!#*/"The Image Type '"+bin.getContentType()+"' is not rendered in this context"); } else { String fn = "Binary-Native-"+bin.getId()+ext; TextFile.bytesToFile(bin.getContent(), Utilities.path(folder, fn)); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java index ae0542762..f31bbff8a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java @@ -62,7 +62,7 @@ public class BundleRenderer extends ResourceRenderer { List entries = b.children("entry"); if ("document".equals(b.get("type").primitiveValue())) { if (entries.isEmpty() || (entries.get(0).has("resource") && !"Composition".equals(entries.get(0).get("resource").fhirType()))) - throw new FHIRException("Invalid document '"+b.getId()+"' - first entry is not a Composition ('"+entries.get(0).get("resource").fhirType()+"')"); + throw new FHIRException(/*!#*/"Invalid document '"+b.getId()+"' - first entry is not a Composition ('"+entries.get(0).get("resource").fhirType()+"')"); return renderDocument(x, b, entries); } else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) { // nothing @@ -106,7 +106,7 @@ public class BundleRenderer extends ResourceRenderer { xn = rr.render(rw); } catch (Exception e) { xn = new XhtmlNode(); - xn.para().b().tx("Exception generating narrative: "+e.getMessage()); + xn.para().b().tx(/*!#*/"Exception generating narrative: "+e.getMessage()); } } root.blockquote().para().addChildren(xn); @@ -280,7 +280,7 @@ public class BundleRenderer extends ResourceRenderer { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); if (b.getType() == BundleType.DOCUMENT) { if (!b.hasEntry() || !(b.getEntryFirstRep().hasResource() && b.getEntryFirstRep().getResource() instanceof Composition)) { - throw new FHIRException("Invalid document - first entry is not a Composition"); + throw new FHIRException(/*!#*/"Invalid document - first entry is not a Composition"); } renderDocument(x, b); start = 1; @@ -342,7 +342,7 @@ public class BundleRenderer extends ResourceRenderer { rr.setRcontext(new ResourceContext(rcontext, be.getResource())); xn = rr.build(be.getResource()); } catch (Exception e) { - xn = makeExceptionXhtml(e, "generating narrative"); + xn = makeExceptionXhtml(e, /*!#*/"generating narrative"); } } x.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java index 7099922e4..592258de2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java @@ -700,26 +700,26 @@ public class CapabilityStatementRenderer extends ResourceRenderer { private void addSummaryTable(XhtmlNode x, CapabilityStatement.CapabilityStatementRestComponent rest, boolean hasVRead, boolean hasPatch, boolean hasDelete, boolean hasHistory, boolean hasUpdates, int count) throws IOException { XhtmlNode t = x.div().attribute("class","table-responsive").table("table table-condensed table-hover"); XhtmlNode tr = t.addTag("thead").tr(); - tr.th().b().tx("Resource Type"); - tr.th().b().tx("Profile"); - tr.th().attribute("class", "text-center").b().attribute("title", "GET a resource (read interaction)").tx("R"); + tr.th().b().tx(/*!#*/"Resource Type"); + tr.th().b().tx(/*!#*/"Profile"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET a resource (read interaction)").tx("R"); if (hasVRead) - tr.th().attribute("class", "text-center").b().attribute("title", "GET past versions of resources (vread interaction)").tx("V-R"); - tr.th().attribute("class", "text-center").b().attribute("title", "GET all set of resources of the type (search interaction)").tx("S"); - tr.th().attribute("class", "text-center").b().attribute("title", "PUT a new resource version (update interaction)").tx("U"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET past versions of resources (vread interaction)").tx("V-R"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET all set of resources of the type (search interaction)").tx("S"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"PUT a new resource version (update interaction)").tx("U"); if (hasPatch) - tr.th().attribute("class", "text-center").b().attribute("title", "PATCH a new resource version (patch interaction)").tx("P"); - tr.th().attribute("class", "text-center").b().attribute("title", "POST a new resource (create interaction)").tx("C"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"PATCH a new resource version (patch interaction)").tx("P"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"POST a new resource (create interaction)").tx("C"); if (hasDelete) - tr.th().attribute("class", "text-center").b().attribute("title", "DELETE a resource (delete interaction)").tx("D"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"DELETE a resource (delete interaction)").tx("D"); if (hasUpdates) - tr.th().attribute("class", "text-center").b().attribute("title", "GET changes to a resource (history interaction on instance)").tx("H-I"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET changes to a resource (history interaction on instance)").tx("H-I"); if (hasHistory) - tr.th().attribute("class", "text-center").b().attribute("title", "GET changes for all resources of the type (history interaction on type)").tx("H-T"); - tr.th().b().attribute("title", "Required and recommended search parameters").tx("Searches"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET changes for all resources of the type (history interaction on type)").tx("H-T"); + tr.th().b().attribute("title", /*!#*/"Required and recommended search parameters").tx(/*!#*/"Searches"); tr.th().code().b().tx("_include"); tr.th().code().b().tx("_revinclude"); - tr.th().b().tx("Operations"); + tr.th().b().tx(/*!#*/"Operations"); XhtmlNode tbody = t.addTag("tbody"); XhtmlNode profCell = null; @@ -744,12 +744,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { //profCell.ah(r.getProfile()).addText(r.getProfile()); if (hasSupProf) { profCell.br(); - profCell.addTag("em").addText("Additional supported profiles:"); + profCell.addTag("em").addText(/*!#*/"Additional supported profiles:"); renderSupportedProfiles(profCell, r); } } else { //Case of only supported profiles - profCell.addText("Supported profiles:"); + profCell.addText(/*!#*/"Supported profiles:"); renderSupportedProfiles(profCell, r); } //Show capabilities @@ -809,17 +809,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } if (r.hasExtension(ToolingExtensions.EXT_PROFILE_MAPPING)) { profCell.br(); - profCell.b().tx("Profile Mapping"); + profCell.b().tx(/*!#*/"Profile Mapping"); XhtmlNode tbl = profCell.table("grid"); boolean doco = false; for (Extension ext : r.getExtensionsByUrl(ToolingExtensions.EXT_PROFILE_MAPPING)) { doco = doco || ext.hasExtension("documentation"); } XhtmlNode tr = tbl.tr(); - tr.th().tx("Criteria"); - tr.th().tx("Profile"); + tr.th().tx(/*!#*/"Criteria"); + tr.th().tx(/*!#*/"Profile"); if (doco) { - tr.th().tx("Criteria"); + tr.th().tx(/*!#*/"Criteria"); } for (Extension ext : r.getExtensionsByUrl(ToolingExtensions.EXT_PROFILE_MAPPING)) { tr = tbl.tr(); @@ -936,7 +936,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } else { panelHead = panel.div().attribute("class", "panel-heading").h(nextLevel,r.getType() + countString).attribute("class", "panel-title"); - panelHead.span("float: right;","").addText("Resource Conformance: " + getResourceExpectation(r)); + panelHead.span("float: right;","").addText(/*!#*/"Resource Conformance: " + getResourceExpectation(r)); panelHead.addText(r.getType()); body = panel.div().attribute("class", "panel-body").div().attribute("class", "container"); } @@ -950,17 +950,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { String refPolicyWidth = "col-lg-3"; if (!Utilities.noString(text)) { cell = row.div().attribute("class", "col-lg-6"); - addLead(cell,"Base System Profile"); + addLead(cell,/*!#*/"Base System Profile"); cell.br(); addResourceLink(cell, text, text); cell=row.div().attribute("class", "col-lg-3"); - addLead(cell, "Profile Conformance"); + addLead(cell, /*!#*/"Profile Conformance"); cell.br(); cell.b().addText(getProfileExpectation(r.getProfileElement())); } else { //No profile, use FHIR Core Resource cell = row.div().attribute("class", "col-lg-4"); - addLead(cell,"Core FHIR Resource"); + addLead(cell,/*!#*/"Core FHIR Resource"); cell.br(); cell.ah(currentFhirBase + r.getType().toLowerCase() + ".html").addText(r.getType()); pullInteraction = true; @@ -968,7 +968,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } cell = row.div().attribute("class", refPolicyWidth); - addLead(cell,"Reference Policy"); + addLead(cell,/*!#*/"Reference Policy"); cell.br(); addSeparatedListOfCodes(cell, getReferencePolicyStrings(r.getReferencePolicy()) , ","); if (pullInteraction) { @@ -979,7 +979,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { if (supportedProfiles.size() > 0) { row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-6"); - addLead(cell,"Supported Profiles"); + addLead(cell,/*!#*/"Supported Profiles"); XhtmlNode para = cell.para(); boolean first = true; for (CanonicalType c : supportedProfiles) { @@ -1004,7 +1004,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { if (!Utilities.noString(mdText)) { row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-12"); - addLead(cell,"Documentation"); + addLead(cell,/*!#*/"Documentation"); addMarkdown(cell.blockquote(), mdText); } @@ -1028,12 +1028,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-12"); - addLead(cell,"Extended Operations"); + addLead(cell,/*!#*/"Extended Operations"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Operation"); - tr.th().addText("Documentation"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Operation"); + tr.th().addText(/*!#*/"Documentation"); tbody = table.addTag("tbody"); addOps(tbody, map, "supported"); addOps(tbody, map, "SHALL"); @@ -1089,7 +1089,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } } XhtmlNode cell = row.div().attribute("class", widthString); - addLead(cell, "Interaction summary"); + addLead(cell, /*!#*/"Interaction summary"); cell.br(); XhtmlNode ul = cell.ul(); addInteractionSummaryList(ul, "SHALL", shalls); @@ -1154,13 +1154,13 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-lg-7"); - addLead(cell,"Search Parameters"); + addLead(cell,/*!#*/"Search Parameters"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Parameter"); - tr.th().addText("Type"); - tr.th().addText("Documentation"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Parameter"); + tr.th().addText(/*!#*/"Type"); + tr.th().addText(/*!#*/"Documentation"); tbody = table.addTag("tbody"); Map> map = sParams.getIndbyExp(); addIndRows(tbody, map, "supported"); @@ -1170,12 +1170,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { addIndRows(tbody, map, "SHOULD-NOT"); cell = row.div().attribute("class", "col-lg-5"); if (!isCombinedEmpty(comboMap)) { - addLead(cell,"Combined Search Parameters"); + addLead(cell,/*!#*/"Combined Search Parameters"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Parameters"); - tr.th().addText("Types"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Parameters"); + tr.th().addText(/*!#*/"Types"); tbody = table.addTag("tbody"); addComboRows(tbody, comboMap, "supported"); addComboRows(tbody, comboMap, "SHALL"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java index c27c37a85..aa81505f3 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java @@ -158,17 +158,17 @@ public class CodeSystemRenderer extends TerminologyRenderer { boolean designations = CodeSystemUtilities.hasDesignations(cs); String features; if (properties && designations) { - features = "displays and properties"; + features = /*!#*/"displays and properties"; } else if (properties) { - features = "properties"; + features = /*!#*/"properties"; } else if (designations) { - features = "displays"; + features = /*!#*/"displays"; } else { - features = "features"; // ? + features = /*!#*/"features"; // ? } return formatMessage(I18nConstants.RND_CS_CONTENT_SUPPLEMENT, features); default: - throw new FHIRException("Unknown CodeSystemContentMode mode"); + throw new FHIRException(/*!#*/"Unknown CodeSystemContentMode mode"); } } @@ -234,10 +234,10 @@ public class CodeSystemRenderer extends TerminologyRenderer { } if (langs.size() >= 2) { Collections.sort(langs); - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String lang : langs) tr.td().b().addText(describeLang(lang)); for (ConceptDefinitionComponent c : cs.getConcept()) { @@ -250,11 +250,11 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void makeHierarchyParam(XhtmlNode x, CodeSystem cs, Enumeration hm) { if (hm.hasValue()) { String s = hm.getValue().getDisplay(); - renderStatus(hm, x).tx(" in a "+s+" heirarchy"); + renderStatus(hm, x).tx(" "+/*!#*/"in a "+s+" heirarchy"); } else if (VersionComparisonAnnotation.hasDeleted(cs, "hierarchyMeaning")) { makeHierarchyParam(x, null, (Enumeration) VersionComparisonAnnotation.getDeleted(cs, "hierarchyMeaning").get(0)); } else if (CodeSystemUtilities.hasHierarchy(cs)) { - x.tx(" in an undefined heirarchy"); + x.tx(" "+/*!#*/"in an undefined heirarchy"); } else { x.tx(""); } @@ -285,7 +285,7 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void addCopyColumn(XhtmlNode tr) { if (context.isCopyButton()) { - tr.td().b().tx("Copy"); + tr.td().b().tx(/*!#*/"Copy"); } } @@ -467,7 +467,7 @@ public class CodeSystemRenderer extends TerminologyRenderer { hasExtensions = true; if (ToolingExtensions.hasExtension(c, ToolingExtensions.EXT_REPLACED_BY)) { Coding cc = (Coding) ToolingExtensions.getExtension(c, ToolingExtensions.EXT_REPLACED_BY).getValue(); - td.tx(" (replaced by "); + td.tx(" "+/*!#*/"(replaced by "); String url = getCodingReference(cc, system); if (url != null) { td.ah(url).addText(cc.getCode()); @@ -606,9 +606,9 @@ public class CodeSystemRenderer extends TerminologyRenderer { } if (context.isCopyButton()) { td = tr.td(); - clipboard(td, "icon_clipboard_x.png", "XML", "\n"+(cs.getVersionNeeded() ? "\n" : "")+"\n\n"); + clipboard(td, "icon_clipboard_x.png", /*!#*/"XML", "\n"+(cs.getVersionNeeded() ? "\n" : "")+"\n\n"); td.nbsp(); - clipboard(td, "icon_clipboard_j.png", "JSON", "\"system\" : \""+Utilities.escapeXml(cs.getUrl())+"\",\n"+(cs.getVersionNeeded() ? "\"version\" : \""+Utilities.escapeXml(cs.getVersion())+"\",\n" : "")+"\"code\" : \""+Utilities.escapeXml(c.getCode())+"\",\n\"display\" : \""+Utilities.escapeXml(c.getDisplay())+"\"\n"); + clipboard(td, "icon_clipboard_j.png", /*!#*/"JSON", "\"system\" : \""+Utilities.escapeXml(cs.getUrl())+"\",\n"+(cs.getVersionNeeded() ? "\"version\" : \""+Utilities.escapeXml(cs.getVersion())+"\",\n" : "")+"\"code\" : \""+Utilities.escapeXml(c.getCode())+"\",\n\"display\" : \""+Utilities.escapeXml(c.getDisplay())+"\"\n"); } return hasExtensions; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java index 4241c9699..6f3e88317 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java @@ -294,23 +294,23 @@ public class ConceptMapRenderer extends TerminologyRenderer { } XhtmlNode p = x.para(); - p.tx("Mapping from "); + p.tx(/*!#*/"Mapping from "); if (cm.hasSourceScope()) AddVsRef(cm.getSourceScope().primitiveValue(), p, cm); else - p.tx("(not specified)"); - p.tx(" to "); + p.tx(/*!#*/"(not specified)"); + p.tx(" "+/*!#*/"to "); if (cm.hasTargetScope()) AddVsRef(cm.getTargetScope().primitiveValue(), p, cm); else - p.tx("(not specified)"); + p.tx(/*!#*/"(not specified)"); p = x.para(); if (cm.getExperimental()) - p.addText(Utilities.capitalize(cm.getStatus().toString())+" (not intended for production usage). "); + p.addText(Utilities.capitalize(cm.getStatus().toString())+" "+/*!#*/"(not intended for production usage). "); else p.addText(Utilities.capitalize(cm.getStatus().toString())+". "); - p.tx("Published on "+(cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()); + p.tx(/*!#*/"Published on "+(cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()); if (!cm.getContact().isEmpty()) { p.tx(" ("); boolean firsti = true; @@ -380,18 +380,18 @@ public class ConceptMapRenderer extends TerminologyRenderer { x.hr(); } XhtmlNode pp = x.para(); - pp.b().tx("Group "+gc); - pp.tx("Mapping from "); + pp.b().tx(/*!#*/"Group "+gc); + pp.tx(/*!#*/"Mapping from "); if (grp.hasSource()) { renderCanonical(cm, pp, grp.getSource()); } else { - pp.code("unspecified code system"); + pp.code(/*!#*/"unspecified code system"); } pp.tx(" to "); if (grp.hasTarget()) { renderCanonical(cm, pp, grp.getTarget()); } else { - pp.code("unspecified code system"); + pp.code(/*!#*/"unspecified code system"); } String display; @@ -399,11 +399,11 @@ public class ConceptMapRenderer extends TerminologyRenderer { // simple XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Source Code"); - tr.td().b().tx("Relationship"); - tr.td().b().tx("Target Code"); + tr.td().b().tx(/*!#*/"Source Code"); + tr.td().b().tx(/*!#*/"Relationship"); + tr.td().b().tx(/*!#*/"Target Code"); if (comment) - tr.td().b().tx("Comment"); + tr.td().b().tx(/*!#*/"Comment"); for (SourceElementComponent ccl : grp.getElement()) { tr = tbl.tr(); XhtmlNode td = tr.td(); @@ -450,21 +450,21 @@ public class ConceptMapRenderer extends TerminologyRenderer { XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); XhtmlNode td; - tr.td().colspan(Integer.toString(1+sources.size())).b().tx("Source Concept Details"); + tr.td().colspan(Integer.toString(1+sources.size())).b().tx(/*!#*/"Source Concept Details"); if (hasRelationships) { - tr.td().b().tx("Relationship"); + tr.td().b().tx(/*!#*/"Relationship"); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx("Target Concept Details"); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(/*!#*/"Target Concept Details"); if (comment) { - tr.td().b().tx("Comment"); + tr.td().b().tx(/*!#*/"Comment"); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx("Properties"); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(/*!#*/"Properties"); tr = tbl.tr(); if (sources.get("code").size() == 1) { String url = sources.get("code").iterator().next(); renderCSDetailsLink(tr, url, true); } else - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String s : sources.keySet()) { if (s != null && !s.equals("code")) { if (sources.get(s).size() == 1) { @@ -481,7 +481,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { String url = targets.get("code").iterator().next(); renderCSDetailsLink(tr, url, true); } else - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String s : targets.keySet()) { if (s != null && !s.equals("code")) { if (targets.get(s).size() == 1) { @@ -678,8 +678,8 @@ public class ConceptMapRenderer extends TerminologyRenderer { if (span2) { td.colspan("2"); } - td.b().tx("Codes"); - td.tx(" from "); + td.b().tx(/*!#*/"Codes"); + td.tx(" "+/*!#*/"from "); if (cs == null) td.tx(url); else diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 62cf5df07..5ea50fa1a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -181,7 +181,7 @@ public class DataRenderer extends Renderer implements CodeResolver { url = p.getUserString("filename"); } } else { - throw new DefinitionException("Unable to resolve markdown link "+link); + throw new DefinitionException(/*!#*/"Unable to resolve markdown link "+link); } text = left+"["+link+"]("+url+(path == null ? "" : "#"+path)+")"+right; @@ -216,18 +216,18 @@ public class DataRenderer extends Renderer implements CodeResolver { private static String month(String m) { switch (m) { - case "1" : return "Jan"; - case "2" : return "Feb"; - case "3" : return "Mar"; - case "4" : return "Apr"; - case "5" : return "May"; - case "6" : return "Jun"; - case "7" : return "Jul"; - case "8" : return "Aug"; - case "9" : return "Sep"; - case "10" : return "Oct"; - case "11" : return "Nov"; - case "12" : return "Dec"; + case "1" : return /*!#*/"Jan"; + case "2" : return /*!#*/"Feb"; + case "3" : return /*!#*/"Mar"; + case "4" : return/*!#*/ "Apr"; + case "5" : return /*!#*/"May"; + case "6" : return /*!#*/"Jun"; + case "7" : return /*!#*/"Jul"; + case "8" : return /*!#*/"Aug"; + case "9" : return /*!#*/"Sep"; + case "10" : return /*!#*/"Oct"; + case "11" : return /*!#*/"Nov"; + case "12" : return /*!#*/"Dec"; default: return null; } } @@ -247,16 +247,16 @@ public class DataRenderer extends Renderer implements CodeResolver { ed = p[p.length-1]; } switch (ed) { - case "900000000000207008": return "Intl"+dt; - case "731000124108": return "US"+dt; - case "32506021000036107": return "AU"+dt; - case "449081005": return "ES"+dt; - case "554471000005108": return "DK"+dt; - case "11000146104": return "NL"+dt; - case "45991000052106": return "SE"+dt; - case "999000041000000102": return "UK"+dt; - case "20611000087101": return "CA"+dt; - case "11000172109": return "BE"+dt; + case "900000000000207008": return /*!#*/"Intl"+dt; + case "731000124108": return /*!#*/"US"+dt; + case "32506021000036107": return /*!#*/"AU"+dt; + case "449081005": return /*!#*/"ES"+dt; + case "554471000005108": return /*!#*/"DK"+dt; + case "11000146104": return /*!#*/"NL"+dt; + case "45991000052106": return /*!#*/"SE"+dt; + case "999000041000000102": return /*!#*/"UK"+dt; + case "20611000087101": return /*!#*/"CA"+dt; + case "11000172109": return /*!#*/"BE"+dt; default: return "??"+dt; } } else { @@ -266,38 +266,38 @@ public class DataRenderer extends Renderer implements CodeResolver { public static String describeSystem(String system) { if (system == null) - return "[not stated]"; + return /*!#*/"[not stated]"; if (system.equals("http://loinc.org")) - return "LOINC"; + return /*!#*/"LOINC"; if (system.startsWith("http://snomed.info")) - return "SNOMED CT"; + return /*!#*/"SNOMED CT"; if (system.equals("http://www.nlm.nih.gov/research/umls/rxnorm")) - return "RxNorm"; + return /*!#*/"RxNorm"; if (system.equals("http://hl7.org/fhir/sid/icd-9")) - return "ICD-9"; + return /*!#*/"ICD-9"; if (system.equals("http://dicom.nema.org/resources/ontology/DCM")) - return "DICOM"; + return /*!#*/"DICOM"; if (system.equals("http://unitsofmeasure.org")) - return "UCUM"; + return /*!#*/"UCUM"; return system; } public String displaySystem(String system) { if (system == null) - return "[not stated]"; + return /*!#*/"[not stated]"; if (system.equals("http://loinc.org")) - return "LOINC"; + return /*!#*/"LOINC"; if (system.startsWith("http://snomed.info")) - return "SNOMED CT"; + return /*!#*/"SNOMED CT"; if (system.equals("http://www.nlm.nih.gov/research/umls/rxnorm")) - return "RxNorm"; + return /*!#*/"RxNorm"; if (system.equals("http://hl7.org/fhir/sid/icd-9")) - return "ICD-9"; + return /*!#*/"ICD-9"; if (system.equals("http://dicom.nema.org/resources/ontology/DCM")) - return "DICOM"; + return /*!#*/"DICOM"; if (system.equals("http://unitsofmeasure.org")) - return "UCUM"; + return /*!#*/"UCUM"; CodeSystem cs = context.getContext().fetchCodeSystem(system); if (cs != null) { @@ -310,7 +310,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (system.contains("/")) { return system.substring(system.lastIndexOf("/")+1); } else { - return "unknown"; + return /*!#*/"unknown"; } } @@ -341,7 +341,7 @@ public class DataRenderer extends Renderer implements CodeResolver { protected String describeLang(String lang) { // special cases: if ("fr-CA".equals(lang)) { - return "French (Canadian)"; // this one was omitted from the value set + return /*!#*/"French (Canadian)"; // this one was omitted from the value set } ValueSet v = getContext().getWorker().findTxResource(ValueSet.class, "http://hl7.org/fhir/ValueSet/languages"); if (v != null) { @@ -408,10 +408,6 @@ public class DataRenderer extends Renderer implements CodeResolver { // -- 4. Language support ------------------------------------------------------ - protected String translate(String source, String content) { - return content; - } - public String gt(@SuppressWarnings("rawtypes") PrimitiveType value) { return value.primitiveValue(); } @@ -476,7 +472,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { // somehow have to do better than this XhtmlNode li = ul.li(); - li.b().tx("WARNING: Unrenderable Modifier Extension!"); + li.b().tx(/*!#*/"WARNING: Unrenderable Modifier Extension!"); } } for (Extension ext : element.getExtension()) { @@ -526,7 +522,7 @@ public class DataRenderer extends Renderer implements CodeResolver { render(div, ext.getValue()); } else { // somehow have to do better than this - div.b().tx("WARNING: Unrenderable Modifier Extension!"); + div.b().tx(/*!#*/"WARNING: Unrenderable Modifier Extension!"); } } for (Extension ext : element.getExtension()) { @@ -557,7 +553,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { return display((DataType) b); } else { - return "No display for "+b.fhirType(); + return /*!#*/"No display for "+b.fhirType(); } } @@ -593,7 +589,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else if (type.isPrimitive()) { return type.primitiveValue(); } else { - return "No display for "+type.fhirType(); + return /*!#*/"No display for "+type.fhirType(); } } @@ -675,7 +671,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } public String display(BaseWrapper type) { - return "to do"; + return /*!#*/"to do"; } public void render(XhtmlNode x, BaseWrapper type) throws FHIRFormatError, DefinitionException, IOException { @@ -683,13 +679,13 @@ public class DataRenderer extends Renderer implements CodeResolver { try { base = type.getBase(); } catch (FHIRException | IOException e) { - x.tx("Error: " + e.getMessage()); // this shouldn't happen - it's an error in the library itself + x.tx(/*!#*/"Error: " + e.getMessage()); // this shouldn't happen - it's an error in the library itself return; } if (base instanceof DataType) { render(x, (DataType) base); } else { - x.tx("to do: "+base.fhirType()); + x.tx(/*!#*/"to do: "+base.fhirType()); } } @@ -697,7 +693,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { render(x, (DataType) b); } else { - x.tx("No display for "+b.fhirType()); + x.tx(/*!#*/"No display for "+b.fhirType()); } } @@ -751,7 +747,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else if (type.isPrimitive()) { x.tx(type.primitiveValue()); } else { - x.tx("No display for "+type.fhirType()); + x.tx(/*!#*/"No display for "+type.fhirType()); } } @@ -843,7 +839,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (a.hasAuthor()) { - b.append("By "); + b.append(/*!#*/"By "); if (a.hasAuthorReference()) { b.append(a.getAuthorReference().getReference()); } else if (a.hasAuthorStringType()) { @@ -1031,7 +1027,7 @@ public class DataRenderer extends Renderer implements CodeResolver { systemName = cs != null ? cs.present() : describeSystem(c.getSystem()); link = getLinkForCode(c.getSystem(), c.getVersion(), c.getCode()); - hint = systemName+": "+display+(c.hasVersion() ? " (version = "+c.getVersion()+")" : ""); + hint = systemName+": "+display+(c.hasVersion() ? " "+/*!#*/"(version = "+c.getVersion()+")" : ""); return new CodeResolution(systemName, systemLink, link, display, hint); } @@ -1066,7 +1062,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.tx(s); } if (c.hasVersion()) { - x.tx(" (version = "+c.getVersion()+")"); + x.tx(" "+/*!#*/"(version = "+c.getVersion()+")"); } } @@ -1081,7 +1077,7 @@ public class DataRenderer extends Renderer implements CodeResolver { s = c.getCode(); if (showCodeDetails) { - x.addText(s+" (Details: "+TerminologyRenderer.describeSystem(c.getSystem())+" code "+c.getCode()+" = '"+lookupCode(c.getSystem(), c.getVersion(), c.getCode())+"', stated as '"+c.getDisplay()+"')"); + x.addText(s+" "+/*!#*/"(Details: "+TerminologyRenderer.describeSystem(c.getSystem())+" code "+c.getCode()+" = '"+lookupCode(c.getSystem(), c.getVersion(), c.getCode())+"', stated as '"+c.getDisplay()+"')"); } else x.span(null, "{"+c.getSystem()+" "+c.getCode()+"}").addText(s); } @@ -1201,7 +1197,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } } - x.span(null, "Codes: "+b.toString()).addText(s); + x.span(null, /*!#*/"Codes: "+b.toString()).addText(s); } } @@ -1265,7 +1261,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { switch (ii.getSystem()) { case "urn:oid:2.51.1.3": - x.ah("https://www.gs1.org/standards/id-keys/gln", "Global Location Number").tx("GLN"); + x.ah("https://www.gs1.org/standards/id-keys/gln", /*!#*/"Global Location Number").tx("GLN"); break; default: x.code(ii.getSystem()); @@ -1279,7 +1275,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); x.tx("("); if (ii.hasUse()) { - x.tx("use:"); + x.tx(/*!#*/"use:"); x.nbsp(); x.tx(ii.getUse().toString()); } @@ -1288,7 +1284,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); } if (ii.hasPeriod()) { - x.tx("period:"); + x.tx(/*!#*/"period:"); x.nbsp(); x.tx(displayPeriod(ii.getPeriod())); } @@ -1411,7 +1407,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } c.code().tx(expr.getExpression()); } else if (expr.hasReference()) { - p.ah(expr.getReference()).tx("source"); + p.ah(expr.getReference()).tx(/*!#*/"source"); } if (expr.hasName() || expr.hasDescription()) { p.tx("("); @@ -1472,9 +1468,9 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void displayContactPoint(XhtmlNode p, ContactPoint c) { if (c != null) { if (c.getSystem() == ContactPointSystem.PHONE) { - p.tx("Phone: "+c.getValue()); + p.tx(/*!#*/"Phone: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx("Fax: "+c.getValue()); + p.tx(/*!#*/"Fax: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.EMAIL) { p.tx(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { @@ -1489,11 +1485,11 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void addTelecom(XhtmlNode p, ContactPoint c) { if (c.getSystem() == ContactPointSystem.PHONE) { - p.tx("Phone: "+c.getValue()); + p.tx(/*!#*/"Phone: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx("Fax: "+c.getValue()); + p.tx(/*!#*/"Fax: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.EMAIL) { - p.ah( "mailto:"+c.getValue()).addText(c.getValue()); + p.ah("mailto:"+c.getValue()).addText(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { if (c.getValue().length() > 30) p.ah(c.getValue()).addText(c.getValue().substring(0, 30)+"..."); @@ -1505,8 +1501,8 @@ public class DataRenderer extends Renderer implements CodeResolver { if (system == null) return ""; switch (system) { - case PHONE: return "ph: "; - case FAX: return "fax: "; + case PHONE: return /*!#*/"ph: "; + case FAX: return /*!#*/"fax: "; default: return ""; } @@ -1544,7 +1540,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.tx("(unit "+q.getCode()+" from "+q.getSystem()+")"); } if (showCodeDetails && q.hasCode()) { - x.span("background: LightGoldenRodYellow", null).tx(" (Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); + x.span("background: LightGoldenRodYellow", null).tx(" "+/*!#*/"(Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); } } @@ -1588,13 +1584,13 @@ public class DataRenderer extends Renderer implements CodeResolver { public String displayPeriod(Period p) { String s = !p.hasStart() ? "(?)" : displayDateTime(p.getStartElement()); s = s + " --> "; - return s + (!p.hasEnd() ? "(ongoing)" : displayDateTime(p.getEndElement())); + return s + (!p.hasEnd() ? /*!#*/"(ongoing)" : displayDateTime(p.getEndElement())); } public void renderPeriod(XhtmlNode x, Period p) { x.addText(!p.hasStart() ? "??" : displayDateTime(p.getStartElement())); x.tx(" --> "); - x.addText(!p.hasEnd() ? "(ongoing)" : displayDateTime(p.getEndElement())); + x.addText(!p.hasEnd() ? /*!#*/"(ongoing)" : displayDateTime(p.getEndElement())); } public void renderUsageContext(XhtmlNode x, UsageContext u) throws FHIRFormatError, DefinitionException, IOException { @@ -1606,31 +1602,31 @@ public class DataRenderer extends Renderer implements CodeResolver { public void renderTriggerDefinition(XhtmlNode x, TriggerDefinition td) throws FHIRFormatError, DefinitionException, IOException { if (x.isPara()) { - x.b().tx("Type"); + x.b().tx(/*!#*/"Type"); x.tx(": "); x.tx(td.getType().getDisplay()); if (td.hasName()) { x.tx(", "); - x.b().tx("Name"); + x.b().tx(/*!#*/"Name"); x.tx(": "); x.tx(td.getType().getDisplay()); } if (td.hasCode()) { x.tx(", "); - x.b().tx("Code"); + x.b().tx(/*!#*/"Code"); x.tx(": "); renderCodeableConcept(x, td.getCode()); } if (td.hasTiming()) { x.tx(", "); - x.b().tx("Timing"); + x.b().tx(/*!#*/"Timing"); x.tx(": "); render(x, td.getTiming()); } if (td.hasCondition()) { x.tx(", "); - x.b().tx("Condition"); + x.b().tx(/*!#*/"Condition"); x.tx(": "); renderExpression(x, td.getCondition()); } @@ -1638,27 +1634,27 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Type"); + tr.td().b().tx(/*!#*/"Type"); tr.td().tx(td.getType().getDisplay()); if (td.hasName()) { tr = tbl.tr(); - tr.td().b().tx("Name"); + tr.td().b().tx(/*!#*/"Name"); tr.td().tx(td.getType().getDisplay()); } if (td.hasCode()) { tr = tbl.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); renderCodeableConcept(tr.td(), td.getCode()); } if (td.hasTiming()) { tr = tbl.tr(); - tr.td().b().tx("Timing"); + tr.td().b().tx(/*!#*/"Timing"); render(tr.td(), td.getTiming()); } if (td.hasCondition()) { tr = tbl.tr(); - tr.td().b().tx("Condition"); + tr.td().b().tx(/*!#*/"Condition"); renderExpression(tr.td(), td.getCondition()); } } @@ -1668,7 +1664,7 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); XhtmlNode td = tr.td().colspan("2"); - td.b().tx("Type"); + td.b().tx(/*!#*/"Type"); td.tx(": "); StructureDefinition sd = context.getWorker().fetchTypeDefinition(dr.getType().toCode()); if (sd != null && sd.hasWebPath()) { @@ -1693,7 +1689,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (dr.hasSubject()) { tr = tbl.tr(); td = tr.td().colspan("2"); - td.b().tx("Subject"); + td.b().tx(/*!#*/"Subject"); if (dr.hasSubjectReference()) { renderReference(td, dr.getSubjectReference()); } else { @@ -1702,24 +1698,24 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (dr.hasCodeFilter() || dr.hasDateFilter()) { tr = tbl.tr().backgroundColor("#efefef"); - tr.td().tx("Filter"); - tr.td().tx("Value"); + tr.td().tx(/*!#*/"Filter"); + tr.td().tx(/*!#*/"Value"); } for (DataRequirementCodeFilterComponent cf : dr.getCodeFilter()) { tr = tbl.tr(); if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx("Search on " +cf.getSearchParam()); + tr.td().tx(/*!#*/"Search on " +cf.getSearchParam()); } if (cf.hasValueSet()) { td = tr.td(); - td.tx("In ValueSet "); + td.tx(/*!#*/"In ValueSet "); render(td, cf.getValueSetElement()); } else { boolean first = true; td = tr.td(); - td.tx("One of these codes: "); + td.tx(/*!#*/"One of these codes: "); for (Coding c : cf.getCode()) { if (first) first = false; else td.tx(", "); render(td, c); @@ -1731,7 +1727,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx("Search on " +cf.getSearchParam()); + tr.td().tx(/*!#*/"Search on " +cf.getSearchParam()); } render(tr.td(), cf.getValue()); } @@ -1739,7 +1735,7 @@ public class DataRenderer extends Renderer implements CodeResolver { tr = tbl.tr(); td = tr.td().colspan("2"); if (dr.hasLimit()) { - td.b().tx("Limit"); + td.b().tx(/*!#*/"Limit"); td.tx(": "); td.tx(dr.getLimit()); if (dr.hasSort()) { @@ -1747,7 +1743,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } } if (dr.hasSort()) { - td.b().tx("Sort"); + td.b().tx(/*!#*/"Sort"); td.tx(": "); boolean first = true; for (DataRequirementSortComponent p : dr.getSort()) { @@ -1763,7 +1759,7 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayTiming(Timing s) throws FHIRException { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasCode()) - b.append("Code: "+displayCodeableConcept(s.getCode())); + b.append(/*!#*/"Code: "+displayCodeableConcept(s.getCode())); if (s.getEvent().size() > 0) { CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder(); @@ -1774,17 +1770,17 @@ public class DataRenderer extends Renderer implements CodeResolver { c.append("??"); } } - b.append("Events: "+ c.toString()); + b.append(/*!#*/"Events: "+ c.toString()); } if (s.hasRepeat()) { TimingRepeatComponent rep = s.getRepeat(); if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasStart()) - b.append("Starting "+displayDateTime(rep.getBoundsPeriod().getStartElement())); + b.append(/*!#*/"Starting "+displayDateTime(rep.getBoundsPeriod().getStartElement())); if (rep.hasCount()) - b.append("Count "+Integer.toString(rep.getCount())+" times"); + b.append(/*!#*/"Count "+Integer.toString(rep.getCount())+" times"); if (rep.hasDuration()) - b.append("Duration "+rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())); + b.append(/*!#*/"Duration "+rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())); if (rep.hasWhen()) { String st = ""; @@ -1797,14 +1793,14 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { String st = ""; if (!rep.hasFrequency() || (!rep.hasFrequencyMax() && rep.getFrequency() == 1) ) - st = "Once"; + st = /*!#*/"Once"; else { st = Integer.toString(rep.getFrequency()); if (rep.hasFrequencyMax()) st = st + "-"+Integer.toString(rep.getFrequency()); } if (rep.hasPeriod()) { - st = st + " per "+rep.getPeriod().toPlainString(); + st = st + " "+/*!#*/"per "+rep.getPeriod().toPlainString(); if (rep.hasPeriodMax()) st = st + "-"+rep.getPeriodMax().toPlainString(); st = st + " "+displayTimeUnits(rep.getPeriodUnit()); @@ -1812,7 +1808,7 @@ public class DataRenderer extends Renderer implements CodeResolver { b.append(st); } if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasEnd()) - b.append("Until "+displayDateTime(rep.getBoundsPeriod().getEndElement())); + b.append(/*!#*/"Until "+displayDateTime(rep.getBoundsPeriod().getEndElement())); } return b.toString(); } @@ -1828,20 +1824,20 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayEventCode(EventTiming when) { switch (when) { - case C: return "at meals"; - case CD: return "at lunch"; - case CM: return "at breakfast"; - case CV: return "at dinner"; - case AC: return "before meals"; - case ACD: return "before lunch"; - case ACM: return "before breakfast"; - case ACV: return "before dinner"; - case HS: return "before sleeping"; - case PC: return "after meals"; - case PCD: return "after lunch"; - case PCM: return "after breakfast"; - case PCV: return "after dinner"; - case WAKE: return "after waking"; + case C: return /*!#*/"at meals"; + case CD: return /*!#*/"at lunch"; + case CM: return /*!#*/"at breakfast"; + case CV: return /*!#*/"at dinner"; + case AC: return /*!#*/"before meals"; + case ACD: return /*!#*/"before lunch"; + case ACM: return /*!#*/"before breakfast"; + case ACV: return /*!#*/"before dinner"; + case HS: return /*!#*/"before sleeping"; + case PC: return /*!#*/"after meals"; + case PCD: return /*!#*/"after lunch"; + case PCM: return /*!#*/"after breakfast"; + case PCV: return /*!#*/"after dinner"; + case WAKE: return /*!#*/"after waking"; default: return "?ngen-6?"; } } @@ -1869,29 +1865,29 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displaySampledData(SampledData s) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasOrigin()) - b.append("Origin: "+displayQuantity(s.getOrigin())); + b.append(/*!#*/"Origin: "+displayQuantity(s.getOrigin())); if (s.hasInterval()) { - b.append("Interval: "+s.getInterval().toString()); + b.append(/*!#*/"Interval: "+s.getInterval().toString()); if (s.hasIntervalUnit()) b.append(s.getIntervalUnit().toString()); } if (s.hasFactor()) - b.append("Factor: "+s.getFactor().toString()); + b.append(/*!#*/"Factor: "+s.getFactor().toString()); if (s.hasLowerLimit()) - b.append("Lower: "+s.getLowerLimit().toString()); + b.append(/*!#*/"Lower: "+s.getLowerLimit().toString()); if (s.hasUpperLimit()) - b.append("Upper: "+s.getUpperLimit().toString()); + b.append(/*!#*/"Upper: "+s.getUpperLimit().toString()); if (s.hasDimensions()) - b.append("Dimensions: "+s.getDimensions()); + b.append(/*!#*/"Dimensions: "+s.getDimensions()); if (s.hasData()) - b.append("Data: "+s.getData()); + b.append(/*!#*/"Data: "+s.getData()); return b.toString(); } @@ -1909,7 +1905,7 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode xn; xn = new XhtmlNode(NodeType.Element, "div"); XhtmlNode p = xn.para(); - p.b().tx("Exception "+function+": "+e.getMessage()); + p.b().tx(/*!#*/"Exception "+function+": "+e.getMessage()); p.addComment(getStackTrace(e)); return xn; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java index 13680d5aa..d906db817 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java @@ -62,7 +62,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { XhtmlNode tr; if (dr.has("subject")) { tr = tbl.tr(); - tr.td().tx("Subject"); + tr.td().tx(/*!#*/"Subject"); populateSubjectSummary(tr.td(), getProperty(dr, "subject").value()); } @@ -71,13 +71,13 @@ public class DiagnosticReportRenderer extends ResourceRenderer { if (dr.has("effective[x]")) { tr = tbl.tr(); - tr.td().tx("When For"); + tr.td().tx(/*!#*/"When For"); eff = (DataType) getProperty(dr, "effective[x]").value().getBase(); render(tr.td(), eff); } if (dr.has("issued")) { tr = tbl.tr(); - tr.td().tx("Reported"); + tr.td().tx(/*!#*/"Reported"); eff = (DataType) getProperty(dr, "issued").value().getBase(); render(tr.td(), getProperty(dr, "issued").value()); } @@ -85,7 +85,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "perfomer"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Performer", pw.getValues().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Performer", pw.getValues().size())); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -95,7 +95,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "identifier"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Identifier", pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize(/*!#*/"Identifier", pw.getValues().size())+":"); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -105,7 +105,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "request"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Request", pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize(/*!#*/"Request", pw.getValues().size())+":"); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -115,7 +115,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } - x.para().b().tx("Report Details"); + x.para().b().tx(/*!#*/"Report Details"); pw = getProperty(dr, "result"); if (valued(pw)) { @@ -138,7 +138,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } if (valued(pw)) { XhtmlNode p = x.para(); - p.b().tx("Coded Conclusions :"); + p.b().tx(/*!#*/"Coded Conclusions :"); XhtmlNode ul = x.ul(); for (BaseWrapper v : pw.getValues()) { render(ul.li(), v); @@ -174,11 +174,11 @@ public class DiagnosticReportRenderer extends ResourceRenderer { private void populateSubjectSummary(XhtmlNode container, BaseWrapper subject) throws UnsupportedEncodingException, FHIRException, IOException, EOperationOutcome { ResourceWrapper r = fetchResource(subject); if (r == null) - container.tx("Unable to get Patient Details"); + container.tx(/*!#*/"Unable to get Patient Details"); else if (r.getName().equals("Patient")) generatePatientSummary(container, r); else - container.tx("Not done yet"); + container.tx(/*!#*/"Not done yet"); } private void generatePatientSummary(XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome { @@ -218,22 +218,22 @@ public class DiagnosticReportRenderer extends ResourceRenderer { if (issued) cs++; if (effectiveTime) cs++; XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Code"); - tr.td().b().tx("Value"); + tr.td().b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"Value"); if (refRange) { - tr.td().b().tx("Reference Range"); + tr.td().b().tx(/*!#*/"Reference Range"); } if (flags) { - tr.td().b().tx("Flags"); + tr.td().b().tx(/*!#*/"Flags"); } if (note) { - tr.td().b().tx("Note"); + tr.td().b().tx(/*!#*/"Note"); } if (effectiveTime) { - tr.td().b().tx("When For"); + tr.td().b().tx(/*!#*/"When For"); } if (issued) { - tr.td().b().tx("Reported"); + tr.td().b().tx(/*!#*/"Reported"); } for (ObservationNode o : observations) { addObservationToTable(tbl, o, 0, Integer.toString(cs), refRange, flags, note, effectiveTime, issued, eff, iss); @@ -340,13 +340,13 @@ public class DiagnosticReportRenderer extends ResourceRenderer { XhtmlNode tr = tbl.tr(); if (o.obs != null && o.obs.getReference() == null) { XhtmlNode td = tr.td().colspan(cs); - td.i().tx("This Observation could not be resolved"); + td.i().tx(/*!#*/"This Observation could not be resolved"); } else { if (o.obs != null && o.obs.getResource() != null) { addObservationToTable(tr, o.obs.getResource(), i, o.obs.getReference(), refRange, flags, note, effectiveTime, issued, eff, iss); } else { XhtmlNode td = tr.td().colspan(cs); - td.i().tx("Observation"); + td.i().tx(/*!#*/"Observation"); } if (o.contained != null) { for (ObservationNode c : o.contained) { @@ -380,7 +380,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(obs, "dataAbsentReason"); if (valued(pw)) { XhtmlNode span = td.span("color: maroon", "Error"); - span.tx("Error: "); + span.tx(/*!#*/"Error: "); render(span.b(), pw.value()); } } @@ -421,7 +421,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { PropertyWrapper pwrA = getProperty(v, "age"); if (valued(pwr) || valued(pwrA)) { boolean firstA = true; - td.tx(" for "); + td.tx(" "+/*!#*/"for "); if (valued(pwr)) { for (BaseWrapper va : pwr.getValues()) { if (firstA) firstA = false; else td.tx(", "); @@ -430,7 +430,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } if (valued(pwrA)) { if (firstA) firstA = false; else td.tx(", "); - td.tx("Age "); + td.tx(/*!#*/"Age "); render(td, pwrA.value()); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java index bec93686e..7f2a5544e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java @@ -43,11 +43,11 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { case PROCESSES: return renderProcesses(x, scen); default: - throw new FHIRException("Unknown ExampleScenario Renderer Mode " + context.getScenarioMode()); + throw new FHIRException(/*!#*/"Unknown ExampleScenario Renderer Mode " + context.getScenarioMode()); } } } catch (Exception e) { - throw new FHIRException("Error rendering ExampleScenario " + scen.getUrl(), e); + throw new FHIRException(/*!#*/"Error rendering ExampleScenario " + scen.getUrl(), e); } } @@ -105,7 +105,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { for (ExampleScenarioProcessStepComponent step: process.getStep()) { plantUml += toPlantUml(step, stepPrefix(prefix, step, stepCount), scen, actorsActive, actorKeys); if (step.getPause()) - plantUml += "... time passes ...\n"; + plantUml += /*!#*/"... time passes ...\n"; stepCount++; } @@ -119,7 +119,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { XhtmlNode n = new XhtmlDocument(); renderCanonical(scen, n, step.getWorkflow()); XhtmlNode ref = n.getChildNodes().get(0); - plantUml += noteOver(scen.getActor(), "Step " + trimPrefix(prefix) + " - See scenario\n" + creolLink(ref.getContent(), ref.getAttribute("href"))); + plantUml += noteOver(scen.getActor(), /*!#*/"Step " + trimPrefix(prefix) + " - See scenario\n" + creolLink(ref.getContent(), ref.getAttribute("href"))); } else if (step.hasProcess()) plantUml += toPlantUml(step.getProcess(), prefix, scen, actorKeys); else { @@ -211,9 +211,9 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public boolean renderActors(XhtmlNode x, ExampleScenario scen) throws IOException { XhtmlNode tbl = x.table("table-striped table-bordered"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Name"); - thead.th().addText("Type"); - thead.th().addText("Description"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Type"); + thead.th().addText(/*!#*/"Description"); for (ExampleScenarioActorComponent actor : scen.getActor()) { XhtmlNode tr = tbl.tr(); XhtmlNode nameCell = tr.td(); @@ -228,10 +228,10 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public boolean renderInstances(XhtmlNode x, ExampleScenario scen) throws IOException { XhtmlNode tbl = x.table("table-striped table-bordered"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Name"); - thead.th().addText("Type"); - thead.th().addText("Content"); - thead.th().addText("Description"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Type"); + thead.th().addText(/*!#*/"Content"); + thead.th().addText(/*!#*/"Description"); Map instanceNames = new HashMap(); for (ExampleScenarioInstanceComponent instance : scen.getInstance()) { @@ -254,7 +254,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { if (!instance.hasStructureVersion() || instance.getStructureType().getSystem().equals("")) { if (instance.hasStructureVersion()) - typeCell.tx("FHIR version " + instance.getStructureVersion() + " "); + typeCell.tx(/*!#*/"FHIR version " + instance.getStructureVersion() + " "); if (instance.hasStructureProfile()) { renderCanonical(scen, typeCell, instance.getStructureProfile().toString()); } else { @@ -262,7 +262,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { } } else { render(typeCell, instance.getStructureVersionElement()); - typeCell.tx(" version " + instance.getStructureVersion()); + typeCell.tx(" "+/*!#*/"version " + instance.getStructureVersion()); if (instance.hasStructureProfile()) { typeCell.tx(" "); renderCanonical(scen, typeCell, instance.getStructureProfile().toString()); @@ -280,7 +280,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { XhtmlNode descCell = row.td(); addMarkdown(descCell, instance.getDescription()); if (instance.hasContainedInstance()) { - descCell.b().tx("Contains: "); + descCell.b().tx(/*!#*/"Contains: "); int containedCount = 1; for (ExampleScenarioInstanceContainedInstanceComponent contained: instance.getContainedInstance()) { String key = "i_" + contained.getInstanceReference(); @@ -341,26 +341,26 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public void renderProcess(XhtmlNode x, ExampleScenarioProcessComponent process, String prefix, Map actors, Map instances) throws IOException { XhtmlNode div = x.div(); div.an("p_" + prefix); - div.b().tx("Process: " + process.getTitle()); + div.b().tx(/*!#*/"Process: " + process.getTitle()); if (process.hasDescription()) addMarkdown(div, process.getDescription()); if (process.hasPreConditions()) { - div.para().b().i().tx("Pre-conditions:"); + div.para().b().i().tx(/*!#*/"Pre-conditions:"); addMarkdown(div, process.getPreConditions()); } if (process.hasPostConditions()) { - div.para().b().i().tx("Post-conditions:"); + div.para().b().i().tx(/*!#*/"Post-conditions:"); addMarkdown(div, process.getPostConditions()); } XhtmlNode tbl = div.table("table-striped table-bordered").style("width:100%"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Step"); - thead.th().addText("Name"); - thead.th().addText("Description"); - thead.th().addText("Initator"); - thead.th().addText("Receiver"); - thead.th().addText("Request"); - thead.th().addText("Response"); + thead.th().addText(/*!#*/"Step"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Description"); + thead.th().addText(/*!#*/"Initator"); + thead.th().addText(/*!#*/"Receiver"); + thead.th().addText(/*!#*/"Request"); + thead.th().addText(/*!#*/"Response"); int stepCount = 1; for (ExampleScenarioProcessStepComponent step: process.getStep()) { renderStep(tbl, step, stepPrefix(prefix, step, stepCount), actors, instances); @@ -407,13 +407,13 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { prefixCell.tx(stepLabel.substring(stepLabel.indexOf(".") + 1)); if (step.hasProcess()) { XhtmlNode n = row.td().colspan(6); - n.tx("See subprocess" ); + n.tx(/*!#*/"See subprocess" ); n.ah("#p_" + stepLabel, step.getProcess().getTitle()); - n.tx(" below"); + n.tx(" "+/*!#*/"below"); } else if (step.hasWorkflow()) { XhtmlNode n = row.td().colspan(6); - n.tx("See other scenario "); + n.tx(/*!#*/"See other scenario "); String link = new ContextUtilities(context.getWorker()).getLinkForUrl(context.getLink(KnownLinkType.SPEC), step.getWorkflow()); n.ah(link, step.getProcess().getTitle()); @@ -438,7 +438,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { int altNum = 1; for (ExampleScenarioProcessStepAlternativeComponent alt : step.getAlternative()) { XhtmlNode altHeading = tbl.tr().colspan(7).td(); - altHeading.para().i().tx("Alternative " + alt.getTitle()); + altHeading.para().i().tx(/*!#*/"Alternative " + alt.getTitle()); if (alt.hasDescription()) addMarkdown(altHeading, alt.getDescription()); int stepCount = 1; @@ -458,7 +458,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { return; ExampleScenarioActorComponent actor = actors.get(actorId); if (actor==null) - throw new FHIRException("Unable to find referenced actor " + actorId); + throw new FHIRException(/*!#*/"Unable to find referenced actor " + actorId); actorCell.ah("#a_" + actor.getKey(), actor.getDescription()).tx(actor.getTitle()); } @@ -468,7 +468,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { return; ExampleScenarioInstanceComponent instance = instances.get(instanceRef.getInstanceReference()); if (instance==null) - throw new FHIRException("Unable to find referenced instance " + instanceRef.getInstanceReference()); + throw new FHIRException(/*!#*/"Unable to find referenced instance " + instanceRef.getInstanceReference()); if (instanceRef.hasVersionReference()) { ExampleScenarioInstanceVersionComponent theVersion = null; for (ExampleScenarioInstanceVersionComponent version: instance.getVersion()) { @@ -478,7 +478,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { } } if (theVersion==null) - throw new FHIRException("Unable to find referenced version " + instanceRef.getVersionReference() + " within instance " + instanceRef.getInstanceReference()); + throw new FHIRException(/*!#*/"Unable to find referenced version " + instanceRef.getVersionReference() + " within instance " + instanceRef.getInstanceReference()); instanceCell.ah("#i_" + instance.getKey() + "v_"+ theVersion.getKey() , theVersion.getDescription()).tx(theVersion.getTitle()); } else diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java index c44349623..bf2960859 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java @@ -28,7 +28,7 @@ public class ImplementationGuideRenderer extends ResourceRenderer { public boolean render(XhtmlNode x, ImplementationGuide ig) throws FHIRFormatError, DefinitionException, IOException { x.h2().addText(ig.getName()); - x.para().tx("The official URL for this implementation guide is: "); + x.para().tx(/*!#*/"The official URL for this implementation guide is: "); x.pre().tx(ig.getUrl()); addMarkdown(x, ig.getDescription()); return true; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java index a77bad3a8..bc8ce887b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java @@ -49,32 +49,32 @@ public class LibraryRenderer extends ResourceRenderer { boolean email = hasCT(authors, "email") || hasCT(editors, "email") || hasCT(reviewers, "email") || hasCT(endorsers, "email"); boolean phone = hasCT(authors, "phone") || hasCT(editors, "phone") || hasCT(reviewers, "phone") || hasCT(endorsers, "phone"); boolean url = hasCT(authors, "url") || hasCT(editors, "url") || hasCT(reviewers, "url") || hasCT(endorsers, "url"); - x.h2().tx("Participants"); + x.h2().tx(/*!#*/"Participants"); XhtmlNode t = x.table("grid"); if (authors != null) { for (BaseWrapper cd : authors.getValues()) { - participantRow(t, "Author", cd, email, phone, url); + participantRow(t, /*!#*/"Author", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : editors.getValues()) { - participantRow(t, "Editor", cd, email, phone, url); + participantRow(t, /*!#*/"Editor", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : reviewers.getValues()) { - participantRow(t, "Reviewer", cd, email, phone, url); + participantRow(t, /*!#*/"Reviewer", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : endorsers.getValues()) { - participantRow(t, "Endorser", cd, email, phone, url); + participantRow(t, /*!#*/"Endorser", cd, email, phone, url); } } } PropertyWrapper artifacts = lib.getChildByName("relatedArtifact"); if (artifacts != null && artifacts.hasValues()) { - x.h2().tx("Related Artifacts"); + x.h2().tx(/*!#*/"Related Artifacts"); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -90,7 +90,7 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper parameters = lib.getChildByName("parameter"); if (parameters != null && parameters.hasValues()) { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode t = x.table("grid"); boolean doco = false; for (BaseWrapper p : parameters.getValues()) { @@ -102,14 +102,14 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper dataRequirements = lib.getChildByName("dataRequirement"); if (dataRequirements != null && dataRequirements.hasValues()) { - x.h2().tx("Data Requirements"); + x.h2().tx(/*!#*/"Data Requirements"); for (BaseWrapper p : dataRequirements.getValues()) { renderDataRequirement(x, (DataRequirement) p.getBase()); } } PropertyWrapper contents = lib.getChildByName("content"); if (contents != null) { - x.h2().tx("Contents"); + x.h2().tx(/*!#*/"Contents"); boolean isCql = false; int counter = 0; for (BaseWrapper p : contents.getValues()) { @@ -151,23 +151,23 @@ public class LibraryRenderer extends ResourceRenderer { boolean email = hasCT(lib.getAuthor(), "email") || hasCT(lib.getEditor(), "email") || hasCT(lib.getReviewer(), "email") || hasCT(lib.getEndorser(), "email"); boolean phone = hasCT(lib.getAuthor(), "phone") || hasCT(lib.getEditor(), "phone") || hasCT(lib.getReviewer(), "phone") || hasCT(lib.getEndorser(), "phone"); boolean url = hasCT(lib.getAuthor(), "url") || hasCT(lib.getEditor(), "url") || hasCT(lib.getReviewer(), "url") || hasCT(lib.getEndorser(), "url"); - x.h2().tx("Participants"); + x.h2().tx(/*!#*/"Participants"); XhtmlNode t = x.table("grid"); for (ContactDetail cd : lib.getAuthor()) { - participantRow(t, "Author", cd, email, phone, url); + participantRow(t, /*!#*/"Author", cd, email, phone, url); } for (ContactDetail cd : lib.getEditor()) { - participantRow(t, "Editor", cd, email, phone, url); + participantRow(t, /*!#*/"Editor", cd, email, phone, url); } for (ContactDetail cd : lib.getReviewer()) { - participantRow(t, "Reviewer", cd, email, phone, url); + participantRow(t, /*!#*/"Reviewer", cd, email, phone, url); } for (ContactDetail cd : lib.getEndorser()) { - participantRow(t, "Endorser", cd, email, phone, url); + participantRow(t, /*!#*/"Endorser", cd, email, phone, url); } } if (lib.hasRelatedArtifact()) { - x.h2().tx("Related Artifacts"); + x.h2().tx(/*!#*/"Related Artifacts"); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -182,7 +182,7 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasParameter()) { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode t = x.table("grid"); boolean doco = false; for (ParameterDefinition p : lib.getParameter()) { @@ -193,13 +193,13 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasDataRequirement()) { - x.h2().tx("Data Requirements"); + x.h2().tx(/*!#*/"Data Requirements"); for (DataRequirement p : lib.getDataRequirement()) { renderDataRequirement(x, p); } } if (lib.hasContent()) { - x.h2().tx("Contents"); + x.h2().tx(/*!#*/"Contents"); boolean isCql = false; int counter = 0; for (Attachment att : lib.getContent()) { @@ -356,7 +356,7 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx("No Content"); + p.code().tx(/*!#*/"No Content"); p.tx(" ("); p.code().tx(att.getContentType()); p.tx(lang(att)); @@ -405,10 +405,10 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx("Content not shown - ("); + p.code().tx(/*!#*/"Content not shown - ("); p.code().tx(att.getContentType()); p.tx(lang(att)); - p.tx(", size = "+Utilities.describeSize(att.getData().length)+")"); + p.tx(/*!#*/", size = "+Utilities.describeSize(att.getData().length)+")"); } } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java index b0a44b312..c61d75545 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java @@ -40,33 +40,33 @@ public class ListRenderer extends ResourceRenderer { XhtmlNode tr = t.tr(); XhtmlNode td = tr.td(); if (list.has("date")) { - td.tx("Date: "+list.get("date").dateTimeValue().toHumanDisplay()); + td.tx(/*!#*/"Date: "+list.get("date").dateTimeValue().toHumanDisplay()); } if (list.has("mode")) { - td.tx("Mode: "+list.get("mode").primitiveValue()); + td.tx(/*!#*/"Mode: "+list.get("mode").primitiveValue()); } if (list.has("status")) { - td.tx("Status: "+list.get("status").primitiveValue()); + td.tx(/*!#*/"Status: "+list.get("status").primitiveValue()); } if (list.has("code")) { - td.tx("Code: "+displayBase(list.get("code"))); + td.tx(/*!#*/"Code: "+displayBase(list.get("code"))); } tr = t.tr(); td = tr.td(); if (list.has("subject")) { - td.tx("Subject: "); + td.tx(/*!#*/"Subject: "); shortForRef(td, list.get("subject")); } if (list.has("encounter")) { - td.tx("Encounter: "); + td.tx(/*!#*/"Encounter: "); shortForRef(td, list.get("encounter")); } if (list.has("source")) { - td.tx("Source: "); + td.tx(/*!#*/"Source: "); shortForRef(td, list.get("encounter")); } if (list.has("orderedBy")) { - td.tx("Order: "+displayBase(list.get("orderedBy"))); + td.tx(/*!#*/"Order: "+displayBase(list.get("orderedBy"))); } // for (Annotation a : list.getNote()) { // renderAnnotation(a, x); @@ -81,15 +81,15 @@ public class ListRenderer extends ResourceRenderer { } t = x.table("grid"); tr = t.tr().style("backgound-color: #eeeeee"); - tr.td().b().tx("Items"); + tr.td().b().tx(/*!#*/"Items"); if (date) { - tr.td().tx("Date"); + tr.td().tx(/*!#*/"Date"); } if (flag) { - tr.td().tx("Flag"); + tr.td().tx(/*!#*/"Flag"); } if (deleted) { - tr.td().tx("Deleted"); + tr.td().tx(/*!#*/"Deleted"); } for (BaseWrapper e : list.children("entry")) { tr = t.tr(); @@ -113,16 +113,16 @@ public class ListRenderer extends ResourceRenderer { XhtmlNode t = x.table("clstu"); XhtmlNode tr = t.tr(); if (list.hasDate()) { - tr.td().tx("Date: "+list.getDate().toLocaleString()); + tr.td().tx(/*!#*/"Date: "+list.getDate().toLocaleString()); } if (list.hasMode()) { - tr.td().tx("Mode: "+list.getMode().getDisplay()); + tr.td().tx(/*!#*/"Mode: "+list.getMode().getDisplay()); } if (list.hasStatus()) { - tr.td().tx("Status: "+list.getStatus().getDisplay()); + tr.td().tx(/*!#*/"Status: "+list.getStatus().getDisplay()); } if (list.hasCode()) { - tr.td().tx("Code: "+display(list.getCode())); + tr.td().tx(/*!#*/"Code: "+display(list.getCode())); } tr = t.tr(); if (list.hasSubject()) { @@ -130,7 +130,7 @@ public class ListRenderer extends ResourceRenderer { shortForRef(tr.td().txN("Subject: "), list.getSubjectFirstRep()); } else { XhtmlNode td = tr.td(); - td.txN("Subject: "); + td.txN(/*!#*/"Subject: "); int i = 0; for (Reference subj : list.getSubject()) { if (i == list.getSubject().size() - 1) { @@ -143,13 +143,13 @@ public class ListRenderer extends ResourceRenderer { } } if (list.hasEncounter()) { - shortForRef(tr.td().txN("Encounter: "), list.getEncounter()); + shortForRef(tr.td().txN(/*!#*/"Encounter: "), list.getEncounter()); } if (list.hasSource()) { - shortForRef(tr.td().txN("Source: "), list.getEncounter()); + shortForRef(tr.td().txN(/*!#*/"Source: "), list.getEncounter()); } if (list.hasOrderedBy()) { - tr.td().tx("Order: "+display(list.getOrderedBy())); + tr.td().tx(/*!#*/"Order: "+display(list.getOrderedBy())); } for (Annotation a : list.getNote()) { renderAnnotation(x, a); @@ -164,15 +164,15 @@ public class ListRenderer extends ResourceRenderer { } t = x.table("grid"); tr = t.tr().style("backgound-color: #eeeeee"); - tr.td().b().tx("Items"); + tr.td().b().tx(/*!#*/"Items"); if (date) { - tr.td().tx("Date"); + tr.td().tx(/*!#*/"Date"); } if (flag) { - tr.td().tx("Flag"); + tr.td().tx(/*!#*/"Flag"); } if (deleted) { - tr.td().tx("Deleted"); + tr.td().tx(/*!#*/"Deleted"); } for (ListResourceEntryComponent e : list.getEntry()) { tr = t.tr(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java index dfb88d5c3..8b12afcfc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java @@ -30,33 +30,33 @@ public class NamingSystemRenderer extends ResourceRenderer { } public boolean render(XhtmlNode x, NamingSystem ns) throws FHIRFormatError, DefinitionException, IOException { - x.h3().tx("Summary"); + x.h3().tx(/*!#*/"Summary"); XhtmlNode tbl = x.table("grid"); - row(tbl, "Defining URL", ns.getUrl()); + row(tbl, /*!#*/"Defining URL", ns.getUrl()); if (ns.hasVersion()) { - row(tbl, "Version", ns.getVersion()); + row(tbl, /*!#*/"Version", ns.getVersion()); } if (ns.hasName()) { - row(tbl, "Name", gt(ns.getNameElement())); + row(tbl, /*!#*/"Name", gt(ns.getNameElement())); } if (ns.hasTitle()) { - row(tbl, "Title", gt(ns.getTitleElement())); + row(tbl, /*!#*/"Title", gt(ns.getTitleElement())); } - row(tbl, "Status", ns.getStatus().toCode()); + row(tbl, /*!#*/"Status", ns.getStatus().toCode()); if (ns.hasDescription()) { - addMarkdown(row(tbl, "Definition"), ns.getDescription()); + addMarkdown(row(tbl, /*!#*/"Definition"), ns.getDescription()); } if (ns.hasPublisher()) { - row(tbl, "Publisher", gt(ns.getPublisherElement())); + row(tbl, /*!#*/"Publisher", gt(ns.getPublisherElement())); } if (ns.hasExtension(ToolingExtensions.EXT_WORKGROUP)) { renderCommitteeLink(row(tbl, "Committee"), ns); } if (CodeSystemUtilities.hasOID(ns)) { - row(tbl, "OID", CodeSystemUtilities.getOID(ns)).tx("("+translate("ns.summary", "for OID based terminology systems")+")"); + row(tbl, /*!#*/"OID", CodeSystemUtilities.getOID(ns)).tx("("+(/*!#*/"for OID based terminology systems")+")"); } if (ns.hasCopyright()) { - addMarkdown(row(tbl, "Copyright"), ns.getCopyright()); + addMarkdown(row(tbl, /*!#*/"Copyright"), ns.getCopyright()); } boolean hasPreferred = false; boolean hasPeriod = false; @@ -66,19 +66,19 @@ public class NamingSystemRenderer extends ResourceRenderer { hasPeriod = hasPeriod || id.hasPeriod(); hasComment = hasComment || id.hasComment(); } - x.h3().tx("Identifiers"); + x.h3().tx(/*!#*/"Identifiers"); tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(translate("ns.summary", "Type")); - tr.td().b().tx(translate("ns.summary", "Value")); + tr.td().b().tx((/*!#*/"Type")); + tr.td().b().tx((/*!#*/"Value")); if (hasPreferred) { - tr.td().b().tx(translate("ns.summary", "Preferred")); + tr.td().b().tx((/*!#*/"Preferred")); } if (hasPeriod) { - tr.td().b().tx(translate("ns.summary", "Period")); + tr.td().b().tx((/*!#*/"Period")); } if (hasComment) { - tr.td().b().tx(translate("ns.summary", "Comment")); + tr.td().b().tx((/*!#*/"Comment")); } for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) { tr = tbl.tr(); @@ -100,7 +100,7 @@ public class NamingSystemRenderer extends ResourceRenderer { private XhtmlNode row(XhtmlNode tbl, String name) { XhtmlNode tr = tbl.tr(); XhtmlNode td = tr.td(); - td.tx(translate("ns.summary", name)); + td.tx((name)); return tr.td(); } private XhtmlNode row(XhtmlNode tbl, String name, String value) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java index 54b4fd4ba..c891ddc35 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java @@ -353,21 +353,21 @@ public class ObligationsRenderer { XhtmlNode tr = new XhtmlNode(NodeType.Element, "tr"); children.add(tr); - tr.td().style("font-size: 11px").b().tx("Obligations"); + tr.td().style("font-size: 11px").b().tx(/*!#*/"Obligations"); if (actor) { - tr.td().style("font-size: 11px").tx("Actor"); + tr.td().style("font-size: 11px").tx(/*!#*/"Actor"); } if (elementId) { - tr.td().style("font-size: 11px").tx("Elements"); + tr.td().style("font-size: 11px").tx(/*!#*/"Elements"); } if (usage) { - tr.td().style("font-size: 11px").tx("Usage"); + tr.td().style("font-size: 11px").tx(/*!#*/"Usage"); } if (doco) { - tr.td().style("font-size: 11px").tx("Documentation"); + tr.td().style("font-size: 11px").tx(/*!#*/"Documentation"); } if (filter) { - tr.td().style("font-size: 11px").tx("Filter"); + tr.td().style("font-size: 11px").tx(/*!#*/"Filter"); } for (ObligationDetail ob : obligations) { tr = new XhtmlNode(NodeType.Element, "tr"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java index 3d9fdbda7..9d47cf2f7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java @@ -44,22 +44,22 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { if (context.isHeader()) { x.h2().addText(opd.getName()); x.para().addText(Utilities.capitalize(opd.getKind().toString())+": "+opd.getName()); - x.para().tx("The official URL for this operation definition is: "); + x.para().tx(/*!#*/"The official URL for this operation definition is: "); x.pre().tx(opd.getUrl()); addMarkdown(x, opd.getDescription());} if (opd.getSystem()) - x.para().tx("URL: [base]/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/$"+opd.getCode()); for (Enumeration c : opd.getResource()) { if (opd.getType()) - x.para().tx("URL: [base]/"+c.getCode()+"/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/"+c.getCode()+"/$"+opd.getCode()); if (opd.getInstance()) - x.para().tx("URL: [base]/"+c.getCode()+"/[id]/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/"+c.getCode()+"/[id]/$"+opd.getCode()); } if (opd.hasInputProfile()) { XhtmlNode p = x.para(); - p.tx("Input parameters Profile: "); + p.tx(/*!#*/"Input parameters Profile: "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getInputProfile(), opd); if (sd == null) { p.pre().tx(opd.getInputProfile()); @@ -69,7 +69,7 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { } if (opd.hasOutputProfile()) { XhtmlNode p = x.para(); - p.tx("Output parameters Profile: "); + p.tx(/*!#*/"Output parameters Profile: "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getOutputProfile(), opd); if (sd == null) { p.pre().tx(opd.getOutputProfile()); @@ -77,16 +77,16 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { p.ah(sd.getWebPath()).tx(sd.present()); } } - x.para().tx("Parameters"); + x.para().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Use"); - tr.td().b().tx("Name"); - tr.td().b().tx("Scope"); - tr.td().b().tx("Cardinality"); - tr.td().b().tx("Type"); - tr.td().b().tx("Binding"); - tr.td().b().tx("Documentation"); + tr.td().b().tx(/*!#*/"Use"); + tr.td().b().tx(/*!#*/"Name"); + tr.td().b().tx(/*!#*/"Scope"); + tr.td().b().tx(/*!#*/"Cardinality"); + tr.td().b().tx(/*!#*/"Type"); + tr.td().b().tx(/*!#*/"Binding"); + tr.td().b().tx(/*!#*/"Documentation"); for (OperationDefinitionParameterComponent p : opd.getParameter()) { genOpParam(tbl, "", p, opd); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java index b5db9e185..24112e4e5 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java @@ -41,17 +41,17 @@ public class OperationOutcomeRenderer extends ResourceRenderer { hasSource = hasSource || ExtensionHelper.hasExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE); } if (success) - x.para().tx("All OK"); + x.para().tx(/*!#*/"All OK"); if (op.getIssue().size() > 0) { XhtmlNode tbl = x.table("grid"); // on the basis that we'll most likely be rendered using the standard fhir css, but it doesn't really matter XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Severity"); - tr.td().b().tx("Location"); - tr.td().b().tx("Code"); - tr.td().b().tx("Details"); - tr.td().b().tx("Diagnostics"); + tr.td().b().tx(/*!#*/"Severity"); + tr.td().b().tx(/*!#*/"Location"); + tr.td().b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"Details"); + tr.td().b().tx(/*!#*/"Diagnostics"); if (hasSource) - tr.td().b().tx("Source"); + tr.td().b().tx(/*!#*/"Source"); for (OperationOutcomeIssueComponent i : op.getIssue()) { tr = tbl.tr(); tr.td().addText(i.getSeverity().toString()); @@ -82,12 +82,12 @@ public class OperationOutcomeRenderer extends ResourceRenderer { } public String display(OperationOutcome oo) { - return "todo"; + return /*!#*/"todo"; } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } @Override diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java index 646156cb1..892690118 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java @@ -31,7 +31,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, Resource r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table("grid"); params(tbl, ((Parameters) r).getParameter(), 0); return false; @@ -49,7 +49,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, ResourceWrapper params) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table("grid"); PropertyWrapper pw = getProperty(params, "parameter"); if (valued(pw)) { @@ -95,7 +95,7 @@ public class ParametersRenderer extends ResourceRenderer { public XhtmlNode render(Parameters params) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode div = new XhtmlNode(NodeType.Element, "div"); - div.h2().tx("Parameters"); + div.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = div.table("grid"); params(tbl, params.getParameter(), 0); return div; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java index 077d57d8c..898b16ecc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java @@ -225,18 +225,18 @@ public class PatientRenderer extends ResourceRenderer { b.append(display(name)); b.append(" "); if (dob == null) { - b.append("(no stated gender)"); + b.append("(no stated gender)"/*!#*/); } else { b.append(gender); } b.append(", "); if (dob == null) { - b.append("DoB Unknown"); + b.append("DoB Unknown"/*!#*/); } else { - b.append("DoB: "+display(dob)); + b.append(/*!#*/"DoB: "+display(dob)); } if (id != null) { - b.append(" ( "); + b.append(" "+/*!#*/"( "); b.append(display(id)); b.append(")"); } @@ -245,21 +245,21 @@ public class PatientRenderer extends ResourceRenderer { public void describe(XhtmlNode x, HumanName name, String gender, DateType dob, Identifier id) throws UnsupportedEncodingException, IOException { if (name == null) { - x.b().tx("Anonymous Patient"); // todo: is this appropriate? + x.b().tx(/*!#*/"Anonymous Patient"); // todo: is this appropriate? } else { render(x.b(), name); } x.tx(" "); if (gender == null) { - x.tx("(no stated gender)"); + x.tx(/*!#*/"(no stated gender)"); } else { x.tx(gender); } x.tx(", "); if (dob == null) { - x.tx("DoB Unknown"); + x.tx(/*!#*/"DoB Unknown"); } else { - x.tx("DoB: "); + x.tx(/*!#*/"DoB: "); render(x, dob); } if (id != null) { @@ -298,7 +298,7 @@ public class PatientRenderer extends ResourceRenderer { } if (r.has("contained") && context.isTechnicalMode()) { x.hr(); - x.para().b().tx("Contained Resources"); + x.para().b().tx(/*!#*/"Contained Resources"); addContained(x, r.getContained()); } return false; @@ -392,13 +392,13 @@ public class PatientRenderer extends ResourceRenderer { }; if (ids.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Other Id:", "Other Ids (see the one above)"); + nameCell(tr, /*!#*/"Other Id:", /*!#*/"Other Ids (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, ids.get(0)); } else if (ids.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Other Ids:", "Other Ids (see the one above)"); + nameCell(tr, /*!#*/"Other Ids:", /*!#*/"Other Ids (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -425,16 +425,16 @@ public class PatientRenderer extends ResourceRenderer { } if (langs.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Language:", "Languages spoken"); + nameCell(tr, /*!#*/"Language:", /*!#*/"Languages spoken"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, langs.get(0)); if (prefLang != null) { - td.tx(" (preferred)"); + td.tx(" "+/*!#*/"(preferred)"); } } else if (langs.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Languages:", "Languages spoken"); + nameCell(tr, /*!#*/"Languages:", /*!#*/"Languages spoken"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -442,7 +442,7 @@ public class PatientRenderer extends ResourceRenderer { XhtmlNode li = ul.li(); render(r, li, i); if (i == prefLang) { - li.tx(" (preferred)"); + li.tx(" "+/*!#*/"(preferred)"); } } } @@ -454,13 +454,13 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper pw = getProperty(r, "generalPractitioner"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance("General Practitioner", (Reference) t.getBase(), t)); + refs.add(new NamedReferance(/*!#*/"General Practitioner", (Reference) t.getBase(), t)); } } pw = getProperty(r, "managingOrganization"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance("Managing Organization", (Reference) t.getBase(), t)); + refs.add(new NamedReferance(/*!#*/"Managing Organization", (Reference) t.getBase(), t)); } } pw = getProperty(r, "link"); @@ -484,7 +484,7 @@ public class PatientRenderer extends ResourceRenderer { if (refs.size() > 0) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Links:", "Patient Links"); + nameCell(tr, /*!#*/"Links:", /*!#*/"Patient Links"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -499,10 +499,10 @@ public class PatientRenderer extends ResourceRenderer { private String describeLinkedRecord(String type) { switch (type) { - case "replaced-by" : return "This record replaced by"; - case "replaces": return "This record replaces"; - case "refer": return "Please refer to"; - case "seealso": return "Also see"; + case "replaced-by" : return /*!#*/"This record replaced by"; + case "replaces": return /*!#*/"This record replaces"; + case "refer": return /*!#*/"Please refer to"; + case "seealso": return /*!#*/"Also see"; } return "Unknown"; } @@ -564,9 +564,9 @@ public class PatientRenderer extends ResourceRenderer { } XhtmlNode tr = tbl.tr(); if (rels.size() == 1) { - nameCell(tr, (rels.get(0).getCodingFirstRep().hasDisplay() ? rels.get(0).getCodingFirstRep().getDisplay() : display(rels.get(0)))+":", "Nominated Contact: "+display(rels.get(0))); + nameCell(tr, (rels.get(0).getCodingFirstRep().hasDisplay() ? rels.get(0).getCodingFirstRep().getDisplay() : display(rels.get(0)))+":", /*!#*/"Nominated Contact: "+display(rels.get(0))); } else { - nameCell(tr, "Contact", "Patient contact"); + nameCell(tr, /*!#*/"Contact", /*!#*/"Patient contact"); } XhtmlNode td = tr.td(); td.colspan("3"); @@ -576,15 +576,15 @@ public class PatientRenderer extends ResourceRenderer { li = ul.li(); render(r, li, name); if (gender != null) { - li.tx(" ("+gender+")"); + li.tx(" "+/*!#*/"("+gender+")"); } } else if (gender != null) { li = ul.li(); - li.tx("Gender: "+gender); + li.tx(/*!#*/"Gender: "+gender); } if (rels.size() > 1) { li = ul.li(); - li.tx("Relationships: "); + li.tx(/*!#*/"Relationships: "); boolean first = true; for (CodeableConcept rel : rels) { if (first) first = false; else li.tx(", "); @@ -599,12 +599,12 @@ public class PatientRenderer extends ResourceRenderer { } if (organization != null) { li = ul.li(); - li.tx("Organization: "); + li.tx(/*!#*/"Organization: "); render(r, li, organization); } if (period != null) { li = ul.li(); - li.tx("Valid Period: "); + li.tx(/*!#*/"Valid Period: "); render(r, li, period); } } @@ -624,13 +624,13 @@ public class PatientRenderer extends ResourceRenderer { }; if (names.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Alt. Name:", "Alternate names (see the one above)"); + nameCell(tr, /*!#*/"Alt. Name:", /*!#*/"Alternate names (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, names.get(0)); } else if (names.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Alt Names:", "Alternate names (see the one above)"); + nameCell(tr, /*!#*/"Alt Names:", /*!#*/"Alternate names (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -653,7 +653,7 @@ public class PatientRenderer extends ResourceRenderer { } if (tels.size() + adds.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Contact Detail:", "Ways to contact the Patient"); + nameCell(tr, /*!#*/"Contact Detail:", /*!#*/"Ways to contact the Patient"); XhtmlNode td = tr.td(); td.colspan("3"); if (adds.isEmpty()) { @@ -663,7 +663,7 @@ public class PatientRenderer extends ResourceRenderer { } } else if (tels.size() + adds.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Contact Details:", "Ways to contact the Patient"); + nameCell(tr, /*!#*/"Contact Details:", /*!#*/"Ways to contact the Patient"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -698,7 +698,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("active"); if (a.hasValues()) { pos++; - nameCell(tr, "Active:", "Record is active"); + nameCell(tr, /*!#*/"Active:", /*!#*/"Record is active"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -710,7 +710,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("deceased[x]"); if (a.hasValues()) { pos++; - nameCell(tr, "Deceased:", "Known status of Patient"); + nameCell(tr, /*!#*/"Deceased:", /*!#*/"Known status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -725,7 +725,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, "Marital Status:", "Known Marital status of Patient"); + nameCell(tr, /*!#*/"Marital Status:", /*!#*/"Known Marital status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -740,7 +740,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, "Multiple Birth:", "Known multipleBirth status of Patient"); + nameCell(tr, /*!#*/"Multiple Birth:", /*!#*/"Known multipleBirth status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -783,7 +783,7 @@ public class PatientRenderer extends ResourceRenderer { String n = UUID.randomUUID().toString().toLowerCase()+ext; TextFile.bytesToFile(att.getData(), new File(Utilities.path(context.getDestDir(), n))); context.registerFile(n); - td.img(n, "patient photo"); + td.img(n, /*!#*/"patient photo"); } return; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index 8a8ce24a6..c1b0d865c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -107,7 +107,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { boolean idDone = false; XhtmlNode p = x.para(); if (context.isAddGeneratedNarrativeHeader()) { - p.b().tx("Generated Narrative: "+r.fhirType()+(context.isContained() ? " #"+r.getId() : "")); + p.b().tx(/*!#*/"Generated Narrative: "+r.fhirType()+(context.isContained() ? " #"+r.getId() : "")); if (!Utilities.noString(r.getId())) { p.an(r.getId()); p.an("hc"+r.getId()); @@ -125,7 +125,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { try { StructureDefinition sd = r.getDefinition(); if (sd == null) { - throw new FHIRException("Cannot find definition for "+r.fhirType()); + throw new FHIRException(/*!#*/"Cannot find definition for "+r.fhirType()); } else { ElementDefinition ed = sd.getSnapshot().getElement().get(0); containedIds.clear(); @@ -133,9 +133,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer { generateByProfile(r, sd, r.root(), sd.getSnapshot().getElement(), ed, context.getProfileUtilities().getChildList(sd, ed), x, r.fhirType(), context.isTechnicalMode(), 0); } } catch (Exception e) { - System.out.println("Error Generating Narrative for "+r.fhirType()+"/"+r.getId()+": "+e.getMessage()); + System.out.println(/*!#*/"Error Generating Narrative for "+r.fhirType()+"/"+r.getId()+": "+e.getMessage()); e.printStackTrace(); - x.para().b().style("color: maroon").tx("Exception generating Narrative: "+e.getMessage()); + x.para().b().style("color: maroon").tx(/*!#*/"Exception generating Narrative: "+e.getMessage()); } return hasExtensions; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java index 6a177df65..4598a0d33 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java @@ -29,10 +29,10 @@ public class ProvenanceRenderer extends ResourceRenderer { if (!prv.getTarget().isEmpty()) { if (prv.getTarget().size() == 1) { XhtmlNode p = x.para(); - p.tx("Provenance for "); + p.tx(/*!#*/"Provenance for "); renderReference(prv, p, prv.getTargetFirstRep()); } else { - x.para().tx("Provenance for:"); + x.para().tx(/*!#*/"Provenance for:"); XhtmlNode ul = x.ul(); for (Reference ref : prv.getTarget()) { renderReference(prv, ul.li(), ref); @@ -40,12 +40,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } } // summary table - x.para().tx("Summary"); + x.para().tx(/*!#*/"Summary"); XhtmlNode t = x.table("grid"); XhtmlNode tr; if (prv.hasOccurred()) { tr = t.tr(); - tr.td().tx("Occurrence"); + tr.td().tx(/*!#*/"Occurrence"); if (prv.hasOccurredPeriod()) { renderPeriod(tr.td(), prv.getOccurredPeriod()); } else { @@ -54,12 +54,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } if (prv.hasRecorded()) { tr = t.tr(); - tr.td().tx("Recorded"); + tr.td().tx(/*!#*/"Recorded"); tr.td().addText(prv.getRecordedElement().toHumanDisplay()); } if (prv.hasPolicy()) { tr = t.tr(); - tr.td().tx("Policy"); + tr.td().tx(/*!#*/"Policy"); if (prv.getPolicy().size() == 1) { renderUri(tr.td(), prv.getPolicy().get(0)); } else { @@ -71,12 +71,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } if (prv.hasLocation()) { tr = t.tr(); - tr.td().tx("Location"); + tr.td().tx(/*!#*/"Location"); renderReference(prv, tr.td(), prv.getLocation()); } if (prv.hasActivity()) { tr = t.tr(); - tr.td().tx("Activity"); + tr.td().tx(/*!#*/"Activity"); renderCodeableConcept(tr.td(), prv.getActivity(), false); } @@ -88,18 +88,18 @@ public class ProvenanceRenderer extends ResourceRenderer { hasRole = hasRole || a.hasRole(); hasOnBehalfOf = hasOnBehalfOf || a.hasOnBehalfOf(); } - x.para().b().tx("Agents"); + x.para().b().tx(/*!#*/"Agents"); t = x.table("grid"); tr = t.tr(); if (hasType) { - tr.td().b().tx("Type"); + tr.td().b().tx(/*!#*/"Type"); } if (hasRole) { - tr.td().b().tx("Role"); + tr.td().b().tx(/*!#*/"Role"); } - tr.td().b().tx("who"); + tr.td().b().tx(/*!#*/"who"); if (hasOnBehalfOf) { - tr.td().b().tx("On Behalf Of"); + tr.td().b().tx(/*!#*/"On Behalf Of"); } for (ProvenanceAgentComponent a : prv.getAgent()) { tr = t.tr(); @@ -147,12 +147,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } public String display(Provenance prv) throws UnsupportedEncodingException, IOException { - return "Provenance for "+displayReference(prv, prv.getTargetFirstRep()); + return /*!#*/"Provenance for "+displayReference(prv, prv.getTargetFirstRep()); } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java index ed9bae64d..3c99533e6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java @@ -68,7 +68,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { boolean doOpts = context.getDefinitionsTarget() == null && hasAnyOptions(q.getItem()); if (doOpts) { - x.b().tx("Structure"); + x.b().tx(/*!#*/"Structure"); } HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree="+q.getId(), context.getRules() == GenerationRules.IG_PUBLISHER); @@ -79,14 +79,14 @@ public class QuestionnaireRenderer extends TerminologyRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Cardinality"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Cardinality", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Type", /*!#*/"The type of the item", null, 0)); if (hasFlags) { - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Flags"), translate("sd.hint", "Other attributes of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Flags", /*!#*/"Other attributes of the item", null, 0)); } - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description & Constraints", /*!#*/"Additional information about the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -105,7 +105,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void renderOptions(Questionnaire q, XhtmlNode x) { if (hasAnyOptions(q.getItem())) { x.hr(); - x.para().b().tx("Option Sets"); + x.para().b().tx(/*!#*/"Option Sets"); renderOptions(q.getItem(), x); } } @@ -124,7 +124,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { useSelect = useSelect || opt.getInitialSelected(); } x.an("opt-item."+i.getLinkId()); - x.para().b().tx("Answer options for "+i.getLinkId()); + x.para().b().tx(/*!#*/"Answer options for "+i.getLinkId()); XhtmlNode ul = x.ul(); for (QuestionnaireItemAnswerOptionComponent opt : i.getAnswerOption()) { XhtmlNode li = ul.li(); @@ -209,11 +209,11 @@ public class QuestionnaireRenderer extends TerminologyRenderer { Row r = gen.new Row(); rows.add(r); - r.setIcon("icon_q_root.gif", "QuestionnaireRoot"); + 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, 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)); + r.getCells().add(gen.new Cell(null, null, /*!#*/"Questionnaire", null, null)); if (hasFlags) { r.getCells().add(gen.new Cell(null, null, "", null, null)); } @@ -263,45 +263,45 @@ public class QuestionnaireRenderer extends TerminologyRenderer { Cell flags = gen.new Cell(); r.getCells().add(flags); if (i.getReadOnly()) { - flags.addPiece(gen.new Piece(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "questionnaire-definitions.html#Questionnaire.item.readOnly"), null, "Is Readonly").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-readonly.png")))); + flags.addPiece(gen.new Piece(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "questionnaire-definitions.html#Questionnaire.item.readOnly"), null, /*!#*/"Is Readonly").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-readonly.png")))); } if (ToolingExtensions.readBoolExtension(i, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { - flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), null, "Can change the subject of the questionnaire").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-subject.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), null, /*!#*/"Can change the subject of the questionnaire").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-subject.png")))); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_HIDDEN)) { - flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-hidden.html"), null, "Is a hidden item").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-hidden.png")))); + flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-hidden.html"), null, /*!#*/"Is a hidden item").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-hidden.png")))); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_OTP_DISP)) { - flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), null, "Is optional to display").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-optional.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), null, /*!#*/"Is optional to display").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-optional.png")))); } if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod")) { - flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), null, "Is linked to an observation").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-observation.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), null, /*!#*/"Is linked to an observation").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-observation.png")))); } if (i.hasExtension(ToolingExtensions.EXT_Q_CHOICE_ORIENT)) { String code = ToolingExtensions.readStringExtension(i, ToolingExtensions.EXT_Q_CHOICE_ORIENT); - flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-choiceorientation.html"), null, "Orientation: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); + flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-choiceorientation.html"), null, /*!#*/"Orientation: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); } if (i.hasExtension(ToolingExtensions.EXT_Q_DISPLAY_CAT)) { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); - flags.addPiece(gen.new Piece("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", null, "Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); + flags.addPiece(gen.new Piece("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", null, /*!#*/"Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); } } Cell defn = gen.new Cell(); r.getCells().add(defn); if (i.hasMaxLength()) { - defn.getPieces().add(gen.new Piece(null, "Max Length: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Max Length: ", null)); defn.getPieces().add(gen.new Piece(null, Integer.toString(i.getMaxLength()), null)); } if (i.hasDefinition()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Definition: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null)); genDefinitionLink(gen, i, defn, q); } if (i.hasEnableWhen()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - Piece p = gen.new Piece(null, "Enable When: ", null); + Piece p = gen.new Piece(null, /*!#*/"Enable When: ", null); defn.getPieces().add(p); if (i.getEnableWhen().size() == 1) { XhtmlNode x = new XhtmlNode(NodeType.Element, "span"); @@ -317,7 +317,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Value Set: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Value Set: ", null)); if (!Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null) { @@ -336,7 +336,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerOption()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Options: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Options: ", null)); if (context.getDefinitionsTarget() == null) { // if we don't have a definitions target, we'll add them below. defn.getPieces().add(gen.new Piece("#opt-item."+i.getLinkId(), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), null)); @@ -347,7 +347,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasInitial()) { for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Initial Value: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Initial Value: ", null)); defn.getPieces().add(gen.new Piece(null, v.getValue().fhirType(), null)); defn.getPieces().add(gen.new Piece(null, " = ", null)); if (v.getValue().isPrimitive()) { @@ -375,26 +375,26 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Expressions: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Expressions: ", null)); Piece p = gen.new Piece("ul"); defn.getPieces().add(p); for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { - addExpression(p, e.getValueExpression(), "Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression")) { - addExpression(p, e.getValueExpression(), "Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext")) { - addExpression(p, e.getValueExpression(), "Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), /*!#*/"Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression")) { - addExpression(p, e.getValueExpression(), "Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression")) { - addExpression(p, e.getValueExpression(), "Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression")) { - addExpression(p, e.getValueExpression(), "Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); } } @@ -469,8 +469,8 @@ public class QuestionnaireRenderer extends TerminologyRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description & Constraints", /*!#*/"Additional information about the item", null, 0)); boolean hasExt = false; if (!q.hasItem()) { @@ -496,22 +496,22 @@ public class QuestionnaireRenderer extends TerminologyRenderer { r.getCells().add(defn); if (i.hasMaxLength()) { - defn.getPieces().add(gen.new Piece(null, "Max Length: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Max Length: ", null)); defn.getPieces().add(gen.new Piece(null, Integer.toString(i.getMaxLength()), null)); } if (i.hasDefinition()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Definition: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null)); genDefinitionLink(gen, i, defn, q); } if (i.hasEnableWhen()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Enable When: ", null)); - defn.getPieces().add(gen.new Piece(null, "todo", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Enable When: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"todo", null)); } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Value Set: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Value Set: ", null)); if (Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null) { @@ -530,13 +530,13 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerOption()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Options: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Options: ", null)); defn.getPieces().add(gen.new Piece(context.getDefinitionsTarget()+"#item."+i.getLinkId(), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), null)); } if (i.hasInitial()) { for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Initial Value: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Initial Value: ", null)); defn.getPieces().add(gen.new Piece(null, v.getValue().fhirType(), null)); defn.getPieces().add(gen.new Piece(null, " = ", null)); if (v.getValue().isPrimitive()) { @@ -564,26 +564,26 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Expressions: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Expressions: ", null)); Piece p = gen.new Piece("ul"); defn.getPieces().add(p); for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { - addExpression(p, e.getValueExpression(), "Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression")) { - addExpression(p, e.getValueExpression(), "Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext")) { - addExpression(p, e.getValueExpression(), "Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), /*!#*/"Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression")) { - addExpression(p, e.getValueExpression(), "Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression")) { - addExpression(p, e.getValueExpression(), "Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression")) { - addExpression(p, e.getValueExpression(), "Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); } } @@ -640,7 +640,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } p.span(null, "linkId: "+i.getLinkId()).tx(i.getText()); if (i.getRequired()) { - p.span("color: red", "Mandatory").tx("*"); + p.span("color: red", /*!#*/"Mandatory").tx("*"); } XhtmlNode input = null; @@ -719,39 +719,39 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (ToolingExtensions.readBoolExtension(i, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), "Can change the subject of the questionnaire").img(getImgPath("icon-qi-subject.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), /*!#*/"Can change the subject of the questionnaire").img(getImgPath("icon-qi-subject.png"), "icon"); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_HIDDEN)) { hasFlag = true; - flags.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "extension-questionnaire-hidden.html"), "Is a hidden item").img(getImgPath("icon-qi-hidden.png"), "icon"); + flags.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "extension-questionnaire-hidden.html"), /*!#*/"Is a hidden item").img(getImgPath("icon-qi-hidden.png"), "icon"); d.style("background-color: #eeeeee"); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_OTP_DISP)) { hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), "Is optional to display").img(getImgPath("icon-qi-optional.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), /*!#*/"Is optional to display").img(getImgPath("icon-qi-optional.png"), "icon"); } if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod")) { hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), "Is linked to an observation").img(getImgPath("icon-qi-observation.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), /*!#*/"Is linked to an observation").img(getImgPath("icon-qi-observation.png"), "icon"); } if (i.hasExtension(ToolingExtensions.EXT_Q_DISPLAY_CAT)) { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); hasFlag = true; - flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", "Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); + flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", /*!#*/"Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); } if (i.hasMaxLength()) { - item(ul, "Max Length", Integer.toString(i.getMaxLength())); + item(ul, /*!#*/"Max Length", Integer.toString(i.getMaxLength())); } if (i.hasDefinition()) { - genDefinitionLink(item(ul, "Definition"), i, q); + genDefinitionLink(item(ul, /*!#*/"Definition"), i, q); } if (i.hasEnableWhen()) { - item(ul, "Enable When", "todo"); + item(ul, /*!#*/"Enable When", "todo"); } if (i.hasAnswerValueSet()) { - XhtmlNode ans = item(ul, "Answers"); + XhtmlNode ans = item(ul, /*!#*/"Answers"); if (!Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null || !vs.hasWebPath()) { @@ -769,10 +769,10 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } } if (i.hasAnswerOption()) { - item(ul, "Answers", Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); + item(ul, /*!#*/"Answers", Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); } if (i.hasInitial()) { - XhtmlNode vi = item(ul, "Initial Values"); + XhtmlNode vi = item(ul, /*!#*/"Initial Values"); boolean first = true; for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (first) first = false; else vi.tx(", "); @@ -883,13 +883,13 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } public String display(Questionnaire q) throws UnsupportedEncodingException, IOException { - return "Questionnaire "+q.present(); + return /*!#*/"Questionnaire "+q.present(); } private boolean renderLinks(XhtmlNode x, Questionnaire q) { - x.para().tx("Try this questionnaire out:"); + x.para().tx(/*!#*/"Try this questionnaire out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } @@ -908,42 +908,42 @@ public class QuestionnaireRenderer extends TerminologyRenderer { XhtmlNode td = tbl.tr().td("structure").colspan("2").span(null, null).attribute("class", "self-link-parent"); td.an(q.getId()); td.img(getImgPath("icon_q_root.gif"), "icon"); - td.tx(" Questionnaire "); + td.tx(" "+/*!#*/"Questionnaire "); td.b().tx(q.getId()); // general information - defn(tbl, "URL", q.getUrl()); - defn(tbl, "Version", q.getVersion()); - defn(tbl, "Name", q.getName()); - defn(tbl, "Title", q.getTitle()); + defn(tbl, /*!#*/"URL", q.getUrl()); + defn(tbl, /*!#*/"Version", q.getVersion()); + defn(tbl, /*!#*/"Name", q.getName()); + defn(tbl, /*!#*/"Title", q.getTitle()); if (q.hasDerivedFrom()) { - td = defn(tbl, "Derived From"); + td = defn(tbl, /*!#*/"Derived From"); boolean first = true; for (CanonicalType c : q.getDerivedFrom()) { if (first) first = false; else td.tx(", "); td.tx(c.asStringValue()); // todo: make these a reference } } - defn(tbl, "Status", q.getStatus().getDisplay()); - defn(tbl, "Experimental", q.getExperimental()); - defn(tbl, "Publication Date", q.getDateElement().primitiveValue()); - defn(tbl, "Approval Date", q.getApprovalDateElement().primitiveValue()); - defn(tbl, "Last Review Date", q.getLastReviewDateElement().primitiveValue()); + defn(tbl, /*!#*/"Status", q.getStatus().getDisplay()); + defn(tbl, /*!#*/"Experimental", q.getExperimental()); + defn(tbl, /*!#*/"Publication Date", q.getDateElement().primitiveValue()); + defn(tbl, /*!#*/"Approval Date", q.getApprovalDateElement().primitiveValue()); + defn(tbl, /*!#*/"Last Review Date", q.getLastReviewDateElement().primitiveValue()); if (q.hasEffectivePeriod()) { - renderPeriod(defn(tbl, "Effective Period"), q.getEffectivePeriod()); + renderPeriod(defn(tbl, /*!#*/"Effective Period"), q.getEffectivePeriod()); } if (q.hasSubjectType()) { - td = defn(tbl, "Subject Type"); + td = defn(tbl, /*!#*/"Subject Type"); boolean first = true; for (CodeType c : q.getSubjectType()) { if (first) first = false; else td.tx(", "); td.tx(c.asStringValue()); } } - defn(tbl, "Description", q.getDescription()); - defn(tbl, "Purpose", q.getPurpose()); - defn(tbl, "Copyright", q.getCopyright()); + defn(tbl, /*!#*/"Description", q.getDescription()); + defn(tbl, /*!#*/"Purpose", q.getPurpose()); + defn(tbl, /*!#*/"Copyright", q.getCopyright()); if (q.hasCode()) { td = defn(tbl, Utilities.pluralize("Code", q.getCode().size())); boolean first = true; @@ -968,37 +968,37 @@ public class QuestionnaireRenderer extends TerminologyRenderer { td.b().tx(qi.getLinkId()); // general information - defn(tbl, "Link Id", qi.getLinkId()); - defn(tbl, "Prefix", qi.getPrefix()); - defn(tbl, "Text", qi.getText()); - defn(tbl, "Type", qi.getType().getDisplay()); - defn(tbl, "Required", qi.getRequired(), true); - defn(tbl, "Repeats", qi.getRepeats(), true); - defn(tbl, "Read Only", qi.getReadOnly(), false); + defn(tbl, /*!#*/"Link Id", qi.getLinkId()); + defn(tbl, /*!#*/"Prefix", qi.getPrefix()); + defn(tbl, /*!#*/"Text", qi.getText()); + defn(tbl, /*!#*/"Type", qi.getType().getDisplay()); + defn(tbl, /*!#*/"Required", qi.getRequired(), true); + defn(tbl, /*!#*/"Repeats", qi.getRepeats(), true); + defn(tbl, /*!#*/"Read Only", qi.getReadOnly(), false); if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { - defn(tbl, "Subject", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "This element changes who the subject of the question is", null); + defn(tbl, /*!#*/"Subject", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "This element changes who the subject of the question is", null); } // content control - defn(tbl, "Max Length", qi.getMaxLength()); + defn(tbl, /*!#*/"Max Length", qi.getMaxLength()); if (qi.hasAnswerValueSet()) { - defn(tbl, "Value Set", qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); + defn(tbl, /*!#*/"Value Set", qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); } if (qi.hasAnswerOption()) { XhtmlNode tr = tbl.tr(); - tr.td().tx("Allowed Answers"); + tr.td().tx(/*!#*/"Allowed Answers"); XhtmlNode ul = tr.td().ul(); for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { XhtmlNode li = ul.li(); render(li, ans.getValue()); if (ans.getInitialSelected()) { - li.tx(" (initially selected)"); + li.tx(" "+/*!#*/"(initially selected)"); } } } if (qi.hasInitial()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Initial Answer", qi.getInitial().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Initial Answer", qi.getInitial().size())); if (qi.getInitial().size() == 1) { render(tr.td(), qi.getInitialFirstRep().getValue()); } else { @@ -1017,20 +1017,20 @@ public class QuestionnaireRenderer extends TerminologyRenderer { render(tr.td(), qi.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValue()); } if (ToolingExtensions.readBoolExtension(qi, ToolingExtensions.EXT_Q_HIDDEN)) { - defn(tbl, "Hidden Item", ToolingExtensions.EXT_Q_DISPLAY_CAT, "This item is a hidden question", null); + defn(tbl, /*!#*/"Hidden Item", ToolingExtensions.EXT_Q_DISPLAY_CAT, "This item is a hidden question", null); } if (ToolingExtensions.readBoolExtension(qi, ToolingExtensions.EXT_Q_OTP_DISP)) { - defn(tbl, "Hidden Item", ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); + defn(tbl, /*!#*/"Hidden Item", ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); } // formal definitions if (qi.hasDefinition()) { - genDefinitionLink(defn(tbl, "Definition"), qi, q); + genDefinitionLink(defn(tbl, /*!#*/"Definition"), qi, q); } if (qi.hasCode()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Code", qi.getCode().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Code", qi.getCode().size())); XhtmlNode ul = tr.td().ul(); for (Coding c : qi.getCode()) { renderCodingWithDetails(ul.li(), c); @@ -1040,9 +1040,9 @@ public class QuestionnaireRenderer extends TerminologyRenderer { XhtmlNode tr = tbl.tr(); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, ToolingExtensions.EXT_O_LINK_PERIOD); if (sd != null && sd.hasWebPath()) { - tr.td().ah(sd.getWebPath()).tx("Observation Link Period"); + tr.td().ah(sd.getWebPath()).tx(/*!#*/"Observation Link Period"); } else { - tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx("Observation Link Period"); + tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx(/*!#*/"Observation Link Period"); } render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").getValue()); } @@ -1050,15 +1050,15 @@ public class QuestionnaireRenderer extends TerminologyRenderer { // dynamic management if (qi.hasEnableWhen()) { XhtmlNode tr = tbl.tr(); - tr.td().tx("Enable When"); + tr.td().tx(/*!#*/"Enable When"); td = tr.td(); if (qi.getEnableWhen().size() == 1) { renderEnableWhen(td, qi.getEnableWhen().get(0)); } else { if (qi.hasEnableBehavior()) { - td.tx(qi.getEnableBehavior().getDisplay()+" are true:"); + td.tx(qi.getEnableBehavior().getDisplay()+" "+/*!#*/"are true:"); } else { - td.tx("?? are true:"); + td.tx(/*!#*/"?? are true:"); } XhtmlNode ul = td.ul(); for (QuestionnaireItemEnableWhenComponent ew : qi.getEnableWhen()) { @@ -1083,11 +1083,11 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void defn(XhtmlNode tbl, String name, String url, Resource res) throws UnsupportedEncodingException, IOException { if (res != null && res.hasWebPath()) { - defn(tbl, "Definition", RendererFactory.factory(res, context).display(res), res.getWebPath()); + defn(tbl, /*!#*/"Definition", RendererFactory.factory(res, context).display(res), res.getWebPath()); } else if (Utilities.isAbsoluteUrlLinkable(url)) { - defn(tbl, "Definition", url, url); + defn(tbl, /*!#*/"Definition", url, url); } { - defn(tbl, "Definition", url); + defn(tbl, /*!#*/"Definition", url); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java index 88e371b8b..e1c68fcba 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java @@ -45,7 +45,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // case DEFNS: return renderDefns(x, q); case TREE: return renderTree(x, q); default: - throw new Error("Unknown QuestionnaireResponse Renderer Mode"); + throw new Error(/*!#*/"Unknown QuestionnaireResponse Renderer Mode"); } } @@ -57,7 +57,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // case DEFNS: return renderDefns(x, q); case TREE: return renderTree(x, qr); default: - throw new Error("Unknown QuestionnaireResponse Renderer Mode"); + throw new Error(/*!#*/"Unknown QuestionnaireResponse Renderer Mode"); } } @@ -71,10 +71,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Definition"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Answer"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Definition", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Answer", /*!#*/"The type of the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -98,10 +98,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Definition"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Answer"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Definition", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Answer", /*!#*/"The type of the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -120,10 +120,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { Row r = gen.new Row(); rows.add(r); - r.setIcon("icon_q_root.gif", "QuestionnaireResponseRoot"); + r.setIcon("icon_q_root.gif", /*!#*/"QuestionnaireResponseRoot"); r.getCells().add(gen.new Cell(null, null, q.getId(), null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell(null, null, "QuestionnaireResponse", null, null)); + r.getCells().add(gen.new Cell(null, null, /*!#*/"QuestionnaireResponse", null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); return r; } @@ -136,18 +136,18 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { String ref = b == null ? null : b.primitiveValue(); Questionnaire q = context.getContext().fetchResource(Questionnaire.class, ref); - r.setIcon("icon_q_root.gif", "QuestionnaireResponseRoot"); + r.setIcon("icon_q_root.gif", /*!#*/"QuestionnaireResponseRoot"); r.getCells().add(gen.new Cell(null, null, qr.getId(), null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); if (ref == null ) { r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", null, "None specified", null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", null, /*!#*/"None specified", null, null)); } else if (q == null || !q.hasWebPath()) { r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", null, ref, null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", null, ref, null, null)); } else{ r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", q.getWebPath(), q.present(), null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", q.getWebPath(), q.present(), null, null)); } return r; } @@ -168,9 +168,9 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { } } if (hasItem) { - r.setIcon("icon-q-group.png", "Group"); + r.setIcon("icon-q-group.png", /*!#*/"Group"); } else { - r.setIcon("icon-q-string.png", "Item"); + r.setIcon("icon-q-string.png", /*!#*/"Item"); } String linkId = i.has("linkId") ? i.get("linkId").primitiveValue() : "??"; String text = i.has("text") ? i.get("text").primitiveValue() : ""; @@ -235,9 +235,9 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { hasItem = a.hasItem(); } if (hasItem) { - r.setIcon("icon-q-group.png", "Group"); + r.setIcon("icon-q-group.png", /*!#*/"Group"); } else { - r.setIcon("icon-q-string.png", "Item"); + r.setIcon("icon-q-string.png", /*!#*/"Item"); } r.getCells().add(gen.new Cell(null, context.getDefinitionsTarget() == null ? "" : context.getDefinitionsTarget()+"#item."+i.getLinkId(), i.getLinkId(), null, null)); r.getCells().add(gen.new Cell(null, null, i.getText(), null, null)); @@ -327,7 +327,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { public boolean renderForm(XhtmlNode x, ResourceWrapper q) throws UnsupportedEncodingException, IOException { boolean hasExt = false; XhtmlNode d = x.div(); - d.tx("todo"); + d.tx(/*!#*/"todo"); // boolean hasPrefix = false; // for (QuestionnaireItemComponent c : q.getItem()) { // hasPrefix = hasPrefix || doesItemHavePrefix(c); @@ -370,7 +370,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // p.span(null, "linkId: "+i.getLinkId()).tx(i.getText()); // if (i.getRequired()) { -// p.span("color: red", "Mandatory").tx("*"); +// p.span("color: red", /*!#*/"Mandatory").tx("*"); // } // // XhtmlNode input = null; @@ -605,16 +605,16 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // private boolean renderLinks(XhtmlNode x, QuestionnaireResponse q) { - x.para().tx("Try this QuestionnaireResponse out:"); + x.para().tx(/*!#*/"Try this QuestionnaireResponse out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } private boolean renderLinks(XhtmlNode x, ResourceWrapper q) { - x.para().tx("Try this QuestionnaireResponse out:"); + x.para().tx(/*!#*/"Try this QuestionnaireResponse out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } @@ -711,13 +711,13 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // if (qi.hasAnswerOption()) { // XhtmlNode tr = tbl.tr(); -// tr.td().tx("Allowed Answers"); +// tr.td().tx(/*!#*/"Allowed Answers"); // XhtmlNode ul = tr.td().ul(); // for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { // XhtmlNode li = ul.li(); // render(li, ans.getValue()); // if (ans.getInitialSelected()) { -// li.tx(" (initially selected)"); +// li.tx(/*!#*/" (initially selected)"); // } // } // } @@ -738,7 +738,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // // appearance // if (qi.hasExtension(" http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory")) { // XhtmlNode tr = tbl.tr(); -// tr.td().ah("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").tx("Display Category"); +// tr.td().ah("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").tx(/*!#*/"Display Category"); // render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").getValue()); // } // if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-hidden")) { @@ -763,14 +763,14 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // if (qi.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod")) { // XhtmlNode tr = tbl.tr(); -// tr.td().ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").tx("Observation Link Period"); +// tr.td().ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").tx(/*!#*/"Observation Link Period"); // render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").getValue()); // } // // // dynamic management // if (qi.hasEnableWhen()) { // XhtmlNode tr = tbl.tr(); -// tr.td().tx("Enable When"); +// tr.td().tx(/*!#*/"Enable When"); // td = tr.td(); // if (qi.getEnableWhen().size() == 1) { // renderEnableWhen(td, qi.getEnableWhen().get(0)); @@ -876,12 +876,12 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { @Override public String display(Resource r) throws UnsupportedEncodingException, IOException { - return "todo"; + return /*!#*/"todo"; } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java index 51ee0ad6b..cff967a4b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java @@ -55,7 +55,7 @@ public class Renderer { public void genStandardsStatus(XhtmlNode td, StandardsStatus ss) { if (ss != null) { td.tx(" "); - XhtmlNode a = td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "versions.html#std-process"), "Standards Status = "+ss.toDisplay()); + XhtmlNode a = td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "versions.html#std-process"), /*!#*/"Standards Status = "+ss.toDisplay()); a.style("padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold; color: black; background-color: "+ss.getColor()); a.tx(ss.getAbbrev()); } @@ -72,21 +72,21 @@ public class Renderer { switch (vca.getType()) { case Added: XhtmlNode spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - XhtmlNode spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+context.getChangeVersion()); + XhtmlNode spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+context.getChangeVersion()); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added:"); + spanInner.tx(" "+/*!#*/"Added:"); return spanOuter; case Changed: spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed:"); + spanInner.tx(" "+/*!#*/"Changed:"); return spanOuter; case Deleted: spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed:"); + spanInner.tx(" "+/*!#*/"Removed:"); return spanOuter.strikethrough(); default: return x; @@ -104,21 +104,21 @@ public class Renderer { switch (vca.getType()) { case Added: XhtmlNode divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - XhtmlNode spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+context.getChangeVersion()); + XhtmlNode spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+context.getChangeVersion()); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added:"); + spanInner.tx(" "+/*!#*/"Added:"); return divOuter; case Changed: divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+(vca.getOriginal())+"')" : "")); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+(vca.getOriginal())+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed:"); + spanInner.tx(" "+/*!#*/"Changed:"); return divOuter; case Deleted: divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed:"); + spanInner.tx(" "+/*!#*/"Removed:"); return divOuter.strikethrough(); default: return x; @@ -140,27 +140,27 @@ public class Renderer { tr.style("border: solid 1px #dddddd; margin: 2px; padding: 2px"); } XhtmlNode td = tr.td(); - XhtmlNode span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been added since "+context.getChangeVersion()); + XhtmlNode span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px",/*!#*/"This row of content has been added since "+context.getChangeVersion()); span.img("icon-change-add.png", "icon"); - span.tx(" Added:"); + span.tx(" "+/*!#*/"Added:"); XhtmlNode x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been added since "+context.getChangeVersion()).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This row of content has been added since "+context.getChangeVersion()).tx(" "); tr.styleCells(x); return td; case Changed: td = tr.td(); - span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been changed since"+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This row of content has been changed since"+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); span.img("icon-change-edit.png", "icon"); - span.tx(" Changed:"); + span.tx(" "+/*!#*/"Changed:"); return td; case Deleted: tr.style("text-decoration: line-through"); td = tr.td(); - span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); span.img("icon-change-remove.png", "icon"); - span.tx(" Removed:"); + span.tx(" "+/*!#*/"Removed:"); x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", "This row of content has been added since "+context.getChangeVersion()).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", /*!#*/"This row of content has been added since "+context.getChangeVersion()).tx(" "); tr.styleCells(x); return td; default: @@ -173,24 +173,24 @@ public class Renderer { VersionComparisonAnnotation self = (VersionComparisonAnnotation) base.getUserData(VersionComparisonAnnotation.USER_DATA_NAME); switch (self.getType()) { case Added: - XhtmlNode spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+version); + XhtmlNode spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+version); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added"); + spanInner.tx(" "+/*!#*/"Added"); return; case Changed: if (self.getComp().noChangeOtherThanMetadata(metadataFields)) { x.span("color: #eeeeee").tx("n/c"); return; } else { - spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+version+(self.getOriginal() != null ? " (was '"+(self.getOriginal())+"')" : "")); + spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+version+(self.getOriginal() != null ? " (was '"+(self.getOriginal())+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed"); + spanInner.tx(" "+/*!#*/"Changed"); } return; case Deleted: - spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+version); + spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+version); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed"); + spanInner.tx(" "+/*!#*/"Removed"); return; default: x.span("color: #eeeeee").tx("n/c"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java index 63b8fb42e..aa91936a7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java @@ -43,14 +43,14 @@ public class RequirementsRenderer extends ResourceRenderer { if (req.getActor().size() == 1) { ActorDefinition acd = context.getWorker().fetchResource(ActorDefinition.class, req.getActor().get(0).getValue(), req); XhtmlNode p = x.para(); - p.tx("These requirements apply to the actor "); + p.tx(/*!#*/"These requirements apply to the actor "); if (acd == null) { p.code(req.getActor().get(0).getValue()); } else { p.ah(acd.getWebPath()).tx(acd.present()); } } else { - x.para().tx("These requirements apply to the following actors:"); + x.para().tx(/*!#*/"These requirements apply to the following actors:"); XhtmlNode ul = x.ul(); for (CanonicalType a : req.getActor()) { ActorDefinition acd = context.getWorker().fetchResource(ActorDefinition.class, a.getValue(), req); @@ -66,14 +66,14 @@ public class RequirementsRenderer extends ResourceRenderer { if (req.getDerivedFrom().size() == 1) { Requirements reqd = context.getWorker().fetchResource(Requirements.class, req.getDerivedFrom().get(0).getValue(), req); XhtmlNode p = x.para(); - p.tx("These requirements derive from "); + p.tx(/*!#*/"These requirements derive from "); if (reqd == null) { p.code(req.getDerivedFrom().get(0).getValue()); } else { p.ah(reqd.getWebPath()).tx(reqd.present()); } } else { - x.para().tx("These requirements are derived from the following requirements:"); + x.para().tx(/*!#*/"These requirements are derived from the following requirements:"); XhtmlNode ul = x.ul(); for (CanonicalType a : req.getDerivedFrom()) { Requirements reqd = context.getWorker().fetchResource(Requirements.class, a.getValue(), req); @@ -87,7 +87,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (req.hasReference()) { XhtmlNode p = x.para(); - p.tx("References: "); + p.tx(/*!#*/"References: "); int i = 0; for (UrlType c : req.getReference()) { i++; @@ -121,11 +121,11 @@ public class RequirementsRenderer extends ResourceRenderer { td = tr.td(); addMarkdown(td, stmt.getRequirement()); if (stmt.hasDerivedFrom() || stmt.hasSatisfiedBy() || stmt.hasReference() || stmt.hasSource()) { - td.para().tx("Links:"); + td.para().tx(/*!#*/"Links:"); XhtmlNode ul = td.ul(); if (stmt.hasDerivedFrom()) { XhtmlNode li = ul.li(); - li.tx("Derived From: "); + li.tx(/*!#*/"Derived From: "); String url = stmt.getDerivedFrom(); String key = url.contains("#") ? url.substring(url.indexOf("#")+1) : ""; if (url.contains("#")) { url = url.substring(0, url.indexOf("#")); }; @@ -143,7 +143,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasSatisfiedBy()) { XhtmlNode li = ul.li(); - li.tx("Satisfied By: "); + li.tx(/*!#*/"Satisfied By: "); first = true; for (UrlType c : stmt.getSatisfiedBy()) { if (first) first = false; else li.tx(", "); @@ -162,7 +162,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasReference()) { XhtmlNode li = ul.li(); - li.tx("References: "); + li.tx(/*!#*/"References: "); int i = 0; for (UrlType c : stmt.getReference()) { i++; @@ -176,7 +176,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasSource()) { XhtmlNode li = ul.li(); - li.tx("Source: "); + li.tx(/*!#*/"Source: "); first = true; for (Reference c : stmt.getSource()) { if (first) first = false; else li.tx(", "); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java index e6030d871..684833bfb 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java @@ -210,11 +210,11 @@ public abstract class ResourceRenderer extends DataRenderer { CanonicalResource cr = (CanonicalResource) target; if (url.contains("|")) { if (target.hasWebPath()) { - x.ah(target.getWebPath()).tx(cr.present()+" (version "+cr.getVersion()+")"); + x.ah(target.getWebPath()).tx(cr.present()+/*!#*/" (version "+cr.getVersion()+")"); } else { url = url.substring(0, url.indexOf("|")); x.code().tx(url); - x.tx(": "+cr.present()+" (version "+cr.getVersion()+")"); + x.tx(": "+cr.present()+/*!#*/" (version "+cr.getVersion()+")"); } } else { if (target.hasWebPath()) { @@ -282,14 +282,14 @@ public abstract class ResourceRenderer extends DataRenderer { if (tr != null && tr.getReference() != null) { link = tr.getReference(); } else if (r.getReference().contains("?")) { - text.append("Conditional Reference: "); + text.append(/*!#*/"Conditional Reference: "); } else { link = r.getReference(); } } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { - text.append("See above ("); + text.append(/*!#*/"See above ("); } // what to display: if text is provided, then that. if the reference was resolved, then show the name, or the generated narrative String display = r.hasDisplayElement() ? r.getDisplay() : null; @@ -333,7 +333,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { text.append(name); } else { - text.append(". Description: (todo)"); + text.append(/*!#*/". Description: (todo)"); } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { @@ -356,7 +356,7 @@ public abstract class ResourceRenderer extends DataRenderer { if (tr != null && tr.getReference() != null) { c = x.ah(tr.getReference()); } else if (r.getReference().contains("?")) { - x.tx("Conditional Reference: "); + x.tx(/*!#*/"Conditional Reference: "); c = x.code(""); } else { c = x.ah(r.getReference()); @@ -370,7 +370,7 @@ public abstract class ResourceRenderer extends DataRenderer { c = x.span(null, null); } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { - c.tx("See above ("); + c.tx(/*!#*/"See above ("); } // what to display: if text is provided, then that. if the reference was resolved, then show the name, or the generated narrative String display = r.hasDisplayElement() ? r.getDisplay() : null; @@ -414,7 +414,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { c.addText(name); } else { - c.tx(". Generated Summary: "); + c.tx(/*!#*/". Generated Summary: "); if (tr != null) { new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, r.getReference().startsWith("#"), true); } @@ -446,7 +446,7 @@ public abstract class ResourceRenderer extends DataRenderer { if (r.has("display")) { c.addText(r.get("display").primitiveValue()); if (tr != null && tr.getResource() != null) { - c.tx(". Generated Summary: "); + c.tx(/*!#*/". Generated Summary: "); new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, v.startsWith("#"), false); } } else if (tr != null && tr.getResource() != null) { @@ -530,7 +530,7 @@ public abstract class ResourceRenderer extends DataRenderer { } public String displayReference(Resource res, Reference r) throws UnsupportedEncodingException, IOException { - return "todo"; + return /*!#*/"todo"; } @@ -575,10 +575,10 @@ public abstract class ResourceRenderer extends DataRenderer { protected String describeStatus(PublicationStatus status, boolean experimental) { switch (status) { - case ACTIVE: return experimental ? "Experimental" : "Active"; - case DRAFT: return "draft"; - case RETIRED: return "retired"; - default: return "Unknown"; + case ACTIVE: return experimental ? /*!#*/"Experimental" : /*!#*/"Active"; + case DRAFT: return /*!#*/"draft"; + case RETIRED: return /*!#*/"retired"; + default: return /*!#*/"Unknown"; } } @@ -624,35 +624,35 @@ public abstract class ResourceRenderer extends DataRenderer { if (id != null || lang != null || versionId != null || lastUpdated != null) { XhtmlNode p = plateStyle(div.para()); - p.tx("Resource "); + p.tx(/*!#*/"Resource "); p.tx(r.fhirType()); p.tx(" "); if (id != null) { p.tx("\""+id+"\" "); } if (versionId != null) { - p.tx("Version \""+versionId+"\" "); + p.tx(/*!#*/"Version \""+versionId+"\" "); } if (lastUpdated != null) { - p.tx("Updated \""); + p.tx(/*!#*/"Updated \""); renderDateTime(p, lastUpdated); p.tx("\" "); } if (lang != null) { - p.tx(" (Language \""+lang+"\") "); + p.tx(/*!#*/" (Language \""+lang+"\") "); } } if (ir != null) { - plateStyle(div.para()).b().tx("Special rules apply: "+ir+"!"); + plateStyle(div.para()).b().tx(/*!#*/"Special rules apply: "+ir+"!"); } if (source != null) { - plateStyle(div.para()).tx("Information Source: "+source+"!"); + plateStyle(div.para()).tx(/*!#*/"Information Source: "+source+"!"); } if (meta != null) { PropertyWrapper pl = meta.getChildByName("profile"); if (pl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Profile", pl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Profile", pl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : pl.getValues()) { if (first) first = false; else p.tx(", "); @@ -662,7 +662,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper tl = meta.getChildByName("tag"); if (tl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Tag", tl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Tag", tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : tl.getValues()) { if (first) first = false; else p.tx(", "); @@ -676,7 +676,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper sl = meta.getChildByName("security"); if (sl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Security Label", tl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Security Label", tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : sl.getValues()) { if (first) first = false; else p.tx(", "); @@ -708,7 +708,7 @@ public abstract class ResourceRenderer extends DataRenderer { render(dr); } catch (Exception e) { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.para().tx("Error rendering: "+e.getMessage()); + x.para().tx(/*!#*/"Error rendering: "+e.getMessage()); dr.setText(null); inject(dr, x, NarrativeStatus.GENERATED); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java index d7c9b260e..8e49aa4e4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java @@ -47,7 +47,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { genStandardsStatus(h2, ss); } XhtmlNode p = x.para(); - p.tx("Parameter "); + p.tx(/*!#*/"Parameter "); p.code().tx(spd.getCode()); p.tx(":"); p.code().tx(spd.getType().toCode()); @@ -55,7 +55,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Resource", spd.getBase().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Resource", spd.getBase().size())); XhtmlNode td = tr.td(); for (Enumeration t : spd.getBase()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(t.getCode()); @@ -68,23 +68,23 @@ public class SearchParameterRenderer extends TerminologyRenderer { } } tr = tbl.tr(); - tr.td().tx("Expression"); + tr.td().tx(/*!#*/"Expression"); if (spd.hasExpression()) { tr.td().code().tx(spd.getExpression()); } else { - tr.td().tx("(none)"); + tr.td().tx(/*!#*/"(none)"); } if (spd.hasProcessingMode()) { tr = tbl.tr(); - tr.td().tx("Processing Mode"); + tr.td().tx(/*!#*/"Processing Mode"); tr.td().tx(spd.getProcessingMode().getDisplay()); } if (spd.hasTarget()) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Target Resources", spd.getTarget().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Target Resources", spd.getTarget().size())); td = tr.td(); if (isAllConcreteResources(spd.getTarget())) { - td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx("All Resources"); + td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx(/*!#*/"All Resources"); } else { for (Enumeration t : spd.getTarget()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(t.getCode()); @@ -99,28 +99,28 @@ public class SearchParameterRenderer extends TerminologyRenderer { } } tr = tbl.tr(); - tr.td().tx("Multiples"); + tr.td().tx(/*!#*/"Multiples"); XhtmlNode ul = tr.td().ul(); if (!spd.hasMultipleAnd()) { - ul.li().tx("multipleAnd: It's up to the server whether the parameter may repeat in order to specify multiple values that must all be true"); + ul.li().tx(/*!#*/"multipleAnd: It's up to the server whether the parameter may repeat in order to specify multiple values that must all be true"); } else if (spd.getMultipleAnd()) { - ul.li().tx("multipleAnd: The parameter may repeat in order to specify multiple values that must all be true"); + ul.li().tx(/*!#*/"multipleAnd: The parameter may repeat in order to specify multiple values that must all be true"); } else { - ul.li().tx("multipleAnd: The parameter may only appear once"); + ul.li().tx(/*!#*/"multipleAnd: The parameter may only appear once"); } if (!spd.hasMultipleOr()) { - ul.li().tx("multipleOr: It's up to the server whether the parameter can have multiple values (separated by comma) where at least one must be true"); + ul.li().tx(/*!#*/"multipleOr: It's up to the server whether the parameter can have multiple values (separated by comma) where at least one must be true"); } else if (spd.getMultipleOr()) { - ul.li().tx("multipleOr: The parameter may have multiple values (separated by comma) where at least one must be true"); + ul.li().tx(/*!#*/"multipleOr: The parameter may have multiple values (separated by comma) where at least one must be true"); } else { - ul.li().tx("multipleOr: The parameter may only have one value (no comma separators)"); + ul.li().tx(/*!#*/"multipleOr: The parameter may only have one value (no comma separators)"); } if (spd.hasComparator()) { tr = tbl.tr(); - tr.td().tx("Comparators"); + tr.td().tx(/*!#*/"Comparators"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (Enumeration t : spd.getComparator()) { td.sep(", "); td.tx(t.asStringValue()); @@ -128,9 +128,9 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasModifier()) { tr = tbl.tr(); - tr.td().tx("Modifiers"); + tr.td().tx(/*!#*/"Modifiers"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (Enumeration t : spd.getModifier()) { td.sep(", "); td.tx(t.asStringValue()); @@ -138,9 +138,9 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasChain()) { tr = tbl.tr(); - tr.td().tx("Chains"); + tr.td().tx(/*!#*/"Chains"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (StringType t : spd.getChain()) { td.sep(", "); td.tx(t.asStringValue()); @@ -148,7 +148,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasComponent()) { - x.para().b().tx("Components"); + x.para().b().tx(/*!#*/"Components"); tbl = x.table("grid"); for (SearchParameterComponentComponent t : spd.getComponent()) { tr = tbl.tr(); @@ -167,7 +167,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { private boolean isAllConcreteResources(List> list) { for (String s : context.getWorker().getResourceNames()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(s); - if (!sd.getAbstract() && !Utilities.existsInList(sd.getType(), "Parameters")) { + if (!sd.getAbstract() && !Utilities.existsInList(sd.getType(), /*!#*/"Parameters")) { boolean found = false; for (Enumeration c : list) { found = found || sd.getName().equals(c.getCode()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java index 64104e043..b8a47194d 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java @@ -217,7 +217,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public void renderDetails(XhtmlNode f) { f = renderStatus(value, f); - f.b().attribute("title", "Formal Invariant Identifier").tx(value.getKey()); + f.b().attribute("title", /*!#*/"Formal Invariant Identifier").tx(value.getKey()); f.tx(": "); if (value.hasHuman()) { renderStatus(value.getHumanElement(), f).tx(value.getHuman()); @@ -491,7 +491,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!url.equals(source.getUrl())) { source = context.getWorker().fetchResource(StructureDefinition.class, url, source); if (source == null) { - throw new FHIRException("Unable to resolve StructureDefinition "+url+" resolving content reference "+contentReference); + throw new FHIRException(/*!#*/"Unable to resolve StructureDefinition "+url+" resolving content reference "+contentReference); } elements = source.getSnapshot().getElement(); } @@ -504,7 +504,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return new ElementInStructure(source, ed); } } - throw new Error("getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl()); + throw new Error(/*!#*/"getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl()); // return null; } @@ -573,7 +573,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model = gen.initNormalTable(corePath, false, true, profile.getId()+(diff ? "d" : "s"), rc.getRules() == GenerationRules.IG_PUBLISHER, rc.getRules() == GenerationRules.IG_PUBLISHER ? TableGenerationMode.XHTML : TableGenerationMode.XML); break; default: - throw new Error("Unknown structure mode"); + throw new Error(/*!#*/"Unknown structure mode"); } List profiles = new ArrayList(); @@ -592,37 +592,37 @@ public class StructureDefinitionRenderer extends ResourceRenderer { Set cols = new HashSet<>(); scanBindings(cols, list, list.get(0)); if (cols.contains("required")) { - columns.add(new Column("required", "Required", "Concepts must come from this value set")); + columns.add(new Column("required", /*!#*/"Required", /*!#*/"Concepts must come from this value set")); } if (cols.contains("extensible")) { - columns.add(new Column("extensible", "Extensible", "Concepts must come from this value set if an appropriate concept is in the value set ")); + columns.add(new Column("extensible", /*!#*/"Extensible", /*!#*/"Concepts must come from this value set if an appropriate concept is in the value set ")); } if (cols.contains("maximum")) { - columns.add(new Column("maximum", "Maximum", "A required binding for additional codes, for use when the binding strength is 'extensible' or 'preferred'")); + columns.add(new Column("maximum", /*!#*/"Maximum", /*!#*/"A required binding for additional codes, for use when the binding strength is 'extensible' or 'preferred'")); } if (cols.contains("minimum")) { - columns.add(new Column("minimum", "Minimum", "The minimum allowable value set - any conformant system SHALL support all these codes")); + columns.add(new Column("minimum", /*!#*/"Minimum", /*!#*/"The minimum allowable value set - any conformant system SHALL support all these codes")); } if (cols.contains("candidate")) { - columns.add(new Column("candidate", "Candidate", "This value set is a candidate to substitute for the overall conformance value set in some situations; usually these are defined in the documentation")); + columns.add(new Column("candidate", /*!#*/"Candidate", /*!#*/"This value set is a candidate to substitute for the overall conformance value set in some situations; usually these are defined in the documentation")); } if (cols.contains("current")) { - columns.add(new Column("current", "Current", "New records are required to use this value set, but legacy records may use other codes. The definition of 'new record' is difficult, since systems often create new records based on pre-existing data. Usually 'current' bindings are mandated by an external authority that makes clear rules around this")); + columns.add(new Column("current", /*!#*/"Current", /*!#*/"New records are required to use this value set, but legacy records may use other codes. The definition of 'new record' is difficult, since systems often create new records based on pre-existing data. Usually 'current' bindings are mandated by an external authority that makes clear rules around this")); } if (cols.contains("preferred")) { - columns.add(new Column("preferred", "Preferred", "This is the value set that is preferred in a given context (documentation should explain why)")); + columns.add(new Column("preferred", /*!#*/"Preferred", /*!#*/"This is the value set that is preferred in a given context (documentation should explain why)")); } if (cols.contains("ui")) { - columns.add(new Column("ui", "UI", "This value set is provided for user look up in a given context. Typically, these valuesets only include a subset of codes relevant for input in a context")); + columns.add(new Column("ui", /*!#*/"UI", /*!#*/"This value set is provided for user look up in a given context. Typically, these valuesets only include a subset of codes relevant for input in a context")); } if (cols.contains("starter")) { - columns.add(new Column("starter", "Starter", "This value set is a good set of codes to start with when designing your system")); + columns.add(new Column("starter", /*!#*/"Starter", /*!#*/"This value set is a good set of codes to start with when designing your system")); } if (cols.contains("component")) { - columns.add(new Column("component", "Component", "This value set is a component of the base value set. Usually this is called out so that documentation can be written about a portion of the value set")); + columns.add(new Column("component", /*!#*/"Component", /*!#*/"This value set is a component of the base value set. Usually this is called out so that documentation can be written about a portion of the value set")); } if (cols.contains("example")) { - columns.add(new Column("example", "Example", "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included.")); + columns.add(new Column("example", /*!#*/"Example", /*!#*/"Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included.")); } } @@ -631,16 +631,16 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (ed.getBinding().hasValueSet() && ed.getBinding().hasStrength()) { switch (ed.getBinding().getStrength()) { case EXAMPLE: - cols.add("example"); + cols.add(/*!#*/"example"); break; case EXTENSIBLE: - cols.add("extensible"); + cols.add(/*!#*/"extensible"); break; case PREFERRED: - cols.add("preferred"); + cols.add(/*!#*/"preferred"); break; case REQUIRED: - cols.add("required"); + cols.add(/*!#*/"required"); break; default: break; @@ -665,15 +665,15 @@ public class StructureDefinitionRenderer extends ResourceRenderer { scanObligations(cols, list, list.get(0)); if (cols.contains("$all")) { - columns.add(new Column("$all", "All Actors", "Obligations that apply to all actors")); + columns.add(new Column("$all", /*!#*/"All Actors", /*!#*/"Obligations that apply to all actors")); } for (String col : cols) { if (!"$all".equals(col)) { ActorDefinition actor = context.getWorker().fetchResource(ActorDefinition.class, col); if (actor == null) { - columns.add(new Column(col, tail(col), "Obligations that apply to the undefined actor "+col, col)); + columns.add(new Column(col, tail(col), /*!#*/"Obligations that apply to the undefined actor "+col, col)); } else { - columns.add(new Column(col, actor.getName(), "Obligations that apply to the actor "+actor.present(), actor.getWebPath())); + columns.add(new Column(col, actor.getName(), /*!#*/"Obligations that apply to the actor "+actor.present(), actor.getWebPath())); } } } @@ -706,9 +706,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views")); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (/*!#*/"Name"), (/*!#*/"The logical name of the element"), null, 0)); for (Column col : columns) { - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", col.title), translate("sd.hint", col.hint), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (/*!#*/col.title), (/*!#*/col.hint), null, 0)); } return model; } @@ -847,7 +847,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); hrow.setIcon("icon_element.gif", HierarchicalTableGenerator.TEXT_ICON_ELEMENT); - hrow.getCells().add(gen.new Cell(null, null, sName+":All Slices", "", null)); + hrow.getCells().add(gen.new Cell(null, null, sName+/*!#*/":All Slices", "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -859,7 +859,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); - hrow.getCells().add(gen.new Cell(null, null, "Content/Rules for all slices", "", null)); + hrow.getCells().add(gen.new Cell(null, null, /*!#*/"Content/Rules for all slices", "", null)); break; } row.getSubRows().add(hrow); @@ -872,7 +872,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); hrow.setIcon("icon_element.gif", HierarchicalTableGenerator.TEXT_ICON_ELEMENT); - hrow.getCells().add(gen.new Cell(null, null, sName+":All Types", "", null)); + hrow.getCells().add(gen.new Cell(null, null, sName+/*!#*/":All Types", "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -884,7 +884,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); - hrow.getCells().add(gen.new Cell(null, null, "Content/Rules for all Types", "", null)); + hrow.getCells().add(gen.new Cell(null, null, /*!#*/"Content/Rules for all Types", "", null)); } row.getSubRows().add(hrow); row = hrow; @@ -1011,13 +1011,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String imagePath, boolean root, boolean logicalModel, boolean allInvariants, StructureDefinition profile, Row typesRow, Row row, boolean hasDef, boolean ext, UnusedTracker used, String ref, String sName, List elements) throws IOException { String hint = ""; - hint = checkAdd(hint, (element.hasSliceName() ? translate("sd.table", "Slice")+" "+element.getSliceName() : "")); + hint = checkAdd(hint, (element.hasSliceName() ? (/*!#*/"Slice")+" "+element.getSliceName() : "")); if (hasDef && element.hasDefinition()) { hint = checkAdd(hint, (hasDef && element.hasSliceName() ? ": " : "")); hint = checkAdd(hint, !hasDef ? null : gt(element.getDefinitionElement())); } if (element.hasSlicing() && slicesExist(elements, element)) { // some elements set up slicing but don't actually slice, so we don't augment the name - sName = "Slices for "+sName; + sName = /*!#*/"Slices for "+sName; } Cell left = gen.new Cell(null, ref, sName, hint, null); row.getCells().add(left); @@ -1032,32 +1032,32 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(gc); res.add(gc); if (element != null && element.getIsModifier()) { - checkForNoChange(element.getIsModifierElement(), gc.addStyledText(translate("sd.table", "This element is a modifier element"), "?!", null, null, null, false)); + checkForNoChange(element.getIsModifierElement(), gc.addStyledText((/*!#*/"This element is a modifier element"), "?!", null, null, null, false)); } if (element != null) { if (element.getMustSupport() && element.hasExtension(ToolingExtensions.EXT_OBLIGATION_CORE, ToolingExtensions.EXT_OBLIGATION_TOOLS)) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element has obligations and must be supported"), "SO", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element has obligations and must be supported"), "SO", "white", "red", null, false)); } else if (element.getMustSupport()) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element must be supported"), "S", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element must be supported"), "S", "white", "red", null, false)); } else if (element != null && element.hasExtension(ToolingExtensions.EXT_OBLIGATION_CORE, ToolingExtensions.EXT_OBLIGATION_TOOLS)) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element has obligations"), "O", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element has obligations"), "O", "white", "red", null, false)); } } if (element != null && element.getIsSummary()) { - checkForNoChange(element.getIsSummaryElement(), gc.addStyledText(translate("sd.table", "This element is included in summaries"), "\u03A3", null, null, null, false)); + checkForNoChange(element.getIsSummaryElement(), gc.addStyledText((/*!#*/"This element is included in summaries"), "\u03A3", null, null, null, false)); } if (element != null && element.getMustHaveValue()) { - checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText(translate("sd.table", "This primitive element must have a value"), "V", "maroon", null, null, true)); + checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText((/*!#*/"This primitive element must have a value"), "V", "maroon", null, null, true)); } if (element != null && (hasNonBaseConstraints(element.getConstraint()) || hasNonBaseConditions(element.getCondition()))) { Piece p = gc.addText(CONSTRAINT_CHAR); - p.setHint(translate("sd.table", "This element has or is affected by constraints ("+listConstraintsAndConditions(element)+")")); + p.setHint((/*!#*/"This element has or is affected by constraints ("+listConstraintsAndConditions(element)+")")); p.addStyle(CONSTRAINT_STYLE); p.setReference(Utilities.pathURL(VersionUtilities.getSpecUrl(context.getWorker().getVersion()), "conformance-rules.html#constraints")); } if (element != null && element.hasExtension(ToolingExtensions.EXT_STANDARDS_STATUS)) { StandardsStatus ss = StandardsStatus.fromCode(element.getExtensionString(ToolingExtensions.EXT_STANDARDS_STATUS)); - gc.addStyledText("Standards Status = "+ss.toDisplay(), ss.getAbbrev(), "black", ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); + gc.addStyledText(/*!#*/"Standards Status = "+ss.toDisplay(), ss.getAbbrev(), "black", ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); } ExtensionContext extDefn = null; @@ -1074,14 +1074,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String name = element.hasSliceName() ? element.getSliceName() : urltail(eurl); nameCell.getPieces().get(0).setText(name); // left.getPieces().get(0).setReference((String) extDefn.getExtensionStructure().getTag("filename")); - nameCell.getPieces().get(0).setHint(translate("sd.table", "Extension URL")+" = "+extDefn.getUrl()); + nameCell.getPieces().get(0).setHint((/*!#*/"Extension URL")+" = "+extDefn.getUrl()); res.add(genCardinality(gen, element, row, hasDef, used, extDefn.getElement())); ElementDefinition valueDefn = extDefn.getExtensionValueDefinition(); if (valueDefn != null && !"0".equals(valueDefn.getMax())) res.add(genTypes(gen, row, valueDefn, profileBaseFileName, profile, corePath, imagePath, root, mustSupport)); else // if it's complex, we just call it nothing // genTypes(gen, row, extDefn.getSnapshot().getElement().get(0), profileBaseFileName, profile); - res.add(addCell(row, gen.new Cell(null, null, "("+translate("sd.table", "Complex")+")", null, null))); + res.add(addCell(row, gen.new Cell(null, null, "("+(/*!#*/"Complex")+")", null, null))); res.add(generateDescription(gen, row, element, extDefn.getElement(), used.used, null, extDefn.getUrl(), profile, corePath, imagePath, root, logicalModel, allInvariants, valueDefn, snapshot, mustSupport, allowSubRows, rc)); } } else { @@ -1134,9 +1134,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) { String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_EMPTY); if ("present".equals(code)) { - hint = "This element is present as a JSON Array even when there are no items in the instance"; + hint = /*!#*/"This element is present as a JSON Array even when there are no items in the instance"; } else { - hint = "This element may be present as a JSON Array even when there are no items in the instance"; + hint = /*!#*/"This element may be present as a JSON Array even when there are no items in the instance"; } } } @@ -1199,7 +1199,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.setColor(context.getProfileUtilities().getRowColor(parent, isConstraintMode)); row.setLineColor(1); row.setIcon("icon_choice.gif", HierarchicalTableGenerator.TEXT_ICON_CHOICE); - row.getCells().add(gen.new Cell(null, null, "(Choice of one)", "", null)); + row.getCells().add(gen.new Cell(null, null, /*!#*/"(Choice of one)", "", null)); row.getCells().add(gen.new Cell()); row.getCells().add(gen.new Cell(null, null, (grp.isMandatory() ? "1" : "0")+"..1", "", null)); row.getCells().add(gen.new Cell()); @@ -1266,18 +1266,18 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (used) { if (logicalModel && ToolingExtensions.hasAnyOfExtensions(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (root) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } else if (!root && ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) && !ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED).equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } } if (root) { if (profile != null && profile.getAbstract()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "This is an abstract "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"This is an abstract "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); List children = new ArrayList<>(); for (StructureDefinition sd : context.getWorker().fetchResourcesByType(StructureDefinition.class)) { @@ -1286,7 +1286,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } if (!children.isEmpty()) { - c.addPiece(gen.new Piece(null, "Child "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profiles" : "types")+": ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"Child "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profiles" : "types")+": ", null)); boolean first = true; for (StructureDefinition sd : children) { if (first) first = false; else c.addPiece(gen.new Piece(null, ", ", null)); @@ -1299,7 +1299,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { getAncestorElements(profile, ancestors); if (ancestors.size() > 0) { c.addPiece(gen.new Piece("br")); - c.addPiece(gen.new Piece(null, "Elements defined in Ancestors: ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"Elements defined in Ancestors: ", null)); boolean first = true; for (SourcedElementDefinition ed : ancestors) { if (first) @@ -1348,14 +1348,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (fixedUrl == null) { if (!Utilities.noString(fullUrl)) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "URL")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"URL")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } } else { // reference to a profile take on the extension show the base URL - c.getPieces().add(gen.new Piece(null, translate("sd.table", "URL")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"URL")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref2, fixedUrl, null)); - c.getPieces().add(gen.new Piece(null, translate("sd.table", " profiled by ")+" ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/" "+/*!#*/"profiled by ")+" ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } @@ -1363,26 +1363,26 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasSlicing()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Slice")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Slice")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); } if (!definition.getPath().contains(".") && ToolingExtensions.hasExtension(profile, ToolingExtensions.EXT_BINDING_STYLE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, "This type can be bound to a value set using the ", null)); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"This type can be bound to a value set using the ", null)); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_BINDING_STYLE), null)); - c.getPieces().add(gen.new Piece(null, " binding style", null)); + c.getPieces().add(gen.new Piece(null, " "+/*!#*/"binding style", null)); } if (definition.hasValueAlternatives()) { addCanonicalList(gen, c, definition.getValueAlternatives(), "The primitive value may be replaced by the extension", true); } if (definition.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "When this element is read ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"When this element is read ", null)); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_IMPLIED_PREFIX))); c.getPieces().add(piece); - c.getPieces().add(gen.new Piece(null, " is prefixed to the value before validation", null)); + c.getPieces().add(gen.new Piece(null, " "+/*!#*/"is prefixed to the value before validation", null)); } if (definition.hasExtension(ToolingExtensions.EXT_EXTENSION_STYLE)) { @@ -1390,9 +1390,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String es = definition.getExtensionString(ToolingExtensions.EXT_EXTENSION_STYLE); if ("named-elements".equals(es)) { if (rc.hasLink(KnownLinkType.JSON_NAMES)) { - c.getPieces().add(gen.new Piece(rc.getLink(KnownLinkType.JSON_NAMES), "This element can be extended by named JSON elements", null)); + c.getPieces().add(gen.new Piece(rc.getLink(KnownLinkType.JSON_NAMES), /*!#*/"This element can be extended by named JSON elements", null)); } else { - c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, "This element can be extended by named JSON elements", null)); + c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, /*!#*/"This element can be extended by named JSON elements", null)); } } } @@ -1400,61 +1400,61 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String df = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_DATE_FORMAT); if (df != null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Date Format: "+df, null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Date Format: "+df, null)); } } if (definition.hasExtension(ToolingExtensions.EXT_ID_EXPECTATION)) { String ide = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_ID_EXPECTATION); if (ide.equals("optional")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Id may or not be present (this is the default for elements but not resources)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Id may or not be present (this is the default for elements but not resources)", null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Id is required to be present (this is the default for resources but not elements)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Id is required to be present (this is the default for resources but not elements)", null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "An ID is not allowed in this context", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"An id is not allowed in this context", null)); } } if (definition.hasExtension(ToolingExtensions.EXT_ID_CHOICE_GROUP)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Choice Group")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, "This is a repeating choice group that does not appear directly in the instance", null)); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Choice Group")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"This is a repeating choice group that does not appear directly in the instance", null)); } if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, " (", null)); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, ")", null)); } else { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Element Name")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Element Name")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); } } else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_EMPTY); if ("present".equals(code)) { - c.getPieces().add(gen.new Piece(null, "JSON: This element is present as a JSON Array even when there are no items in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This element is present as a JSON Array even when there are no items in the instance", null)); } else { - c.getPieces().add(gen.new Piece(null, "JSON: This element may be present as a JSON Array even when there are no items in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This element may be present as a JSON Array even when there are no items in the instance", null)); } } String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (!Utilities.noString(jn)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (definition.getPath().contains(".")) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "JSON Property Name")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"JSON Property Name")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, jn, null)); } else { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "JSON Property Name for Type")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"JSON Property Name for Type")+": ", null).addStyle("font-weight:bold")); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(jn)); c.getPieces().add(piece); @@ -1463,27 +1463,27 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "JSON: The type of this element is inferred from the JSON type in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: The type of this element is inferred from the JSON type in the instance", null)); } if (ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_JSON_NULLABLE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "JSON: This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)", null)); } if (definition.hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_PROP_KEY); - c.getPieces().add(gen.new Piece(null, "JSON: Represented as a single JSON Object with named properties using the value of the "+code+" child as the key", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: Represented as a single JSON Object with named properties using the value of the "+code+" child as the key", null)); } if (definition.hasExtension(ToolingExtensions.EXT_TYPE_SPEC)) { for (Extension e : definition.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String cond = ToolingExtensions.readStringExtension(e, "condition"); String type = ToolingExtensions.readStringExtension(e, "type"); - c.getPieces().add(gen.new Piece(null, "JSON: If ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: If ", null)); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(cond)); c.getPieces().add(piece); - c.getPieces().add(gen.new Piece(null, "then the type is ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"then the type is ", null)); StructureDefinition sd = context.getWorker().fetchTypeDefinition(type); if (sd == null) { c.getPieces().add(gen.new Piece("")); @@ -1497,7 +1497,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (root) { if (ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_OBLIGATION_PROFILE_FLAG)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "This is an obligation profile that only contains obligations and additional bindings", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"This is an obligation profile that only contains obligations and additional bindings", null).addStyle("font-weight:bold")); } addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS), "This profile picks up obligations and additional bindings from the profile", true); addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE), "This profile also imposes the profile", true); @@ -1507,31 +1507,31 @@ public class StructureDefinitionRenderer extends ResourceRenderer { Extension lt = ToolingExtensions.getExtension(profile, ToolingExtensions.EXT_LOGICAL_TARGET); if (lt == null || !lt.hasValueBooleanType()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) { } else if (!lt.getValueBooleanType().hasValue()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; } else if (lt.getValueBooleanType().booleanValue()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model can be the target of a Reference", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model can be the target of a Reference", null).addStyle("font-weight:bold")); } else { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model cannot be the target of a Reference", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model cannot be the target of a Reference", null).addStyle("font-weight:bold")); } String ps = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_PROFILE_STYLE); if (ps != null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if ("cda".equals(ps)) { - c.addPiece(gen.new Piece(null, "Instances of this type are validated by templateId", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this type are validated by templateId", null).addStyle("font-weight:bold")); } else { - c.addPiece(gen.new Piece(null, "Instances of this type are validated using an unknown approach: "+ps, null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this type are validated using an unknown approach: "+ps, null).addStyle("font-weight:bold")); } } Extension lc = ToolingExtensions.getExtension(profile, ToolingExtensions.EXT_LOGICAL_CONTAINER); if (lc != null && lc.hasValueUriType()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Logical Container")+": ", "The root class that contains instances of this class").addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Logical Container")+": ", /*!#*/"The root class that contains instances of this class").addStyle("font-weight:bold")); String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); @@ -1553,7 +1553,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp() == null ? makeNullBr(binding) : context.getPkp().resolveBinding(profile, binding, definition.getPath()); - c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(binding.getValueSetElement(), checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (binding.hasStrength()) { c.getPieces().add(checkForNoChange(binding.getStrengthElement(), gen.new Piece(null, " (", null))); @@ -1591,14 +1591,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (c.getPieces().size() > 0) c.addPiece(gen.new Piece("br")); if (definition.hasOrderMeaning()) { - c.getPieces().add(gen.new Piece(null, "This repeating element order: "+definition.getOrderMeaning(), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"This repeating element order: "+definition.getOrderMeaning(), null)); } else { // don't show this, this it's important: c.getPieces().add(gen.new Piece(null, "This repeating element has no defined order", null)); } } if (definition.hasFixed()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, translate("sd.table", "Fixed Value")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, (/*!#*/"Fixed Value")+": ", null).addStyle("font-weight:bold"))); if (!useTableForFixedValues || !allowSubRows || definition.getFixed().isPrimitive()) { String s = buildJson(definition.getFixed()); String link = null; @@ -1606,7 +1606,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { link = context.getPkp().getLinkForUrl(corePath, s); c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(link, s, null).addStyle("color: darkgreen"))); } else { - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "As shown", null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, /*!#*/"As shown", null).addStyle("color: darkgreen"))); genFixedValue(gen, row, definition.getFixed(), snapshot, false, corePath, false); } if (isCoded(definition.getFixed()) && !hasDescription(definition.getFixed())) { @@ -1616,17 +1616,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } else if (definition.hasPattern()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, translate("sd.table", "Required Pattern")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, (/*!#*/"Required Pattern")+": ", null).addStyle("font-weight:bold"))); if (!useTableForFixedValues || !allowSubRows || definition.getPattern().isPrimitive()) c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); else { - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "At least the following", null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, /*!#*/"At least the following", null).addStyle("color: darkgreen"))); genFixedValue(gen, row, definition.getPattern(), snapshot, true, corePath, mustSupportOnly); } } else if (definition.hasExample()) { for (ElementDefinitionExampleComponent ex : definition.getExample()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, translate("sd.table", "Example")+("".equals("General")? "" : " "+ex.getLabel())+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, (/*!#*/"Example")+("".equals("General")? "" : " "+ex.getLabel())+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); } } @@ -1765,13 +1765,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (e.hasContentReference()) { ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference(), profile); if (ed == null) - c.getPieces().add(gen.new Piece(null, "Unknown reference to "+ e.getContentReference(), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Unknown reference to "+ e.getContentReference(), null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece(null, "See ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"See ", null)); c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), tail(ed.getElement().getPath()), ed.getElement().getPath())); } else { - c.getPieces().add(gen.new Piece(null, "See ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"See ", null)); c.getPieces().add(gen.new Piece(pfx(corePath, ed.getSource().getWebPath())+"#"+ed.getElement().getPath(), tail(ed.getElement().getPath())+" ("+ed.getSource().getTypeName()+")", ed.getElement().getPath())); } } @@ -1830,7 +1830,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); boolean tfirst = true; @@ -1843,7 +1843,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { genTargetLink(gen, profileBaseFileName, corePath, c, t, u.getValue(), null); if (!mustSupportMode && isMustSupport(u) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This target must be supported"), "S", "white", "red", null, false); } } } @@ -1890,7 +1890,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupport(p) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This profile must be supported"), "S", "white", "red", null, false); } } } @@ -1910,7 +1910,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } } @@ -2121,7 +2121,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private BindingResolution makeNullBr(ElementDefinitionBindingComponent binding) { BindingResolution br = new BindingResolution(); br.url = "http://none.none/none"; - br.display = "todo"; + br.display = /*!#*/"todo"; return br; } @@ -2185,7 +2185,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); if (!pattern) { c.addPiece(gen.new Piece(null, "0..0", null)); - row.setIcon("icon_fixed.gif", "Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", /*!#*/"Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); } else if (context.getContext().isPrimitiveType(t.getTypeCode())) { row.setIcon("icon_primitive.png", HierarchicalTableGenerator.TEXT_ICON_PRIMITIVE); c.addPiece(gen.new Piece(null, "0.."+(t.getMaxCardinality() == 2147483647 ? "*": Integer.toString(t.getMaxCardinality())), null)); @@ -2219,7 +2219,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { for (Base b : t.getValues()) { Row row = gen.new Row(); erow.getSubRows().add(row); - row.setIcon("icon_fixed.gif", "Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", /*!#*/"Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); Cell c = gen.new Cell(); row.getCells().add(c); @@ -2257,7 +2257,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); c.addPiece(gen.new Piece(null, ed.getShort(), null)); c.addPiece(gen.new Piece("br")); - c.getPieces().add(gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight: bold")); String s = b.primitiveValue(); // ok. let's see if we can find a relevant link for this String link = null; @@ -2270,8 +2270,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); c.addPiece(gen.new Piece(null, ed.getShort(), null)); c.addPiece(gen.new Piece("br")); - c.getPieces().add(gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight: bold")); - c.getPieces().add(gen.new Piece(null, "(complex)", null).addStyle("color: darkgreen")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"(complex)", null).addStyle("color: darkgreen")); genFixedValue(gen, row, (DataType) b, snapshot, pattern, corePath, skipnoValue); } } @@ -2348,12 +2348,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasContentReference()) { ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference(), profile); if (ed == null) - c.getPieces().add(gen.new Piece(null, "Unknown reference to "+definition.getContentReference(), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Unknown reference to "+definition.getContentReference(), null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), "See "+ed.getElement().getPath(), null)); + c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), /*!#*/"See "+ed.getElement().getPath(), null)); } else { - c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), "See "+ed.getSource().getTypeName()+"."+ed.getElement().getPath(), null)); + c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), /*!#*/"See "+ed.getSource().getTypeName()+"."+ed.getElement().getPath(), null)); } } } @@ -2372,13 +2372,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { ref = p.startsWith("http:") || context.getRules() == GenerationRules.IG_PUBLISHER ? p : Utilities.pathURL(corePath, p); } } - c.getPieces().add(gen.new Piece(null, "URL: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"URL: ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } if (definition.hasSlicing()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Slice: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Slice: ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); } if (definition != null) { @@ -2391,7 +2391,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp().resolveBinding(profile, binding, definition.getPath()); - c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, "Binding: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, /*!#*/"Binding: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(binding, checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (binding.hasStrength()) { c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, " (", null))); @@ -2414,7 +2414,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (definition.hasFixed()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight:bold"))); String s = buildJson(definition.getFixed()); String link = null; if (Utilities.isAbsoluteUrl(s)) @@ -2422,18 +2422,18 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(link, s, null).addStyle("color: darkgreen"))); } else if (definition.hasPattern()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "Required Pattern: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, /*!#*/"Required Pattern: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); } else if (definition.hasExample()) { for (ElementDefinitionExampleComponent ex : definition.getExample()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, "Example'"+("".equals("General")? "": " "+ex.getLabel()+"'")+": ", "").addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, /*!#*/"Example'"+("".equals("General")? "": " "+ex.getLabel()+"'")+": ", "").addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); } } if (definition.hasMaxLength() && definition.getMaxLength()!=0) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, "Max Length: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, /*!#*/"Max Length: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, Integer.toString(definition.getMaxLength()), null).addStyle("color: darkgreen"))); } if (profile != null) { @@ -2454,14 +2454,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (definition.hasDefinition()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Definition: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null).addStyle("font-weight:bold")); c.addPiece(gen.new Piece("br")); c.addMarkdown(definition.getDefinition()); // c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null))); } if (definition.getComment()!=null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Comments: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Comments: ", null).addStyle("font-weight:bold")); c.addPiece(gen.new Piece("br")); c.addMarkdown(definition.getComment()); // c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null))); @@ -2621,7 +2621,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(gen.new Piece(corePath+"references.html#Reference", "Reference", null)); if (!mustSupportMode && isMustSupportDirect(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); } @@ -2633,7 +2633,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { genTargetLink(gen, profileBaseFileName, corePath, c, tr, rt.getValue(), src); if (!mustSupportMode && isMustSupport(rt) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This target must be supported"), "S", "white", "red", null, false); } first = false; } @@ -2661,7 +2661,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } else { used = true; @@ -2673,7 +2673,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } if (tr.hasProfile() && used) { @@ -2690,7 +2690,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { typeCell.addPiece(gen.new Piece(psd.getWebPath(), psd.getName(), psd.present())); if (!mustSupportMode && isMustSupport(pt) && element.getMustSupport()) { typeCell.addPiece(gen.new Piece(null, " ", null)); - typeCell.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false); + typeCell.addStyledText((/*!#*/"This profile must be supported"), "S", "white", "red", null, false); } } } @@ -2739,7 +2739,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } private String describeSlice(ElementDefinitionSlicingComponent slicing) { - return formatMessage("%s, %s by %s", slicing.getOrdered() ? translate("sd.table", "Ordered") : translate("sd.table", "Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator())); + return formatMessage("%s, %s by %s", slicing.getOrdered() ? (/*!#*/"Ordered") : (/*!#*/"Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator())); } @@ -2754,11 +2754,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String describe(SlicingRules rules) { if (rules == null) - return translate("sd.table", "Unspecified"); + return (/*!#*/"Unspecified"); switch (rules) { - case CLOSED : return translate("sd.table", "Closed"); - case OPEN : return translate("sd.table", "Open"); - case OPENATEND : return translate("sd.table", "Open At End"); + case CLOSED : return (/*!#*/"Closed"); + case OPEN : return (/*!#*/"Open"); + case OPENATEND : return (/*!#*/"Open At End"); default: return "?gen-sr?"; } @@ -2847,7 +2847,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (open) b.append("]"); } else - res.setDescription("Base FHIR "+profile.getName()); + res.setDescription(/*!#*/"Base FHIR "+profile.getName()); res.setType(b.toString()); return res ; } @@ -2868,7 +2868,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String system = TerminologyRenderer.describeSystem(uri); if (Utilities.isURL(system)) { if (system.equals("http://cap.org/protocols")) - system = "CAP Code"; + system = /*!#*/"CAP Code"; } return system+" "+value.getCode(); } @@ -2896,10 +2896,10 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); // todo: change to graph definition - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Property", "A profiled resource", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Card.", "Minimum and Maximum # of times the the element can appear in the instance", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Content", "What goes here", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Description", "Description of the profile", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Property", /*!#*/"A profiled resource", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Card.", /*!#*/"Minimum and Maximum # of times the the element can appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Content", /*!#*/"What goes here", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description", /*!#*/"Description of the profile", null, 0)); return model; } @@ -3016,9 +3016,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (first) first = false; else x.br(); String cond = ToolingExtensions.readStringExtension(e, "condition"); String type = ToolingExtensions.readStringExtension(e, "type"); - x.tx("If "); + x.tx(/*!#*/"If "); x.code().tx(cond); - x.tx(" then the type is "); + x.tx(" "+/*!#*/"then the type is "); StructureDefinition sd = context.getContext().fetchTypeDefinition(type); if (sd == null) { x.code().tx(type); @@ -3110,7 +3110,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!full && !(deep || vdeep) && ved != null && ved.hasBinding()) { c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp().resolveBinding(ed, ved.getBinding(), ved.getPath()); - c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ved.getBinding(), checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (ved.getBinding().hasStrength()) { c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, " (", null))); @@ -3260,7 +3260,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { sd = (StructureDefinition) context.getContext().fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/Element"); } if (sd == null) { - throw new FHIRException("Unable to retrieve StructureDefinition with URL " + url); + throw new FHIRException(/*!#*/"Unable to retrieve StructureDefinition with URL " + url); } } sdCache = new HashMap(); @@ -3568,60 +3568,60 @@ public class StructureDefinitionRenderer extends ResourceRenderer { boolean slicedExtension = d.hasSliceName() && (d.getPath().endsWith(".extension") || d.getPath().endsWith(".modifierExtension")); // int slicedExtensionMode = (mode == GEN_MODE_KEY) && slicedExtension ? GEN_MODE_SNAP : mode; // see ProfileUtilities.checkExtensionDoco / Task 3970 if (d.hasSliceName()) { - tableRow(tbl, "Slice Name", "profiling.html#slicing", strikethrough, compareString(d.getSliceName(), d.getSliceNameElement(), null, (compare != null ? compare.getSliceName() : null), d, null, "sliceName", mode, false, false)); - tableRow(tbl, "Slice Constraining", "profiling.html#slicing", strikethrough, compareString(encodeValue(d.getSliceIsConstrainingElement(), null), d.getSliceIsConstrainingElement(), null, (compare != null ? encodeValue(compare.getSliceIsConstrainingElement(), null) : null), d, null, "sliceName", mode, false, false)); + tableRow(tbl, /*!#*/"Slice Name", "profiling.html#slicing", strikethrough, compareString(d.getSliceName(), d.getSliceNameElement(), null, (compare != null ? compare.getSliceName() : null), d, null, "sliceName", mode, false, false)); + tableRow(tbl, /*!#*/"Slice Constraining", "profiling.html#slicing", strikethrough, compareString(encodeValue(d.getSliceIsConstrainingElement(), null), d.getSliceIsConstrainingElement(), null, (compare != null ? encodeValue(compare.getSliceIsConstrainingElement(), null) : null), d, null, "sliceName", mode, false, false)); } - tableRow(tbl, "Definition", null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); - tableRow(tbl, "Short", null, strikethrough, compareString(d.hasShort() ? d.getShort() : null, d.getShortElement(), null, "short", d, compare!= null && compare.hasShortElement() ? compare.getShort() : null, null, mode, false, false)); - tableRow(tbl, "Comments", null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); - tableRow(tbl, "Note", null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); - tableRow(tbl, "Control", "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); - tableRow(tbl, "Binding", "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); + tableRow(tbl, /*!#*/"Definition", null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); + tableRow(tbl, /*!#*/"Short", null, strikethrough, compareString(d.hasShort() ? d.getShort() : null, d.getShortElement(), null, "short", d, compare!= null && compare.hasShortElement() ? compare.getShort() : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Comments", null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); + tableRow(tbl, /*!#*/"Note", null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); + tableRow(tbl, /*!#*/"Control", "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); + tableRow(tbl, /*!#*/"Binding", "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); if (d.hasContentReference()) { - tableRow(tbl, "Type", null, strikethrough, "See " + d.getContentReference().substring(1)); + tableRow(tbl, /*!#*/"Type", null, strikethrough, /*!#*/"See " + d.getContentReference().substring(1)); } else { - tableRow(tbl, "Type", "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); + tableRow(tbl, /*!#*/"Type", "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); } if (d.hasExtension(ToolingExtensions.EXT_DEF_TYPE)) { - tableRow(tbl, "Default Type", "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); + tableRow(tbl, /*!#*/"Default Type", "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); } if (d.hasExtension(ToolingExtensions.EXT_TYPE_SPEC)) { - tableRow(tbl, Utilities.pluralize("Type Specifier", d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); + tableRow(tbl, Utilities.pluralize(/*!#*/"Type Specifier", d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); } if (d.getPath().endsWith("[x]") && !d.prohibited()) { - tableRow(tbl, "[x] Note", null, strikethrough).ahWithText("See ", spec("formats.html#choice"), null, "Choice of Data Types", " for further information about how to use [x]"); + tableRow(tbl, /*!#*/"[x] Note", null, strikethrough).ahWithText("See ", spec("formats.html#choice"), null, /*!#*/"Choice of Data Types", " for further information about how to use [x]"); } - tableRow(tbl, "Is Modifier", "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); + tableRow(tbl, /*!#*/"Is Modifier", "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); if (d.getMustHaveValue()) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, "This primitive type must have a value (the value must be present, and cannot be replaced by an extension)"); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, /*!#*/"This primitive type must have a value (the value must be present, and cannot be replaced by an extension)"); } else if (d.hasValueAlternatives()) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, renderCanonicalList("This primitive type may be present, or absent if replaced by one of the following extensions: ", d.getValueAlternatives())); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, renderCanonicalList(/*!#*/"This primitive type may be present, or absent if replaced by one of the following extensions: ", d.getValueAlternatives())); } else if (hasPrimitiveTypes(d)) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, "This primitive element may be present, or absent, or replaced by an extension"); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, /*!#*/"This primitive element may be present, or absent, or replaced by an extension"); } if (ToolingExtensions.hasAllowedUnits(d)) { - tableRow(tbl, "Allowed Units", "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); + tableRow(tbl, /*!#*/"Allowed Units", "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); } - tableRow(tbl, "Must Support", "conformance-rules.html#mustSupport", strikethrough, displayBoolean(d.getMustSupport(), d.getMustSupportElement(), "mustSupport", d, compare==null ? null : compare.getMustSupportElement(), mode)); + tableRow(tbl, /*!#*/"Must Support", "conformance-rules.html#mustSupport", strikethrough, displayBoolean(d.getMustSupport(), d.getMustSupportElement(), "mustSupport", d, compare==null ? null : compare.getMustSupportElement(), mode)); if (d.getMustSupport()) { if (hasMustSupportTypes(d.getType())) { - tableRow(tbl, "Must Support Types", "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); + tableRow(tbl, /*!#*/"Must Support Types", "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); } else if (hasChoices(d.getType())) { - tableRow(tbl, "Must Support Types", "datatypes.html", strikethrough, "No must-support rules about the choice of types/profiles"); + tableRow(tbl, /*!#*/"Must Support Types", "datatypes.html", strikethrough, /*!#*/"No must-support rules about the choice of types/profiles"); } } if (root && sd.getKind() == StructureDefinitionKind.LOGICAL) { Extension lt = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_TARGET); if (lt == null || !lt.hasValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model are not marked to be the target of a Reference"); } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) { } else if (lt.getValueBooleanType().hasValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model are not marked to be the target of a Reference"); } else if (lt.getValueBooleanType().booleanValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model can be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model can be the target of a Reference"); } else { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model cannot be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model cannot be the target of a Reference"); } Extension lc = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_CONTAINER); @@ -3629,79 +3629,79 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); if (lct != null) { - tableRowLink(tbl, "Logical Container", null, strikethrough, lct.present(), lct.getWebPath()); + tableRowLink(tbl, /*!#*/"Logical Container", null, strikethrough, lct.present(), lct.getWebPath()); } else { - tableRow(tbl, "Logical Container", null, strikethrough, uri); + tableRow(tbl, /*!#*/"Logical Container", null, strikethrough, uri); } } String ps = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_PROFILE_STYLE); if (ps != null) { if ("cda".equals(ps)) { - tableRow(tbl, "Validation", null, strikethrough, "Instances of this type are validated by templateId"); + tableRow(tbl, /*!#*/"Validation", null, strikethrough, /*!#*/"Instances of this type are validated by templateId"); } else { - tableRow(tbl, "Validation", null, strikethrough, "Instances of this type are validated using an unknown approach: "+ps); + tableRow(tbl, /*!#*/"Validation", null, strikethrough, /*!#*/"Instances of this type are validated using an unknown approach: "+ps); } } } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) { - tableRow(tbl, "Impose Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, - renderCanonicalListExt("This profile also requires that the instance also conform this additional profile: ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); + tableRow(tbl, /*!#*/"Impose Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, + renderCanonicalListExt(/*!#*/"This profile also requires that the instance also conform this additional profile: ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE)) { - tableRow(tbl, "Complies with Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, - renderCanonicalListExt("This profile compiles with the profile ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); + tableRow(tbl, /*!#*/"Complies with Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, + renderCanonicalListExt(/*!#*/"This profile compiles with the profile ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); } - tableRow(tbl, "Obligations", null, strikethrough, describeObligations(d, root, sd)); + tableRow(tbl, /*!#*/"Obligations", null, strikethrough, describeObligations(d, root, sd)); if (d.hasExtension(ToolingExtensions.EXT_EXTENSION_STYLE)) { String es = d.getExtensionString(ToolingExtensions.EXT_EXTENSION_STYLE); if ("named-elements".equals(es)) { if (context.hasLink(KnownLinkType.JSON_NAMES)) { - tableRow(tbl, "Extension Style", context.getLink(KnownLinkType.JSON_NAMES), strikethrough, "This element can be extended by named JSON elements"); + tableRow(tbl, /*!#*/"Extension Style", context.getLink(KnownLinkType.JSON_NAMES), strikethrough, /*!#*/"This element can be extended by named JSON elements"); } else { - tableRow(tbl, "Extension Style", ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, "This element can be extended by named JSON elements"); + tableRow(tbl, /*!#*/"Extension Style", ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, /*!#*/"This element can be extended by named JSON elements"); } } } if (!d.getPath().contains(".") && ToolingExtensions.hasExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)) { - tableRow(tbl, "Binding Style", ToolingExtensions.WEB_BINDING_STYLE, strikethrough, - "This type can be bound to a value set using the " + ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style"); + tableRow(tbl, /*!#*/"Binding Style", ToolingExtensions.WEB_BINDING_STYLE, strikethrough, + /*!#*/"This type can be bound to a value set using the " + ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style"); } if (d.hasExtension(ToolingExtensions.EXT_DATE_FORMAT)) { - tableRow(tbl, "Date Format", null, strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DATE_FORMAT)); + tableRow(tbl, /*!#*/"Date Format", null, strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DATE_FORMAT)); } String ide = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_ID_EXPECTATION); if (ide != null) { if (ide.equals("optional")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "Id may or not be present (this is the default for elements but not resources)"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"Id may or not be present (this is the default for elements but not resources)"); } else if (ide.equals("required")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "Id is required to be present (this is the default for resources but not elements)"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"Id is required to be present (this is the default for resources but not elements)"); } else if (ide.equals("required")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "An ID is not allowed in this context"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"An ID is not allowed in this context"); } } if (d.hasExtension(ToolingExtensions.EXT_ID_CHOICE_GROUP)) { - tableRow(tbl, "Choice Group", null, strikethrough, "This is a repeating choice group that does not appear directly in the instance"); + tableRow(tbl, /*!#*/"Choice Group", null, strikethrough, /*!#*/"This is a repeating choice group that does not appear directly in the instance"); } // tooling extensions for formats if (ToolingExtensions.hasAnyOfExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - tableRow(tbl, "JSON Format", null, strikethrough, describeJson(d)); + tableRow(tbl, /*!#*/"JSON Format", null, strikethrough, describeJson(d)); } if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || d.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || d.hasRepresentation()) { - tableRow(tbl, "XML Format", null, strikethrough, describeXml(sd, d, root)); + tableRow(tbl, /*!#*/"XML Format", null, strikethrough, describeXml(sd, d, root)); } if (d.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) { - tableRow(tbl, "String Format", null, strikethrough).codeWithText("When this element is read ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), "is prefixed to the value before validation"); + tableRow(tbl, /*!#*/"String Format", null, strikethrough).codeWithText(/*!#*/"When this element is read ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), /*!#*/"is prefixed to the value before validation"); } if (d.hasExtension(ToolingExtensions.EXT_STANDARDS_STATUS)) { @@ -3711,34 +3711,34 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (sdb != null) { StandardsStatus base = determineStandardsStatus(sdb, (ElementDefinition) d.getUserData("derived.pointer")); if (base != null) { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); } else { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); } } else { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); } } if (mode != GEN_MODE_DIFF && d.hasIsSummary()) { - tableRow(tbl, "Summary", "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); + tableRow(tbl, /*!#*/"Summary", "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); } - tableRow(tbl, "Requirements", null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); - tableRow(tbl, "Label", null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); - tableRow(tbl, "Alternate Names", null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); - tableRow(tbl, "Definitional Codes", null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); - tableRow(tbl, "Min Value", null, strikethrough, compareString(d.hasMinValue() ? encodeValue(d.getMinValue(), null) : null, d.getMinValue(), null, "minValue", d, compare!= null && compare.hasMinValue() ? encodeValue(compare.getMinValue(), null) : null, null, mode, false, false)); - tableRow(tbl, "Max Value", null, strikethrough, compareString(d.hasMaxValue() ? encodeValue(d.getMaxValue(), null) : null, d.getMaxValue(), null, "maxValue", d, compare!= null && compare.hasMaxValue() ? encodeValue(compare.getMaxValue(), null) : null, null, mode, false, false)); - tableRow(tbl, "Max Length", null, strikethrough, compareString(d.hasMaxLength() ? toStr(d.getMaxLength()) : null, d.getMaxLengthElement(), null, "maxLength", d, compare!= null && compare.hasMaxLengthElement() ? toStr(compare.getMaxLength()) : null, null, mode, false, false)); - tableRow(tbl, "Value Required", null, strikethrough, compareString(encodeValue(d.getMustHaveValueElement(), null), d.getMustHaveValueElement(), null, (compare != null ? encodeValue(compare.getMustHaveValueElement(), null) : null), d, null, "mustHaveValueElement", mode, false, false)); - tableRow(tbl, "Value Alternatives", null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); - tableRow(tbl, "Default Value", null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); - tableRow(tbl, "Meaning if Missing", null, strikethrough, d.getMeaningWhenMissing()); - tableRow(tbl, "Fixed Value", null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); - tableRow(tbl, "Pattern Value", null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); - tableRow(tbl, "Example", null, strikethrough, encodeValues(d.getExample())); - tableRow(tbl, "Invariants", null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); - tableRow(tbl, "LOINC Code", null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); - tableRow(tbl, "SNOMED-CT Code", null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); + tableRow(tbl, /*!#*/"Requirements", null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); + tableRow(tbl, /*!#*/"Label", null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); + tableRow(tbl, /*!#*/"Alternate Names", null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); + tableRow(tbl, /*!#*/"Definitional Codes", null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); + tableRow(tbl, /*!#*/"Min Value", null, strikethrough, compareString(d.hasMinValue() ? encodeValue(d.getMinValue(), null) : null, d.getMinValue(), null, "minValue", d, compare!= null && compare.hasMinValue() ? encodeValue(compare.getMinValue(), null) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Max Value", null, strikethrough, compareString(d.hasMaxValue() ? encodeValue(d.getMaxValue(), null) : null, d.getMaxValue(), null, "maxValue", d, compare!= null && compare.hasMaxValue() ? encodeValue(compare.getMaxValue(), null) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Max Length", null, strikethrough, compareString(d.hasMaxLength() ? toStr(d.getMaxLength()) : null, d.getMaxLengthElement(), null, "maxLength", d, compare!= null && compare.hasMaxLengthElement() ? toStr(compare.getMaxLength()) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Value Required", null, strikethrough, compareString(encodeValue(d.getMustHaveValueElement(), null), d.getMustHaveValueElement(), null, (compare != null ? encodeValue(compare.getMustHaveValueElement(), null) : null), d, null, "mustHaveValueElement", mode, false, false)); + tableRow(tbl, /*!#*/"Value Alternatives", null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); + tableRow(tbl, /*!#*/"Default Value", null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); + tableRow(tbl, /*!#*/"Meaning if Missing", null, strikethrough, d.getMeaningWhenMissing()); + tableRow(tbl, /*!#*/"Fixed Value", null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); + tableRow(tbl, /*!#*/"Pattern Value", null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); + tableRow(tbl, /*!#*/"Example", null, strikethrough, encodeValues(d.getExample())); + tableRow(tbl, /*!#*/"Invariants", null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); + tableRow(tbl, /*!#*/"LOINC Code", null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); + tableRow(tbl, /*!#*/"SNOMED-CT Code", null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); tbl.tx("\r\n"); } @@ -3747,7 +3747,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (x1 != null) { XhtmlNode x2 = compareString(encodeValue(d.getIsModifierReasonElement(), null), d.getIsModifierReasonElement(), null, "isModifierReason", d, compare == null ? null : encodeValue(compare.getIsModifierReasonElement(), null), null, mode, false, false); if (x2 != null) { - x1.tx(" because "); + x1.tx(" "+/*!#*/"because "); x1.copyAllContent(x2); } } @@ -3764,19 +3764,19 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (d.hasRepresentation(pr)) { switch (pr) { case CDATEXT: - ret.tx("This property is represented as CDA Text in the XML."); + ret.tx(/*!#*/"This property is represented as CDA Text in the XML."); break; case TYPEATTR: - ret.codeWithText("The type of this property is determined using the ", "xsi:type", "attribute."); + ret.codeWithText(/*!#*/"The type of this property is determined using the ", "xsi:type", "attribute."); break; case XHTML: - ret.tx("This property is represented as XHTML Text in the XML."); + ret.tx(/*!#*/"This property is represented as XHTML Text in the XML."); break; case XMLATTR: - ret.tx("In the XML format, this property is represented as an attribute."); + ret.tx(/*!#*/"In the XML format, this property is represented as an attribute."); break; case XMLTEXT: - ret.tx("In the XML format, this property is represented as unadorned text."); + ret.tx(/*!#*/"In the XML format, this property is represented as unadorned text."); break; default: } @@ -3787,11 +3787,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); } if (name != null) { - ret.codeWithText("In the XML format, this property has the namespace ", name, "."); + ret.codeWithText(/*!#*/"In the XML format, this property has the namespace ", name, "."); } name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED); if (name != null) { - ret.codeWithText("In the XML format, this property has the actual name", name, "."); + ret.codeWithText(/*!#*/"In the XML format, this property has the actual name", name, "."); } return ret; } @@ -3805,33 +3805,33 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (code != null) { switch (code) { case "present": - ul.li().tx("The JSON Array for this property is present even when there are no items in the instance (e.g. as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property is present even when there are no items in the instance (e.g. as an empty array)"); break; case "absent": - ul.li().tx("The JSON Array for this property is not present when there are no items in the instance (e.g. never as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property is not present when there are no items in the instance (e.g. never as an empty array)"); break; case "either": - ul.li().tx("The JSON Array for this property may be present even when there are no items in the instance (e.g. may be present as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property may be present even when there are no items in the instance (e.g. may be present as an empty array)"); break; } } String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (jn != null) { if (d.getPath().contains(".")) { - ul.li().codeWithText("This property appears in JSON with the property name ", jn, null); + ul.li().codeWithText(/*!#*/"This property appears in JSON with the property name ", jn, null); } else { - ul.li().codeWithText("This type can appear in JSON with the property name ", jn, " (in elements using named extensions)"); + ul.li().codeWithText(/*!#*/"This type can appear in JSON with the property name ", jn, " (in elements using named extensions)"); } } code = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_PROP_KEY); if (code != null) { - ul.li().codeWithText("This repeating object is represented as a single JSON object with named properties. The name of the property (key) is the value of the ", code, " child"); + ul.li().codeWithText(/*!#*/"This repeating object is represented as a single JSON object with named properties. The name of the property (key) is the value of the ", code, " child"); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_NULLABLE)) { - ul.li().tx("This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)"); + ul.li().tx(/*!#*/"This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)"); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - ul.li().tx("The type of this element is inferred from the JSON type in the instance"); + ul.li().tx(/*!#*/"The type of this element is inferred from the JSON type in the instance"); } switch (ul.getChildNodes().size()) { @@ -3850,12 +3850,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode ul = ret.ul(); if (root) { if (sdx.hasExtension(ToolingExtensions.EXT_OBLIGATION_PROFILE_FLAG)) { - ul.li().tx("This is an obligation profile that only contains obligations and additional bindings"); + ul.li().tx(/*!#*/"This is an obligation profile that only contains obligations and additional bindings"); } for (Extension ext : sdx.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS)) { String iu = ext.getValue().primitiveValue(); XhtmlNode bb = ul.li(); - bb.tx("This profile picks up obligations and additional bindings from "); + bb.tx(/*!#*/"This profile picks up obligations and additional bindings from "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, iu); if (sd == null) { bb.code().tx(iu); @@ -3888,13 +3888,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (au instanceof CanonicalType) { String url = ((CanonicalType) au).asStringValue(); ValueSet vs = context.getContext().findTxResource(ValueSet.class, url); - ret.tx("Value set "); + ret.tx(/*!#*/"Value set "); genCT(ret, url, vs); return ret; } else if (au instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) au; if (cc.getCoding().size() != 1) { - ret.tx("One of:"); + ret.tx(/*!#*/"One of:"); } ret.tx(summarise(cc)); return ret; @@ -3967,23 +3967,23 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String sliceOrderString(ElementDefinitionSlicingComponent slicing) { if (slicing.getOrdered()) - return "ordered"; + return /*!#*/"ordered"; else - return "unordered"; + return /*!#*/"unordered"; } private void generateSlicing(XhtmlNode tbl, StructureDefinition profile, ElementDefinition ed, ElementDefinitionSlicingComponent slicing, ElementDefinition compare, int mode, boolean strikethrough) throws IOException { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.codeWithText("This element introduces a set of slices on ", ed.getPath(), ". The slices are "); + x.codeWithText(/*!#*/"This element introduces a set of slices on ", ed.getPath(), ". The slices are "); String newOrdered = sliceOrderString(slicing); String oldOrdered = (compare==null || !compare.hasSlicing()) ? null : sliceOrderString(compare.getSlicing()); compareString(x, newOrdered, slicing.getOrderedElement(), null, null, null, oldOrdered, null, mode, false, false); - x.tx(" and "); + x.tx(" "+/*!#*/"and "); compareString(x, slicing.hasRules() ? slicing.getRules().getDisplay() : null, slicing.getRulesElement(), null, "rules", slicing, compare!=null && compare.hasSlicing() && compare.getSlicing().hasRules() ? compare.getSlicing().getRules().getDisplay() : null, null, mode, false, false); if (slicing.hasDiscriminator()) { - x.tx(", and can be differentiated using the following discriminators: "); + x.tx(/*!#*/", and can be differentiated using the following discriminators: "); StatusList list = new StatusList<>(); for (ElementDefinitionSlicingDiscriminatorComponent d : slicing.getDiscriminator()) { list.add(new DiscriminatorWithStatus(d)); @@ -3998,7 +3998,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { rc.render(x.li()); } } else { - x.tx(", and defines no discriminators to differentiate the slices"); + x.tx(/*!#*/", and defines no discriminators to differentiate the slices"); } tableRow(tbl, "Slicing", "profiling.html#slicing", strikethrough, x); tbl.tx("\r\n"); @@ -4077,15 +4077,15 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private XhtmlNode businessIdWarning(String resource, String name) { if (name.equals("identifier")) { XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); - ret.tx("This is a business identifier, not a resource identifier (see "); - ret.ah(corePath + "resource.html#identifiers").tx("discussion"); + ret.tx(/*!#*/"This is a business identifier, not a resource identifier (see "); + ret.ah(corePath + "resource.html#identifiers").tx(/*!#*/"discussion"); ret.tx(")"); return ret; } if (name.equals("version")) {// && !resource.equals("Device")) XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); - ret.tx("This is a business versionId, not a resource version id (see "); - ret.ah(corePath + "resource.html#versions").tx("discussion"); + ret.tx(/*!#*/"This is a business versionId, not a resource version id (see "); + ret.ah(corePath + "resource.html#versions").tx(/*!#*/"discussion"); ret.tx(")"); return ret; } @@ -4117,7 +4117,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode t = compareSimpleTypeLists(d.getCondition(), compare == null ? null : compare.getCondition(), mode); if (t != null) { x.br(); - x.tx("This element is affected by the following invariants: "); + x.tx(/*!#*/"This element is affected by the following invariants: "); x.copyAllContent(t); } return x; @@ -4145,7 +4145,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } else { boolean first = true; if (types.size() > 1) { - ret.tx("Choice of: "); + ret.tx(/*!#*/"Choice of: "); } Map map = new HashMap(); for (TypeRefComponent t : compareTypes) { @@ -4191,11 +4191,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return null; case 2: XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" (Complex Extension)"); + x.tx(" "+/*!#*/"(Complex Extension)"); return x; case 3: x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" (Extension Type: "); + x.tx(" "+/*!#*/"(Extension Type: "); x.copyAllContent(describeTypes(value.getType(), false, value, compareValue, compMode, null, null, sd)); x.tx(")"); return x; @@ -4451,7 +4451,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { span.tx("to "); XhtmlNode ispan = span.spanClss("copy-text-inline"); ispan.code().tx(binding.getValueSet()); - ispan.button("btn-copy", "Click to Copy URL").attribute("data-clipboard-text", binding.getValueSet()); + ispan.button("btn-copy", /*!#*/"Click to Copy URL").attribute("data-clipboard-text", binding.getValueSet()); } span.tx(")"); } @@ -4469,17 +4469,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String conf(ElementDefinitionBindingComponent def) { if (def.getStrength() == null) { - return "For codes, see "; + return /*!#*/"For codes, see "; } switch (def.getStrength()) { case EXAMPLE: - return "For example codes, see "; + return /*!#*/"For example codes, see "; case PREFERRED: - return "The codes SHOULD be taken from "; + return /*!#*/"The codes SHOULD be taken from "; case EXTENSIBLE: - return "Unless not suitable, these codes SHALL be taken from "; + return /*!#*/"Unless not suitable, these codes SHALL be taken from "; case REQUIRED: - return "The codes SHALL be taken from "; + return /*!#*/"The codes SHALL be taken from "; default: return "?sd-conf?"; } @@ -4645,17 +4645,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } return b.toString(); } else { - throw new FHIRException("Error describing concept - not done yet (no codings, no text)"); + throw new FHIRException(/*!#*/"Error describing concept - not done yet (no codings, no text)"); } } private String summarise(Coding coding) throws FHIRException { if ("http://snomed.info/sct".equals(coding.getSystem())) - return "" + translate("sd.summary", "SNOMED CT code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (/*!#*/"SNOMED CT code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://loinc.org".equals(coding.getSystem())) - return "" + translate("sd.summary", "LOINC code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (/*!#*/"LOINC code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://unitsofmeasure.org/".equals(coding.getSystem())) - return " (" + translate("sd.summary", "UCUM") + ": " + coding.getCode() + ")"; + return " (" + (/*!#*/"UCUM") + ": " + coding.getCode() + ")"; CodeSystem cs = context.getContext().fetchCodeSystem(coding.getSystem()); if (cs == null) return "" + coding.getCode() + "" + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java index 2332e94b3..829034c61 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java @@ -61,7 +61,7 @@ public class StructureMapRenderer extends TerminologyRenderer { private static final String COLOR_SYNTAX = "navy"; private static final boolean RENDER_MULTIPLE_TARGETS_ONELINE = true; private static final String COLOR_SPECIAL = "#b36b00"; - private static final String DEFAULT_COMMENT = "This element was not defined prior to R5"; + private static final String DEFAULT_COMMENT = /*!#*/"This element was not defined prior to R5"; private String clauseComment = DEFAULT_COMMENT; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java index 327ffa80b..2d96d61f0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java @@ -49,39 +49,39 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { } if (st.hasResourceTrigger()) { - TableData td = new TableData("Resource Triggers"); + TableData td = new TableData(/*!#*/"Resource Triggers"); for (SubscriptionTopicResourceTriggerComponent rt : st.getResourceTrigger()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } for (Enumeration t : rt.getSupportedInteraction()) { - tr.value("Interactions", t); + tr.value(/*!#*/"Interactions", t); } if (rt.hasQueryCriteria()) { StringBuilder md = new StringBuilder(); if (rt.getQueryCriteria().hasPrevious()) { - md.append("* previous = "+rt.getQueryCriteria().getPrevious()+"\r\n"); + md.append(/*!#*/"* previous = "+rt.getQueryCriteria().getPrevious()+"\r\n"); } if (rt.getQueryCriteria().hasResultForCreate()) { - md.append("* create result = "+rt.getQueryCriteria().getResultForCreate()+"\r\n"); + md.append(/*!#*/"* create result = "+rt.getQueryCriteria().getResultForCreate()+"\r\n"); } if (rt.getQueryCriteria().hasCurrent()) { - md.append("* create result = "+rt.getQueryCriteria().getCurrent()+"\r\n"); + md.append(/*!#*/"* create result = "+rt.getQueryCriteria().getCurrent()+"\r\n"); } if (rt.getQueryCriteria().hasPrevious()) { - md.append("* delete result = "+rt.getQueryCriteria().getResultForDelete()+"\r\n"); + md.append(/*!#*/"* delete result = "+rt.getQueryCriteria().getResultForDelete()+"\r\n"); } if (rt.getQueryCriteria().hasRequireBoth()) { - md.append("* require both = "+rt.getQueryCriteria().getRequireBoth()+"\r\n"); + md.append(/*!#*/"* require both = "+rt.getQueryCriteria().getRequireBoth()+"\r\n"); } - tr.value("Criteria", new MarkdownType(md.toString())); + tr.value(/*!#*/"Criteria", new MarkdownType(md.toString())); } if (rt.hasFhirPathCriteriaElement()) { - tr.value("FHIR Path", rt.getFhirPathCriteriaElement()); + tr.value(/*!#*/"FHIR Path", rt.getFhirPathCriteriaElement()); } if (rt.hasDescription()) { - tr.value("Description", rt.getDescriptionElement()); + tr.value(/*!#*/"Description", rt.getDescriptionElement()); } } renderTable(td, x); @@ -92,13 +92,13 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicEventTriggerComponent rt : st.getEventTrigger()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } if (rt.hasEvent()) { - tr.value("Event", rt.getEvent()); + tr.value(/*!#*/"Event", rt.getEvent()); } if (rt.hasDescription()) { - tr.value("Description", rt.getDescriptionElement()); + tr.value(/*!#*/"Description", rt.getDescriptionElement()); } } renderTable(td, x); @@ -109,19 +109,19 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicCanFilterByComponent rt : st.getCanFilterBy()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } if (rt.hasFilterParameter()) { - tr.value("Filter Parameter", rt.getFilterParameterElement()); + tr.value(/*!#*/"Filter Parameter", rt.getFilterParameterElement()); } if (rt.hasFilterDefinition()) { - tr.value("Filter Definition", rt.getFilterDefinitionElement()); + tr.value(/*!#*/"Filter Definition", rt.getFilterDefinitionElement()); } for (Enumeration t : rt.getComparator()) { - tr.value("Comparators", t); + tr.value(/*!#*/"Comparators", t); } for (Enumeration t : rt.getModifier()) { - tr.value("Modifiers", t); + tr.value(/*!#*/"Modifiers", t); } } renderTable(td, x); @@ -132,13 +132,13 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicNotificationShapeComponent rt : st.getNotificationShape()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } for (StringType t : rt.getInclude()) { - tr.value("Includes", t); + tr.value(/*!#*/"Includes", t); } for (StringType t : rt.getRevInclude()) { - tr.value("Reverse Includes", t); + tr.value(/*!#*/"Reverse Includes", t); } } renderTable(td, x); 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 8a6b700b9..7f994273e 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 @@ -209,7 +209,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { protected XhtmlNode addTableHeaderRowStandard(XhtmlNode t, boolean hasHierarchy, boolean hasDisplay, boolean definitions, boolean comments, boolean version, boolean deprecated, List properties, List langs, Map designations, boolean doDesignations) { XhtmlNode tr = t.tr(); if (hasHierarchy) { - tr.td().b().tx("Lvl"); + tr.td().b().tx(/*!#*/"Lvl"); } tr.td().attribute("style", "white-space:nowrap").b().tx(formatMessage(RenderingContext.RENDER_TX_CODE)); if (hasDisplay) { @@ -307,7 +307,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { a.addText(value); } else if (value.equals("http://snomed.info/sct") || value.equals("http://snomed.info/id")) { XhtmlNode a = li.ah(value); - a.tx("SNOMED-CT"); + a.tx(/*!#*/"SNOMED-CT"); } else { if (value.startsWith("http://hl7.org") && !Utilities.existsInList(value, "http://hl7.org/fhir/sid/icd-10-us")) { @@ -329,7 +329,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { protected void clipboard(XhtmlNode x, String img, String title, String source) { - XhtmlNode span = x.span("cursor: pointer", "Copy "+title+" Format to clipboard"); + XhtmlNode span = x.span("cursor: pointer", /*!#*/"Copy "+title+" Format to clipboard"); span.attribute("onClick", "navigator.clipboard.writeText('"+Utilities.escapeJson(source)+"');"); span.img(img, "btn").setAttribute("width", "24px").setAttribute("height", "16px"); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java index 86ffa34ad..bf1805c2d 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java @@ -45,7 +45,7 @@ public class TestPlanRenderer extends ResourceRenderer { XhtmlNode p = null; if (!tp.getContact().isEmpty()) { p = x.para(); - p.b().tx("Contact:"); + p.b().tx(/*!#*/"Contact:"); p.tx(" ("); boolean firsti = true; for (ContactDetail ci : tp.getContact()) { @@ -69,7 +69,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasCategory()) { p = x.para(); - p.b().tx("Category: "); + p.b().tx(/*!#*/"Category: "); boolean first = true; for (CodeableConcept cc : tp.getCategory()) { if (first) @@ -83,10 +83,10 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasScope()) { if (tp.getScope().size() == 1) { p = x.para(); - p.b().tx("Test Plan Scope: "); + p.b().tx(/*!#*/"Test Plan Scope: "); renderReference(tp, p, tp.getScopeFirstRep()); } else { - x.para().b().tx("Test Plan Scopes:"); + x.para().b().tx(/*!#*/"Test Plan Scopes:"); XhtmlNode ul = x.ul(); for (Reference ref : tp.getScope()) { renderReference(tp, ul.li(), ref); @@ -97,7 +97,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasDependency()) { if (tp.getDependency().size() == 1) { p = x.para(); - p.b().tx("Test Plan Dependency: "); + p.b().tx(/*!#*/"Test Plan Dependency: "); XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); if (!Utilities.noString(tp.getDependencyFirstRep().getDescription())) { @@ -106,7 +106,7 @@ public class TestPlanRenderer extends ResourceRenderer { tr = t.tr(); renderReference(tp, tr.td(), tp.getDependencyFirstRep().getPredecessor()); } else { - x.para().b().tx("Test Plan Dependencies:"); + x.para().b().tx(/*!#*/"Test Plan Dependencies:"); XhtmlNode ul = x.ul(); XhtmlNode li = null; for (TestPlanDependencyComponent d : tp.getDependency()) { @@ -115,7 +115,7 @@ public class TestPlanRenderer extends ResourceRenderer { addMarkdown(li, d.getDescription()); } else { - li.addText("Dependency - no description"); + li.addText(/*!#*/"Dependency - no description"); } if (d.hasPredecessor()) { XhtmlNode liul = li.ul(); @@ -132,15 +132,15 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasTestCase()) { for (TestPlanTestCaseComponent tc : tp.getTestCase()) { - x.h2().addText("Test Case" + (tc.hasSequence() ? " - Sequence" + tc.getSequence() : "")); + x.h2().addText(/*!#*/"Test Case" + (tc.hasSequence() ? " - Sequence" + tc.getSequence() : "")); if (tc.hasScope()) { if (tc.getScope().size() == 1) { p = x.para(); - p.b().tx("Test Case Scope: "); + p.b().tx(/*!#*/"Test Case Scope: "); renderReference(tp, p, tc.getScopeFirstRep()); } else { - x.para().b().tx("Test Case Scopes:"); + x.para().b().tx(/*!#*/"Test Case Scopes:"); XhtmlNode ul = x.ul(); for (Reference ref : tc.getScope()) { renderReference(tp, ul.li(), ref); @@ -150,7 +150,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasDependency()) { if (tc.getDependency().size() == 1) { - x.h3().addText("Test Case Dependency"); + x.h3().addText(/*!#*/"Test Case Dependency"); XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); if (!Utilities.noString(tc.getDependencyFirstRep().getDescription())) { @@ -159,7 +159,7 @@ public class TestPlanRenderer extends ResourceRenderer { tr = t.tr(); renderReference(tp, tr.td(), tc.getDependencyFirstRep().getPredecessor()); } else { - x.h3().addText("Test Case Dependencies"); + x.h3().addText(/*!#*/"Test Case Dependencies"); XhtmlNode ul = x.ul(); XhtmlNode li = null; for (TestCaseDependencyComponent d : tc.getDependency()) { @@ -168,7 +168,7 @@ public class TestPlanRenderer extends ResourceRenderer { addMarkdown(li, d.getDescription()); } else { - li.addText("Dependency - no description"); + li.addText(/*!#*/"Dependency - no description"); } if (d.hasPredecessor()) { XhtmlNode liul = li.ul(); @@ -181,14 +181,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasTestRun()) { if (tc.getTestRun().size() == 1) { - x.h3().addText("Test Run"); + x.h3().addText(/*!#*/"Test Run"); renderTestRun(x, tp, tc.getTestRunFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestRunComponent trun : tc.getTestRun()) { count++; - x.h3().addText("Test Run " + count); + x.h3().addText(/*!#*/"Test Run " + count); renderTestRun(x, tp, trun); } } @@ -196,14 +196,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasTestData()) { if (tc.getTestData().size() == 1) { - x.h3().addText("Test Data"); + x.h3().addText(/*!#*/"Test Data"); renderTestData(x, tp, tc.getTestDataFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestDataComponent tdata : tc.getTestData()) { count++; - x.h3().addText("Test Data " + count); + x.h3().addText(/*!#*/"Test Data " + count); renderTestData(x, tp, tdata); } } @@ -211,14 +211,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasAssertion()) { if (tc.getAssertion().size() == 1) { - x.h3().addText("Assertion"); + x.h3().addText(/*!#*/"Assertion"); renderAssertion(x, tp, tc.getAssertionFirstRep()); } else { int count = 0; for (TestPlanTestCaseAssertionComponent as : tc.getAssertion()) { count++; - x.h3().addText("Assertion " + count); + x.h3().addText(/*!#*/"Assertion " + count); renderAssertion(x, tp, as); } } @@ -237,8 +237,8 @@ public class TestPlanRenderer extends ResourceRenderer { if (trun.hasScript()) { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Language"); - tr.td().b().addText("Source[x]"); + tr.td().b().addText(/*!#*/"Language"); + tr.td().b().addText(/*!#*/"Source[x]"); tr = t.tr(); if (trun.getScript().hasLanguage()) { renderCodeableConcept(tr.td(), trun.getScript().getLanguage(), false); @@ -261,9 +261,9 @@ public class TestPlanRenderer extends ResourceRenderer { private void renderTestData(XhtmlNode x, TestPlan tp, TestPlanTestCaseTestDataComponent tdata) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Type"); - tr.td().b().addText("Content"); - tr.td().b().addText("Source[x]"); + tr.td().b().addText(/*!#*/"Type"); + tr.td().b().addText(/*!#*/"Content"); + tr.td().b().addText(/*!#*/"Source[x]"); tr = t.tr(); if (tdata.hasType()) { renderCoding(tr.td(), tdata.getType()); @@ -291,9 +291,9 @@ public class TestPlanRenderer extends ResourceRenderer { private void renderAssertion(XhtmlNode x, TestPlan tp, TestPlanTestCaseAssertionComponent as) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Type"); - tr.td().b().addText("Content"); - tr.td().b().addText("Result"); + tr.td().b().addText(/*!#*/"Type"); + tr.td().b().addText(/*!#*/"Content"); + tr.td().b().addText(/*!#*/"Result"); tr = t.tr(); if (as.hasType()) { XhtmlNode td = tr.td(); 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 83b5a6886..e235ad9d8 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 @@ -78,7 +78,7 @@ public class ValueSetRenderer extends TerminologyRenderer { super(context, rcontext); } - private static final String ABSTRACT_CODE_HINT = "This code is not selectable ('Abstract')"; + private static final String ABSTRACT_CODE_HINT = /*!#*/"This code is not selectable ('Abstract')"; private static final int MAX_DESIGNATIONS_IN_LINE = 5; @@ -185,7 +185,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (header) { XhtmlNode h = x.addTag(getHeader()); - h.tx("Value Set Contents"); + h.tx(/*!#*/"Value Set Contents"); if (IsNotFixedExpansion(vs)) addMarkdown(x, vs.getDescription()); if (vs.hasCopyright()) @@ -207,9 +207,9 @@ public class ValueSetRenderer extends TerminologyRenderer { // } String msg = null; if (vs.getExpansion().getContains().isEmpty()) { - msg = "This value set cannot be expanded because of the way it is defined - it has an infinite number of members."; // not sure that's true? + msg = /*!#*/"This value set cannot be expanded because of the way it is defined - it has an infinite number of members."; // not sure that's true? } else { - msg = "This value set cannot be fully expanded, but a selection ("+countMembership(vs)+" codes) of the whole set of codes is shown here."; + msg = /*!#*/"This value set cannot be fully expanded, but a selection ("+countMembership(vs)+" codes) of the whole set of codes is shown here."; } x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { @@ -217,17 +217,17 @@ public class ValueSetRenderer extends TerminologyRenderer { if (vs.getExpansion().hasTotal()) { if (count != vs.getExpansion().getTotal()) { x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px") - .addText("This value set has "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" codes in it. In order to keep the publication size manageable, only a selection ("+count+" codes) of the whole set of codes is shown."); + .addText(/*!#*/"This value set has "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" codes in it. In order to keep the publication size manageable, only a selection ("+count+" codes) of the whole set of codes is shown."); } else { - x.para().tx("This value set contains "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" concepts."); + x.para().tx(/*!#*/"This value set contains "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" concepts."); } } else if (count == 1000) { // it's possible that there's exactly 1000 codes, in which case wht we're about to do is wrong // work in progress to tighten up the terminology system to always return a total... - String msg = "This value set has >1000 codes in it. In order to keep the publication size manageable, only a selection (1000 codes) of the whole set of codes is shown"; + String msg = /*!#*/"This value set has >1000 codes in it. In order to keep the publication size manageable, only a selection (1000 codes) of the whole set of codes is shown"; x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { - x.para().tx("This value set expansion contains "+count+" concepts."); + x.para().tx(/*!#*/"This value set expansion contains "+count+" concepts."); } } @@ -245,21 +245,21 @@ public class ValueSetRenderer extends TerminologyRenderer { XhtmlNode t = x.table( "codes"); XhtmlNode tr = t.tr(); if (doLevel) - tr.td().b().tx("Level"); - tr.td().attribute("style", "white-space:nowrap").b().tx("Code"); - tr.td().b().tx("System"); + tr.td().b().tx(/*!#*/"Level"); + tr.td().attribute("style", "white-space:nowrap").b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"System"); XhtmlNode tdDisp = tr.td(); - tdDisp.b().tx("Display"); + tdDisp.b().tx(/*!#*/"Display"); boolean doDesignations = false; for (ValueSetExpansionContainsComponent c : vs.getExpansion().getContains()) { scanForDesignations(c, langs, designations); } scanForProperties(vs.getExpansion(), langs, properties); if (doInactive) { - tr.td().b().tx("Inactive"); + tr.td().b().tx(/*!#*/"Inactive"); } if (doDefinition) { - tr.td().b().tx("Definition"); + tr.td().b().tx(/*!#*/"Definition"); doDesignations = false; for (String n : Utilities.sorted(properties.keySet())) { tr.td().b().ah(properties.get(n)).addText(n); @@ -295,15 +295,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); } else if (langs.size() == 0) { - x.para().b().tx("Additional Designations"); + x.para().b().tx(/*!#*/"Additional Designations"); } else { - x.para().b().tx("Additional Designations and Language Displays"); + x.para().b().tx(/*!#*/"Additional Designations and Language Displays"); } t = x.table("codes"); tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -343,8 +343,8 @@ public class ValueSetRenderer extends TerminologyRenderer { } private boolean generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) { - generateContentModeNotice(x, expansion, "example", "Expansion based on example code system", vs); - return generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs); + generateContentModeNotice(x, expansion, "example", /*!#*/"Expansion based on example code system", vs); + return generateContentModeNotice(x, expansion, "fragment", /*!#*/"Expansion based on code system fragment", vs); } private boolean generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) { @@ -487,14 +487,14 @@ public class ValueSetRenderer extends TerminologyRenderer { if (versions.size() == 1 && versions.get(s).size() == 1) { for (String v : versions.get(s)) { // though there'll only be one XhtmlNode p = x.para().style("border: black 1px dotted; background-color: #EEEEEE; padding: 8px; margin-bottom: 8px"); - p.tx("Expansion based on "); + p.tx(/*!#*/"Expansion based on "); expRef(p, s, v, vs); } } else { for (String v : versions.get(s)) { if (first) { div = x.div().style("border: black 1px dotted; background-color: #EEEEEE; padding: 8px; margin-bottom: 8px"); - div.para().tx("Expansion based on: "); + div.para().tx(/*!#*/"Expansion based on: "); ul = div.ul(); first = false; } @@ -514,30 +514,30 @@ public class ValueSetRenderer extends TerminologyRenderer { if (parts.length >= 5) { String m = describeModule(parts[4]); if (parts.length == 7) { - x.tx("SNOMED CT "+m+" edition "+formatSCTDate(parts[6])); + x.tx(/*!#*/"SNOMED CT "+m+" edition "+formatSCTDate(parts[6])); } else { - x.tx("SNOMED CT "+m+" edition"); + x.tx(/*!#*/"SNOMED CT "+m+" edition"); } } else { - x.tx(describeSystem(u)+" version "+v); + x.tx(describeSystem(u)+" "+/*!#*/"version "+v); } } else if (u.equals("http://loinc.org")) { String vd = describeLoincVer(v); if (vd != null) { - x.tx("Loinc v"+v+" ("+vd+")"); + x.tx(/*!#*/"Loinc v"+v+" ("+vd+")"); } else { - x.tx("Loinc v"+v); + x.tx(/*!#*/"Loinc v"+v); } } else if (Utilities.noString(v)) { CanonicalResource cr = (CanonicalResource) getContext().getWorker().fetchResource(Resource.class, u, source); if (cr != null) { if (cr.hasWebPath()) { - x.ah(cr.getWebPath()).tx(t+" "+cr.present()+" (no version) ("+cr.fhirType()+")"); + x.ah(cr.getWebPath()).tx(t+" "+cr.present()+" "+/*!#*/"(no version) ("+cr.fhirType()+")"); } else { - x.tx(t+" "+describeSystem(u)+" (no version) ("+cr.fhirType()+")"); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"(no version) ("+cr.fhirType()+")"); } } else { - x.tx(t+" "+describeSystem(u)+" (no version)"); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"(no version)"); } } else { CanonicalResource cr = (CanonicalResource) getContext().getWorker().fetchResource(Resource.class, u+"|"+v, source); @@ -548,7 +548,7 @@ public class ValueSetRenderer extends TerminologyRenderer { x.tx(t+" "+describeSystem(u)+" v"+v+" ("+cr.fhirType()+")"); } } else { - x.tx(t+" "+describeSystem(u)+" version "+v); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"version "+v); } } } @@ -620,21 +620,21 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describeModule(String module) { if ("900000000000207008".equals(module)) - return "International"; + return /*!#*/"International"; if ("731000124108".equals(module)) - return "United States"; + return /*!#*/"United States"; if ("32506021000036107".equals(module)) - return "Australian"; + return /*!#*/"Australian"; if ("449081005".equals(module)) - return "Spanish"; + return /*!#*/"Spanish"; if ("554471000005108".equals(module)) - return "Danish"; + return /*!#*/"Danish"; if ("11000146104".equals(module)) - return "Dutch"; + return /*!#*/"Dutch"; if ("45991000052106".equals(module)) - return "Swedish"; + return /*!#*/"Swedish"; if ("999000041000000102".equals(module)) - return "United Kingdon"; + return /*!#*/"United Kingdon"; return module; } @@ -828,7 +828,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (doInactive) { td = tr.td(); if (c.getInactive()) { - td.tx("inactive"); + td.tx(/*!#*/"inactive"); } } if (doDefinition) { @@ -960,26 +960,26 @@ public class ValueSetRenderer extends TerminologyRenderer { hasExtensions = genInclude(x.ul(), vs.getCompose().getInclude().get(0), "Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; } else { XhtmlNode p = x.para(); - p.tx("This value set includes codes based on the following rules:"); + p.tx(/*!#*/"This value set includes codes based on the following rules:"); XhtmlNode ul = x.ul(); for (ConceptSetComponent inc : vs.getCompose().getInclude()) { - hasExtensions = genInclude(ul, inc, "Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, inc, /*!#*/"Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "include")) { - genInclude(ul, (ConceptSetComponent) inc, "Include", langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, /*!#*/"Include", langs, doDesignations, maps, designations, index, vs); index++; } if (vs.getCompose().hasExclude() || VersionComparisonAnnotation.hasDeleted(vs.getCompose(), "exclude")) { p = x.para(); - p.tx("This value set excludes codes based on the following rules:"); + p.tx(/*!#*/"This value set excludes codes based on the following rules:"); ul = x.ul(); for (ConceptSetComponent exc : vs.getCompose().getExclude()) { - hasExtensions = genInclude(ul, exc, "Exclude", langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, exc, /*!#*/"Exclude", langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "exclude")) { - genInclude(ul, (ConceptSetComponent) inc, "Exclude", langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, /*!#*/"Exclude", langs, doDesignations, maps, designations, index, vs); index++; } } @@ -990,15 +990,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); } else if (langs.size() == 0) { - x.para().b().tx("Additional Designations"); + x.para().b().tx(/*!#*/"Additional Designations"); } else { - x.para().b().tx("Additional Designations and Language Displays"); + x.para().b().tx(/*!#*/"Additional Designations and Language Displays"); } XhtmlNode t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -1017,14 +1017,14 @@ public class ValueSetRenderer extends TerminologyRenderer { } private void renderExpansionRules(XhtmlNode x, ConceptSetComponent inc, int index, Map definitions) throws FHIRException, IOException { - String s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface, but the rules are not properly defined"; + String s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface, but the rules are not properly defined"; if (inc.hasExtension(ToolingExtensions.EXT_EXPAND_RULES)) { String rule = inc.getExtensionString(ToolingExtensions.EXT_EXPAND_RULES); if (rule != null) { switch (rule) { - case "all-codes": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains all the codes, and also this structure:"; - case "ungrouped": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure, and any codes not found in the structure:"; - case "groups-only": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure:"; + case "all-codes": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains all the codes, and also this structure:"; + case "ungrouped": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure, and any codes not found in the structure:"; + case "groups-only": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure:"; } } } @@ -1033,8 +1033,8 @@ public class ValueSetRenderer extends TerminologyRenderer { HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("exp.h="+index, context.getRules() == GenerationRules.IG_PUBLISHER); model.setAlternating(true); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("vs.exp.header", "Code"), translate("vs.exp.hint", "The code for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("vs.exp.header", "Display"), translate("vs.exp.hint", "The display for the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Code", /*!#*/"The code for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Display", /*!#*/"The display for the item", null, 0)); for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) { renderExpandGroup(gen, model, ext, inc, definitions); @@ -1142,9 +1142,9 @@ public class ValueSetRenderer extends TerminologyRenderer { } switch (url) { case "http://snomed.info/sct#900000000000003001": - return "Fully specified name"; + return /*!#*/"Fully specified name"; case "http://snomed.info/sct#900000000000013009": - return "Synonym"; + return /*!#*/"Synonym"; default: // As specified in http://www.hl7.org/fhir/valueset-definitions.html#ValueSet.compose.include.concept.designation.use and in http://www.hl7.org/fhir/codesystem-definitions.html#CodeSystem.concept.designation.use the terminology binding is extensible. return url; @@ -1178,14 +1178,14 @@ public class ValueSetRenderer extends TerminologyRenderer { if (inc.hasSystem()) { CodeSystem e = getContext().getWorker().fetchCodeSystem(inc.getSystem()); if (inc.getConcept().size() == 0 && inc.getFilter().size() == 0) { - li.addText(type+" all codes defined in "); + li.addText(type+" "+/*!#*/"all codes defined in "); addCsRef(inc, li, e); } else { if (inc.getConcept().size() > 0) { - li.addText(type+" these codes as defined in "); + li.addText(type+" "+/*!#*/"these codes as defined in "); addCsRef(inc, li, e); if (inc.hasVersion()) { - li.addText(" version "); + li.addText(" "+/*!#*/"version "); li.code(inc.getVersion()); } @@ -1212,24 +1212,24 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.getFilter().size() > 0) { - li.addText(type+" codes from "); + li.addText(type+" "+/*!#*/"codes from "); addCsRef(inc, li, e); - li.tx(" where "); + li.tx(" "+/*!#*/"where "); for (int i = 0; i < inc.getFilter().size(); i++) { ConceptSetFilterComponent f = inc.getFilter().get(i); if (i > 0) { if (i == inc.getFilter().size()-1) { - li.tx(" and "); + li.tx(" "+/*!#*/"and "); } else { - li.tx(", "); + li.tx(/*!#*/", "); } } XhtmlNode wli = renderStatus(f, li); if (f.getOp() == FilterOperator.EXISTS) { if (f.getValue().equals("true")) { - wli.tx(f.getProperty()+" exists"); + wli.tx(f.getProperty()+" "+/*!#*/"exists"); } else { - wli.tx(f.getProperty()+" doesn't exist"); + wli.tx(f.getProperty()+" "+/*!#*/"doesn't exist"); } } else { wli.tx(f.getProperty()+" "+describe(f.getOp())+" "); @@ -1257,7 +1257,7 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.hasValueSet()) { - li.tx(", where the codes are contained in "); + li.tx(/*!#*/", where the codes are contained in "); boolean first = true; for (UriType vs : inc.getValueSet()) { if (first) @@ -1273,7 +1273,7 @@ public class ValueSetRenderer extends TerminologyRenderer { renderExpansionRules(li, inc, index, definitions); } } else { - li.tx("Import all the codes that are contained in "); + li.tx(/*!#*/"Import all the codes that are contained in "); if (inc.getValueSet().size() < 4) { boolean first = true; for (UriType vs : inc.getValueSet()) { @@ -1324,7 +1324,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (hasComments) { td = tr.td(); if (ExtensionHelper.hasExtension(c, ToolingExtensions.EXT_VS_COMMENT)) { - smartAddText(td, "Note: "+ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)); + smartAddText(td, /*!#*/"Note: "+ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)); } } if (doDesignations) { @@ -1405,7 +1405,7 @@ public class ValueSetRenderer extends TerminologyRenderer { ValueSetExpansionOutcome vso = getContext().getWorker().expandVS(vs, true, false); ValueSet valueset = vso.getValueset(); if (valueset == null) - throw new TerminologyServiceException("Error Expanding ValueSet: "+vso.getError()); + throw new TerminologyServiceException(/*!#*/"Error Expanding ValueSet: "+vso.getError()); vse = valueset.getExpansion(); } catch (Exception e1) { @@ -1502,18 +1502,18 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describe(FilterOperator op) { if (op == null) - return " null "; + return " "+/*!#*/"null "; switch (op) { - case EQUAL: return " = "; - case ISA: return " is-a "; - case ISNOTA: return " is-not-a "; - case REGEX: return " matches (by regex) "; - case NULL: return " ?ngen-13? "; - case IN: return " in "; - case NOTIN: return " not in "; - case DESCENDENTOF: return " descends from "; - case EXISTS: return " exists "; - case GENERALIZES: return " generalizes "; + case EQUAL: return " "+/*!#*/"= "; + case ISA: return " "+/*!#*/"is-a "; + case ISNOTA: return " "+/*!#*/"is-not-a "; + case REGEX: return " "+/*!#*/"matches (by regex) "; + case NULL: return " "+/*!#*/"?ngen-13? "; + case IN: return " "+/*!#*/"in "; + case NOTIN: return " "+/*!#*/"not in "; + case DESCENDENTOF: return " "+/*!#*/"descends from "; + case EXISTS: return " "+/*!#*/"exists "; + case GENERALIZES: return " "+/*!#*/"generalizes "; } return null; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java index 0bced86fb..b4dd81e58 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java @@ -94,22 +94,22 @@ public class HierarchicalTableGenerator { XML, XHTML } - public static final String TEXT_ICON_REFERENCE = "Reference to another Resource"; - public static final String TEXT_ICON_PRIMITIVE = "Primitive Data Type"; - public static final String TEXT_ICON_KEY = "JSON Key Value"; - public static final String TEXT_ICON_DATATYPE = "Data Type"; - public static final String TEXT_ICON_RESOURCE = "Resource"; - public static final String TEXT_ICON_ELEMENT = "Element"; - public static final String TEXT_ICON_OBJECT_BOX = "Object"; - public static final String TEXT_ICON_REUSE = "Reference to another Element"; - public static final String TEXT_ICON_EXTENSION = "Extension"; - public static final String TEXT_ICON_CHOICE = "Choice of Types"; - public static final String TEXT_ICON_SLICE = "Slice Definition"; - public static final String TEXT_ICON_SLICE_ITEM = "Slice Item"; - public static final String TEXT_ICON_FIXED = "Fixed Value"; - public static final String TEXT_ICON_EXTENSION_SIMPLE = "Simple Extension"; - public static final String TEXT_ICON_PROFILE = "Profile"; - public static final String TEXT_ICON_EXTENSION_COMPLEX = "Complex Extension"; + /*!#*/public static final String TEXT_ICON_REFERENCE = "Reference to another Resource"; + /*!#*/public static final String TEXT_ICON_PRIMITIVE = "Primitive Data Type"; + /*!#*/public static final String TEXT_ICON_KEY = "JSON Key Value"; + /*!#*/public static final String TEXT_ICON_DATATYPE = "Data Type"; + /*!#*/public static final String TEXT_ICON_RESOURCE = "Resource"; + /*!#*/public static final String TEXT_ICON_ELEMENT = "Element"; + /*!#*/public static final String TEXT_ICON_OBJECT_BOX = "Object"; + /*!#*/public static final String TEXT_ICON_REUSE = "Reference to another Element"; + /*!#*/public static final String TEXT_ICON_EXTENSION = "Extension"; + /*!#*/public static final String TEXT_ICON_CHOICE = "Choice of Types"; + /*!#*/public static final String TEXT_ICON_SLICE = "Slice Definition"; + /*!#*/public static final String TEXT_ICON_SLICE_ITEM = "Slice Item"; + /*!#*/public static final String TEXT_ICON_FIXED = "Fixed Value"; + /*!#*/public static final String TEXT_ICON_EXTENSION_SIMPLE = "Simple Extension"; + /*!#*/public static final String TEXT_ICON_PROFILE = "Profile"; + /*!#*/public static final String TEXT_ICON_EXTENSION_COMPLEX = "Complex Extension"; public static final int NEW_REGULAR = 0; public static final int CONTINUE_REGULAR = 1;