From a86fe5a2d2ca1faa34f8e8dc703b513420a23058 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 20 May 2024 04:37:37 -0500 Subject: [PATCH 1/3] FIx up issues with calling translation on the wrong set of properties (#1592) --- .../fhir/r5/comparison/ComparisonSession.java | 10 +- .../StructureDefinitionComparer.java | 26 +- .../r5/renderers/ActorDefinitionRenderer.java | 10 +- .../renderers/AdditionalBindingsRenderer.java | 42 +- .../hl7/fhir/r5/renderers/BundleRenderer.java | 56 +- .../CapabilityStatementRenderer.java | 148 ++--- .../fhir/r5/renderers/CodeSystemRenderer.java | 60 +- .../fhir/r5/renderers/ConceptMapRenderer.java | 46 +- .../hl7/fhir/r5/renderers/DataRenderer.java | 170 +++--- .../renderers/DiagnosticReportRenderer.java | 44 +- .../r5/renderers/ExampleScenarioRenderer.java | 60 +- .../ImplementationGuideRenderer.java | 2 +- .../fhir/r5/renderers/LibraryRenderer.java | 42 +- .../hl7/fhir/r5/renderers/ListRenderer.java | 48 +- .../r5/renderers/NamingSystemRenderer.java | 32 +- .../r5/renderers/ObligationsRenderer.java | 12 +- .../OperationDefinitionRenderer.java | 28 +- .../renderers/OperationOutcomeRenderer.java | 18 +- .../fhir/r5/renderers/ParametersRenderer.java | 6 +- .../fhir/r5/renderers/PatientRenderer.java | 60 +- .../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 | 58 +- .../r5/renderers/RequirementsRenderer.java | 20 +- .../fhir/r5/renderers/ResourceRenderer.java | 50 +- .../r5/renderers/SearchParameterRenderer.java | 44 +- .../StructureDefinitionRenderer.java | 572 +++++++++--------- .../r5/renderers/StructureMapRenderer.java | 2 +- .../renderers/SubscriptionTopicRenderer.java | 44 +- .../r5/renderers/TerminologyRenderer.java | 18 +- .../fhir/r5/renderers/TestPlanRenderer.java | 54 +- .../fhir/r5/renderers/ValueSetRenderer.java | 164 ++--- .../utilities/i18n/RenderingI18nContext.java | 15 +- .../xhtml/HierarchicalTableGenerator.java | 42 +- .../resources/rendering-phrases.properties | 2 +- .../cli/services/ComparisonService.java | 3 +- .../comparison/tests/ComparisonTests.java | 3 +- 39 files changed, 1168 insertions(+), 1153 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonSession.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonSession.java index 167e6cc14..52f4f5db1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonSession.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonSession.java @@ -25,6 +25,8 @@ import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.ValueSet; +import org.hl7.fhir.r5.renderers.utils.RenderingContext; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; public class ComparisonSession { @@ -39,8 +41,9 @@ public class ComparisonSession { private String title; private ProfileKnowledgeProvider pkpLeft; private ProfileKnowledgeProvider pkpRight; + private RenderingI18nContext i18n; - public ComparisonSession(IWorkerContext contextLeft, IWorkerContext contextRight, String title, ProfileKnowledgeProvider pkpLeft, ProfileKnowledgeProvider pkpRight) { + public ComparisonSession(RenderingI18nContext i18n, IWorkerContext contextLeft, IWorkerContext contextRight, String title, ProfileKnowledgeProvider pkpLeft, ProfileKnowledgeProvider pkpRight) { super(); this.contextLeft = contextLeft; this.contextRight = contextRight; @@ -48,6 +51,7 @@ public class ComparisonSession { this.title = title; this.pkpLeft = pkpLeft; this.pkpRight = pkpRight; + this.i18n = i18n; debug = false; } @@ -175,6 +179,10 @@ public class ComparisonSession { return annotate; } + public RenderingI18nContext getI18n() { + return i18n; + } + public void setAnnotate(boolean annotate) { this.annotate = annotate; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java index 3f562a249..713ccf44a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java @@ -42,8 +42,6 @@ import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode; import org.hl7.fhir.r5.utils.DefinitionNavigator; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.i18n.I18nConstants; -import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; @@ -1253,7 +1251,7 @@ public class StructureDefinitionComparer extends CanonicalResourceComparer imple } public XhtmlNode renderStructure(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false, true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(session.getI18n(), Utilities.path("[tmp]", "compare"), false, true); TableModel model = gen.initComparisonTable(corePath, id); genElementComp(null /* come back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true); return gen.generate(model, prefix, 0, null); @@ -1290,32 +1288,32 @@ public class StructureDefinitionComparer extends CanonicalResourceComparer imple boolean ext = false; if (tail(path).equals("extension")) { if (elementIsComplex(combined)) - row.setIcon("icon_extension_complex.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX)); + row.setIcon("icon_extension_complex.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX)); else - row.setIcon("icon_extension_simple.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + row.setIcon("icon_extension_simple.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); ext = true; } else if (tail(path).equals("modifierExtension")) { if (elementIsComplex(combined)) - row.setIcon("icon_modifier_extension_complex.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX)); + row.setIcon("icon_modifier_extension_complex.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX)); else - row.setIcon("icon_modifier_extension_simple.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + row.setIcon("icon_modifier_extension_simple.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); } else if (hasChoice(combined)) { if (allAreReference(combined)) - row.setIcon("icon_reference.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + row.setIcon("icon_reference.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); else { - row.setIcon("icon_choice.gif", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_CHOICE)); + row.setIcon("icon_choice.gif", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_CHOICE)); typesRow = row; } } else if (combined.either().getDef().hasContentReference()) - row.setIcon("icon_reuse.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_REUSE)); + row.setIcon("icon_reuse.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_REUSE)); else if (isPrimitive(combined)) - row.setIcon("icon_primitive.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_PRIMITIVE)); + row.setIcon("icon_primitive.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_PRIMITIVE)); else if (hasTarget(combined)) - row.setIcon("icon_reference.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + row.setIcon("icon_reference.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); else if (isDataType(combined)) - row.setIcon("icon_datatype.gif", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_DATATYPE)); + row.setIcon("icon_datatype.gif", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_DATATYPE)); else - row.setIcon("icon_resource.png", utilsLeft.getContext().formatMessage(RenderingI18nContext.TEXT_ICON_RESOURCE)); + row.setIcon("icon_resource.png", session.getI18n().formatPhrase(RenderingContext.TEXT_ICON_RESOURCE)); String ref = defPath == null ? null : defPath + combined.either().getDef().getId(); String sName = tail(path); String sn = getSliceName(combined); 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 f42183782..41ac7bc42 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(context.formatMessage(RenderingContext.ACTOR_DEF_ACT, acd.getName()) + " "); + tr.td().b().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_ACT, acd.getName()) + " "); tr.td().tx(acd.getTitle()); - tr.td().tx(context.formatMessage(RenderingContext.ACTOR_DEF_TYP, acd.getType().toCode()) + " "); + tr.td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_TYP, acd.getType().toCode()) + " "); XhtmlNode td = tbl.tr().td().colspan("3"); addMarkdown(td, acd.getDocumentation()); if (acd.hasReference()) { - tbl.tr().td().tx(context.formatMessage(RenderingContext.ACTOR_DEF_REF)); + tbl.tr().td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_REF)); 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(context.formatMessage(RenderingContext.ACTOR_DEF_CAP)); + tbl.tr().td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_CAP)); 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(context.formatMessage(RenderingContext.ACTOR_DEF_DER)); + tbl.tr().td().tx(context.formatPhrase(RenderingContext.ACTOR_DEF_DER)); 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 bbc768ade..6577f6729 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(context.formatMessage(RenderingContext.ADD_BIND_ADD_BIND)); - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.ADD_BIND_PUR)); + tr.td().style("font-size: 11px").b().tx(context.formatPhrase(RenderingContext.ADD_BIND_ADD_BIND)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.ADD_BIND_PUR)); if (usage) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.ADD_BIND_USE)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.ADD_BIND_USE)); } if (any) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.ADD_BIND_ANY)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.ADD_BIND_ANY)); } if (doco) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.ADD_BIND_DOC)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.ADD_BIND_DOC)); } for (AdditionalBindingDetail binding : bindings) { tr = new XhtmlNode(NodeType.Element, "tr"); @@ -296,8 +296,8 @@ public class AdditionalBindingsRenderer { } } if (any) { - String newRepeat = binding.any ? context.formatMessage(RenderingContext.ADD_BIND_ANY_REP) : context.formatMessage(RenderingContext.ADD_BIND_ALL_REP); - String oldRepeat = binding.compare!=null && binding.compare.any ? context.formatMessage(RenderingContext.ADD_BIND_ANY_REP) : context.formatMessage(RenderingContext.ADD_BIND_ALL_REP); + String newRepeat = binding.any ? context.formatPhrase(RenderingContext.ADD_BIND_ANY_REP) : context.formatPhrase(RenderingContext.ADD_BIND_ALL_REP); + String oldRepeat = binding.compare!=null && binding.compare.any ? context.formatPhrase(RenderingContext.ADD_BIND_ANY_REP) : context.formatPhrase(RenderingContext.ADD_BIND_ALL_REP); 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", context.formatMessage(RenderingContext.ADD_BIND_EXT_PREF)).tx(context.formatMessage(RenderingContext.ADD_BIND_MAX)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", context.formatPhrase(RenderingContext.ADD_BIND_EXT_PREF)).tx(context.formatPhrase(RenderingContext.ADD_BIND_MAX)); break; case "minimum": - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", context.formatMessage(RenderingContext.ADD_BIND_MIN_ALLOW)).tx(context.formatMessage(RenderingContext.ADD_BIND_MIN)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", context.formatPhrase(RenderingContext.ADD_BIND_MIN_ALLOW)).tx(context.formatPhrase(RenderingContext.ADD_BIND_MIN)); break; case "required" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", context.formatMessage(RenderingContext.ADD_BIND_VALID_REQ)).tx(context.formatMessage(RenderingContext.ADD_BIND_REQ_BIND)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", context.formatPhrase(RenderingContext.ADD_BIND_VALID_REQ)).tx(context.formatPhrase(RenderingContext.ADD_BIND_REQ_BIND)); break; case "extensible" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", context.formatMessage(RenderingContext.ADD_BIND_VALID_EXT)).tx(context.formatMessage(RenderingContext.ADD_BIND_EX_BIND)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", context.formatPhrase(RenderingContext.ADD_BIND_VALID_EXT)).tx(context.formatPhrase(RenderingContext.ADD_BIND_EX_BIND)); break; case "current" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", context.formatMessage(RenderingContext.ADD_BIND_NEW_REC)).tx(context.formatMessage(RenderingContext.ADD_BIND_CURR_BIND)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", context.formatPhrase(RenderingContext.ADD_BIND_NEW_REC)).tx(context.formatPhrase(RenderingContext.ADD_BIND_CURR_BIND)); } else { - td.span(null, context.formatMessage(RenderingContext.ADD_BIND_NEW_REC)).tx(context.formatMessage(RenderingContext.ADD_BIND_REQUIRED)); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_NEW_REC)).tx(context.formatPhrase(RenderingContext.ADD_BIND_REQUIRED)); } break; case "preferred" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", context.formatMessage(RenderingContext.ADD_BIND_RECOM_VALUE_SET)).tx(context.formatMessage(RenderingContext.ADD_BIND_PREF_BIND)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", context.formatPhrase(RenderingContext.ADD_BIND_RECOM_VALUE_SET)).tx(context.formatPhrase(RenderingContext.ADD_BIND_PREF_BIND)); } else { - td.span(null, context.formatMessage(RenderingContext.ADD_BIND_RECOM_VALUE_SET)).tx(context.formatMessage(RenderingContext.ADD_BIND_PREFERRED)); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_RECOM_VALUE_SET)).tx(context.formatPhrase(RenderingContext.ADD_BIND_PREFERRED)); } break; case "ui" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", context.formatMessage(RenderingContext.ADD_BIND_GIVEN_CONT)).tx(context.formatMessage(RenderingContext.ADD_BIND_UI_BIND)); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", context.formatPhrase(RenderingContext.ADD_BIND_GIVEN_CONT)).tx(context.formatPhrase(RenderingContext.ADD_BIND_UI_BIND)); } else { - td.span(null, context.formatMessage(RenderingContext.ADD_BIND_GIVEN_CONT)).tx(context.formatMessage(RenderingContext.ADD_BIND_UI)); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_GIVEN_CONT)).tx(context.formatPhrase(RenderingContext.ADD_BIND_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, context.formatMessage(RenderingContext.ADD_BIND_DESIG_SYS)).tx(context.formatMessage(RenderingContext.ADD_BIND_STARTER)); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_DESIG_SYS)).tx(context.formatPhrase(RenderingContext.ADD_BIND_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, context.formatMessage(RenderingContext.ADD_BIND_VALUE_COMP)).tx(context.formatMessage(RenderingContext.ADD_BIND_COMPONENT)); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_VALUE_COMP)).tx(context.formatPhrase(RenderingContext.ADD_BIND_COMPONENT)); } break; default: - td.span(null, context.formatMessage(RenderingContext.ADD_BIND_UNKNOWN_PUR)).tx(purpose); + td.span(null, context.formatPhrase(RenderingContext.ADD_BIND_UNKNOWN_PUR)).tx(purpose); } } @@ -430,7 +430,7 @@ public class AdditionalBindingsRenderer { children.tx(" ("); boolean ffirst = !b.getAny(); if (b.getAny()) { - children.tx(context.formatMessage(RenderingContext.ADD_BIND_ANY_REP)); + children.tx(context.formatPhrase(RenderingContext.ADD_BIND_ANY_REP)); } 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/BundleRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java index e3550e1c9..4c7d110bf 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 @@ -68,13 +68,13 @@ 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(context.formatMessage(RenderingContext.BUND_REND_INVALID_DOC, b.getId(), entries.get(0).get("resource").fhirType()+"')")); + throw new FHIRException(context.formatPhrase(RenderingContext.BUND_REND_INVALID_DOC, b.getId(), entries.get(0).get("resource").fhirType()+"')")); return renderDocument(x, b, entries); } else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) { // nothing } else { XhtmlNode root = new XhtmlNode(NodeType.Element, "div"); - root.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue())); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue())); int i = 0; for (BaseWrapper be : entries) { i++; @@ -93,9 +93,9 @@ public class BundleRenderer extends ResourceRenderer { } root.hr(); if (be.has("fullUrl")) { - root.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue())); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue())); } else { - root.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ENTRY, Integer.toString(i))); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ENTRY, Integer.toString(i))); } // if (be.hasRequest()) // renderRequest(root, be.getRequest()); @@ -104,7 +104,7 @@ public class BundleRenderer extends ResourceRenderer { // if (be.hasResponse()) // renderResponse(root, be.getResponse()); if (be.has("resource")) { - root.para().addText(formatMessage(RenderingContext.BUNDLE_RESOURCE, be.get("resource").fhirType())); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_RESOURCE, be.get("resource").fhirType())); ResourceWrapper rw = be.getChildByName("resource").getAsResource(); XhtmlNode xn = rw.getNarrative(); if (xn == null || xn.isEmpty()) { @@ -114,7 +114,7 @@ public class BundleRenderer extends ResourceRenderer { xn = rr.render(rw); } catch (Exception e) { xn = new XhtmlNode(); - xn.para().b().tx(context.formatMessage(RenderingContext.BUNDLE_REV_EXCP, e.getMessage()) + " "); + xn.para().b().tx(context.formatPhrase(RenderingContext.BUNDLE_REV_EXCP, e.getMessage()) + " "); } } root.blockquote().para().addChildren(xn); @@ -288,15 +288,15 @@ 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(context.formatMessage(RenderingContext.BUNDLE_REV_INV_DOC)); + throw new FHIRException(context.formatPhrase(RenderingContext.BUNDLE_REV_INV_DOC)); } renderDocument(x, b); start = 1; docMode = true; x.hr(); - x.h2().addText(formatMessage(RenderingContext.BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode())); + x.h2().addText(formatPhrase(RenderingContext.BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode())); } else { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); } int i = 0; for (BundleEntryComponent be : b.getEntry()) { @@ -317,17 +317,17 @@ public class BundleRenderer extends ResourceRenderer { x.hr(); if (docMode) { if (be.hasFullUrl() && be.hasResource()) { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_URD, Integer.toString(i), be.getFullUrl(), be.getResource().fhirType(), be.getResource().getIdBase())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_URD, Integer.toString(i), be.getFullUrl(), be.getResource().fhirType(), be.getResource().getIdBase())); } else if (be.hasFullUrl()) { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_U, Integer.toString(i), be.getFullUrl())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_U, Integer.toString(i), be.getFullUrl())); } else if (be.hasResource()) { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_RD, Integer.toString(i), be.getResource().fhirType(), be.getResource().getIdBase())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_DOC_ENTRY_RD, Integer.toString(i), be.getResource().fhirType(), be.getResource().getIdBase())); } } else { if (be.hasFullUrl()) { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl())); } else { - x.para().addText(formatMessage(RenderingContext.BUNDLE_HEADER_ENTRY, Integer.toString(i))); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_HEADER_ENTRY, Integer.toString(i))); } if (be.hasRequest()) renderRequest(x, be.getRequest()); @@ -338,7 +338,7 @@ public class BundleRenderer extends ResourceRenderer { } if (be.hasResource()) { if (!docMode) { - x.para().addText(formatMessage(RenderingContext.BUNDLE_RESOURCE, be.getResource().fhirType())); + x.para().addText(formatPhrase(RenderingContext.BUNDLE_RESOURCE, be.getResource().fhirType())); } if (be.hasResource()) { XhtmlNode xn = null; @@ -352,7 +352,7 @@ public class BundleRenderer extends ResourceRenderer { rr.setRcontext(new ResourceContext(rcontext, be.getResource())); xn = rr.build(be.getResource()); } catch (Exception e) { - xn = makeExceptionXhtml(e, context.formatMessage(RenderingContext.BUND_REND_GEN_NARR)); + xn = makeExceptionXhtml(e, context.formatPhrase(RenderingContext.BUND_REND_GEN_NARR)); } } x.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); @@ -411,42 +411,42 @@ public class BundleRenderer extends ResourceRenderer { private void renderSearch(XhtmlNode root, BundleEntrySearchComponent search) { StringBuilder b = new StringBuilder(); - b.append(formatMessage(RenderingContext.BUNDLE_SEARCH)); + b.append(formatPhrase(RenderingContext.BUNDLE_SEARCH)); if (search.hasMode()) - b.append(formatMessage(RenderingContext.BUNDLE_SEARCH_MODE, search.getMode().toCode())); + b.append(formatPhrase(RenderingContext.BUNDLE_SEARCH_MODE, search.getMode().toCode())); if (search.hasScore()) { if (search.hasMode()) b.append(","); - b.append(formatMessage(RenderingContext.BUNDLE_SEARCH_SCORE, search.getScore())); + b.append(formatPhrase(RenderingContext.BUNDLE_SEARCH_SCORE, search.getScore())); } root.para().addText(b.toString()); } private void renderResponse(XhtmlNode root, BundleEntryResponseComponent response) { - root.para().addText(formatMessage(RenderingContext.BUNDLE_RESPONSE)); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_RESPONSE)); StringBuilder b = new StringBuilder(); b.append(response.getStatus()+"\r\n"); if (response.hasLocation()) - b.append(formatMessage(RenderingContext.BUNDLE_LOCATION, response.getLocation())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_LOCATION, response.getLocation())+"\r\n"); if (response.hasEtag()) - b.append(formatMessage(RenderingContext.BUNDLE_ETAG, response.getEtag())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_ETAG, response.getEtag())+"\r\n"); if (response.hasLastModified()) - b.append(formatMessage(RenderingContext.BUNDLE_LAST_MOD, response.getEtag())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_LAST_MOD, response.getEtag())+"\r\n"); root.pre().addText(b.toString()); } private void renderRequest(XhtmlNode root, BundleEntryRequestComponent request) { - root.para().addText(formatMessage(RenderingContext.BUNDLE_REQUEST)); + root.para().addText(formatPhrase(RenderingContext.BUNDLE_REQUEST)); StringBuilder b = new StringBuilder(); b.append(request.getMethod()+" "+request.getUrl()+"\r\n"); if (request.hasIfNoneMatch()) - b.append(formatMessage(RenderingContext.BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n"); if (request.hasIfModifiedSince()) - b.append(formatMessage(RenderingContext.BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n"); if (request.hasIfMatch()) - b.append(formatMessage(RenderingContext.BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n"); if (request.hasIfNoneExist()) - b.append(formatMessage(RenderingContext.BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n"); + b.append(formatPhrase(RenderingContext.BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n"); root.pre().addText(b.toString()); } 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 489f92d72..0e82c161e 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 @@ -289,17 +289,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { x.h(2,"title").addText(conf.getTitle()); XhtmlNode uList = x.ul(); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_IMP_VER, igVersion) + " "); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_FHIR_VER, currentVersion.toCode()) + " "); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_IMP_VER, igVersion) + " "); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_FHIR_VER, currentVersion.toCode()) + " "); addSupportedFormats(uList, conf); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_PUB_ON, displayDateTime(conf.getDateElement()) + " ")); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_PUB_BY, conf.getPublisherElement().asStringValue()) + " "); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_PUB_ON, displayDateTime(conf.getDateElement()) + " ")); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_PUB_BY, conf.getPublisherElement().asStringValue()) + " "); XhtmlNode block = x.addTag("blockquote").attribute("class","impl-note"); - block.addTag("p").addTag("strong").addText(context.formatMessage(RenderingContext.CAPABILITY_NOTE_CAP)); - block.addTag("p").addText(context.formatMessage(RenderingContext.CAPABILTY_ALLOW_CAP)); + block.addTag("p").addTag("strong").addText(context.formatPhrase(RenderingContext.CAPABILITY_NOTE_CAP)); + block.addTag("p").addText(context.formatPhrase(RenderingContext.CAPABILTY_ALLOW_CAP)); addSupportedCSs(x, conf); @@ -308,11 +308,11 @@ public class CapabilityStatementRenderer extends ResourceRenderer { int restNum = conf.getRest().size(); int nextLevel = 3; if (restNum > 0) { - x.h(2,"rest").addText((context.formatMessage(RenderingContext.CAPABILITY_REST_CAPS))); + x.h(2,"rest").addText((context.formatPhrase(RenderingContext.CAPABILITY_REST_CAPS))); int count=1; for (CapabilityStatementRestComponent rest : conf.getRest()) { if (restNum > 1) { - x.h(3,"rest"+Integer.toString(count)).addText(context.formatMessage(RenderingContext.CAPABILITY_REST_CONFIG, Integer.toString(count)) + " "); + x.h(3,"rest"+Integer.toString(count)).addText(context.formatPhrase(RenderingContext.CAPABILITY_REST_CONFIG, Integer.toString(count)) + " "); nextLevel = 4; } addRestConfigPanel(x, rest, nextLevel, count); @@ -330,8 +330,8 @@ public class CapabilityStatementRenderer extends ResourceRenderer { hasUpdates = hasUpdates || hasOp(r, TypeRestfulInteraction.HISTORYINSTANCE); } if (rest.getResource().size() >0) { - x.h(nextLevel,"resourcesCap" + Integer.toString(count)).addText(context.formatMessage(RenderingContext.CAPABILITY_RES_PRO)); - x.h(nextLevel+1,"resourcesSummary" + Integer.toString(count)).addText(context.formatMessage(RenderingContext.CAPABILITY_SUMM)); + x.h(nextLevel,"resourcesCap" + Integer.toString(count)).addText(context.formatPhrase(RenderingContext.CAPABILITY_RES_PRO)); + x.h(nextLevel+1,"resourcesSummary" + Integer.toString(count)).addText(context.formatPhrase(RenderingContext.CAPABILITY_SUMM)); addSummaryIntro(x); addSummaryTable(x, rest, hasVRead, hasPatch, hasDelete, hasHistory, hasUpdates, count); x.addTag("hr"); @@ -473,7 +473,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } XhtmlNode ul = null; if (igShalls.size() > 0) { - x.h(3,"shallIGs").addText(context.formatMessage(RenderingContext.CAPABILTY_SHALL_SUPP)); + x.h(3,"shallIGs").addText(context.formatPhrase(RenderingContext.CAPABILTY_SHALL_SUPP)); ul = x.ul(); for (String url : igShalls) { addResourceLink(ul.li(), url, url); @@ -481,7 +481,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } } if (igShoulds.size() > 0) { - x.h(3,"shouldIGs").addText(context.formatMessage(RenderingContext.CAPABILITY_SHOULD_SUPP)); + x.h(3,"shouldIGs").addText(context.formatPhrase(RenderingContext.CAPABILITY_SHOULD_SUPP)); ul = x.ul(); for (String url : igShoulds) { addResourceLink(ul.li(), url, url); @@ -489,7 +489,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } } if (igMays.size() > 0) { - x.h(3,"shouldIGs").addText(context.formatMessage(RenderingContext.CAPABILITY_SHOULD_SUPP)); + x.h(3,"shouldIGs").addText(context.formatPhrase(RenderingContext.CAPABILITY_SHOULD_SUPP)); ul = x.ul(); for (String url : igMays) { addResourceLink(ul.li(), url, url); @@ -502,7 +502,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { private void addSupportedFormats(XhtmlNode uList, CapabilityStatement conf) { XhtmlNode lItem = uList.li(); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP_FORM) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP_FORM) + " "); Boolean first = true; String capExpectation = null; for (CodeType c : conf.getFormat()) { @@ -512,13 +512,13 @@ public class CapabilityStatementRenderer extends ResourceRenderer { capExpectation = getExtValueCode(c.getExtensionByUrl(EXPECTATION)); if (!Utilities.noString(capExpectation)) { lItem.addTag("strong").addText(capExpectation); - lItem.addText(" "+ (context.formatMessage(RenderingContext.CAPABILITY_SUPP) + " ")); + lItem.addText(" "+ (context.formatPhrase(RenderingContext.CAPABILITY_SUPP) + " ")); } lItem.code().addText(c.getCode()); first = false; } lItem = uList.li(); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP_PATCH_FORM) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP_PATCH_FORM) + " "); first=true; for (CodeType c : conf.getPatchFormat()) { if (!first) { @@ -527,7 +527,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { capExpectation = getExtValueCode(c.getExtensionByUrl(EXPECTATION)); if (!Utilities.noString(capExpectation)) { lItem.addTag("strong").addText(capExpectation); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP) + " "); } lItem.code().addText(c.getCode()); first = false; @@ -564,16 +564,16 @@ public class CapabilityStatementRenderer extends ResourceRenderer { addMarkdown(body.blockquote(),mdText); } } - body.div().attribute("class","lead").addTag("em").addText(context.formatMessage(RenderingContext.CAPABILITY_SUMM_SYS_INT)); + body.div().attribute("class","lead").addTag("em").addText(context.formatPhrase(RenderingContext.CAPABILITY_SUMM_SYS_INT)); addSystemInteractions(body, rest.getInteraction()); } private String getCorsText(boolean on) { if (on) { - return context.formatMessage(RenderingContext.CAPABILITY_CORS_YES); + return context.formatPhrase(RenderingContext.CAPABILITY_CORS_YES); } - return context.formatMessage(RenderingContext.CAPABILITY_CORS_NO); + return context.formatPhrase(RenderingContext.CAPABILITY_CORS_NO); } private List getSecServices(List services) @@ -644,20 +644,20 @@ public class CapabilityStatementRenderer extends ResourceRenderer { for (Map interactionMap : interactions) { item = uList.li(); if (Utilities.noString(verb)) { - item.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP_THE) + " "); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP_THE) + " "); } else { item.addTag("strong").addText(verb); - item.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP_THE) + " "); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP_THE) + " "); } interaction = interactionMap.keySet().toArray()[0].toString(); item.code(interaction); documentation = interactionMap.get(interaction); if (Utilities.noString(documentation)) { - item.addText(context.formatMessage(RenderingContext.CAPABILITY_INT)); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_INT)); } else { - item.addText(context.formatMessage(RenderingContext.CAPABILITY_INT_DESC)); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_INT_DESC)); try { addMarkdown(item, documentation); } catch (FHIRFormatError e) { @@ -678,11 +678,11 @@ public class CapabilityStatementRenderer extends ResourceRenderer { if (interactions.size() == 0) return; XhtmlNode item = uList.li(); if (Utilities.noString(verb)) { - item.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPPS) + " "); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPPS) + " "); } else { item.addTag("strong").addText(verb); - item.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP) + " "); + item.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP) + " "); } addSeparatedListOfCodes(item, interactions, ","); item.addText("."); @@ -691,11 +691,11 @@ public class CapabilityStatementRenderer extends ResourceRenderer { private void addSummaryIntro(XhtmlNode x) { XhtmlNode uList = null; XhtmlNode lItem = null; - x.para().addText(context.formatMessage(RenderingContext.CAPABILITY_SUMM_RES)); + x.para().addText(context.formatPhrase(RenderingContext.CAPABILITY_SUMM_RES)); uList=x.ul(); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_REV_PROF)); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_REV_PROF)); lItem = uList.li(); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_INTER_SUPP)); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_INTER_SUPP)); lItem.b().addTag("span").attribute("class","bg-info").addText("R"); lItem.addText("ead, "); lItem.b().addTag("span").attribute("class","bg-info").addText("S"); @@ -717,40 +717,40 @@ public class CapabilityStatementRenderer extends ResourceRenderer { lItem.b().addTag("span").attribute("class","bg-info").addText("H"); lItem.addText("istory on "); lItem.b().addTag("span").attribute("class","bg-info").addText("T"); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_TYP_PRES)); - uList.li().addTag("span").addText(context.formatMessage(RenderingContext.CAPABILITY_SEARCH_PAR) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_TYP_PRES)); + uList.li().addTag("span").addText(context.formatPhrase(RenderingContext.CAPABILITY_SEARCH_PAR) + " "); lItem = uList.li(); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_RES_ENB) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_RES_ENB) + " "); lItem.code().addText("_include"); lItem = uList.li(); - lItem.addText(context.formatMessage(RenderingContext.CAPABILITY_OTH_RES_ENB) + " "); + lItem.addText(context.formatPhrase(RenderingContext.CAPABILITY_OTH_RES_ENB) + " "); lItem.code().addText("_revinclude"); - uList.li().addText(context.formatMessage(RenderingContext.CAPABILITY_RES_OPER)); + uList.li().addText(context.formatPhrase(RenderingContext.CAPABILITY_RES_OPER)); } 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(context.formatMessage(RenderingContext.CAPABILITY_RES_TYP)); - tr.th().b().tx(context.formatMessage(RenderingContext.CAPABILITY_PROF)); - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_READ_INT)).tx("R"); + tr.th().b().tx(context.formatPhrase(RenderingContext.CAPABILITY_RES_TYP)); + tr.th().b().tx(context.formatPhrase(RenderingContext.CAPABILITY_PROF)); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_READ_INT)).tx("R"); if (hasVRead) - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_VREAD_INT)).tx("V-R"); - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_SEARCH_INT)).tx("S"); - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_UPDATE_INT)).tx("U"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_VREAD_INT)).tx("V-R"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_SEARCH_INT)).tx("S"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_UPDATE_INT)).tx("U"); if (hasPatch) - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_PATCH_INT)).tx("P"); - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_CREATE_INT)).tx("C"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_PATCH_INT)).tx("P"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_CREATE_INT)).tx("C"); if (hasDelete) - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_DELETE_INT)).tx("D"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_DELETE_INT)).tx("D"); if (hasUpdates) - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_HISTORY_INT)).tx("H-I"); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_HISTORY_INT)).tx("H-I"); if (hasHistory) - tr.th().attribute("class", "text-center").b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_HISTORY_TYPE)).tx("H-T"); - tr.th().b().attribute("title", context.formatMessage(RenderingContext.CAPABILITY_REQ_RECOM)).tx(context.formatMessage(RenderingContext.CAPABILITY_SEARCHES)); + tr.th().attribute("class", "text-center").b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_HISTORY_TYPE)).tx("H-T"); + tr.th().b().attribute("title", context.formatPhrase(RenderingContext.CAPABILITY_REQ_RECOM)).tx(context.formatPhrase(RenderingContext.CAPABILITY_SEARCHES)); tr.th().code().b().tx("_include"); tr.th().code().b().tx("_revinclude"); - tr.th().b().tx(context.formatMessage(RenderingContext.CAPABILITY_OP)); + tr.th().b().tx(context.formatPhrase(RenderingContext.CAPABILITY_OP)); XhtmlNode tbody = t.addTag("tbody"); XhtmlNode profCell = null; @@ -775,12 +775,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { //profCell.ah(r.getProfile()).addText(r.getProfile()); if (hasSupProf) { profCell.br(); - profCell.addTag("em").addText(context.formatMessage(RenderingContext.CAPABILITY_ADD_SUPP_PROF)); + profCell.addTag("em").addText(context.formatPhrase(RenderingContext.CAPABILITY_ADD_SUPP_PROF)); renderSupportedProfiles(profCell, r); } } else { //Case of only supported profiles - profCell.addText(context.formatMessage(RenderingContext.CAPABILITY_SUPP_PROFS)); + profCell.addText(context.formatPhrase(RenderingContext.CAPABILITY_SUPP_PROFS)); renderSupportedProfiles(profCell, r); } //Show capabilities @@ -840,17 +840,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } if (r.hasExtension(ToolingExtensions.EXT_PROFILE_MAPPING)) { profCell.br(); - profCell.b().tx(context.formatMessage(RenderingContext.CAPABILITY_PROF_MAP)); + profCell.b().tx(context.formatPhrase(RenderingContext.CAPABILITY_PROF_MAP)); 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(context.formatMessage(RenderingContext.CAPABILITY_CRIT)); - tr.th().tx(context.formatMessage(RenderingContext.CAPABILITY_PROF)); + tr.th().tx(context.formatPhrase(RenderingContext.CAPABILITY_CRIT)); + tr.th().tx(context.formatPhrase(RenderingContext.CAPABILITY_PROF)); if (doco) { - tr.th().tx(context.formatMessage(RenderingContext.CAPABILITY_CRIT)); + tr.th().tx(context.formatPhrase(RenderingContext.CAPABILITY_CRIT)); } for (Extension ext : r.getExtensionsByUrl(ToolingExtensions.EXT_PROFILE_MAPPING)) { tr = tbl.tr(); @@ -967,7 +967,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(context.formatMessage(RenderingContext.CAPABILITY_RES_CONF, getResourceExpectation(r)) + " "); + panelHead.span("float: right;","").addText(context.formatPhrase(RenderingContext.CAPABILITY_RES_CONF, getResourceExpectation(r)) + " "); panelHead.addText(r.getType()); body = panel.div().attribute("class", "panel-body").div().attribute("class", "container"); } @@ -981,17 +981,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,context.formatMessage(RenderingContext.CAPABILITY_BASE_SYS)); + addLead(cell,context.formatPhrase(RenderingContext.CAPABILITY_BASE_SYS)); cell.br(); addResourceLink(cell, text, text); cell=row.div().attribute("class", "col-lg-3"); - addLead(cell, context.formatMessage(RenderingContext.CAPABILITY_PROF_CONF)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_PROF_CONF)); 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, context.formatMessage(RenderingContext.CAPABILITY_FHIR)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_FHIR)); cell.br(); cell.ah(currentFhirBase + r.getType().toLowerCase() + ".html").addText(r.getType()); pullInteraction = true; @@ -999,7 +999,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } cell = row.div().attribute("class", refPolicyWidth); - addLead(cell,context.formatMessage(RenderingContext.CAPABILITY_REF_PROF)); + addLead(cell,context.formatPhrase(RenderingContext.CAPABILITY_REF_PROF)); cell.br(); addSeparatedListOfCodes(cell, getReferencePolicyStrings(r.getReferencePolicy()) , ","); if (pullInteraction) { @@ -1010,7 +1010,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, context.formatMessage(RenderingContext.CAPABILITY_SUPP_PROF)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_SUPP_PROF)); XhtmlNode para = cell.para(); boolean first = true; for (CanonicalType c : supportedProfiles) { @@ -1035,7 +1035,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, context.formatMessage(RenderingContext.CAPABILITY_DOC)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_DOC)); addMarkdown(cell.blockquote(), mdText); } @@ -1059,12 +1059,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-12"); - addLead(cell, context.formatMessage(RenderingContext.CAPABILITY_EXT_OP)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_EXT_OP)); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_CONF)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_OPER)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_DOC)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_CONF)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_OPER)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_DOC)); tbody = table.addTag("tbody"); addOps(tbody, map, "supported"); addOps(tbody, map, "SHALL"); @@ -1120,7 +1120,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } } XhtmlNode cell = row.div().attribute("class", widthString); - addLead(cell, context.formatMessage(RenderingContext.CAPABILITY_INT_SUMM)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_INT_SUMM)); cell.br(); XhtmlNode ul = cell.ul(); addInteractionSummaryList(ul, "SHALL", shalls); @@ -1185,13 +1185,13 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-lg-7"); - addLead(cell, context.formatMessage(RenderingContext.CAPABILITY_SEARCH_PARS)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_SEARCH_PARS)); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_CONF)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_PAR)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_TYP)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_DOC)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_CONF)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_PAR)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_TYP)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_DOC)); tbody = table.addTag("tbody"); Map> map = sParams.getIndbyExp(); addIndRows(tbody, map, "supported"); @@ -1201,12 +1201,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { addIndRows(tbody, map, "SHOULD-NOT"); cell = row.div().attribute("class", "col-lg-5"); if (!isCombinedEmpty(comboMap)) { - addLead(cell, context.formatMessage(RenderingContext.CAPABILITY_COMB_SEARCH_PAR)); + addLead(cell, context.formatPhrase(RenderingContext.CAPABILITY_COMB_SEARCH_PAR)); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_CONF)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_PARS)); - tr.th().addText(context.formatMessage(RenderingContext.CAPABILITY_TYPS)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_CONF)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_PARS)); + tr.th().addText(context.formatPhrase(RenderingContext.CAPABILITY_TYPS)); 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 3264b8334..a0be76f57 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 @@ -107,13 +107,13 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void generateFilters(XhtmlNode x, CodeSystem cs) { if (cs.hasFilter()) { - x.para().b().tx(formatMessage(RenderingContext.CODESYSTEM_FILTERS)); + x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTERS)); XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_FILTER_CODE)); - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_FILTER_DESC)); - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_FILTER_OP)); - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_FILTER_VALUE)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_CODE)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_DESC)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_OP)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_VALUE)); for (CodeSystemFilterComponent f : cs.getFilter()) { tr = tbl.tr(); renderStatus(f, tr.td()).tx(f.getCode()); @@ -137,20 +137,20 @@ public class CodeSystemRenderer extends TerminologyRenderer { hasDescription = hasDescription || p.hasDescription(); } - x.para().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROPS)); - x.para().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROPS_DESC)); + x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROPS)); + x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROPS_DESC)); XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); if (hasRendered) { - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROP_NAME)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_NAME)); } - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROP_CODE)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_CODE)); if (hasURI) { - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROP_URI)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_URI)); } - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROP_TYPE)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_TYPE)); if (hasDescription) { - tr.td().b().tx(formatMessage(RenderingContext.CODESYSTEM_PROP_DESC)); + tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_DESC)); } for (PropertyComponent p : cs.getProperty()) { tr = tbl.tr(); @@ -174,32 +174,32 @@ public class CodeSystemRenderer extends TerminologyRenderer { private String sentenceForContent(CodeSystemContentMode mode, CodeSystem cs) { switch (mode) { - case COMPLETE: return formatMessage(RenderingContext.CODESYSTEM_CONTENT_COMPLETE); - case EXAMPLE: return formatMessage(RenderingContext.CODESYSTEM_CONTENT_EXAMPLE); - case FRAGMENT: return formatMessage(RenderingContext.CODESYSTEM_CONTENT_FRAGMENT); - case NOTPRESENT: return formatMessage(RenderingContext.CODESYSTEM_CONTENT_NOTPRESENT); + case COMPLETE: return formatPhrase(RenderingContext.CODESYSTEM_CONTENT_COMPLETE); + case EXAMPLE: return formatPhrase(RenderingContext.CODESYSTEM_CONTENT_EXAMPLE); + case FRAGMENT: return formatPhrase(RenderingContext.CODESYSTEM_CONTENT_FRAGMENT); + case NOTPRESENT: return formatPhrase(RenderingContext.CODESYSTEM_CONTENT_NOTPRESENT); case SUPPLEMENT: boolean properties = CodeSystemUtilities.hasProperties(cs); boolean designations = CodeSystemUtilities.hasDesignations(cs); String features; if (properties && designations) { - features = (context.formatMessage(RenderingContext.CODE_SYS_DISP_PROP)); + features = (context.formatPhrase(RenderingContext.CODE_SYS_DISP_PROP)); } else if (properties) { - features = (context.formatMessage(RenderingContext.CODE_SYS_PROP)); + features = (context.formatPhrase(RenderingContext.CODE_SYS_PROP)); } else if (designations) { - features = (context.formatMessage(RenderingContext.CODE_SYS_DISP)); + features = (context.formatPhrase(RenderingContext.CODE_SYS_DISP)); } else { - features = (context.formatMessage(RenderingContext.CODE_SYS_FEAT)); // ? + features = (context.formatPhrase(RenderingContext.CODE_SYS_FEAT)); // ? } - return formatMessage(RenderingContext.CODESYSTEM_CONTENT_SUPPLEMENT, features); + return formatPhrase(RenderingContext.CODESYSTEM_CONTENT_SUPPLEMENT, features); default: - throw new FHIRException(context.formatMessage(RenderingContext.CODE_SYS_UNKN_MODE)); + throw new FHIRException(context.formatPhrase(RenderingContext.CODE_SYS_UNKN_MODE)); } } private boolean generateCodeSystemContent(XhtmlNode x, CodeSystem cs, boolean hasExtensions, List maps, boolean props) throws FHIRFormatError, DefinitionException, IOException { if (props) { - x.para().b().tx(formatMessage(RenderingContext.CODESYSTEM_CONCEPTS)); + x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_CONCEPTS)); } XhtmlNode p = x.para(); renderStatus(cs.getUrlElement(), p.param("cs")).code().tx(cs.getUrl()); @@ -259,10 +259,10 @@ public class CodeSystemRenderer extends TerminologyRenderer { } if (langs.size() >= 2) { Collections.sort(langs); - x.para().b().tx(context.formatMessage(RenderingContext.CODE_SYS_ADD_LANG)); + x.para().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_ADD_LANG)); t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.CODE_SYS_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_CODE)); for (String lang : langs) tr.td().b().addText(describeLang(lang)); for (ConceptDefinitionComponent c : cs.getConcept()) { @@ -275,11 +275,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(" "+context.formatMessage(RenderingContext.CODE_SYS_IN_A_HIERARCHY, s)); + renderStatus(hm, x).tx(" "+context.formatPhrase(RenderingContext.CODE_SYS_IN_A_HIERARCHY, s)); } else if (VersionComparisonAnnotation.hasDeleted(cs, "hierarchyMeaning")) { makeHierarchyParam(x, null, (Enumeration) VersionComparisonAnnotation.getDeleted(cs, "hierarchyMeaning").get(0)); } else if (CodeSystemUtilities.hasHierarchy(cs)) { - x.tx(" "+ (context.formatMessage(RenderingContext.CODE_SYS_UNDEF_HIER))); + x.tx(" "+ (context.formatPhrase(RenderingContext.CODE_SYS_UNDEF_HIER))); } else { x.tx(""); } @@ -310,7 +310,7 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void addCopyColumn(XhtmlNode tr) { if (context.isCopyButton()) { - tr.td().b().tx(context.formatMessage(RenderingContext.CODE_SYS_COPY)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_COPY)); } } @@ -502,11 +502,11 @@ public class CodeSystemRenderer extends TerminologyRenderer { td = tr.td(); Boolean b = CodeSystemUtilities.isDeprecated(cs, c, false); if (b != null && b) { - smartAddText(td, formatMessage(RenderingContext.CODESYSTEM_DEPRECATED)); + smartAddText(td, formatPhrase(RenderingContext.CODESYSTEM_DEPRECATED)); hasExtensions = true; if (ToolingExtensions.hasExtension(c, ToolingExtensions.EXT_REPLACED_BY)) { Coding cc = (Coding) ToolingExtensions.getExtension(c, ToolingExtensions.EXT_REPLACED_BY).getValue(); - td.tx(" "+ context.formatMessage(RenderingContext.CODE_SYS_REPLACED_BY) + " "); + td.tx(" "+ context.formatPhrase(RenderingContext.CODE_SYS_REPLACED_BY) + " "); String url = getCodingReference(cc, system); if (url != null) { td.ah(url).addText(cc.getCode()); 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 5b304246e..461a11e50 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 @@ -314,23 +314,23 @@ public class ConceptMapRenderer extends TerminologyRenderer { } XhtmlNode p = x.para(); - p.tx(context.formatMessage(RenderingContext.CONC_MAP_FROM) + " "); + p.tx(context.formatPhrase(RenderingContext.CONC_MAP_FROM) + " "); if (cm.hasSourceScope()) AddVsRef(cm.getSourceScope().primitiveValue(), p, cm); else - p.tx(context.formatMessage(RenderingContext.CONC_MAP_NOT_SPEC)); - p.tx(" "+ (context.formatMessage(RenderingContext.CONC_MAP_TO) + " ")); + p.tx(context.formatPhrase(RenderingContext.CONC_MAP_NOT_SPEC)); + p.tx(" "+ (context.formatPhrase(RenderingContext.CONC_MAP_TO) + " ")); if (cm.hasTargetScope()) AddVsRef(cm.getTargetScope().primitiveValue(), p, cm); else - p.tx(context.formatMessage(RenderingContext.CONC_MAP_NOT_SPEC)); + p.tx(context.formatPhrase(RenderingContext.CONC_MAP_NOT_SPEC)); p = x.para(); if (cm.getExperimental()) - p.addText(Utilities.capitalize(cm.getStatus().toString())+" "+ (context.formatMessage(RenderingContext.CONC_MAP_NO_PROD_USE) + " ")); + p.addText(Utilities.capitalize(cm.getStatus().toString())+" "+ (context.formatPhrase(RenderingContext.CONC_MAP_NO_PROD_USE) + " ")); else p.addText(Utilities.capitalize(cm.getStatus().toString())+". "); - p.tx(context.formatMessage(RenderingContext.CONC_MAP_PUB_ON, (cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()) + " "); + p.tx(context.formatPhrase(RenderingContext.CONC_MAP_PUB_ON, (cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()) + " "); if (!cm.getContact().isEmpty()) { p.tx(" ("); boolean firsti = true; @@ -400,18 +400,18 @@ public class ConceptMapRenderer extends TerminologyRenderer { x.hr(); } XhtmlNode pp = x.para(); - pp.b().tx(context.formatMessage(RenderingContext.CONC_MAP_GRP, gc) + " "); - pp.tx(context.formatMessage(RenderingContext.CONC_MAP_FROM) + " "); + pp.b().tx(context.formatPhrase(RenderingContext.CONC_MAP_GRP, gc) + " "); + pp.tx(context.formatPhrase(RenderingContext.CONC_MAP_FROM) + " "); if (grp.hasSource()) { renderCanonical(cm, pp, grp.getSource()); } else { - pp.code(context.formatMessage(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC)); + pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC)); } pp.tx(" to "); if (grp.hasTarget()) { renderCanonical(cm, pp, grp.getTarget()); } else { - pp.code(context.formatMessage(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC)); + pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC)); } String display; @@ -419,11 +419,11 @@ public class ConceptMapRenderer extends TerminologyRenderer { // simple XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_SOURCE)); - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_REL)); - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_TRGT)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_SOURCE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_REL)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_TRGT)); if (comment) - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_CMNT)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CMNT)); for (SourceElementComponent ccl : grp.getElement()) { tr = tbl.tr(); XhtmlNode td = tr.td(); @@ -470,21 +470,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(context.formatMessage(RenderingContext.CONC_MAP_SRC_DET)); + tr.td().colspan(Integer.toString(1+sources.size())).b().tx(context.formatPhrase(RenderingContext.CONC_MAP_SRC_DET)); if (hasRelationships) { - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_REL)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_REL)); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx(context.formatMessage(RenderingContext.CONC_MAP_TRGT_DET)); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(context.formatPhrase(RenderingContext.CONC_MAP_TRGT_DET)); if (comment) { - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_CMNT)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CMNT)); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx(context.formatMessage(RenderingContext.CONC_MAP_PROP)); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(context.formatPhrase(RenderingContext.CONC_MAP_PROP)); 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(context.formatMessage(RenderingContext.CONC_MAP_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE)); for (String s : sources.keySet()) { if (s != null && !s.equals("code")) { if (sources.get(s).size() == 1) { @@ -501,7 +501,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { String url = targets.get("code").iterator().next(); renderCSDetailsLink(tr, url, true); } else - tr.td().b().tx(context.formatMessage(RenderingContext.CONC_MAP_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE)); for (String s : targets.keySet()) { if (s != null && !s.equals("code")) { if (targets.get(s).size() == 1) { @@ -698,8 +698,8 @@ public class ConceptMapRenderer extends TerminologyRenderer { if (span2) { td.colspan("2"); } - td.b().tx(context.formatMessage(RenderingContext.CONC_MAP_CODES)); - td.tx(" " + (context.formatMessage(RenderingContext.CONC_MAP_FRM) + " ")); + td.b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODES)); + td.tx(" " + (context.formatPhrase(RenderingContext.CONC_MAP_FRM) + " ")); 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 a9635bd55..e57a6073e 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 @@ -186,7 +186,7 @@ public class DataRenderer extends Renderer implements CodeResolver { url = p.getUserString("filename"); } } else { - throw new DefinitionException(context.formatMessage(RenderingContext.DATA_REND_MKDWN_LNK, link) + " "); + throw new DefinitionException(context.formatPhrase(RenderingContext.DATA_REND_MKDWN_LNK, link) + " "); } text = left+"["+link+"]("+url+(path == null ? "" : "#"+path)+")"+right; @@ -271,19 +271,19 @@ public class DataRenderer extends Renderer implements CodeResolver { public String displaySystem(String system) { if (system == null) - return (context.formatMessage(RenderingContext.DATA_REND_NOT_STAT)); + return (context.formatPhrase(RenderingContext.DATA_REND_NOT_STAT)); if (system.equals("http://loinc.org")) - return (context.formatMessage(RenderingContext.DATA_REND_LOINC)); + return (context.formatPhrase(RenderingContext.DATA_REND_LOINC)); if (system.startsWith("http://snomed.info")) - return (context.formatMessage(RenderingContext.DATA_REND_SNOMED)); + return (context.formatPhrase(RenderingContext.DATA_REND_SNOMED)); if (system.equals("http://www.nlm.nih.gov/research/umls/rxnorm")) - return (context.formatMessage(RenderingContext.DATA_REND_RXNORM)); + return (context.formatPhrase(RenderingContext.DATA_REND_RXNORM)); if (system.equals("http://hl7.org/fhir/sid/icd-9")) - return (context.formatMessage(RenderingContext.DATA_REND_ICD)); + return (context.formatPhrase(RenderingContext.DATA_REND_ICD)); if (system.equals("http://dicom.nema.org/resources/ontology/DCM")) - return (context.formatMessage(RenderingContext.DATA_REND_DICOM)); + return (context.formatPhrase(RenderingContext.DATA_REND_DICOM)); if (system.equals("http://unitsofmeasure.org")) - return (context.formatMessage(RenderingContext.DATA_REND_UCUM)); + return (context.formatPhrase(RenderingContext.DATA_REND_UCUM)); CodeSystem cs = context.getContext().fetchCodeSystem(system); if (cs != null) { @@ -307,7 +307,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (system.contains("/")) { return system.substring(system.lastIndexOf("/")+1); } else { - return (context.formatMessage(RenderingContext.DATA_REND_UNKNWN)); + return (context.formatPhrase(RenderingContext.DATA_REND_UNKNWN)); } } @@ -469,7 +469,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { // somehow have to do better than this XhtmlNode li = ul.li(); - li.b().tx(context.formatMessage(RenderingContext.DATA_REND_UNRD_EX)); + li.b().tx(context.formatPhrase(RenderingContext.DATA_REND_UNRD_EX)); } } for (Extension ext : element.getExtension()) { @@ -519,7 +519,7 @@ public class DataRenderer extends Renderer implements CodeResolver { render(div, ext.getValue()); } else { // somehow have to do better than this - div.b().tx(context.formatMessage(RenderingContext.DATA_REND_UNRD_EX)); + div.b().tx(context.formatPhrase(RenderingContext.DATA_REND_UNRD_EX)); } } for (Extension ext : element.getExtension()) { @@ -550,7 +550,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { return display((DataType) b); } else { - return (context.formatMessage(RenderingContext.DATA_REND_NO_DISP, b.fhirType()) + " "); + return (context.formatPhrase(RenderingContext.DATA_REND_NO_DISP, b.fhirType()) + " "); } } @@ -588,7 +588,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else if (type.isPrimitive()) { return context.getTranslated((PrimitiveType) type); } else { - return (context.formatMessage(RenderingContext.DATA_REND_NO_DISP, type.fhirType()) + " "); + return (context.formatPhrase(RenderingContext.DATA_REND_NO_DISP, type.fhirType()) + " "); } } @@ -670,7 +670,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } public String display(BaseWrapper type) { - return (context.formatMessage(RenderingContext.DATA_REND_TO_DO)); + return (context.formatPhrase(RenderingContext.DATA_REND_TO_DO)); } public void render(XhtmlNode x, BaseWrapper type) throws FHIRFormatError, DefinitionException, IOException { @@ -678,13 +678,13 @@ public class DataRenderer extends Renderer implements CodeResolver { try { base = type.getBase(); } catch (FHIRException | IOException e) { - x.tx(context.formatMessage(RenderingContext.DATA_REND_ERROR, e.getMessage()) + " "); // this shouldn't happen - it's an error in the library itself + x.tx(context.formatPhrase(RenderingContext.DATA_REND_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(context.formatMessage(RenderingContext.DATA_REND_TO_DO, base.fhirType())); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_TO_DO, base.fhirType())); } } @@ -692,7 +692,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { render(x, (DataType) b); } else { - x.tx(context.formatMessage(RenderingContext.DATA_REND_NO_DISP, b.fhirType()) + " "); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_NO_DISP, b.fhirType()) + " "); } } @@ -744,11 +744,11 @@ public class DataRenderer extends Renderer implements CodeResolver { addMarkdown(x, context.getTranslated((MarkdownType) type)); } else if (type instanceof Base64BinaryType) { Base64BinaryType b64 = (Base64BinaryType) type; - x.tx(context.formatMessage(RenderingContext.DATA_REND_BASE64, (b64.getValue() == null ? "0" : b64.getValue().length))); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_BASE64, (b64.getValue() == null ? "0" : b64.getValue().length))); } else if (type.isPrimitive()) { x.tx(context.getTranslated((PrimitiveType) type)); } else { - x.tx(context.formatMessage(RenderingContext.DATA_REND_NO_DISP, type.fhirType()) + " "); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_NO_DISP, type.fhirType()) + " "); } } @@ -850,7 +850,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (a.hasAuthor()) { - b.append(context.formatMessage(RenderingContext.DATA_REND_BY) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_BY) + " "); if (a.hasAuthorReference()) { b.append(a.getAuthorReference().getReference()); } else if (a.hasAuthorStringType()) { @@ -1038,7 +1038,7 @@ public class DataRenderer extends Renderer implements CodeResolver { systemName = cs != null ? crPresent(cs) : displaySystem(c.getSystem()); link = getLinkForCode(c.getSystem(), c.getVersion(), c.getCode()); - hint = systemName+": "+display+(c.hasVersion() ? " "+ context.formatMessage(RenderingContext.DATA_REND_VERSION, c.getVersion(), ")") : ""); + hint = systemName+": "+display+(c.hasVersion() ? " "+ context.formatPhrase(RenderingContext.DATA_REND_VERSION, c.getVersion(), ")") : ""); return new CodeResolution(systemName, systemLink, link, display, hint); } @@ -1073,7 +1073,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.tx(s); } if (c.hasVersion()) { - x.tx(" "+context.formatMessage(RenderingContext.DATA_REND_VERSION, c.getVersion(), ")")); + x.tx(" "+context.formatPhrase(RenderingContext.DATA_REND_VERSION, c.getVersion(), ")")); } } @@ -1088,7 +1088,7 @@ public class DataRenderer extends Renderer implements CodeResolver { s = c.getCode(); if (showCodeDetails) { - x.addText(s+" "+context.formatMessage(RenderingContext.DATA_REND_DETAILS_STATED, displaySystem(c.getSystem()), c.getCode(), " = '", lookupCode(c.getSystem(), c.getVersion(), c.getCode()), c.getDisplay(), "')")); + x.addText(s+" "+context.formatPhrase(RenderingContext.DATA_REND_DETAILS_STATED, displaySystem(c.getSystem()), c.getCode(), " = '", lookupCode(c.getSystem(), c.getVersion(), c.getCode()), c.getDisplay(), "')")); } else x.span(null, "{"+c.getSystem()+" "+c.getCode()+"}").addText(s); } @@ -1208,7 +1208,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } } - x.span(null, context.formatMessage(RenderingContext.DATA_REND_CODES) +b.toString()).addText(s); + x.span(null, context.formatPhrase(RenderingContext.DATA_REND_CODES) +b.toString()).addText(s); } } @@ -1272,7 +1272,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", context.formatMessage(RenderingContext.DATA_REND_GLN)).tx("GLN"); + x.ah("https://www.gs1.org/standards/id-keys/gln", context.formatPhrase(RenderingContext.DATA_REND_GLN)).tx("GLN"); break; default: x.code(ii.getSystem()); @@ -1286,7 +1286,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); x.tx("("); if (ii.hasUse()) { - x.tx(context.formatMessage(RenderingContext.DATA_REND_USE)); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_USE)); x.nbsp(); x.tx(ii.getUse().toCode()); } @@ -1295,7 +1295,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); } if (ii.hasPeriod()) { - x.tx(context.formatMessage(RenderingContext.DATA_REND_PERIOD)); + x.tx(context.formatPhrase(RenderingContext.DATA_REND_PERIOD)); x.nbsp(); x.tx(displayPeriod(ii.getPeriod())); } @@ -1444,7 +1444,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } c.code().tx(expr.getExpression()); } else if (expr.hasReference()) { - p.ah(expr.getReference()).tx(context.formatMessage(RenderingContext.DATA_REND_SOURCE)); + p.ah(expr.getReference()).tx(context.formatPhrase(RenderingContext.DATA_REND_SOURCE)); } if (expr.hasName() || expr.hasDescription()) { p.tx("("); @@ -1505,9 +1505,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(context.formatMessage(RenderingContext.DATA_REND_PHONE, c.getValue()) + " "); + p.tx(context.formatPhrase(RenderingContext.DATA_REND_PHONE, c.getValue()) + " "); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx(context.formatMessage(RenderingContext.DATA_REND_FAX, c.getValue()) + " "); + p.tx(context.formatPhrase(RenderingContext.DATA_REND_FAX, c.getValue()) + " "); } else if (c.getSystem() == ContactPointSystem.EMAIL) { p.tx(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { @@ -1522,9 +1522,9 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void addTelecom(XhtmlNode p, ContactPoint c) { if (c.getSystem() == ContactPointSystem.PHONE) { - p.tx(context.formatMessage(RenderingContext.DATA_REND_PHONE, c.getValue()) + " "); + p.tx(context.formatPhrase(RenderingContext.DATA_REND_PHONE, c.getValue()) + " "); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx(context.formatMessage(RenderingContext.DATA_REND_FAX, c.getValue()) + " "); + p.tx(context.formatPhrase(RenderingContext.DATA_REND_FAX, c.getValue()) + " "); } else if (c.getSystem() == ContactPointSystem.EMAIL) { p.ah("mailto:"+c.getValue()).addText(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { @@ -1577,7 +1577,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(" "+ (context.formatMessage(RenderingContext.DATA_REND_DETAILS, displaySystem(q.getSystem()))) +q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); + x.span("background: LightGoldenRodYellow", null).tx(" "+ (context.formatPhrase(RenderingContext.DATA_REND_DETAILS, displaySystem(q.getSystem()))) +q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); } } @@ -1621,13 +1621,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() ? context.formatMessage(RenderingContext.DATA_REND_ONGOING) : displayDateTime(p.getEndElement())); + return s + (!p.hasEnd() ? context.formatPhrase(RenderingContext.DATA_REND_ONGOING) : displayDateTime(p.getEndElement())); } public void renderPeriod(XhtmlNode x, Period p) { x.addText(!p.hasStart() ? "??" : displayDateTime(p.getStartElement())); x.tx(" --> "); - x.addText(!p.hasEnd() ? context.formatMessage(RenderingContext.DATA_REND_ONGOING) : displayDateTime(p.getEndElement())); + x.addText(!p.hasEnd() ? context.formatPhrase(RenderingContext.DATA_REND_ONGOING) : displayDateTime(p.getEndElement())); } public void renderUsageContext(XhtmlNode x, UsageContext u) throws FHIRFormatError, DefinitionException, IOException { @@ -1639,31 +1639,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(context.formatMessage(RenderingContext.DATA_REND_TYPE)); + x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_TYPE)); x.tx(": "); x.tx(td.getType().getDisplay()); if (td.hasName()) { x.tx(", "); - x.b().tx(context.formatMessage(RenderingContext.DATA_REND_NAME)); + x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_NAME)); x.tx(": "); x.tx(context.getTranslated(td.getNameElement())); } if (td.hasCode()) { x.tx(", "); - x.b().tx(context.formatMessage(RenderingContext.DATA_REND_CODE)); + x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_CODE)); x.tx(": "); renderCodeableConcept(x, td.getCode()); } if (td.hasTiming()) { x.tx(", "); - x.b().tx(context.formatMessage(RenderingContext.DATA_REND_TIMING)); + x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_TIMING)); x.tx(": "); render(x, td.getTiming()); } if (td.hasCondition()) { x.tx(", "); - x.b().tx(context.formatMessage(RenderingContext.DATA_REND_COND)); + x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_COND)); x.tx(": "); renderExpression(x, td.getCondition()); } @@ -1671,27 +1671,27 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.DATA_REND_TYPE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_TYPE)); tr.td().tx(td.getType().getDisplay()); if (td.hasName()) { tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.DATA_REND_NAME)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_NAME)); tr.td().tx(context.getTranslated(td.getNameElement())); } if (td.hasCode()) { tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.DATA_REND_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_CODE)); renderCodeableConcept(tr.td(), td.getCode()); } if (td.hasTiming()) { tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.DATA_REND_TIMING)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_TIMING)); render(tr.td(), td.getTiming()); } if (td.hasCondition()) { tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.DATA_REND_COND)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_COND)); renderExpression(tr.td(), td.getCondition()); } } @@ -1701,7 +1701,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(context.formatMessage(RenderingContext.DATA_REND_TYPE)); + td.b().tx(context.formatPhrase(RenderingContext.DATA_REND_TYPE)); td.tx(": "); StructureDefinition sd = context.getWorker().fetchTypeDefinition(dr.getType().toCode()); if (sd != null && sd.hasWebPath()) { @@ -1726,7 +1726,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (dr.hasSubject()) { tr = tbl.tr(); td = tr.td().colspan("2"); - td.b().tx(context.formatMessage(RenderingContext.DATA_REND_SUB)); + td.b().tx(context.formatPhrase(RenderingContext.DATA_REND_SUB)); if (dr.hasSubjectReference()) { renderReference(td, dr.getSubjectReference()); } else { @@ -1735,24 +1735,24 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (dr.hasCodeFilter() || dr.hasDateFilter()) { tr = tbl.tr().backgroundColor("#efefef"); - tr.td().tx(context.formatMessage(RenderingContext.DATA_REND_FILT)); - tr.td().tx(context.formatMessage(RenderingContext.DATA_REND_VALUE)); + tr.td().tx(context.formatPhrase(RenderingContext.DATA_REND_FILT)); + tr.td().tx(context.formatPhrase(RenderingContext.DATA_REND_VALUE)); } for (DataRequirementCodeFilterComponent cf : dr.getCodeFilter()) { tr = tbl.tr(); if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx(context.formatMessage(RenderingContext.DATA_REND_SEARCH, cf.getSearchParam()) + " "); + tr.td().tx(context.formatPhrase(RenderingContext.DATA_REND_SEARCH, cf.getSearchParam()) + " "); } if (cf.hasValueSet()) { td = tr.td(); - td.tx(context.formatMessage(RenderingContext.DATA_REND_VALUESET) + " "); + td.tx(context.formatPhrase(RenderingContext.DATA_REND_VALUESET) + " "); render(td, cf.getValueSetElement()); } else { boolean first = true; td = tr.td(); - td.tx(context.formatMessage(RenderingContext.DATA_REND_THESE_CODES) + " "); + td.tx(context.formatPhrase(RenderingContext.DATA_REND_THESE_CODES) + " "); for (Coding c : cf.getCode()) { if (first) first = false; else td.tx(", "); render(td, c); @@ -1764,7 +1764,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx(context.formatMessage(RenderingContext.DATA_REND_SEARCH, cf.getSearchParam()) + " "); + tr.td().tx(context.formatPhrase(RenderingContext.DATA_REND_SEARCH, cf.getSearchParam()) + " "); } render(tr.td(), cf.getValue()); } @@ -1772,7 +1772,7 @@ public class DataRenderer extends Renderer implements CodeResolver { tr = tbl.tr(); td = tr.td().colspan("2"); if (dr.hasLimit()) { - td.b().tx(context.formatMessage(RenderingContext.DATA_REND_LIMIT)); + td.b().tx(context.formatPhrase(RenderingContext.DATA_REND_LIMIT)); td.tx(": "); td.tx(dr.getLimit()); if (dr.hasSort()) { @@ -1780,7 +1780,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } } if (dr.hasSort()) { - td.b().tx(context.formatMessage(RenderingContext.DATA_REND_SORT)); + td.b().tx(context.formatPhrase(RenderingContext.DATA_REND_SORT)); td.tx(": "); boolean first = true; for (DataRequirementSortComponent p : dr.getSort()) { @@ -1796,7 +1796,7 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayTiming(Timing s) throws FHIRException { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasCode()) - b.append(context.formatMessage(RenderingContext.DATA_REND_GETCODE, displayCodeableConcept(s.getCode())) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_GETCODE, displayCodeableConcept(s.getCode())) + " "); if (s.getEvent().size() > 0) { CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder(); @@ -1807,17 +1807,17 @@ public class DataRenderer extends Renderer implements CodeResolver { c.append("??"); } } - b.append(context.formatMessage(RenderingContext.DATA_REND_EVENTS, c.toString()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_EVENTS, c.toString()) + " "); } if (s.hasRepeat()) { TimingRepeatComponent rep = s.getRepeat(); if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasStart()) - b.append(context.formatMessage(RenderingContext.DATA_REND_STARTING, displayDateTime(rep.getBoundsPeriod().getStartElement())) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_STARTING, displayDateTime(rep.getBoundsPeriod().getStartElement())) + " "); if (rep.hasCount()) - b.append(context.formatMessage(RenderingContext.DATA_REND_COUNT, Integer.toString(rep.getCount())) + " " + " times"); + b.append(context.formatPhrase(RenderingContext.DATA_REND_COUNT, Integer.toString(rep.getCount())) + " " + " times"); if (rep.hasDuration()) - b.append(context.formatMessage(RenderingContext.DATA_REND_DURATION, rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_DURATION, rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())) + " "); if (rep.hasWhen()) { String st = ""; @@ -1830,14 +1830,14 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { String st = ""; if (!rep.hasFrequency() || (!rep.hasFrequencyMax() && rep.getFrequency() == 1) ) - st = context.formatMessage(RenderingContext.DATA_REND_ONCE); + st = context.formatPhrase(RenderingContext.DATA_REND_ONCE); else { st = Integer.toString(rep.getFrequency()); if (rep.hasFrequencyMax()) st = st + "-"+Integer.toString(rep.getFrequency()); } if (rep.hasPeriod()) { - st = st + " "+ (context.formatMessage(RenderingContext.DATA_REND_PER))+rep.getPeriod().toPlainString(); + st = st + " "+ (context.formatPhrase(RenderingContext.DATA_REND_PER))+rep.getPeriod().toPlainString(); if (rep.hasPeriodMax()) st = st + "-"+rep.getPeriodMax().toPlainString(); st = st + " "+displayTimeUnits(rep.getPeriodUnit()); @@ -1845,7 +1845,7 @@ public class DataRenderer extends Renderer implements CodeResolver { b.append(st); } if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasEnd()) - b.append(context.formatMessage(RenderingContext.DATA_REND_UNTIL, displayDateTime(rep.getBoundsPeriod().getEndElement())) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_UNTIL, displayDateTime(rep.getBoundsPeriod().getEndElement())) + " "); } return b.toString(); } @@ -1861,20 +1861,20 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayEventCode(EventTiming when) { switch (when) { - case C: return (context.formatMessage(RenderingContext.DATA_REND_MEALS)); - case CD: return (context.formatMessage(RenderingContext.DATA_REND_ATLUNCH)); - case CM: return (context.formatMessage(RenderingContext.DATA_REND_ATBKFST)); - case CV: return (context.formatMessage(RenderingContext.DATA_REND_ATDINR)); - case AC: return (context.formatMessage(RenderingContext.DATA_REND_BFMEALS)); - case ACD: return (context.formatMessage(RenderingContext.DATA_REND_BFLUNCH)); - case ACM: return (context.formatMessage(RenderingContext.DATA_REND_BFBKFST)); - case ACV: return (context.formatMessage(RenderingContext.DATA_REND_BFDINR)); - case HS: return (context.formatMessage(RenderingContext.DATA_REND_BFSLEEP)); - case PC: return (context.formatMessage(RenderingContext.DATA_REND_AFTRMEALS)); - case PCD: return (context.formatMessage(RenderingContext.DATA_REND_AFTRLUNCH)); - case PCM: return (context.formatMessage(RenderingContext.DATA_REND_AFTRBKFST)); - case PCV: return (context.formatMessage(RenderingContext.DATA_REND_AFTRDINR)); - case WAKE: return (context.formatMessage(RenderingContext.DATA_REND_AFTRWKNG)); + case C: return (context.formatPhrase(RenderingContext.DATA_REND_MEALS)); + case CD: return (context.formatPhrase(RenderingContext.DATA_REND_ATLUNCH)); + case CM: return (context.formatPhrase(RenderingContext.DATA_REND_ATBKFST)); + case CV: return (context.formatPhrase(RenderingContext.DATA_REND_ATDINR)); + case AC: return (context.formatPhrase(RenderingContext.DATA_REND_BFMEALS)); + case ACD: return (context.formatPhrase(RenderingContext.DATA_REND_BFLUNCH)); + case ACM: return (context.formatPhrase(RenderingContext.DATA_REND_BFBKFST)); + case ACV: return (context.formatPhrase(RenderingContext.DATA_REND_BFDINR)); + case HS: return (context.formatPhrase(RenderingContext.DATA_REND_BFSLEEP)); + case PC: return (context.formatPhrase(RenderingContext.DATA_REND_AFTRMEALS)); + case PCD: return (context.formatPhrase(RenderingContext.DATA_REND_AFTRLUNCH)); + case PCM: return (context.formatPhrase(RenderingContext.DATA_REND_AFTRBKFST)); + case PCV: return (context.formatPhrase(RenderingContext.DATA_REND_AFTRDINR)); + case WAKE: return (context.formatPhrase(RenderingContext.DATA_REND_AFTRWKNG)); default: return "?ngen-6?"; } } @@ -1902,29 +1902,29 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displaySampledData(SampledData s) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasOrigin()) - b.append(context.formatMessage(RenderingContext.DATA_REND_ORIGIN, displayQuantity(s.getOrigin())) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_ORIGIN, displayQuantity(s.getOrigin())) + " "); if (s.hasInterval()) { - b.append(context.formatMessage(RenderingContext.DATA_REND_INT, s.getInterval().toString()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_INT, s.getInterval().toString()) + " "); if (s.hasIntervalUnit()) b.append(s.getIntervalUnit().toString()); } if (s.hasFactor()) - b.append(context.formatMessage(RenderingContext.DATA_REND_FACT, s.getFactor().toString()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_FACT, s.getFactor().toString()) + " "); if (s.hasLowerLimit()) - b.append(context.formatMessage(RenderingContext.DATA_REND_LOWER, s.getLowerLimit().toString()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_LOWER, s.getLowerLimit().toString()) + " "); if (s.hasUpperLimit()) - b.append(context.formatMessage(RenderingContext.DATA_REND_UP, s.getUpperLimit().toString()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_UP, s.getUpperLimit().toString()) + " "); if (s.hasDimensions()) - b.append(context.formatMessage(RenderingContext.DATA_REND_DIM, s.getDimensions()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_DIM, s.getDimensions()) + " "); if (s.hasData()) - b.append(context.formatMessage(RenderingContext.DATA_REND_DATA, s.getData()) + " "); + b.append(context.formatPhrase(RenderingContext.DATA_REND_DATA, s.getData()) + " "); return b.toString(); } @@ -1942,7 +1942,7 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode xn; xn = new XhtmlNode(NodeType.Element, "div"); XhtmlNode p = xn.para(); - p.b().tx((context.formatMessage(RenderingContext.DATA_REND_EXCEPTION)) +function+": "+e.getMessage()); + p.b().tx((context.formatPhrase(RenderingContext.DATA_REND_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 b95c46e77..22048005c 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(context.formatMessage(RenderingContext.DIAG_REP_REND_SUB)); + tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_SUB)); 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(context.formatMessage(RenderingContext.DIAG_REP_REND_WHEN)); + tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN)); eff = (DataType) getProperty(dr, "effective[x]").value().getBase(); render(tr.td(), eff); } if (dr.has("issued")) { tr = tbl.tr(); - tr.td().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_REP)); + tr.td().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP)); 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((context.formatMessage(RenderingContext.DIAG_REP_REND_PER)), pw.getValues().size())); + tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_PER)), 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((context.formatMessage(RenderingContext.DIAG_REP_REND_IDENTIFIER)), pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_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((context.formatMessage(RenderingContext.DIAG_REP_REND_REQUEST)), pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.DIAG_REP_REND_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(context.formatMessage(RenderingContext.DIAG_REP_REND_REPDET)); + x.para().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REPDET)); 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(context.formatMessage(RenderingContext.DIAG_REP_REND_CODECON)); + p.b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODECON)); 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(context.formatMessage(RenderingContext.DIAG_REP_REND_UNABLE)); + container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_UNABLE)); else if (r.getName().equals("Patient")) generatePatientSummary(container, r); else - container.tx(context.formatMessage(RenderingContext.DIAG_REP_REND_NOTDONE)); + container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTDONE)); } 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(context.formatMessage(RenderingContext.DIAG_REP_REND_CODE)); - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_VALUE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_VALUE)); if (refRange) { - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_REFRAN)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REFRAN)); } if (flags) { - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_FLAG)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_FLAG)); } if (note) { - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_NOTE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTE)); } if (effectiveTime) { - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_WHEN)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_WHEN)); } if (issued) { - tr.td().b().tx(context.formatMessage(RenderingContext.DIAG_REP_REND_REP)); + tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REP)); } 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(context.formatMessage(RenderingContext.DIAG_REP_REND_NOTRES)); + td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_NOTRES)); } 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(context.formatMessage(RenderingContext.DIAG_REP_REND_OBS)); + td.i().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_OBS)); } 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(context.formatMessage(RenderingContext.DIAG_REP_REND_ERR) + " "); + span.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_ERR) + " "); 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(" "+ (context.formatMessage(RenderingContext.DIAG_REP_REND_FOR)) + " "); + td.tx(" "+ (context.formatPhrase(RenderingContext.DIAG_REP_REND_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(context.formatMessage(RenderingContext.DIAG_REP_REND_AGE) + " "); + td.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_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 a4d881b8b..408586f8c 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(context.formatMessage(RenderingContext.EX_SCEN_UN, context.getScenarioMode()) + " "); + throw new FHIRException(context.formatPhrase(RenderingContext.EX_SCEN_UN, context.getScenarioMode()) + " "); } } } catch (Exception e) { - throw new FHIRException(context.formatMessage(RenderingContext.EX_SCEN_ERR_REN, scen.getUrl(), e) + " "); + throw new FHIRException(context.formatPhrase(RenderingContext.EX_SCEN_ERR_REN, 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 += context.formatMessage(RenderingContext.EX_SCEN_TIME); + plantUml += context.formatPhrase(RenderingContext.EX_SCEN_TIME); 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(), context.formatMessage(RenderingContext.EXAMPLE_SCEN_STEP_SCEN, trimPrefix(prefix), creolLink((ref.getContent()), ref.getAttribute("href")))); + plantUml += noteOver(scen.getActor(), context.formatPhrase(RenderingContext.EXAMPLE_SCEN_STEP_SCEN, trimPrefix(prefix), 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(context.formatMessage(RenderingContext.EX_SCEN_NAME)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_TYPE)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_DESC)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_NAME)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_TYPE)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_DESC)); 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(context.formatMessage(RenderingContext.EX_SCEN_NAME)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_TYPE)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_CONT)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_DESC)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_NAME)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_TYPE)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_CONT)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_DESC)); 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((context.formatMessage(RenderingContext.EX_SCEN_FVER, instance.getStructureVersion()) + " ") + " "); + typeCell.tx((context.formatPhrase(RenderingContext.EX_SCEN_FVER, 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(" "+(context.formatMessage(RenderingContext.EX_SCEN_VER, instance.getStructureVersion())+" ")); + typeCell.tx(" "+(context.formatPhrase(RenderingContext.EX_SCEN_VER, 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(context.formatMessage(RenderingContext.EX_SCEN_CONTA) + " "); + descCell.b().tx(context.formatPhrase(RenderingContext.EX_SCEN_CONTA) + " "); 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(context.formatMessage(RenderingContext.EX_SCEN_PROC, process.getTitle())+" "); + div.b().tx(context.formatPhrase(RenderingContext.EX_SCEN_PROC, process.getTitle())+" "); if (process.hasDescription()) addMarkdown(div, process.getDescription()); if (process.hasPreConditions()) { - div.para().b().i().tx(context.formatMessage(RenderingContext.EX_SCEN_PRECON)); + div.para().b().i().tx(context.formatPhrase(RenderingContext.EX_SCEN_PRECON)); addMarkdown(div, process.getPreConditions()); } if (process.hasPostConditions()) { - div.para().b().i().tx(context.formatMessage(RenderingContext.EX_SCEN_POSTCON)); + div.para().b().i().tx(context.formatPhrase(RenderingContext.EX_SCEN_POSTCON)); addMarkdown(div, process.getPostConditions()); } XhtmlNode tbl = div.table("table-striped table-bordered").style("width:100%"); XhtmlNode thead = tbl.tr(); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_STEP)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_NAME)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_DESC)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_IN)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_REC)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_REQ)); - thead.th().addText(context.formatMessage(RenderingContext.EX_SCEN_RES)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_STEP)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_NAME)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_DESC)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_IN)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_REC)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_REQ)); + thead.th().addText(context.formatPhrase(RenderingContext.EX_SCEN_RES)); 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(context.formatMessage(RenderingContext.EX_SCEN_SEE)); + n.tx(context.formatPhrase(RenderingContext.EX_SCEN_SEE)); n.ah("#p_" + stepLabel, step.getProcess().getTitle()); - n.tx(" "+ context.formatMessage(RenderingContext.EX_SCEN_BEL)); + n.tx(" "+ context.formatPhrase(RenderingContext.EX_SCEN_BEL)); } else if (step.hasWorkflow()) { XhtmlNode n = row.td().colspan(6); - n.tx(context.formatMessage(RenderingContext.EX_SCEN_OTH)); + n.tx(context.formatPhrase(RenderingContext.EX_SCEN_OTH)); 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(context.formatMessage(RenderingContext.EX_SCEN_ALT, alt.getTitle())+" "); + altHeading.para().i().tx(context.formatPhrase(RenderingContext.EX_SCEN_ALT, 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(context.formatMessage(RenderingContext.EX_SCEN_UN_ACT, actorId)+" "); + throw new FHIRException(context.formatPhrase(RenderingContext.EX_SCEN_UN_ACT, 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(context.formatMessage(RenderingContext.EX_SCEN_UN_INST, instanceRef.getInstanceReference())+" "); + throw new FHIRException(context.formatPhrase(RenderingContext.EX_SCEN_UN_INST, instanceRef.getInstanceReference())+" "); if (instanceRef.hasVersionReference()) { ExampleScenarioInstanceVersionComponent theVersion = null; for (ExampleScenarioInstanceVersionComponent version: instance.getVersion()) { 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 5715bcc11..29a3bf2d2 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(context.formatMessage(RenderingContext.IMP_GUIDE_URL)+" "); + x.para().tx(context.formatPhrase(RenderingContext.IMP_GUIDE_URL)+" "); 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 1261fd31b..c54e7b351 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 @@ -50,32 +50,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(context.formatMessage(RenderingContext.LIB_REND_PAR)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_PAR)); XhtmlNode t = x.table("grid"); if (authors != null) { for (BaseWrapper cd : authors.getValues()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_AUT)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_AUT)), cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : editors.getValues()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_ED)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_ED)), cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : reviewers.getValues()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_REV)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_REV)), cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : endorsers.getValues()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_END)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_END)), cd, email, phone, url); } } } PropertyWrapper artifacts = lib.getChildByName("relatedArtifact"); if (artifacts != null && artifacts.hasValues()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_ART)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_ART)); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -91,7 +91,7 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper parameters = lib.getChildByName("parameter"); if (parameters != null && parameters.hasValues()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_PARA)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_PARA)); XhtmlNode t = x.table("grid"); boolean doco = false; for (BaseWrapper p : parameters.getValues()) { @@ -103,14 +103,14 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper dataRequirements = lib.getChildByName("dataRequirement"); if (dataRequirements != null && dataRequirements.hasValues()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_REQ)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_REQ)); for (BaseWrapper p : dataRequirements.getValues()) { renderDataRequirement(x, (DataRequirement) p.getBase()); } } PropertyWrapper contents = lib.getChildByName("content"); if (contents != null) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_CONT)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_CONT)); boolean isCql = false; int counter = 0; for (BaseWrapper p : contents.getValues()) { @@ -152,23 +152,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(context.formatMessage(RenderingContext.LIB_REND_PAR)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_PAR)); XhtmlNode t = x.table("grid"); for (ContactDetail cd : lib.getAuthor()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_AUT)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_AUT)), cd, email, phone, url); } for (ContactDetail cd : lib.getEditor()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_ED)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_ED)), cd, email, phone, url); } for (ContactDetail cd : lib.getReviewer()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_REV)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_REV)), cd, email, phone, url); } for (ContactDetail cd : lib.getEndorser()) { - participantRow(t, (context.formatMessage(RenderingContext.LIB_REND_END)), cd, email, phone, url); + participantRow(t, (context.formatPhrase(RenderingContext.LIB_REND_END)), cd, email, phone, url); } } if (lib.hasRelatedArtifact()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_ART)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_ART)); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -183,7 +183,7 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasParameter()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_PARA)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_PARA)); XhtmlNode t = x.table("grid"); boolean doco = false; for (ParameterDefinition p : lib.getParameter()) { @@ -194,13 +194,13 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasDataRequirement()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_REQ)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_REQ)); for (DataRequirement p : lib.getDataRequirement()) { renderDataRequirement(x, p); } } if (lib.hasContent()) { - x.h2().tx(context.formatMessage(RenderingContext.LIB_REND_CONT)); + x.h2().tx(context.formatPhrase(RenderingContext.LIB_REND_CONT)); boolean isCql = false; int counter = 0; for (Attachment att : lib.getContent()) { @@ -364,7 +364,7 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx(context.formatMessage(RenderingContext.LIB_REND_NOCONT)); + p.code().tx(context.formatPhrase(RenderingContext.LIB_REND_NOCONT)); p.tx(" ("); p.code().tx(att.getContentType()); p.tx(lang(att)); @@ -413,10 +413,10 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx(context.formatMessage(RenderingContext.LIB_REND_SHOW)); + p.code().tx(context.formatPhrase(RenderingContext.LIB_REND_SHOW)); p.code().tx(att.getContentType()); p.tx(lang(att)); - p.tx((context.formatMessage(RenderingContext.LIB_REND_SIZE, Utilities.describeSize(att.getData().length))+" ")+")"); + p.tx((context.formatPhrase(RenderingContext.LIB_REND_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 949e98560..9635e0bd4 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(context.formatMessage(RenderingContext.LIST_REND_DATE, displayDateTime(list.get("date").dateTimeValue()))+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.get("date").dateTimeValue()))+" "); } if (list.has("mode")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_MODE, list.get("mode").primitiveValue())+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.get("mode").primitiveValue())+" "); } if (list.has("status")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" "); } if (list.has("code")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_CODE, displayBase(list.get("code")))+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_CODE, displayBase(list.get("code")))+" "); } tr = t.tr(); td = tr.td(); if (list.has("subject")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_SUB)+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" "); shortForRef(td, list.get("subject")); } if (list.has("encounter")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_ENC)+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" "); shortForRef(td, list.get("encounter")); } if (list.has("source")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_SRC)+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" "); shortForRef(td, list.get("encounter")); } if (list.has("orderedBy")) { - td.tx(context.formatMessage(RenderingContext.LIST_REND_ORD, displayBase(list.get("orderedBy")))+" "); + td.tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, 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(context.formatMessage(RenderingContext.LIST_REND_ITEM)); + tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM)); if (date) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_DAT)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT)); } if (flag) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_FLAG)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG)); } if (deleted) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_DEL)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL)); } 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(context.formatMessage(RenderingContext.LIST_REND_DATE, displayDateTime(list.getDateElement()))+" "); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DATE, displayDateTime(list.getDateElement()))+" "); } if (list.hasMode()) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_MODE, list.getMode().getDisplay())+" "); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_MODE, list.getMode().getDisplay())+" "); } if (list.hasStatus()) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" "); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" "); } if (list.hasCode()) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_CODE, display(list.getCode()))+" "); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_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(context.formatMessage(RenderingContext.LIST_REND_SUB)+" "); + td.txN(context.formatPhrase(RenderingContext.LIST_REND_SUB)+" "); 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(context.formatMessage(RenderingContext.LIST_REND_ENC)+" "), list.getEncounter()); + shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_ENC)+" "), list.getEncounter()); } if (list.hasSource()) { - shortForRef(tr.td().txN(context.formatMessage(RenderingContext.LIST_REND_SRC)+" "), list.getEncounter()); + shortForRef(tr.td().txN(context.formatPhrase(RenderingContext.LIST_REND_SRC)+" "), list.getEncounter()); } if (list.hasOrderedBy()) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_ORD, display(list.getOrderedBy()))+" "); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_ORD, 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(context.formatMessage(RenderingContext.LIST_REND_ITEM)); + tr.td().b().tx(context.formatPhrase(RenderingContext.LIST_REND_ITEM)); if (date) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_DAT)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DAT)); } if (flag) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_FLAG)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_FLAG)); } if (deleted) { - tr.td().tx(context.formatMessage(RenderingContext.LIST_REND_DEL)); + tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_DEL)); } 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 15721d9be..caf5ddd69 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(context.formatMessage(RenderingContext.NAME_SYS_SUM)); + x.h3().tx(context.formatPhrase(RenderingContext.NAME_SYS_SUM)); XhtmlNode tbl = x.table("grid"); - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_URL)), ns.getUrl()); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_URL)), ns.getUrl()); if (ns.hasVersion()) { - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_VER)), ns.getVersion()); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_VER)), ns.getVersion()); } if (ns.hasName()) { - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_NAME)), gt(ns.getNameElement())); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_NAME)), gt(ns.getNameElement())); } if (ns.hasTitle()) { - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_TITLE)), gt(ns.getTitleElement())); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_TITLE)), gt(ns.getTitleElement())); } - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_STAT)), ns.getStatus().toCode()); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_STAT)), ns.getStatus().toCode()); if (ns.hasDescription()) { - addMarkdown(row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_DEF))), ns.getDescription()); + addMarkdown(row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_DEF))), ns.getDescription()); } if (ns.hasPublisher()) { - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_PUB)), gt(ns.getPublisherElement())); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_PUB)), gt(ns.getPublisherElement())); } if (ns.hasExtension(ToolingExtensions.EXT_WORKGROUP)) { renderCommitteeLink(row(tbl, "Committee"), ns); } if (CodeSystemUtilities.hasOID(ns)) { - row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_OID)), CodeSystemUtilities.getOID(ns)).tx("("+(context.formatMessage(RenderingContext.NAME_SYS_FOROID))+")"); + row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_OID)), CodeSystemUtilities.getOID(ns)).tx("("+(context.formatPhrase(RenderingContext.NAME_SYS_FOROID))+")"); } if (ns.hasCopyright()) { - addMarkdown(row(tbl, (context.formatMessage(RenderingContext.NAME_SYS_COPY))), ns.getCopyright()); + addMarkdown(row(tbl, (context.formatPhrase(RenderingContext.NAME_SYS_COPY))), 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(context.formatMessage(RenderingContext.NAME_SYS_IDEN)); + x.h3().tx(context.formatPhrase(RenderingContext.NAME_SYS_IDEN)); tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx((context.formatMessage(RenderingContext.NAME_SYS_TYPE))); - tr.td().b().tx((context.formatMessage(RenderingContext.NAME_SYS_VALUE))); + tr.td().b().tx((context.formatPhrase(RenderingContext.NAME_SYS_TYPE))); + tr.td().b().tx((context.formatPhrase(RenderingContext.NAME_SYS_VALUE))); if (hasPreferred) { - tr.td().b().tx((context.formatMessage(RenderingContext.NAME_SYS_PREF))); + tr.td().b().tx((context.formatPhrase(RenderingContext.NAME_SYS_PREF))); } if (hasPeriod) { - tr.td().b().tx((context.formatMessage(RenderingContext.NAME_SYS_PER))); + tr.td().b().tx((context.formatPhrase(RenderingContext.NAME_SYS_PER))); } if (hasComment) { - tr.td().b().tx((context.formatMessage(RenderingContext.NAME_SYS_COM))); + tr.td().b().tx((context.formatPhrase(RenderingContext.NAME_SYS_COM))); } for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) { tr = tbl.tr(); 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 8d3f8bd97..2b8c04b99 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(context.formatMessage(RenderingContext.OBLIG_OBLIG)); + tr.td().style("font-size: 11px").b().tx(context.formatPhrase(RenderingContext.OBLIG_OBLIG)); if (actor) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.OBLIG_ACT)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.OBLIG_ACT)); } if (elementId) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.OBLIG_ELE)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.OBLIG_ELE)); } if (usage) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.OBLIG_USE)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.OBLIG_USE)); } if (doco) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.OBLIG_DOC)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.OBLIG_DOC)); } if (filter) { - tr.td().style("font-size: 11px").tx(context.formatMessage(RenderingContext.OBLIG_FILT)); + tr.td().style("font-size: 11px").tx(context.formatPhrase(RenderingContext.OBLIG_FILT)); } 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 84012c5c9..0be97f86f 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(context.formatMessage(RenderingContext.OP_DEF_OFFIC)+" "); + x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_OFFIC)+" "); x.pre().tx(opd.getUrl()); addMarkdown(x, opd.getDescription());} if (opd.getSystem()) - x.para().tx(context.formatMessage(RenderingContext.OP_DEF_URLS, opd.getCode())); + x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URLS, opd.getCode())); for (Enumeration c : opd.getResource()) { if (opd.getType()) - x.para().tx(context.formatMessage(RenderingContext.OP_DEF_URL, c.getCode()+"/$"+opd.getCode())); + x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/$"+opd.getCode())); if (opd.getInstance()) - x.para().tx(context.formatMessage(RenderingContext.OP_DEF_URL, c.getCode()+"/[id]/$"+opd.getCode())); + x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_URL, c.getCode()+"/[id]/$"+opd.getCode())); } if (opd.hasInputProfile()) { XhtmlNode p = x.para(); - p.tx(context.formatMessage(RenderingContext.OP_DEF_INPAR)); + p.tx(context.formatPhrase(RenderingContext.OP_DEF_INPAR)); 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(context.formatMessage(RenderingContext.OP_DEF_OUTPAR)); + p.tx(context.formatPhrase(RenderingContext.OP_DEF_OUTPAR)); 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(context.formatMessage(RenderingContext.OP_DEF_PAR)); + x.para().tx(context.formatPhrase(RenderingContext.OP_DEF_PAR)); XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_USE)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_NAME)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_SCO)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_CARD)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_TYPE)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_BIND)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_DEF_DOC)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_USE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_NAME)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_SCO)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_CARD)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_TYPE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_BIND)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_DOC)); 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 93ef1d2e1..890a42af7 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(context.formatMessage(RenderingContext.OP_OUT_OK)); + x.para().tx(context.formatPhrase(RenderingContext.OP_OUT_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(context.formatMessage(RenderingContext.OP_OUT_SEV)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_OUT_LOC)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_OUT_CODE)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_OUT_DET)); - tr.td().b().tx(context.formatMessage(RenderingContext.OP_OUT_DIAG)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SEV)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_LOC)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DET)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DIAG)); if (hasSource) - tr.td().b().tx(context.formatMessage(RenderingContext.OP_OUT_SRC)); + tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SRC)); 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 (context.formatMessage(RenderingContext.OP_OUT_TODO)); + return (context.formatPhrase(RenderingContext.OP_OUT_TODO)); } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return (context.formatMessage(RenderingContext.OP_OUT_NOT)); + return (context.formatPhrase(RenderingContext.OP_OUT_NOT)); } @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 70f44cdce..fb2e276d5 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 @@ -37,7 +37,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, Resource r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx(context.formatMessage(RenderingContext.PAR_REND_PAR)); + x.h2().tx(context.formatPhrase(RenderingContext.PAR_REND_PAR)); XhtmlNode tbl = x.table("grid"); params(tbl, ((Parameters) r).getParameter(), 0); return false; @@ -55,7 +55,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, ResourceWrapper params) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx(context.formatMessage(RenderingContext.PAR_REND_PAR)); + x.h2().tx(context.formatPhrase(RenderingContext.PAR_REND_PAR)); XhtmlNode tbl = x.table("grid"); PropertyWrapper pw = getProperty(params, "parameter"); if (valued(pw)) { @@ -102,7 +102,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(context.formatMessage(RenderingContext.PAR_REND_PAR)); + div.h2().tx(context.formatPhrase(RenderingContext.PAR_REND_PAR)); 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 8e2cd1b84..c5011ea23 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 @@ -228,19 +228,19 @@ public class PatientRenderer extends ResourceRenderer { if (name == null) { b.append(display(name)); } else { - b.append(context.formatMessage(RenderingContext.PAT_NO_NAME)); + b.append(context.formatPhrase(RenderingContext.PAT_NO_NAME)); } b.append(" "); if (dob == null) { - b.append(context.formatMessage(RenderingContext.PAT_NO_GENDER)); + b.append(context.formatPhrase(RenderingContext.PAT_NO_GENDER)); } else { b.append(gender); } b.append(", "); if (dob == null) { - b.append(context.formatMessage(RenderingContext.PAT_NO_DOB)); + b.append(context.formatPhrase(RenderingContext.PAT_NO_DOB)); } else { - b.append(context.formatMessage(RenderingContext.PAT_DOB, display(dob))); + b.append(context.formatPhrase(RenderingContext.PAT_DOB, display(dob))); } if (id != null) { b.append(" ( "); @@ -252,21 +252,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(context.formatMessage(RenderingContext.PAT_NO_NAME)); // todo: is this appropriate? + x.b().tx(context.formatPhrase(RenderingContext.PAT_NO_NAME)); // todo: is this appropriate? } else { render(x.b(), name); } x.tx(" "); if (gender == null) { - x.tx(context.formatMessage(RenderingContext.PAT_NO_GENDER)); + x.tx(context.formatPhrase(RenderingContext.PAT_NO_GENDER)); } else { x.tx(gender); } x.tx(", "); if (dob == null) { - x.tx(context.formatMessage(RenderingContext.PAT_NO_DOB)); + x.tx(context.formatPhrase(RenderingContext.PAT_NO_DOB)); } else { - x.tx(context.formatMessage(RenderingContext.PAT_DOB, display(dob))); + x.tx(context.formatPhrase(RenderingContext.PAT_DOB, display(dob))); } if (id != null) { x.tx(" ( "); @@ -435,7 +435,7 @@ public class PatientRenderer extends ResourceRenderer { if (langs.size() == 1) { render(r, td, langs.get(0)); if (prefLang != null) { - td.tx(" "+context.formatMessage(RenderingContext.PAT_LANG_PREFERRED)); + td.tx(" "+context.formatPhrase(RenderingContext.PAT_LANG_PREFERRED)); } } else if (langs.size() > 1) { XhtmlNode ul = td.ul(); @@ -443,7 +443,7 @@ public class PatientRenderer extends ResourceRenderer { XhtmlNode li = ul.li(); render(r, li, i); if (i == prefLang) { - li.tx(" "+context.formatMessage(RenderingContext.PAT_LANG_PREFERRED));; + li.tx(" "+context.formatPhrase(RenderingContext.PAT_LANG_PREFERRED));; } } } @@ -455,13 +455,13 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper pw = getProperty(r, "generalPractitioner"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance(context.formatMessage(RenderingContext.PAT_GP), (Reference) t.getBase(), t)); + refs.add(new NamedReferance(context.formatPhrase(RenderingContext.PAT_GP), (Reference) t.getBase(), t)); } } pw = getProperty(r, "managingOrganization"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance(context.formatMessage(RenderingContext.PAT_MO), (Reference) t.getBase(), t)); + refs.add(new NamedReferance(context.formatPhrase(RenderingContext.PAT_MO), (Reference) t.getBase(), t)); } } pw = getProperty(r, "link"); @@ -485,7 +485,7 @@ public class PatientRenderer extends ResourceRenderer { if (refs.size() > 0) { XhtmlNode tr = tbl.tr(); - nameCell(tr, context.formatMessage(RenderingContext.PAT_LINKS), context.formatMessage(RenderingContext.PAT_LINKS_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_LINKS), context.formatPhrase(RenderingContext.PAT_LINKS_HINT)); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -500,10 +500,10 @@ public class PatientRenderer extends ResourceRenderer { private String describeLinkedRecord(String type) { switch (type) { - case "replaced-by" : return context.formatMessage(RenderingContext.PAT_LINK_REPLBY); - case "replaces": return context.formatMessage(RenderingContext.PAT_LINK_REPL); - case "refer": return context.formatMessage(RenderingContext.PAT_LINK_REFER); - case "seealso": return context.formatMessage(RenderingContext.PAT_LINK_SEE); + case "replaced-by" : return context.formatPhrase(RenderingContext.PAT_LINK_REPLBY); + case "replaces": return context.formatPhrase(RenderingContext.PAT_LINK_REPL); + case "refer": return context.formatPhrase(RenderingContext.PAT_LINK_REFER); + case "seealso": return context.formatPhrase(RenderingContext.PAT_LINK_SEE); } return "Unknown"; } @@ -565,9 +565,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)))+":", context.formatMessage(RenderingContext.PAT_NOM_CONTACT)+" "+display(rels.get(0))); + nameCell(tr, (rels.get(0).getCodingFirstRep().hasDisplay() ? rels.get(0).getCodingFirstRep().getDisplay() : display(rels.get(0)))+":", context.formatPhrase(RenderingContext.PAT_NOM_CONTACT)+" "+display(rels.get(0))); } else { - nameCell(tr, context.formatMessage(RenderingContext.PAT_NOK_CONTACT), context.formatMessage(RenderingContext.PAT_NOK_CONTACT_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_NOK_CONTACT), context.formatPhrase(RenderingContext.PAT_NOK_CONTACT_HINT)); } XhtmlNode td = tr.td(); td.colspan("3"); @@ -581,11 +581,11 @@ public class PatientRenderer extends ResourceRenderer { } } else if (gender != null) { li = ul.li(); - li.tx(context.formatMessage(RenderingContext.PAT_GENDER, gender)); + li.tx(context.formatPhrase(RenderingContext.PAT_GENDER, gender)); } if (rels.size() > 1) { li = ul.li(); - li.tx(context.formatMessage(RenderingContext.PAT_RELN)); + li.tx(context.formatPhrase(RenderingContext.PAT_RELN)); boolean first = true; for (CodeableConcept rel : rels) { if (first) first = false; else li.tx(", "); @@ -600,12 +600,12 @@ public class PatientRenderer extends ResourceRenderer { } if (organization != null) { li = ul.li(); - li.tx(context.formatMessage(RenderingContext.PAT_ORG)); + li.tx(context.formatPhrase(RenderingContext.PAT_ORG)); render(r, li, organization); } if (period != null) { li = ul.li(); - li.tx(context.formatMessage(RenderingContext.PAT_PERIOD)); + li.tx(context.formatPhrase(RenderingContext.PAT_PERIOD)); render(r, li, period); } } @@ -625,7 +625,7 @@ public class PatientRenderer extends ResourceRenderer { }; if (names.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, context.formatMessage(RenderingContext.PAT_ALT_NAME), context.formatMessage(RenderingContext.PAT_ALT_NAME_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_ALT_NAME), context.formatPhrase(RenderingContext.PAT_ALT_NAME_HINT)); XhtmlNode td = tr.td(); td.colspan("3"); if (names.size() == 1) { @@ -652,7 +652,7 @@ public class PatientRenderer extends ResourceRenderer { } if (tels.size() + adds.size() > 0) { XhtmlNode tr = tbl.tr(); - nameCell(tr, context.formatMessage(RenderingContext.PAT_CONTACT), context.formatMessage(RenderingContext.PAT_CONTACT_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_CONTACT), context.formatPhrase(RenderingContext.PAT_CONTACT_HINT)); XhtmlNode td = tr.td(); td.colspan("3"); if (tels.size() + adds.size() == 1) { @@ -695,7 +695,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("active"); if (a.hasValues()) { pos++; - nameCell(tr, context.formatMessage(RenderingContext.PAT_ACTIVE), context.formatMessage(RenderingContext.PAT_ACTIVE_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_ACTIVE), context.formatPhrase(RenderingContext.PAT_ACTIVE_HINT)); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -707,7 +707,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("deceased[x]"); if (a.hasValues()) { pos++; - nameCell(tr, context.formatMessage(RenderingContext.PAT_DECEASED), context.formatMessage(RenderingContext.PAT_DECEASED_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_DECEASED), context.formatPhrase(RenderingContext.PAT_DECEASED_HINT)); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -722,7 +722,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, context.formatMessage(RenderingContext.PAT_MARITAL), context.formatMessage(RenderingContext.PAT_MARITAL_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_MARITAL), context.formatPhrase(RenderingContext.PAT_MARITAL_HINT)); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -737,7 +737,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, context.formatMessage(RenderingContext.PAT_MUL_BIRTH), context.formatMessage(RenderingContext.PAT_MUL_BIRTH_HINT)); + nameCell(tr, context.formatPhrase(RenderingContext.PAT_MUL_BIRTH), context.formatPhrase(RenderingContext.PAT_MUL_BIRTH_HINT)); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -780,7 +780,7 @@ public class PatientRenderer extends ResourceRenderer { String n = UUID.randomUUID().toString().toLowerCase()+ext; TextFile.bytesToFile(att.getData(), ManagedFileAccess.file(Utilities.path(context.getDestDir(), n))); context.registerFile(n); - td.img(n, context.formatMessage(RenderingContext.PAT_PHOTO)); + td.img(n, context.formatPhrase(RenderingContext.PAT_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 0623bda9c..6abe12781 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(context.formatMessage(RenderingContext.PROF_DRIV_GEN_NARR, r.fhirType(), (context.isContained() ? " #"+r.getId() : ""))); + p.b().tx(context.formatPhrase(RenderingContext.PROF_DRIV_GEN_NARR, 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(context.formatMessage(RenderingContext.PROF_DRIV_FEXCP, r.fhirType())+" "); + throw new FHIRException(context.formatPhrase(RenderingContext.PROF_DRIV_FEXCP, 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(context.formatMessage(RenderingContext.PROF_DRIV_ERR_GEN_NARR) +r.fhirType()+"/"+r.getId()+": "+e.getMessage()); + System.out.println(context.formatPhrase(RenderingContext.PROF_DRIV_ERR_GEN_NARR) +r.fhirType()+"/"+r.getId()+": "+e.getMessage()); e.printStackTrace(); - x.para().b().style("color: maroon").tx(context.formatMessage(RenderingContext.PROF_DRIV_EXCP, e.getMessage())+" "); + x.para().b().style("color: maroon").tx(context.formatPhrase(RenderingContext.PROF_DRIV_EXCP, 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 6c269b858..f6604f0dc 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(context.formatMessage(RenderingContext.PROV_PROV)+" "); + p.tx(context.formatPhrase(RenderingContext.PROV_PROV)+" "); renderReference(prv, p, prv.getTargetFirstRep()); } else { - x.para().tx(context.formatMessage(RenderingContext.PROV_PROVE)+" "); + x.para().tx(context.formatPhrase(RenderingContext.PROV_PROVE)+" "); 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(context.formatMessage(RenderingContext.PROV_SUM)); + x.para().tx(context.formatPhrase(RenderingContext.PROV_SUM)); XhtmlNode t = x.table("grid"); XhtmlNode tr; if (prv.hasOccurred()) { tr = t.tr(); - tr.td().tx(context.formatMessage(RenderingContext.PROV_OCC)); + tr.td().tx(context.formatPhrase(RenderingContext.PROV_OCC)); 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(context.formatMessage(RenderingContext.PROV_REC)); + tr.td().tx(context.formatPhrase(RenderingContext.PROV_REC)); tr.td().addText(displayDateTime(prv.getRecordedElement())); } if (prv.hasPolicy()) { tr = t.tr(); - tr.td().tx(context.formatMessage(RenderingContext.PROV_POL)); + tr.td().tx(context.formatPhrase(RenderingContext.PROV_POL)); 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(context.formatMessage(RenderingContext.PROV_LOC)); + tr.td().tx(context.formatPhrase(RenderingContext.PROV_LOC)); renderReference(prv, tr.td(), prv.getLocation()); } if (prv.hasActivity()) { tr = t.tr(); - tr.td().tx(context.formatMessage(RenderingContext.PROV_ACT)); + tr.td().tx(context.formatPhrase(RenderingContext.PROV_ACT)); 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(context.formatMessage(RenderingContext.PROV_AGE)); + x.para().b().tx(context.formatPhrase(RenderingContext.PROV_AGE)); t = x.table("grid"); tr = t.tr(); if (hasType) { - tr.td().b().tx(context.formatMessage(RenderingContext.PROV_TYPE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.PROV_TYPE)); } if (hasRole) { - tr.td().b().tx(context.formatMessage(RenderingContext.PROV_ROLE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.PROV_ROLE)); } - tr.td().b().tx(context.formatMessage(RenderingContext.PROV_WHO)); + tr.td().b().tx(context.formatPhrase(RenderingContext.PROV_WHO)); if (hasOnBehalfOf) { - tr.td().b().tx(context.formatMessage(RenderingContext.PROV_BEHALF)); + tr.td().b().tx(context.formatPhrase(RenderingContext.PROV_BEHALF)); } 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 (context.formatMessage(RenderingContext.PROV_FOR, displayReference(prv, prv.getTargetFirstRep()))+" "); + return (context.formatPhrase(RenderingContext.PROV_FOR, displayReference(prv, prv.getTargetFirstRep()))+" "); } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return (context.formatMessage(RenderingContext.PROV_NOT)); + return (context.formatPhrase(RenderingContext.PROV_NOT)); } } \ 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 5541531f6..df5e71073 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(context.formatMessage(RenderingContext.QUEST_STRUCT)); + x.b().tx(context.formatPhrase(RenderingContext.QUEST_STRUCT)); } 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(), (context.formatMessage(RenderingContext.QUEST_LINKID)), (context.formatMessage(RenderingContext.QUEST_LINK)), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatMessage(RenderingContext.QUEST_TEXT)), (context.formatMessage(RenderingContext.QUEST_TEXTFOR)), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatMessage(RenderingContext.QUEST_CARD)), (context.formatMessage(RenderingContext.QUEST_TIMES)), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatMessage(RenderingContext.QUEST_TYPE)), (context.formatMessage(RenderingContext.QUEST_TYPE_ITEM)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_LINKID)), (context.formatPhrase(RenderingContext.QUEST_LINK)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TEXT)), (context.formatPhrase(RenderingContext.QUEST_TEXTFOR)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_CARD)), (context.formatPhrase(RenderingContext.QUEST_TIMES)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TYPE)), (context.formatPhrase(RenderingContext.QUEST_TYPE_ITEM)), null, 0)); if (hasFlags) { - model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatMessage(RenderingContext.QUEST_FLAG)), (context.formatMessage(RenderingContext.QUEST_ATTRIBUTES)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_FLAG)), (context.formatPhrase(RenderingContext.QUEST_ATTRIBUTES)), null, 0)); } - model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatMessage(RenderingContext.QUEST_DESC)), (context.formatMessage(RenderingContext.QUEST_ADD_INFO)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_DESC)), (context.formatPhrase(RenderingContext.QUEST_ADD_INFO)), 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(context.formatMessage(RenderingContext.QUEST_OPT)); + x.para().b().tx(context.formatPhrase(RenderingContext.QUEST_OPT)); 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(context.formatMessage(RenderingContext.QUEST_ANSW, i.getLinkId())+" "); + x.para().b().tx(context.formatPhrase(RenderingContext.QUEST_ANSW, 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", context.formatMessage(RenderingContext.QUEST_ROOT)); + r.setIcon("icon_q_root.gif", context.formatPhrase(RenderingContext.QUEST_ROOT)); 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, context.formatMessage(RenderingContext.QUEST_QUEST), null, null)); + r.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.QUEST_QUEST), 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, context.formatMessage(RenderingContext.QUEST_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, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_SUBJECT)).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, context.formatPhrase(RenderingContext.QUEST_SUBJECT)).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, context.formatMessage(RenderingContext.QUEST_HIDDEN)).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, context.formatPhrase(RenderingContext.QUEST_HIDDEN)).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, context.formatMessage(RenderingContext.QUEST_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, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_LINKED)).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, context.formatPhrase(RenderingContext.QUEST_LINKED)).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, context.formatMessage(RenderingContext.QUEST_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, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_CAT, 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, context.formatPhrase(RenderingContext.QUEST_CAT, 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, (context.formatMessage(RenderingContext.QUEST_MAX)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_MAX)+" "), 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, (context.formatMessage(RenderingContext.QUEST_DEF)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_DEF)+" "), 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, (context.formatMessage(RenderingContext.QUEST_ENABLE)+" "), null); + Piece p = gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_ENABLE)+" "), 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, (context.formatMessage(RenderingContext.QUEST_VALUE)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_VALUE)+" "), 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, (context.formatMessage(RenderingContext.QUEST_OPTIONS)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_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, (context.formatMessage(RenderingContext.QUEST_INITIAL)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_INITIAL)+" "), 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, (context.formatMessage(RenderingContext.QUEST_EXP)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_EXP)+" "), 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(), context.formatMessage(RenderingContext.QUEST_INT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_INT), "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.formatMessage(RenderingContext.QUEST_CONT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CONT), "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(), context.formatMessage(RenderingContext.QUEST_ITEM_CONT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_ITEM_CONT), "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(), context.formatMessage(RenderingContext.QUEST_EN), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_EN), "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(), context.formatMessage(RenderingContext.QUEST_CALC), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CALC), "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(), context.formatMessage(RenderingContext.QUEST_CAND), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CAND), "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(), context.formatMessage(RenderingContext.QUEST_LINKID), context.formatMessage(RenderingContext.QUEST_LINK), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_DESC), context.formatMessage(RenderingContext.QUEST_ADD_INFO), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_LINKID), context.formatPhrase(RenderingContext.QUEST_LINK), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_DESC), context.formatPhrase(RenderingContext.QUEST_ADD_INFO), 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, (context.formatMessage(RenderingContext.QUEST_MAX)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_MAX)+" "), 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, (context.formatMessage(RenderingContext.QUEST_DEF)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_DEF)+" "), 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, (context.formatMessage(RenderingContext.QUEST_ENABLE)+" "), null)); - defn.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.QUEST_TODO), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_ENABLE)+" "), null)); + defn.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.QUEST_TODO), null)); } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, (context.formatMessage(RenderingContext.QUEST_VALUE)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_VALUE)+" "), 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, (context.formatMessage(RenderingContext.QUEST_OPTIONS)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_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, (context.formatMessage(RenderingContext.QUEST_INITIAL)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_INITIAL)+" "), 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, (context.formatMessage(RenderingContext.QUEST_EXP)+" "), null)); + defn.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.QUEST_EXP)+" "), 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(), context.formatMessage(RenderingContext.QUEST_INT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_INT), "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.formatMessage(RenderingContext.QUEST_CONT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CONT), "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(), context.formatMessage(RenderingContext.QUEST_ITEM_CONT), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_ITEM_CONT), "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(), context.formatMessage(RenderingContext.QUEST_EN), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_EN), "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(), context.formatMessage(RenderingContext.QUEST_CALC), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CALC), "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(), context.formatMessage(RenderingContext.QUEST_CAND), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), context.formatPhrase(RenderingContext.QUEST_CAND), "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", context.formatMessage(RenderingContext.QUEST_MAND)).tx("*"); + p.span("color: red", context.formatPhrase(RenderingContext.QUEST_MAND)).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"), context.formatMessage(RenderingContext.QUEST_SUBJECT)).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"), context.formatPhrase(RenderingContext.QUEST_SUBJECT)).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"), context.formatMessage(RenderingContext.QUEST_HIDDEN)).img(getImgPath("icon-qi-hidden.png"), "icon"); + flags.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "extension-questionnaire-hidden.html"), context.formatPhrase(RenderingContext.QUEST_HIDDEN)).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"), context.formatMessage(RenderingContext.QUEST_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"), context.formatPhrase(RenderingContext.QUEST_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"), context.formatMessage(RenderingContext.QUEST_LINKED)).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"), context.formatPhrase(RenderingContext.QUEST_LINKED)).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", (context.formatMessage(RenderingContext.QUEST_CAT, code)+" ")).img(getImgPath("icon-qi-" + code + ".png"), "icon"); + flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", (context.formatPhrase(RenderingContext.QUEST_CAT, code)+" ")).img(getImgPath("icon-qi-" + code + ".png"), "icon"); } if (i.hasMaxLength()) { - item(ul, context.formatMessage(RenderingContext.QUEST_MAX), Integer.toString(i.getMaxLength())); + item(ul, context.formatPhrase(RenderingContext.QUEST_MAX), Integer.toString(i.getMaxLength())); } if (i.hasDefinition()) { - genDefinitionLink(item(ul, context.formatMessage(RenderingContext.QUEST_DEF)), i, q); + genDefinitionLink(item(ul, context.formatPhrase(RenderingContext.QUEST_DEF)), i, q); } if (i.hasEnableWhen()) { - item(ul, context.formatMessage(RenderingContext.QUEST_EN), "todo"); + item(ul, context.formatPhrase(RenderingContext.QUEST_EN), "todo"); } if (i.hasAnswerValueSet()) { - XhtmlNode ans = item(ul, context.formatMessage(RenderingContext.QUEST_ANSWERS)); + XhtmlNode ans = item(ul, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_ANSWERS), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); + item(ul, context.formatPhrase(RenderingContext.QUEST_ANSWERS), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); } if (i.hasInitial()) { - XhtmlNode vi = item(ul, context.formatMessage(RenderingContext.QUEST_INT)); + XhtmlNode vi = item(ul, context.formatPhrase(RenderingContext.QUEST_INT)); 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 context.formatMessage(RenderingContext.QUEST_QUESTIONNAIRE, q.present())+" "; + return context.formatPhrase(RenderingContext.QUEST_QUESTIONNAIRE, q.present())+" "; } private boolean renderLinks(XhtmlNode x, Questionnaire q) { - x.para().tx(context.formatMessage(RenderingContext.QUEST_TRY)); + x.para().tx(context.formatPhrase(RenderingContext.QUEST_TRY)); 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(context.formatMessage(RenderingContext.QUEST_NLM)); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(context.formatPhrase(RenderingContext.QUEST_NLM)); 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(" "+(context.formatMessage(RenderingContext.QUEST_QUEST)+" ")); + td.tx(" "+(context.formatPhrase(RenderingContext.QUEST_QUEST)+" ")); td.b().tx(q.getId()); // general information - defn(tbl, context.formatMessage(RenderingContext.QUEST_URL), q.getUrl()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_VERSION), q.getVersion()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_NAME), q.getName()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_TITLE), q.getTitle()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_URL), q.getUrl()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_VERSION), q.getVersion()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_NAME), q.getName()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_TITLE), q.getTitle()); if (q.hasDerivedFrom()) { - td = defn(tbl, context.formatMessage(RenderingContext.QUEST_DERIVED)); + td = defn(tbl, context.formatPhrase(RenderingContext.QUEST_DERIVED)); 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, context.formatMessage(RenderingContext.QUEST_STATUS), q.getStatus().getDisplay()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_EXPER), q.getExperimental()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_PUB), q.getDateElement().primitiveValue()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_APP), q.getApprovalDateElement().primitiveValue()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_REV_DATE), q.getLastReviewDateElement().primitiveValue()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_STATUS), q.getStatus().getDisplay()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_EXPER), q.getExperimental()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_PUB), q.getDateElement().primitiveValue()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_APP), q.getApprovalDateElement().primitiveValue()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_REV_DATE), q.getLastReviewDateElement().primitiveValue()); if (q.hasEffectivePeriod()) { - renderPeriod(defn(tbl, context.formatMessage(RenderingContext.QUEST_EFF_PERIOD)), q.getEffectivePeriod()); + renderPeriod(defn(tbl, context.formatPhrase(RenderingContext.QUEST_EFF_PERIOD)), q.getEffectivePeriod()); } if (q.hasSubjectType()) { - td = defn(tbl, context.formatMessage(RenderingContext.QUEST_SUB_TYPE)); + td = defn(tbl, context.formatPhrase(RenderingContext.QUEST_SUB_TYPE)); boolean first = true; for (CodeType c : q.getSubjectType()) { if (first) first = false; else td.tx(", "); td.tx(c.asStringValue()); } } - defn(tbl, context.formatMessage(RenderingContext.QUEST_DESCRIPTION), q.getDescription()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_PURPOSE), q.getPurpose()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_COPYRIGHT), q.getCopyright()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_DESCRIPTION), q.getDescription()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_PURPOSE), q.getPurpose()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_ID), qi.getLinkId()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_PREFIX), qi.getPrefix()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_TEXT), qi.getText()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_TYPE), qi.getType().getDisplay()); - defn(tbl, context.formatMessage(RenderingContext.QUEST_REQ), qi.getRequired(), true); - defn(tbl, context.formatMessage(RenderingContext.QUEST_REP), qi.getRepeats(), true); - defn(tbl, context.formatMessage(RenderingContext.QUEST_READ_ONLY), qi.getReadOnly(), false); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_ID), qi.getLinkId()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_PREFIX), qi.getPrefix()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_TEXT), qi.getText()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_TYPE), qi.getType().getDisplay()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_REQ), qi.getRequired(), true); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_REP), qi.getRepeats(), true); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_READ_ONLY), qi.getReadOnly(), false); if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { - defn(tbl, context.formatMessage(RenderingContext.QUEST_SUB), "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "This element changes who the subject of the question is", null); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_SUB), "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, context.formatMessage(RenderingContext.QUEST_MAX_LENGTH), qi.getMaxLength()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_MAX_LENGTH), qi.getMaxLength()); if (qi.hasAnswerValueSet()) { - defn(tbl, context.formatMessage(RenderingContext.QUEST_VALUE_SET), qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_VALUE_SET), qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); } if (qi.hasAnswerOption()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(context.formatMessage(RenderingContext.QUEST_ALLOWED)); + tr.td().tx(context.formatPhrase(RenderingContext.QUEST_ALLOWED)); XhtmlNode ul = tr.td().ul(); for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { XhtmlNode li = ul.li(); render(li, ans.getValue()); if (ans.getInitialSelected()) { - li.tx(" "+(context.formatMessage(RenderingContext.QUEST_INITIALLY))); + li.tx(" "+(context.formatPhrase(RenderingContext.QUEST_INITIALLY))); } } } if (qi.hasInitial()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize((context.formatMessage(RenderingContext.QUEST_INITIAL_ANSWER)), qi.getInitial().size())); + tr.td().tx(Utilities.pluralize((context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_HIDDEN_ITEM), ToolingExtensions.EXT_Q_DISPLAY_CAT, "This item is a hidden question", null); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_HIDDEN_ITEM), ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_HIDDEN_ITEM), ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); } // formal definitions if (qi.hasDefinition()) { - genDefinitionLink(defn(tbl, context.formatMessage(RenderingContext.QUEST_DEFINITION)), qi, q); + genDefinitionLink(defn(tbl, context.formatPhrase(RenderingContext.QUEST_DEFINITION)), qi, q); } if (qi.hasCode()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize(context.formatMessage(RenderingContext.QUEST_CODE), qi.getCode().size())); + tr.td().tx(Utilities.pluralize(context.formatPhrase(RenderingContext.QUEST_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(context.formatMessage(RenderingContext.QUEST_OBSERVATION)); + tr.td().ah(sd.getWebPath()).tx(context.formatPhrase(RenderingContext.QUEST_OBSERVATION)); } else { - tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx(context.formatMessage(RenderingContext.QUEST_OBSERVATION)); + tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx(context.formatPhrase(RenderingContext.QUEST_OBSERVATION)); } 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(context.formatMessage(RenderingContext.QUEST_EN)); + tr.td().tx(context.formatPhrase(RenderingContext.QUEST_EN)); td = tr.td(); if (qi.getEnableWhen().size() == 1) { renderEnableWhen(td, qi.getEnableWhen().get(0)); } else { if (qi.hasEnableBehavior()) { - td.tx(qi.getEnableBehavior().getDisplay()+" "+(context.formatMessage(RenderingContext.QUEST_TRUE))); + td.tx(qi.getEnableBehavior().getDisplay()+" "+(context.formatPhrase(RenderingContext.QUEST_TRUE))); } else { - td.tx(context.formatMessage(RenderingContext.QUEST_ARE_TRUE)); + td.tx(context.formatPhrase(RenderingContext.QUEST_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, context.formatMessage(RenderingContext.QUEST_DEFINITION), RendererFactory.factory(res, context).display(res), res.getWebPath()); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_DEFINITION), RendererFactory.factory(res, context).display(res), res.getWebPath()); } else if (Utilities.isAbsoluteUrlLinkable(url)) { - defn(tbl, context.formatMessage(RenderingContext.QUEST_DEFINITION), url, url); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_DEFINITION), url, url); } { - defn(tbl, context.formatMessage(RenderingContext.QUEST_DEFINITION), url); + defn(tbl, context.formatPhrase(RenderingContext.QUEST_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 8589632ec..204787d28 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(context.formatMessage(RenderingContext.QUEST_UNKNOWN_MODE)); + throw new Error(context.formatPhrase(RenderingContext.QUEST_UNKNOWN_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(context.formatMessage(RenderingContext.QUEST_UNKNOWN_MODE)); + throw new Error(context.formatPhrase(RenderingContext.QUEST_UNKNOWN_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(), context.formatMessage(RenderingContext.QUEST_LINKID), context.formatMessage(RenderingContext.QUEST_LINK), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_TEXT), context.formatMessage(RenderingContext.QUEST_TEXTFOR), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_DEFINITION), context.formatMessage(RenderingContext.QUEST_TIMES), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_ANSWER), context.formatMessage(RenderingContext.QUEST_TYPE_ITEM), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_LINKID), context.formatPhrase(RenderingContext.QUEST_LINK), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_TEXT), context.formatPhrase(RenderingContext.QUEST_TEXTFOR), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_DEFINITION), context.formatPhrase(RenderingContext.QUEST_TIMES), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_ANSWER), context.formatPhrase(RenderingContext.QUEST_TYPE_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(), context.formatMessage(RenderingContext.QUEST_LINKID), context.formatMessage(RenderingContext.QUEST_LINK), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_TEXT), context.formatMessage(RenderingContext.QUEST_TEXTFOR), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_DEFINITION), context.formatMessage(RenderingContext.QUEST_TIMES), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.QUEST_ANSWER), context.formatMessage(RenderingContext.QUEST_TYPE_ITEM), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_LINKID), context.formatPhrase(RenderingContext.QUEST_LINK), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_TEXT), context.formatPhrase(RenderingContext.QUEST_TEXTFOR), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_DEFINITION), context.formatPhrase(RenderingContext.QUEST_TIMES), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.QUEST_ANSWER), context.formatPhrase(RenderingContext.QUEST_TYPE_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", context.formatMessage(RenderingContext.QUEST_RESP_ROOT)); + r.setIcon("icon_q_root.gif", context.formatPhrase(RenderingContext.QUEST_RESP_ROOT)); 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, context.formatMessage(RenderingContext.QUEST_RESP), null, null)); + r.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.QUEST_RESP), 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", context.formatMessage(RenderingContext.QUEST_RESP_ROOT)); + r.setIcon("icon_q_root.gif", context.formatPhrase(RenderingContext.QUEST_RESP_ROOT)); 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(context.formatMessage(RenderingContext.QUEST_QUESTION), null, context.formatMessage(RenderingContext.QUEST_NONE_SPEC), null, null)); + r.getCells().add(gen.new Cell(context.formatPhrase(RenderingContext.QUEST_QUESTION), null, context.formatPhrase(RenderingContext.QUEST_NONE_SPEC), null, null)); } else if (q == null || !q.hasWebPath()) { r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell(context.formatMessage(RenderingContext.QUEST_QUESTION), null, ref, null, null)); + r.getCells().add(gen.new Cell(context.formatPhrase(RenderingContext.QUEST_QUESTION), null, ref, null, null)); } else{ r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell(context.formatMessage(RenderingContext.QUEST_QUESTION), q.getWebPath(), q.present(), null, null)); + r.getCells().add(gen.new Cell(context.formatPhrase(RenderingContext.QUEST_QUESTION), 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", context.formatMessage(RenderingContext.QUEST_GROUP)); + r.setIcon("icon-q-group.png", context.formatPhrase(RenderingContext.QUEST_GROUP)); } else { - r.setIcon("icon-q-string.png", context.formatMessage(RenderingContext.QUEST_ITEM)); + r.setIcon("icon-q-string.png", context.formatPhrase(RenderingContext.QUEST_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", context.formatMessage(RenderingContext.QUEST_GROUP)); + r.setIcon("icon-q-group.png", context.formatPhrase(RenderingContext.QUEST_GROUP)); } else { - r.setIcon("icon-q-string.png", context.formatMessage(RenderingContext.QUEST_ITEM)); + r.setIcon("icon-q-string.png", context.formatPhrase(RenderingContext.QUEST_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(context.formatMessage(RenderingContext.QUEST_TODO)); + d.tx(context.formatPhrase(RenderingContext.QUEST_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", context.formatMessage(RenderingContext.QUEST_MAND)).tx("*"); +// p.span("color: red", context.formatPhrase(RenderingContext.QUEST_MAND)).tx("*"); // } // // XhtmlNode input = null; @@ -605,16 +605,16 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // private boolean renderLinks(XhtmlNode x, QuestionnaireResponse q) { - x.para().tx(context.formatMessage(RenderingContext.QUEST_TRY_QUEST)); + x.para().tx(context.formatPhrase(RenderingContext.QUEST_TRY_QUEST)); 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(context.formatMessage(RenderingContext.QUEST_NLM)); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(context.formatPhrase(RenderingContext.QUEST_NLM)); return false; } private boolean renderLinks(XhtmlNode x, ResourceWrapper q) { - x.para().tx(context.formatMessage(RenderingContext.QUEST_TRY_QUEST)); + x.para().tx(context.formatPhrase(RenderingContext.QUEST_TRY_QUEST)); 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(context.formatMessage(RenderingContext.QUEST_NLM)); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(context.formatPhrase(RenderingContext.QUEST_NLM)); return false; } @@ -711,13 +711,13 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // if (qi.hasAnswerOption()) { // XhtmlNode tr = tbl.tr(); -// tr.td().tx(context.formatMessage(RenderingContext.QUEST_ALLOWED)); +// tr.td().tx(context.formatPhrase(RenderingContext.QUEST_ALLOWED)); // XhtmlNode ul = tr.td().ul(); // for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { // XhtmlNode li = ul.li(); // render(li, ans.getValue()); // if (ans.getInitialSelected()) { -// li.tx(context.formatMessage(RenderingContext.QUEST_INITIALLY)); +// li.tx(context.formatPhrase(RenderingContext.QUEST_INITIALLY)); // } // } // } @@ -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(context.formatMessage(RenderingContext.QUEST_DISPLAY_CAT)); +// tr.td().ah("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").tx(context.formatPhrase(RenderingContext.QUEST_DISPLAY_CAT)); // 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(context.formatMessage(RenderingContext.QUEST_OBSERVATION)); +// tr.td().ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").tx(context.formatPhrase(RenderingContext.QUEST_OBSERVATION)); // 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(context.formatMessage(RenderingContext.QUEST_ENABLE)); +// tr.td().tx(context.formatPhrase(RenderingContext.QUEST_ENABLE)); // 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 context.formatMessage(RenderingContext.QUEST_TODO); + return context.formatPhrase(RenderingContext.QUEST_TODO); } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return context.formatMessage(RenderingContext.QUEST_NOT_DONE); + return context.formatPhrase(RenderingContext.QUEST_NOT_DONE); } } \ 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 19ff12b9c..9fa7a3a11 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 @@ -48,14 +48,14 @@ public class Renderer { } - protected String formatMessage(String theMessage, Object... theMessageArguments) { - return context.formatMessage(theMessage, theMessageArguments); + protected String formatPhrase(String theMessage, Object... theMessageArguments) { + return context.formatPhrase(theMessage, theMessageArguments); } 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"), (context.formatMessage(RenderingContext.REND_STANDARDS, ss.toDisplay()))); + XhtmlNode a = td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "versions.html#std-process"), (context.formatPhrase(RenderingContext.REND_STANDARDS, 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", (context.formatMessage(RenderingContext.REND_SINCE_ADDED, context.getChangeVersion()))); + XhtmlNode spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", (context.formatPhrase(RenderingContext.REND_SINCE_ADDED, context.getChangeVersion()))); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_ADDED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", vca.getOriginal() == null ? context.formatMessage(RenderingContext.REND_SINCE_CHANGED, context.getChangeVersion()) : context.formatMessage(RenderingContext.REND_SINCE_CHANGED_WAS, context.getChangeVersion(), vca.getOriginal())); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", vca.getOriginal() == null ? context.formatPhrase(RenderingContext.REND_SINCE_CHANGED, context.getChangeVersion()) : context.formatPhrase(RenderingContext.REND_SINCE_CHANGED_WAS, context.getChangeVersion(), vca.getOriginal())); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_CHANGED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", (context.formatMessage(RenderingContext.REND_SINCE_DELETED, context.getChangeVersion()))); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", (context.formatPhrase(RenderingContext.REND_SINCE_DELETED, context.getChangeVersion()))); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_REMOVED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", (context.formatMessage(RenderingContext.REND_SINCE_ADDED, context.getChangeVersion()))); + XhtmlNode spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", (context.formatPhrase(RenderingContext.REND_SINCE_ADDED, context.getChangeVersion()))); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_ADDED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", vca.getOriginal() == null ? context.formatMessage(RenderingContext.REND_SINCE_CHANGED, context.getChangeVersion()) : context.formatMessage(RenderingContext.REND_SINCE_CHANGED_WAS, context.getChangeVersion(), vca.getOriginal())); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", vca.getOriginal() == null ? context.formatPhrase(RenderingContext.REND_SINCE_CHANGED, context.getChangeVersion()) : context.formatPhrase(RenderingContext.REND_SINCE_CHANGED_WAS, context.getChangeVersion(), vca.getOriginal())); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_CHANGED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", (context.formatMessage(RenderingContext.REND_SINCE_DELETED, context.getChangeVersion()))); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", (context.formatPhrase(RenderingContext.REND_SINCE_DELETED, context.getChangeVersion()))); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_REMOVED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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", (context.formatMessage(RenderingContext.REND_ROW_SINCE, context.getChangeVersion()))); + XhtmlNode span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", (context.formatPhrase(RenderingContext.REND_ROW_SINCE, context.getChangeVersion()))); span.img("icon-change-add.png", "icon"); - span.tx(" "+ context.formatMessage(RenderingContext.REND_ADDED)); + span.tx(" "+ context.formatPhrase(RenderingContext.REND_ADDED)); XhtmlNode x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatMessage(RenderingContext.REND_ROW_SINCE, context.getChangeVersion())).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatPhrase(RenderingContext.REND_ROW_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", context.formatMessage(RenderingContext.REND_ROW_CHANGED_SINCE_WAS, context.getChangeVersion(), vca.getOriginal())); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatPhrase(RenderingContext.REND_ROW_CHANGED_SINCE_WAS, context.getChangeVersion(), vca.getOriginal())); span.img("icon-change-edit.png", "icon"); - span.tx(" "+ context.formatMessage(RenderingContext.REND_CHANGED)); + span.tx(" "+ context.formatPhrase(RenderingContext.REND_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", context.formatMessage(RenderingContext.REND_ROW_REMOVED_SINCE, context.getChangeVersion())); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatPhrase(RenderingContext.REND_ROW_REMOVED_SINCE, context.getChangeVersion())); span.img("icon-change-remove.png", "icon"); - span.tx(" "+ context.formatMessage(RenderingContext.REND_REMOVED)); + span.tx(" "+ context.formatPhrase(RenderingContext.REND_REMOVED)); x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", context.formatMessage(RenderingContext.REND_ROW_SINCE, context.getChangeVersion())).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", context.formatPhrase(RenderingContext.REND_ROW_SINCE, context.getChangeVersion())).tx(" "); tr.styleCells(x); return td; default: @@ -173,9 +173,9 @@ 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", context.formatMessage(RenderingContext.REND_SINCE_ADDED, version)); + XhtmlNode spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatPhrase(RenderingContext.REND_SINCE_ADDED, version)); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_ADDED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_ADDED)); return; case Changed: if (self.getComp().noChangeOtherThanMetadata(metadataFields)) { @@ -183,15 +183,15 @@ public class Renderer { return; } else { spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", - self.getOriginal() != null ? context.formatMessage(RenderingContext.REND_SINCE_CHANGED_WAS, version, self.getOriginal()) : context.formatMessage(RenderingContext.REND_SINCE_CHANGED, version)); + self.getOriginal() != null ? context.formatPhrase(RenderingContext.REND_SINCE_CHANGED_WAS, version, self.getOriginal()) : context.formatPhrase(RenderingContext.REND_SINCE_CHANGED, version)); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_CHANGED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_CHANGED)); } return; case Deleted: - spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatMessage(RenderingContext.REND_SINCE_DELETED, version)); + spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", context.formatPhrase(RenderingContext.REND_SINCE_DELETED, version)); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" "+context.formatMessage(RenderingContext.REND_REMOVED)); + spanInner.tx(" "+context.formatPhrase(RenderingContext.REND_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 ba726fe60..60cc200c6 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(context.formatMessage(RenderingContext.REQ_ACTOR)+" "); + p.tx(context.formatPhrase(RenderingContext.REQ_ACTOR)+" "); if (acd == null) { p.code(req.getActor().get(0).getValue()); } else { p.ah(acd.getWebPath()).tx(acd.present()); } } else { - x.para().tx(context.formatMessage(RenderingContext.REQ_FOLLOWING_ACTOR)+" "); + x.para().tx(context.formatPhrase(RenderingContext.REQ_FOLLOWING_ACTOR)+" "); 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(context.formatMessage(RenderingContext.REQ_DERIVE)+" "); + p.tx(context.formatPhrase(RenderingContext.REQ_DERIVE)+" "); if (reqd == null) { p.code(req.getDerivedFrom().get(0).getValue()); } else { p.ah(reqd.getWebPath()).tx(reqd.present()); } } else { - x.para().tx(context.formatMessage(RenderingContext.REQ_FOLLOWING_REQ)+" "); + x.para().tx(context.formatPhrase(RenderingContext.REQ_FOLLOWING_REQ)+" "); 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(context.formatMessage(RenderingContext.REQ_REFERENCES)+" "); + p.tx(context.formatPhrase(RenderingContext.REQ_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(context.formatMessage(RenderingContext.REQ_LINKS)+" "); + td.para().tx(context.formatPhrase(RenderingContext.REQ_LINKS)+" "); XhtmlNode ul = td.ul(); if (stmt.hasDerivedFrom()) { XhtmlNode li = ul.li(); - li.tx(context.formatMessage(RenderingContext.REQ_DERIVED)+" "); + li.tx(context.formatPhrase(RenderingContext.REQ_DERIVED)+" "); 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(context.formatMessage(RenderingContext.REQ_SATISFIED)+" "); + li.tx(context.formatPhrase(RenderingContext.REQ_SATISFIED)+" "); 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(context.formatMessage(RenderingContext.REQ_REFERENCES)+" "); + li.tx(context.formatPhrase(RenderingContext.REQ_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(context.formatMessage(RenderingContext.REQ_SOURCES)+" "); + li.tx(context.formatPhrase(RenderingContext.REQ_SOURCES)+" "); 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 e7c675c59..d35a7e996 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 @@ -232,11 +232,11 @@ public abstract class ResourceRenderer extends DataRenderer { CanonicalResource cr = (CanonicalResource) target; if (url.contains("|")) { if (target.hasWebPath()) { - x.ah(target.getWebPath()).tx(cr.present()+ context.formatMessage(RenderingContext.RES_REND_VER) +cr.getVersion()+")"); + x.ah(target.getWebPath()).tx(cr.present()+ context.formatPhrase(RenderingContext.RES_REND_VER) +cr.getVersion()+")"); } else { url = url.substring(0, url.indexOf("|")); x.code().tx(url); - x.tx(": "+cr.present()+ context.formatMessage(RenderingContext.RES_REND_VER) +cr.getVersion()+")"); + x.tx(": "+cr.present()+ context.formatPhrase(RenderingContext.RES_REND_VER) +cr.getVersion()+")"); } } else { if (target.hasWebPath()) { @@ -304,14 +304,14 @@ public abstract class ResourceRenderer extends DataRenderer { if (tr != null && tr.getReference() != null) { link = tr.getReference(); } else if (r.getReference().contains("?")) { - text.append(context.formatMessage(RenderingContext.RES_REND_COND_REF)+" "); + text.append(context.formatPhrase(RenderingContext.RES_REND_COND_REF)+" "); } else { link = r.getReference(); } } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { - text.append(context.formatMessage(RenderingContext.RES_REND_SEE_ON_THIS_PAGE)+" "); + text.append(context.formatPhrase(RenderingContext.RES_REND_SEE_ON_THIS_PAGE)+" "); } // 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; @@ -355,7 +355,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { text.append(name); } else { - text.append(context.formatMessage(RenderingContext.RES_REND_DESC)); + text.append(context.formatPhrase(RenderingContext.RES_REND_DESC)); } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { @@ -388,7 +388,7 @@ public abstract class ResourceRenderer extends DataRenderer { c = x.ah(tr.getReference()); } } else if (r.getReference().contains("?")) { - x.tx(context.formatMessage(RenderingContext.RES_REND_COND_REF)+" "); + x.tx(context.formatPhrase(RenderingContext.RES_REND_COND_REF)+" "); c = x.code(""); } else { c = x.ah(r.getReference()); @@ -405,7 +405,7 @@ public abstract class ResourceRenderer extends DataRenderer { c = x.span(null, null); } if (onPage) { - c.tx(context.formatMessage(RenderingContext.RES_REND_SEE_ON_THIS_PAGE)+" "); + c.tx(context.formatPhrase(RenderingContext.RES_REND_SEE_ON_THIS_PAGE)+" "); } // 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; @@ -449,7 +449,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { c.addText(name); } else { - c.tx(context.formatMessage(RenderingContext.RES_REND_GEN_SUM)+" "); + c.tx(context.formatPhrase(RenderingContext.RES_REND_GEN_SUM)+" "); if (tr != null) { new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, r.getReference().startsWith("#"), true); } @@ -478,7 +478,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(context.formatMessage(RenderingContext.RES_REND_GEN_SUM)+" "); + c.tx(context.formatPhrase(RenderingContext.RES_REND_GEN_SUM)+" "); new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, v.startsWith("#"), false); } } else if (tr != null && tr.getResource() != null) { @@ -557,12 +557,12 @@ public abstract class ResourceRenderer extends DataRenderer { protected void generateCopyright(XhtmlNode x, CanonicalResource cs) { XhtmlNode p = x.para(); - p.b().tx(getContext().formatMessage(RenderingContext.RESOURCE_COPYRIGHT)); + p.b().tx(getContext().formatPhrase(RenderingContext.RESOURCE_COPYRIGHT)); smartAddText(p, " " + cs.getCopyright()); } public String displayReference(Resource res, Reference r) throws UnsupportedEncodingException, IOException { - return (context.formatMessage(RenderingContext.RES_REND_TODO)); + return (context.formatPhrase(RenderingContext.RES_REND_TODO)); } @@ -607,10 +607,10 @@ public abstract class ResourceRenderer extends DataRenderer { protected String describeStatus(PublicationStatus status, boolean experimental) { switch (status) { - case ACTIVE: return experimental ? (context.formatMessage(RenderingContext.RES_REND_EXP)) : (context.formatMessage(RenderingContext.RES_REND_ACT)); - case DRAFT: return (context.formatMessage(RenderingContext.RES_REND_DRAFT)); - case RETIRED: return (context.formatMessage(RenderingContext.RES_REND_RET)); - default: return (context.formatMessage(RenderingContext.RES_REND_UNKNOWN)); + case ACTIVE: return experimental ? (context.formatPhrase(RenderingContext.RES_REND_EXP)) : (context.formatPhrase(RenderingContext.RES_REND_ACT)); + case DRAFT: return (context.formatPhrase(RenderingContext.RES_REND_DRAFT)); + case RETIRED: return (context.formatPhrase(RenderingContext.RES_REND_RET)); + default: return (context.formatPhrase(RenderingContext.RES_REND_UNKNOWN)); } } @@ -656,35 +656,35 @@ public abstract class ResourceRenderer extends DataRenderer { if (id != null || lang != null || versionId != null || lastUpdated != null) { XhtmlNode p = plateStyle(div.para()); - p.tx(context.formatMessage(RenderingContext.RES_REND_RESOURCE)); + p.tx(context.formatPhrase(RenderingContext.RES_REND_RESOURCE)); p.tx(r.fhirType()); p.tx(" "); if (id != null) { p.tx("\""+id+"\" "); } if (versionId != null) { - p.tx(context.formatMessage(RenderingContext.RES_REND_VERSION) + "\""+versionId+"\" "); + p.tx(context.formatPhrase(RenderingContext.RES_REND_VERSION) + "\""+versionId+"\" "); } if (lastUpdated != null) { - p.tx(context.formatMessage(RenderingContext.RES_REND_UPDATED) + "\""); + p.tx(context.formatPhrase(RenderingContext.RES_REND_UPDATED) + "\""); renderDateTime(p, lastUpdated); p.tx("\" "); } if (lang != null) { - p.tx(" " + context.formatMessage(RenderingContext.RES_REND_LANGUAGE) + "\""+lang+"\") "); + p.tx(" " + context.formatPhrase(RenderingContext.RES_REND_LANGUAGE) + "\""+lang+"\") "); } } if (ir != null) { - plateStyle(div.para()).b().tx(context.formatMessage(RenderingContext.RES_REND_SPEC_RULES) + " "+ir+"!"); + plateStyle(div.para()).b().tx(context.formatPhrase(RenderingContext.RES_REND_SPEC_RULES) + " "+ir+"!"); } if (source != null) { - plateStyle(div.para()).tx(context.formatMessage(RenderingContext.RES_REND_INFO_SOURCE) + " "+source+"!"); + plateStyle(div.para()).tx(context.formatPhrase(RenderingContext.RES_REND_INFO_SOURCE) + " "+source+"!"); } if (meta != null) { PropertyWrapper pl = meta.getChildByName("profile"); if (pl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize(context.formatMessage(RenderingContext.RES_REND_PROFILE), pl.getValues().size())+": "); + p.tx(Utilities.pluralize(context.formatPhrase(RenderingContext.RES_REND_PROFILE), pl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : pl.getValues()) { if (first) first = false; else p.tx(", "); @@ -694,7 +694,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper tl = meta.getChildByName("tag"); if (tl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize(context.formatMessage(RenderingContext.RES_REND_TAG), tl.getValues().size())+": "); + p.tx(Utilities.pluralize(context.formatPhrase(RenderingContext.RES_REND_TAG), tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : tl.getValues()) { if (first) first = false; else p.tx(", "); @@ -708,7 +708,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper sl = meta.getChildByName("security"); if (sl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize(context.formatMessage(RenderingContext.RES_REND_SECURITY_LABEL), tl.getValues().size())+": "); + p.tx(Utilities.pluralize(context.formatPhrase(RenderingContext.RES_REND_SECURITY_LABEL), tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : sl.getValues()) { if (first) first = false; else p.tx(", "); @@ -740,7 +740,7 @@ public abstract class ResourceRenderer extends DataRenderer { render(dr); } catch (Exception e) { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.para().tx(context.formatMessage(RenderingContext.RES_REND_ERROR, e.getMessage())+" "); + x.para().tx(context.formatPhrase(RenderingContext.RES_REND_ERROR, 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 acfeb563f..ab28017ae 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(context.formatMessage(RenderingContext.SEARCH_PAR_PAR)+" "); + p.tx(context.formatPhrase(RenderingContext.SEARCH_PAR_PAR)+" "); 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(context.formatMessage(RenderingContext.SEARCH_PAR_REND_RES), spd.getBase().size())); + tr.td().tx(Utilities.pluralize(context.formatPhrase(RenderingContext.SEARCH_PAR_REND_RES), 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(context.formatMessage(RenderingContext.SEARCH_PAR_EXP)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_EXP)); if (spd.hasExpression()) { tr.td().code().tx(spd.getExpression()); } else { - tr.td().tx(context.formatMessage(RenderingContext.SEARCH_PAR_NONE)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_NONE)); } if (spd.hasProcessingMode()) { tr = tbl.tr(); - tr.td().tx(context.formatMessage(RenderingContext.SEARCH_PAR_PROC)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_PROC)); tr.td().tx(spd.getProcessingMode().getDisplay()); } if (spd.hasTarget()) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize(context.formatMessage(RenderingContext.SEARCH_PAR_REND_TARGET), spd.getTarget().size())); + tr.td().tx(Utilities.pluralize(context.formatPhrase(RenderingContext.SEARCH_PAR_REND_TARGET), spd.getTarget().size())); td = tr.td(); if (isAllConcreteResources(spd.getTarget())) { - td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx(context.formatMessage(RenderingContext.SEARCH_PAR_RES)); + td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx(context.formatPhrase(RenderingContext.SEARCH_PAR_RES)); } 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(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLES)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLES)); XhtmlNode ul = tr.td().ul(); if (!spd.hasMultipleAnd()) { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_AND_SERVER)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_AND_SERVER)); } else if (spd.getMultipleAnd()) { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_AND_REPEAT)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_AND_REPEAT)); } else { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_AND_APPEAR)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_AND_APPEAR)); } if (!spd.hasMultipleOr()) { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_OR_SERVER)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_OR_SERVER)); } else if (spd.getMultipleOr()) { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_OR_MULTIPLE)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_OR_MULTIPLE)); } else { - ul.li().tx(context.formatMessage(RenderingContext.SEARCH_PAR_MULTIPLE_OR_ONE)); + ul.li().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MULTIPLE_OR_ONE)); } if (spd.hasComparator()) { tr = tbl.tr(); - tr.td().tx(context.formatMessage(RenderingContext.SEARCH_PAR_COMP)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_COMP)); td = tr.td(); - td.tx(context.formatMessage(RenderingContext.SEARCH_PAR_ALLOWED)+" "); + td.tx(context.formatPhrase(RenderingContext.SEARCH_PAR_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(context.formatMessage(RenderingContext.SEARCH_PAR_MOD)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_MOD)); td = tr.td(); - td.tx(context.formatMessage(RenderingContext.SEARCH_PAR_ALLOWED)+" "); + td.tx(context.formatPhrase(RenderingContext.SEARCH_PAR_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(context.formatMessage(RenderingContext.SEARCH_PAR_CHAIN)); + tr.td().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_CHAIN)); td = tr.td(); - td.tx(context.formatMessage(RenderingContext.SEARCH_PAR_ALLOWED)+" "); + td.tx(context.formatPhrase(RenderingContext.SEARCH_PAR_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(context.formatMessage(RenderingContext.SEARCH_PAR_COMP)); + x.para().b().tx(context.formatPhrase(RenderingContext.SEARCH_PAR_COMP)); 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(), context.formatMessage(RenderingContext.SEARCH_PAR_PAR))) { + if (!sd.getAbstract() && !Utilities.existsInList(sd.getType(), context.formatPhrase(RenderingContext.SEARCH_PAR_PAR))) { 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 2c3f76ff4..54fc7a9e4 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 @@ -218,7 +218,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public void renderDetails(XhtmlNode f) { f = renderStatus(value, f); - f.b().attribute("title", context.formatMessage(RenderingContext.STRUC_DEF_FII)).tx(value.getKey()); + f.b().attribute("title", context.formatPhrase(RenderingContext.STRUC_DEF_FII)).tx(value.getKey()); f.tx(": "); if (value.hasHuman()) { renderStatus(value.getHumanElement(), f).tx(value.getHuman()); @@ -492,7 +492,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(context.formatMessage(RenderingContext.STRUC_DEF_REND_UNABLE_RES, url, contentReference)); + throw new FHIRException(context.formatPhrase(RenderingContext.STRUC_DEF_REND_UNABLE_RES, url, contentReference)); } elements = source.getSnapshot().getElement(); } @@ -505,7 +505,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return new ElementInStructure(source, ed); } } - throw new Error(context.formatMessage(RenderingContext.STRUC_DEF_CANT_FIND, contentReference, elements.toString(), source.getUrl())); + throw new Error(context.formatPhrase(RenderingContext.STRUC_DEF_CANT_FIND, contentReference, elements.toString(), source.getUrl())); // return null; } @@ -574,7 +574,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(context.formatMessage(RenderingContext.STRUC_DEF_ERROR)); + throw new Error(context.formatPhrase(RenderingContext.STRUC_DEF_ERROR)); } List profiles = new ArrayList(); @@ -593,37 +593,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", context.formatMessage(RenderingContext.STRUC_DEF_REQ), context.formatMessage(RenderingContext.STRUC_DEF_CONC_SET))); + columns.add(new Column("required", context.formatPhrase(RenderingContext.STRUC_DEF_REQ), context.formatPhrase(RenderingContext.STRUC_DEF_CONC_SET))); } if (cols.contains("extensible")) { - columns.add(new Column("extensible", context.formatMessage(RenderingContext.STRUC_DEF_EXT), context.formatMessage(RenderingContext.STRUC_DEF_APPROP_CON))); + columns.add(new Column("extensible", context.formatPhrase(RenderingContext.STRUC_DEF_EXT), context.formatPhrase(RenderingContext.STRUC_DEF_APPROP_CON))); } if (cols.contains("maximum")) { - columns.add(new Column("maximum", context.formatMessage(RenderingContext.STRUC_DEF_MAX), context.formatMessage(RenderingContext.STRUC_DEF_REQ_BIND))); + columns.add(new Column("maximum", context.formatPhrase(RenderingContext.STRUC_DEF_MAX), context.formatPhrase(RenderingContext.STRUC_DEF_REQ_BIND))); } if (cols.contains("minimum")) { - columns.add(new Column("minimum", context.formatMessage(RenderingContext.STRUC_DEF_MIN), context.formatMessage(RenderingContext.STRUC_DEF_MIN_ALLOW))); + columns.add(new Column("minimum", context.formatPhrase(RenderingContext.STRUC_DEF_MIN), context.formatPhrase(RenderingContext.STRUC_DEF_MIN_ALLOW))); } if (cols.contains("candidate")) { - columns.add(new Column("candidate", context.formatMessage(RenderingContext.STRUC_DEF_CAND), context.formatMessage(RenderingContext.STRUC_DEF_CAND_SUB))); + columns.add(new Column("candidate", context.formatPhrase(RenderingContext.STRUC_DEF_CAND), context.formatPhrase(RenderingContext.STRUC_DEF_CAND_SUB))); } if (cols.contains("current")) { - columns.add(new Column("current", context.formatMessage(RenderingContext.STRUC_DEF_CURR), context.formatMessage(RenderingContext.STRUC_DEF_CURR_RULE))); + columns.add(new Column("current", context.formatPhrase(RenderingContext.STRUC_DEF_CURR), context.formatPhrase(RenderingContext.STRUC_DEF_CURR_RULE))); } if (cols.contains("preferred")) { - columns.add(new Column("preferred", context.formatMessage(RenderingContext.STRUC_DEF_PREF), context.formatMessage(RenderingContext.STRUC_DEF_PREF_CONT))); + columns.add(new Column("preferred", context.formatPhrase(RenderingContext.STRUC_DEF_PREF), context.formatPhrase(RenderingContext.STRUC_DEF_PREF_CONT))); } if (cols.contains("ui")) { - columns.add(new Column("ui", context.formatMessage(RenderingContext.STRUC_DEF_UI), context.formatMessage(RenderingContext.STRUC_DEF_UI_CONT))); + columns.add(new Column("ui", context.formatPhrase(RenderingContext.STRUC_DEF_UI), context.formatPhrase(RenderingContext.STRUC_DEF_UI_CONT))); } if (cols.contains("starter")) { - columns.add(new Column("starter", context.formatMessage(RenderingContext.STRUC_DEF_START), context.formatMessage(RenderingContext.STRUC_DEF_START_DEF))); + columns.add(new Column("starter", context.formatPhrase(RenderingContext.STRUC_DEF_START), context.formatPhrase(RenderingContext.STRUC_DEF_START_DEF))); } if (cols.contains("component")) { - columns.add(new Column("component", context.formatMessage(RenderingContext.STRUC_DEF_COMP), context.formatMessage(RenderingContext.STRUC_DEF_COMP_DOC))); + columns.add(new Column("component", context.formatPhrase(RenderingContext.STRUC_DEF_COMP), context.formatPhrase(RenderingContext.STRUC_DEF_COMP_DOC))); } if (cols.contains("example")) { - columns.add(new Column("example", context.formatMessage(RenderingContext.STRUC_DEF_EX), context.formatMessage(RenderingContext.STRUC_DEF_EX_DESC))); + columns.add(new Column("example", context.formatPhrase(RenderingContext.STRUC_DEF_EX), context.formatPhrase(RenderingContext.STRUC_DEF_EX_DESC))); } } @@ -632,16 +632,16 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (ed.getBinding().hasValueSet() && ed.getBinding().hasStrength()) { switch (ed.getBinding().getStrength()) { case EXAMPLE: - cols.add(context.formatMessage(RenderingContext.STRUC_DEF_EXAM)); + cols.add(context.formatPhrase(RenderingContext.STRUC_DEF_EXAM)); break; case EXTENSIBLE: - cols.add(context.formatMessage(RenderingContext.STRUC_DEF_EXTENSIBLE)); + cols.add(context.formatPhrase(RenderingContext.STRUC_DEF_EXTENSIBLE)); break; case PREFERRED: - cols.add(context.formatMessage(RenderingContext.STRUC_DEF_PREFERRED)); + cols.add(context.formatPhrase(RenderingContext.STRUC_DEF_PREFERRED)); break; case REQUIRED: - cols.add(context.formatMessage(RenderingContext.STRUC_DEF_REQUIRED)); + cols.add(context.formatPhrase(RenderingContext.STRUC_DEF_REQUIRED)); break; default: break; @@ -666,15 +666,15 @@ public class StructureDefinitionRenderer extends ResourceRenderer { scanObligations(cols, list, list.get(0)); if (cols.contains("$all")) { - columns.add(new Column("$all", context.formatMessage(RenderingContext.STRUC_DEF_ALL_ACTORS), context.formatMessage(RenderingContext.STRUC_DEF_OBLIG_ALL))); + columns.add(new Column("$all", context.formatPhrase(RenderingContext.STRUC_DEF_ALL_ACTORS), context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG_ALL))); } 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), context.formatMessage(RenderingContext.STRUC_DEF_UNDEF_ACT, col, col)+" ")); + columns.add(new Column(col, tail(col), context.formatPhrase(RenderingContext.STRUC_DEF_UNDEF_ACT, col, col)+" ")); } else { - columns.add(new Column(col, actor.getName(), context.formatMessage(RenderingContext.STRUC_DEF_ACT, actor.present(), actor.getWebPath())+" ")); + columns.add(new Column(col, actor.getName(), context.formatPhrase(RenderingContext.STRUC_DEF_ACT, actor.present(), actor.getWebPath())+" ")); } } } @@ -707,7 +707,7 @@ 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(), (context.formatMessage(RenderingContext.STRUC_DEF_NAME)), (context.formatMessage(RenderingContext.STRUC_DEF_LOGIC_NAME)), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.STRUC_DEF_NAME)), (context.formatPhrase(RenderingContext.STRUC_DEF_LOGIC_NAME)), null, 0)); for (Column col : columns) { model.getTitles().add(gen.new Title(null, model.getDocoRef(), (col.title), (col.hint), null, 0)); } @@ -739,52 +739,52 @@ public class StructureDefinitionRenderer extends ResourceRenderer { boolean ext = false; if (tail(element.getPath()).equals("extension") && isExtension(element)) { if (element.hasType() && element.getType().get(0).hasProfile() && extensionIsComplex(element.getType().get(0).getProfile().get(0).getValue())) - row.setIcon("icon_extension_complex.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX)); + row.setIcon("icon_extension_complex.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX)); else - row.setIcon("icon_extension_simple.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + row.setIcon("icon_extension_simple.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); ext = true; } else if (tail(element.getPath()).equals("modifierExtension")) { if (element.hasType() && element.getType().get(0).hasProfile() && extensionIsComplex(element.getType().get(0).getProfile().get(0).getValue())) - row.setIcon("icon_modifier_extension_complex.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX)); + row.setIcon("icon_modifier_extension_complex.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX)); else - row.setIcon("icon_modifier_extension_simple.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + row.setIcon("icon_modifier_extension_simple.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); } else if (!hasDef || element.getType().size() == 0) { if (root && profile != null && context.getWorker().getResourceNames().contains(profile.getType())) { - row.setIcon("icon_resource.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_RESOURCE)); + row.setIcon("icon_resource.png", context.formatPhrase(RenderingContext.TEXT_ICON_RESOURCE)); } else if (hasDef && element.hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY)) { - row.setIcon("icon-object-box.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_OBJECT_BOX)); + row.setIcon("icon-object-box.png", context.formatPhrase(RenderingContext.TEXT_ICON_OBJECT_BOX)); keyRows.add(element.getId()+"."+ToolingExtensions.readStringExtension(element, ToolingExtensions.EXT_JSON_PROP_KEY)); } else { - row.setIcon("icon_element.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_ELEMENT)); + row.setIcon("icon_element.gif", context.formatPhrase(RenderingContext.TEXT_ICON_ELEMENT)); } } else if (hasDef && element.getType().size() > 1) { if (allAreReference(element.getType())) { - row.setIcon("icon_reference.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + row.setIcon("icon_reference.png", context.formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); } else if (element.hasExtension(ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - row.setIcon("icon_choice.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_CHOICE)); + row.setIcon("icon_choice.gif", context.formatPhrase(RenderingContext.TEXT_ICON_CHOICE)); } else { - row.setIcon("icon_choice.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_CHOICE)); + row.setIcon("icon_choice.gif", context.formatPhrase(RenderingContext.TEXT_ICON_CHOICE)); typesRow = row; } } else if (hasDef && element.getType().get(0).getWorkingCode() != null && element.getType().get(0).getWorkingCode().startsWith("@")) { - row.setIcon("icon_reuse.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_REUSE)); + row.setIcon("icon_reuse.png", context.formatPhrase(RenderingContext.TEXT_ICON_REUSE)); } else if (hasDef && context.getContext().isPrimitiveType(element.getType().get(0).getWorkingCode())) { if (keyRows.contains(element.getId())) { - row.setIcon("icon-key.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_KEY)); + row.setIcon("icon-key.png", context.formatPhrase(RenderingContext.TEXT_ICON_KEY)); } else { - row.setIcon("icon_primitive.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_PRIMITIVE)); + row.setIcon("icon_primitive.png", context.formatPhrase(RenderingContext.TEXT_ICON_PRIMITIVE)); } } else if (hasDef && element.getType().get(0).hasTarget()) { - row.setIcon("icon_reference.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + row.setIcon("icon_reference.png", context.formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); } else if (hasDef && context.getContext().isDataType(element.getType().get(0).getWorkingCode())) { - row.setIcon("icon_datatype.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_DATATYPE)); + row.setIcon("icon_datatype.gif", context.formatPhrase(RenderingContext.TEXT_ICON_DATATYPE)); } else if (hasDef && element.hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY)) { - row.setIcon("icon-object-box.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_OBJECT_BOX)); + row.setIcon("icon-object-box.png", context.formatPhrase(RenderingContext.TEXT_ICON_OBJECT_BOX)); keyRows.add(element.getId()+"."+ToolingExtensions.readStringExtension(element, ToolingExtensions.EXT_JSON_PROP_KEY)); } else if (hasDef && Utilities.existsInList(element.getType().get(0).getWorkingCode(), "Base", "Element", "BackboneElement")) { - row.setIcon("icon_element.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_ELEMENT)); + row.setIcon("icon_element.gif", context.formatPhrase(RenderingContext.TEXT_ICON_ELEMENT)); } else { - row.setIcon("icon_resource.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_RESOURCE)); + row.setIcon("icon_resource.png", context.formatPhrase(RenderingContext.TEXT_ICON_RESOURCE)); } if (element.hasUserData("render.opaque")) { row.setOpacity("0.5"); @@ -824,7 +824,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { showMissing = false; //? slicingRow = row; } else { - row.setIcon("icon_slice.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_SLICE)); + row.setIcon("icon_slice.png", context.formatPhrase(RenderingContext.TEXT_ICON_SLICE)); slicingRow = row; for (Cell cell : row.getCells()) for (Piece p : cell.getPieces()) { @@ -832,7 +832,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } } else if (element.hasSliceName()) { - row.setIcon("icon_slice_item.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_SLICE_ITEM)); + row.setIcon("icon_slice_item.png", context.formatPhrase(RenderingContext.TEXT_ICON_SLICE_ITEM)); } if (used.used || showMissing) rows.add(row); @@ -850,8 +850,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setAnchor(element.getPath()); hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); - hrow.setIcon("icon_element.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_ELEMENT)); - hrow.getCells().add(gen.new Cell(null, null, sName+ (context.formatMessage(RenderingContext.STRUC_DEF_ALL_SLICES)), "", null)); + hrow.setIcon("icon_element.gif", context.formatPhrase(RenderingContext.TEXT_ICON_ELEMENT)); + hrow.getCells().add(gen.new Cell(null, null, sName+ (context.formatPhrase(RenderingContext.STRUC_DEF_ALL_SLICES)), "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -863,7 +863,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, context.formatMessage(RenderingContext.STRUC_DEF_CONT_RULE), "", null)); + hrow.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.STRUC_DEF_CONT_RULE), "", null)); break; } row.getSubRows().add(hrow); @@ -876,8 +876,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setAnchor(element.getPath()); hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); - hrow.setIcon("icon_element.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_ELEMENT)); - hrow.getCells().add(gen.new Cell(null, null, sName+ context.formatMessage(RenderingContext.STRUC_DEF_ALL_TYPES), "", null)); + hrow.setIcon("icon_element.gif", context.formatPhrase(RenderingContext.TEXT_ICON_ELEMENT)); + hrow.getCells().add(gen.new Cell(null, null, sName+ context.formatPhrase(RenderingContext.STRUC_DEF_ALL_TYPES), "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -889,7 +889,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, context.formatMessage(RenderingContext.STRUC_DEF_CONT_TYPE), "", null)); + hrow.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.STRUC_DEF_CONT_TYPE), "", null)); } row.getSubRows().add(hrow); row = hrow; @@ -909,7 +909,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { parent.setAnchor(child.getPath()); parent.setColor(context.getProfileUtilities().getRowColor(child, isConstraintMode)); parent.setLineColor(1); - parent.setIcon("icon_slice.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_SLICE)); + parent.setIcon("icon_slice.png", context.formatPhrase(RenderingContext.TEXT_ICON_SLICE)); parent.getCells().add(gen.new Cell(null, null, "Slices for "+ child.getName(), "", null)); switch (context.getStructureMode()) { case BINDINGS: @@ -922,7 +922,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { parent.getCells().add(gen.new Cell()); parent.getCells().add(gen.new Cell()); parent.getCells().add(gen.new Cell()); - parent.getCells().add(gen.new Cell(null, null, context.formatMessage(RenderingContext.STRUC_DEF_CONT_RULE), "", null)); + parent.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.STRUC_DEF_CONT_RULE), "", null)); break; } row.getSubRows().add(parent); @@ -1050,13 +1050,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() ? context.formatMessage(RenderingContext.STRUC_DEF_SLICE_PAR, element.getSliceName()) : ""); + hint = checkAdd(hint, element.hasSliceName() ? context.formatPhrase(RenderingContext.STRUC_DEF_SLICE_PAR, 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 = context.formatMessage(RenderingContext.STRUC_DEF_SLICE_FOR, sName); + sName = context.formatPhrase(RenderingContext.STRUC_DEF_SLICE_FOR, sName); } Cell left = gen.new Cell(null, ref, sName, hint, null); row.getCells().add(left); @@ -1071,32 +1071,32 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(gc); res.add(gc); if (element != null && element.getIsModifier()) { - checkForNoChange(element.getIsModifierElement(), gc.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_MOD)), "?!", null, null, null, false)); + checkForNoChange(element.getIsModifierElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_MOD)), "?!", 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((context.formatMessage(RenderingContext.STRUC_DEF_OBLIG_SUPP)), "SO", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG_SUPP)), "SO", "white", "red", null, false)); } else if (element.getMustSupport()) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_SUPP)), "S", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_SUPP)), "S", "white", "red", null, false)); } else if (element != null && element.hasExtension(ToolingExtensions.EXT_OBLIGATION_CORE, ToolingExtensions.EXT_OBLIGATION_TOOLS)) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_OBLIG)), "O", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG)), "O", "white", "red", null, false)); } } if (element != null && element.getIsSummary()) { - checkForNoChange(element.getIsSummaryElement(), gc.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_SUMM)), "\u03A3", null, null, null, false)); + checkForNoChange(element.getIsSummaryElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_SUMM)), "\u03A3", null, null, null, false)); } if (element != null && element.getMustHaveValue()) { - checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_ELE)), "V", "maroon", null, null, true)); + checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_ELE)), "V", "maroon", null, null, true)); } if (element != null && (hasNonBaseConstraints(element.getConstraint()) || hasNonBaseConditions(element.getCondition()))) { Piece p = gc.addText(CONSTRAINT_CHAR); - p.setHint((context.formatMessage(RenderingContext.STRUC_DEF_ELE_AFFECTED, listConstraintsAndConditions(element), ")"))); + p.setHint((context.formatPhrase(RenderingContext.STRUC_DEF_ELE_AFFECTED, 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(context.formatMessage(RenderingContext.STRUC_DEF_STAND_STATUS) +ss.toDisplay(), ss.getAbbrev(), context.formatMessage(RenderingContext.STRUC_DEF_BLACK), ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); + gc.addStyledText(context.formatPhrase(RenderingContext.STRUC_DEF_STAND_STATUS) +ss.toDisplay(), ss.getAbbrev(), context.formatPhrase(RenderingContext.STRUC_DEF_BLACK), ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); } ExtensionContext extDefn = null; @@ -1113,14 +1113,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((context.formatMessage(RenderingContext.STRUC_DEF_EX_URL, extDefn.getUrl()))); + nameCell.getPieces().get(0).setHint((context.formatPhrase(RenderingContext.STRUC_DEF_EX_URL, extDefn.getUrl()))); res.add(genCardinality(gen, element, row, hasDef, used, extDefn.getElement())); ElementDefinition valueDefn = walksIntoThis ? null : 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, "("+(context.formatMessage(RenderingContext.STRUC_DEF_COMPLEX))+")", null, null))); + res.add(addCell(row, gen.new Cell(null, null, "("+(context.formatPhrase(RenderingContext.STRUC_DEF_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 { @@ -1173,9 +1173,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 = context.formatMessage(RenderingContext.STRUC_DEF_JSON_IS); + hint = context.formatPhrase(RenderingContext.STRUC_DEF_JSON_IS); } else { - hint = context.formatMessage(RenderingContext.STRUC_DEF_JSON_MAY); + hint = context.formatPhrase(RenderingContext.STRUC_DEF_JSON_MAY); } } } @@ -1238,8 +1238,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.setAnchor(parent.getPath()+"-"+grp.getName()); row.setColor(context.getProfileUtilities().getRowColor(parent, isConstraintMode)); row.setLineColor(1); - row.setIcon("icon_choice.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_CHOICE)); - row.getCells().add(gen.new Cell(null, null, context.formatMessage(RenderingContext.STRUC_DEF_CHOICE), "", null)); + row.setIcon("icon_choice.gif", context.formatPhrase(RenderingContext.TEXT_ICON_CHOICE)); + row.getCells().add(gen.new Cell(null, null, context.formatPhrase(RenderingContext.STRUC_DEF_CHOICE), "", 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()); @@ -1306,18 +1306,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, (context.formatMessage(RenderingContext.STRUC_DEF_XML_NAME))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_XML_NAME))+": ", 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, (context.formatMessage(RenderingContext.STRUC_DEF_XML_NAME))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_XML_NAME))+": ", 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, context.formatMessage(RenderingContext.STRUC_DEF_ABSTRACT) +(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_ABSTRACT) +(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); List children = new ArrayList<>(); for (StructureDefinition sd : context.getWorker().fetchResourcesByType(StructureDefinition.class)) { @@ -1326,7 +1326,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } if (!children.isEmpty()) { - c.addPiece(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_CHILD) +(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profiles" : "types")+": ", null)); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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)); @@ -1339,7 +1339,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, context.formatMessage(RenderingContext.STRUC_DEF_ELEMENTS), null)); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_ELEMENTS), null)); boolean first = true; for (SourcedElementDefinition ed : ancestors) { if (first) @@ -1388,14 +1388,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (fixedUrl == null) { if (!Utilities.noString(fullUrl)) { - c.getPieces().add(gen.new Piece(null, (context.formatMessage(RenderingContext.STRUC_DEF_URL))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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, (context.formatMessage(RenderingContext.STRUC_DEF_URL))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_URL))+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref2, fixedUrl, null)); - c.getPieces().add(gen.new Piece(null, (" "+context.formatMessage(RenderingContext.STRUC_DEF_PROFILED)+" ")+" ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (" "+context.formatPhrase(RenderingContext.STRUC_DEF_PROFILED)+" ")+" ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } @@ -1403,26 +1403,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, (context.formatMessage(RenderingContext.STRUC_DEF_SLICE))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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, (context.formatMessage(RenderingContext.STRUC_DEF_BINDING))+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, (context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SET)+" "), null)); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_BINDING))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SET)+" "), null)); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_BINDING_STYLE), null)); - c.getPieces().add(gen.new Piece(null, " "+context.formatMessage(RenderingContext.STRUC_DEF_BINDING_STYLE), null)); + c.getPieces().add(gen.new Piece(null, " "+context.formatPhrase(RenderingContext.STRUC_DEF_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, (context.formatMessage(RenderingContext.STRUC_DEF_ELE_READ)+" "), null)); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_ELE_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, " "+ (context.formatMessage(RenderingContext.STRUC_DEF_PREFIXED)), null)); + c.getPieces().add(gen.new Piece(null, " "+ (context.formatPhrase(RenderingContext.STRUC_DEF_PREFIXED)), null)); } if (definition.hasExtension(ToolingExtensions.EXT_EXTENSION_STYLE)) { @@ -1430,9 +1430,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), context.formatMessage(RenderingContext.STRUC_DEF_EXT_JSON), null)); + c.getPieces().add(gen.new Piece(rc.getLink(KnownLinkType.JSON_NAMES), context.formatPhrase(RenderingContext.STRUC_DEF_EXT_JSON), null)); } else { - c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, context.formatMessage(RenderingContext.STRUC_DEF_EXT_JSON), null)); + c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, context.formatPhrase(RenderingContext.STRUC_DEF_EXT_JSON), null)); } } } @@ -1440,61 +1440,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, (context.formatMessage(RenderingContext.STRUC_DEF_DATE, df)+" "), null)); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_DATE, 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, context.formatMessage(RenderingContext.STRUC_DEF_ID_IS), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_ID_IS), null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_ID_MAY), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_ID_MAY), null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_ID_NOT_ALLOW), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_ID_NOT_ALLOW), 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, (context.formatMessage(RenderingContext.STRUC_DEF_CHOICE_GRP))+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_REPEAT), null)); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_CHOICE_GRP))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REPEAT), 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, (context.formatMessage(RenderingContext.STRUC_DEF_XML))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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, (context.formatMessage(RenderingContext.STRUC_DEF_XML_ELE))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_XML_ELE))+": ", 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, (context.formatMessage(RenderingContext.STRUC_DEF_XML_NAME))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_XML_NAME))+": ", 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, context.formatMessage(RenderingContext.STRUC_DEF_JSON_INFERRED), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_INFERRED), null)); } else { - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_JSON_ARRAY), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_ARRAY), 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, (context.formatMessage(RenderingContext.STRUC_DEF_JSON_NAME))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_JSON_NAME))+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, jn, null)); } else { - c.getPieces().add(gen.new Piece(null, (context.formatMessage(RenderingContext.STRUC_DEF_JSON_TYPE))+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_JSON_TYPE))+": ", null).addStyle("font-weight:bold")); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(jn)); c.getPieces().add(piece); @@ -1503,27 +1503,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, context.formatMessage(RenderingContext.STRUC_DEF_JSON_INFERRED), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_INFERRED), 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, context.formatMessage(RenderingContext.STRUC_DEF_JSON_NULL), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_NULL), 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, context.formatMessage(RenderingContext.STRUC_DEF_SINGLE_JSON_OBJECTS, code), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_SINGLE_JSON_OBJECTS, code), 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, context.formatMessage(RenderingContext.STRUC_DEF_JSON_IF), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_THEN_TYPE), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_THEN_TYPE), null)); StructureDefinition sd = context.getWorker().fetchTypeDefinition(type); if (sd == null) { c.getPieces().add(gen.new Piece("")); @@ -1537,7 +1537,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, context.formatMessage(RenderingContext.STRUC_DEF_OBLIG_ADD), null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG_ADD), 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); @@ -1547,31 +1547,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, context.formatMessage(RenderingContext.STRUC_DEF_NOT_MARK), null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_NOT_MARK), 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, context.formatMessage(RenderingContext.STRUC_DEF_REF), null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REF), 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, context.formatMessage(RenderingContext.STRUC_DEF_REF), null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REF), null).addStyle("font-weight:bold")); } else { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_REF), null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REF), 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,context.formatMessage(RenderingContext.STRUC_DEF_TEMPLATEID), null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null,context.formatPhrase(RenderingContext.STRUC_DEF_TEMPLATEID), null).addStyle("font-weight:bold")); } else { - c.addPiece(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_VALID_UNKNOWN, ps)+" ", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_VALID_UNKNOWN, 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, (context.formatMessage(RenderingContext.STRUC_DEF_LOGIC))+": ", context.formatMessage(RenderingContext.STRUC_DEF_ROOT)).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_LOGIC))+": ", context.formatPhrase(RenderingContext.STRUC_DEF_ROOT)).addStyle("font-weight:bold")); String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); @@ -1593,7 +1593,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, (context.formatMessage(RenderingContext.STRUC_DEF_BINDING))+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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))); @@ -1631,14 +1631,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, context.formatMessage(RenderingContext.STRUC_DEF_REPEAT_ELE, definition.getOrderMeaning()), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REPEAT_ELE, 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, (context.formatMessage(RenderingContext.STRUC_DEF_FIXED))+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_FIXED))+": ", null).addStyle("font-weight:bold"))); if (!useTableForFixedValues || !allowSubRows || definition.getFixed().isPrimitive()) { String s = buildJson(definition.getFixed()); String link = null; @@ -1646,7 +1646,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, context.formatMessage(RenderingContext.STRUC_DEF_AS_SHOWN), null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_AS_SHOWN), null).addStyle("color: darkgreen"))); genFixedValue(gen, row, definition.getFixed(), snapshot, false, corePath, false); } if (isCoded(definition.getFixed()) && !hasDescription(definition.getFixed())) { @@ -1656,17 +1656,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, (context.formatMessage(RenderingContext.STRUC_DEF_REQ_PATT))+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_REQ_PATT))+": ", 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, context.formatMessage(RenderingContext.STRUC_DEF_LEAST_FOLLOW), null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_LEAST_FOLLOW), 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, (context.formatMessage(RenderingContext.STRUC_DEF_EXAMPLE))+("".equals("General")? "" : " "+ex.getLabel())+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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"))); } } @@ -1811,13 +1811,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, context.formatMessage(RenderingContext.STRUC_DEF_UNKNOWN_REF, e.getContentReference())+" ", null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_UNKNOWN_REF, e.getContentReference())+" ", null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_SEE)+" ", null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_SEE)+" ", null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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())); } } @@ -1886,7 +1886,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); boolean tfirst = true; @@ -1899,7 +1899,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((context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); } } } @@ -1946,7 +1946,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupport(p) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_PROF_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_PROF_SUPP)), "S", "white", "red", null, false); } } } @@ -1966,7 +1966,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); } } } @@ -2118,7 +2118,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { used.used = element.hasType() && element.getType().get(0).hasProfile(); showMissing = false; } else { - row.setIcon("icon_slice.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_SLICE); + row.setIcon("icon_slice.png", context.formatPhrase(RenderingContext.TEXT_ICON_SLICE); row.getCells().get(2).getPieces().clear(); for (Cell cell : row.getCells()) for (Piece p : cell.getPieces()) { @@ -2190,7 +2190,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private BindingResolution makeNullBr(ElementDefinitionBindingComponent binding) { BindingResolution br = new BindingResolution(); br.url = "http://none.none/none"; - br.display = context.formatMessage(RenderingContext.STRUC_DEF_TODO); + br.display = context.formatPhrase(RenderingContext.STRUC_DEF_TODO); return br; } @@ -2256,15 +2256,15 @@ 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", context.formatMessage(RenderingContext.STRUC_DEF_FIXED_VALUE) /*context.formatMessage(RenderingI18nContext.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", context.formatPhrase(RenderingContext.STRUC_DEF_FIXED_VALUE) /*context.formatPhrase(RenderingContext.TEXT_ICON_FIXED*/); } else if (context.getContext().isPrimitiveType(t.getTypeCode())) { - row.setIcon("icon_primitive.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_PRIMITIVE)); + row.setIcon("icon_primitive.png", context.formatPhrase(RenderingContext.TEXT_ICON_PRIMITIVE)); c.addPiece(gen.new Piece(null, "0.."+(t.getMaxCardinality() == 2147483647 ? "*": Integer.toString(t.getMaxCardinality())), null)); } else if (isReference(t.getTypeCode())) { - row.setIcon("icon_reference.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + row.setIcon("icon_reference.png", context.formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); c.addPiece(gen.new Piece(null, "0.."+(t.getMaxCardinality() == 2147483647 ? "*": Integer.toString(t.getMaxCardinality())), null)); } else { - row.setIcon("icon_datatype.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_DATATYPE)); + row.setIcon("icon_datatype.gif", context.formatPhrase(RenderingContext.TEXT_ICON_DATATYPE)); c.addPiece(gen.new Piece(null, "0.."+(t.getMaxCardinality() == 2147483647 ? "*": Integer.toString(t.getMaxCardinality())), null)); } c = gen.new Cell(); @@ -2291,7 +2291,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { Row row = gen.new Row(); row.setId(ed.getPath()); erow.getSubRows().add(row); - row.setIcon("icon_fixed.gif", context.formatMessage(RenderingContext.STRUC_DEF_FIXED) /*context.formatMessage(RenderingI18nContext.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", context.formatPhrase(RenderingContext.STRUC_DEF_FIXED) /*context.formatPhrase(RenderingContext.TEXT_ICON_FIXED*/); Cell c = gen.new Cell(); row.getCells().add(c); @@ -2329,7 +2329,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, context.formatMessage(RenderingContext.STRUC_DEF_FIXED_VALUE)+" ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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; @@ -2342,8 +2342,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, context.formatMessage(RenderingContext.STRUC_DEF_FIXED_VALUE)+" ", null).addStyle("font-weight: bold")); - c.getPieces().add(gen.new Piece(null, context.formatMessage(RenderingContext.STRUC_DEF_COMPLEXBRACK), null).addStyle("color: darkgreen")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_FIXED_VALUE)+" ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_COMPLEXBRACK), null).addStyle("color: darkgreen")); genFixedValue(gen, row, (DataType) b, snapshot, pattern, corePath, skipnoValue); } } @@ -2431,12 +2431,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, context.formatMessage(RenderingContext.STRUC_DEF_UNKNOWN_REF, definition.getContentReference()), null)); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_UNKNOWN_REF, definition.getContentReference()), null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), context.formatMessage(RenderingContext.STRUC_DEF_SEE, ed.getElement().getPath()), null)); + c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), context.formatPhrase(RenderingContext.STRUC_DEF_SEE, ed.getElement().getPath()), null)); } else { - c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), context.formatMessage(RenderingContext.STRUC_DEF_SEE, ed.getSource().getTypeName()) +"."+ed.getElement().getPath(), null)); + c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), context.formatPhrase(RenderingContext.STRUC_DEF_SEE, ed.getSource().getTypeName()) +"."+ed.getElement().getPath(), null)); } } } @@ -2455,13 +2455,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, context.formatMessage(RenderingContext.STRUC_DEF_URLS), null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_URLS), 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, context.formatMessage(RenderingContext.STRUC_DEF_SLICES), null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_SLICES), null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); } if (definition != null) { @@ -2474,7 +2474,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, context.formatMessage(RenderingContext.STRUC_DEF_BINDINGS), null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_BINDINGS), 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))); @@ -2497,7 +2497,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, context.formatMessage(RenderingContext.STRUC_DEF_FIXED_VALUE), null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_FIXED_VALUE), null).addStyle("font-weight:bold"))); String s = buildJson(definition.getFixed()); String link = null; if (Utilities.isAbsoluteUrl(s)) @@ -2505,18 +2505,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, context.formatMessage(RenderingContext.STRUC_DEF_REQUIRED_PATT), null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_REQUIRED_PATT), 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, context.formatMessage(RenderingContext.STRUC_DEF_EXAMPLE) +"'"+("".equals("General")? "": " "+ex.getLabel()+"'")+": ", "").addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_MAX_LENGTH), null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_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) { @@ -2537,14 +2537,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, context.formatMessage(RenderingContext.STRUC_DEF_DEF), null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_DEF), 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, context.formatMessage(RenderingContext.STRUC_DEF_COMMENT), null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, context.formatPhrase(RenderingContext.STRUC_DEF_COMMENT), 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))); @@ -2695,7 +2695,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(gen.new Cell(null, null, tail(element.getPath()).replace("[x]", Utilities.capitalize(t)), null, null)); choicerow.getCells().add(gen.new Cell()); choicerow.getCells().add(gen.new Cell(null, null, "", null, null)); - choicerow.setIcon("icon_reference.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_REFERENCE)); + choicerow.setIcon("icon_reference.png", context.formatPhrase(RenderingContext.TEXT_ICON_REFERENCE)); Cell c = gen.new Cell(); choicerow.getCells().add(c); if (ADD_REFERENCE_TO_TABLE) { @@ -2705,7 +2705,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((context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); } @@ -2717,7 +2717,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((context.formatMessage(RenderingContext.STRUC_DEF_TARG_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TARG_SUPP)), "S", "white", "red", null, false); } first = false; } @@ -2740,24 +2740,24 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(gen.new Cell(null, null, tail(element.getPath()).replace("[x]", Utilities.capitalize(t)), sd.getDescription(), null)); choicerow.getCells().add(gen.new Cell()); choicerow.getCells().add(gen.new Cell(null, null, "", null, null)); - choicerow.setIcon("icon_primitive.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_PRIMITIVE)); + choicerow.setIcon("icon_primitive.png", context.formatPhrase(RenderingContext.TEXT_ICON_PRIMITIVE)); Cell c = gen.new Cell(null, corePath+"datatypes.html#"+t, sd.getTypeName(), null, null); choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_TARG_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TARG_SUPP)), "S", "white", "red", null, false); } } else { used = true; choicerow.getCells().add(gen.new Cell(null, null, tail(element.getPath()).replace("[x]", Utilities.capitalize(t)), sd.getDescription(), null)); choicerow.getCells().add(gen.new Cell()); choicerow.getCells().add(gen.new Cell(null, null, "", null, null)); - choicerow.setIcon("icon_datatype.gif", context.formatMessage(RenderingI18nContext.TEXT_ICON_DATATYPE)); + choicerow.setIcon("icon_datatype.gif", context.formatPhrase(RenderingContext.TEXT_ICON_DATATYPE)); Cell c = gen.new Cell(null, context.getPkp().getLinkFor(corePath, t), sd.getTypeName(), null, null); choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText((context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); + c.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SUPP)), "S", "white", "red", null, false); } } if (tr.hasProfile() && used) { @@ -2774,7 +2774,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((context.formatMessage(RenderingContext.STRUC_DEF_PROF_SUPP)), "S", "white", "red", null, false); + typeCell.addStyledText((context.formatPhrase(RenderingContext.STRUC_DEF_PROF_SUPP)), "S", "white", "red", null, false); } } } @@ -2823,7 +2823,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } private String describeSlice(ElementDefinitionSlicingComponent slicing) { - return formatMessage(RenderingContext.SD_SLICING_INFO, slicing.getOrdered() ? (context.formatMessage(RenderingContext.STRUC_DEF_ORDERED)) : (context.formatMessage(RenderingContext.STRUC_DEF_UNORDERED)), describe(slicing.getRules()), commas(slicing.getDiscriminator())); + return formatPhrase(RenderingContext.SD_SLICING_INFO, slicing.getOrdered() ? (context.formatPhrase(RenderingContext.STRUC_DEF_ORDERED)) : (context.formatPhrase(RenderingContext.STRUC_DEF_UNORDERED)), describe(slicing.getRules()), commas(slicing.getDiscriminator())); } @@ -2838,11 +2838,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String describe(SlicingRules rules) { if (rules == null) - return (context.formatMessage(RenderingContext.STRUC_DEF_UNSPECIFIED)); + return (context.formatPhrase(RenderingContext.STRUC_DEF_UNSPECIFIED)); switch (rules) { - case CLOSED : return (context.formatMessage(RenderingContext.STRUC_DEF_CLOSED)); - case OPEN : return (context.formatMessage(RenderingContext.STRUC_DEF_OPEN)); - case OPENATEND : return (context.formatMessage(RenderingContext.STRUC_DEF_OPEN_END)); + case CLOSED : return (context.formatPhrase(RenderingContext.STRUC_DEF_CLOSED)); + case OPEN : return (context.formatPhrase(RenderingContext.STRUC_DEF_OPEN)); + case OPENATEND : return (context.formatPhrase(RenderingContext.STRUC_DEF_OPEN_END)); default: return "?gen-sr?"; } @@ -2931,7 +2931,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (open) b.append("]"); } else - res.setDescription(context.formatMessage(RenderingContext.STRUC_DEF_FHIR, profile.getName())+" "); + res.setDescription(context.formatPhrase(RenderingContext.STRUC_DEF_FHIR, profile.getName())+" "); res.setType(b.toString()); return res ; } @@ -2952,7 +2952,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String system = displaySystem(uri); if (Utilities.isURL(system)) { if (system.equals("http://cap.org/protocols")) - system = context.formatMessage(RenderingContext.STRUC_DEF_CAP); + system = context.formatPhrase(RenderingContext.STRUC_DEF_CAP); } return system+" "+value.getCode(); } @@ -2980,10 +2980,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(), context.formatMessage(RenderingContext.STRUC_DEF_PROPERTY), context.formatMessage(RenderingContext.STRUC_DEF_PROF_RES), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.STRUC_DEF_CARD), context.formatMessage(RenderingContext.STRUC_DEF_MAX_MIN), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.STRUC_DEF_CONTENT), context.formatMessage(RenderingContext.STRUC_DEF_WHAT), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.STRUC_DEF_DESC), context.formatMessage(RenderingContext.STRUC_DEF_DESC_PROF), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_PROPERTY), context.formatPhrase(RenderingContext.STRUC_DEF_PROF_RES), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_CARD), context.formatPhrase(RenderingContext.STRUC_DEF_MAX_MIN), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_CONTENT), context.formatPhrase(RenderingContext.STRUC_DEF_WHAT), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_DESC), context.formatPhrase(RenderingContext.STRUC_DEF_DESC_PROF), null, 0)); return model; } @@ -2994,9 +2994,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.setAnchor(span.getId()); //row.setColor(..?); if (span.isProfile()) { - row.setIcon("icon_profile.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_PROFILE)); + row.setIcon("icon_profile.png", context.formatPhrase(RenderingContext.TEXT_ICON_PROFILE)); } else { - row.setIcon("icon_resource.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_RESOURCE)); + row.setIcon("icon_resource.png", context.formatPhrase(RenderingContext.TEXT_ICON_RESOURCE)); } row.getCells().add(gen.new Cell(null, null, span.getName(), null, null)); @@ -3101,9 +3101,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(context.formatMessage(RenderingContext.STRUC_DEF_IF)+" "); + x.tx(context.formatPhrase(RenderingContext.STRUC_DEF_IF)+" "); x.code().tx(cond); - x.tx(" "+(context.formatMessage(RenderingContext.STRUC_DEF_THEN_TYPE)+" ")); + x.tx(" "+(context.formatPhrase(RenderingContext.STRUC_DEF_THEN_TYPE)+" ")); StructureDefinition sd = context.getContext().fetchTypeDefinition(type); if (sd == null) { x.code().tx(type); @@ -3146,7 +3146,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (full || vdeep) { r.getCells().add(gen.new Cell("", "", "Extension", null, null)); - r.setIcon(deep ? "icon_"+m+"extension_complex.png" : "icon_extension_simple.png", deep ? context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX) : context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + r.setIcon(deep ? "icon_"+m+"extension_complex.png" : "icon_extension_simple.png", deep ? context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX) : context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); List children = getChildren(ed.getSnapshot().getElement(), ed.getSnapshot().getElement().get(0)); for (ElementDefinition child : children) if (!child.getPath().endsWith(".id")) { @@ -3162,7 +3162,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } r.getCells().add(gen.new Cell("", "", "Extension", null, null)); - r.setIcon("icon_"+m+"extension_complex.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_COMPLEX)); + r.setIcon("icon_"+m+"extension_complex.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_COMPLEX)); for (ElementDefinition c : children) { ved = getValueFor(ed, c); @@ -3175,7 +3175,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { r1.getCells().add(gen.new Cell()); r1.getCells().add(gen.new Cell(null, null, describeCardinality(c, null, new UnusedTracker()), null, null)); genTypes(gen, r1, ved, defFile, ed, corePath, imagePath, false, false); - r1.setIcon("icon_"+m+"extension_simple.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + r1.setIcon("icon_"+m+"extension_simple.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); generateDescription(gen, r1, c, null, true, corePath, corePath, ed, corePath, imagePath, false, false, false, ved, false, false, false, rc); } } @@ -3187,7 +3187,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { genTypes(gen, r, ved, defFile, ed, corePath, imagePath, false, false); - r.setIcon("icon_"+m+"extension_simple.png", context.formatMessage(RenderingI18nContext.TEXT_ICON_EXTENSION_SIMPLE)); + r.setIcon("icon_"+m+"extension_simple.png", context.formatPhrase(RenderingContext.TEXT_ICON_EXTENSION_SIMPLE)); } Cell c = gen.new Cell("", "", "URL = "+ed.getUrl(), null, null); Piece cc = gen.new Piece(null, ed.getName()+": ", null); @@ -3197,7 +3197,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, (context.formatMessage(RenderingContext.STRUC_DEF_BINDING))+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, (context.formatPhrase(RenderingContext.STRUC_DEF_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))); @@ -3347,7 +3347,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(context.formatMessage(RenderingContext.STRUC_DEF_FHIR_EXCEP, url)+" "); + throw new FHIRException(context.formatPhrase(RenderingContext.STRUC_DEF_FHIR_EXCEP, url)+" "); } } sdCache = new HashMap(); @@ -3655,61 +3655,61 @@ 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, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_DEFINITION), null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_COMMENTS), null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_NOTE_C), null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_CONTROL), "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_BINDING), "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_DEFINITION), null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_COMMENTS), null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_NOTE_C), null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_CONTROL), "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_BINDING), "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); if (d.hasContentReference()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_TYPE), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_SEE) + d.getContentReference().substring(1)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_TYPE), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_SEE) + d.getContentReference().substring(1)); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_TYPE), "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_TYPE), "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); } if (d.hasExtension(ToolingExtensions.EXT_DEF_TYPE)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_DEFAULT_TYPE), "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_DEFAULT_TYPE), "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); } if (d.hasExtension(ToolingExtensions.EXT_TYPE_SPEC)) { - tableRow(tbl, Utilities.pluralize(context.formatMessage(RenderingContext.STRUC_DEF_TYPE_SPEC), d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); + tableRow(tbl, Utilities.pluralize(context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_SPEC), d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); } if (d.getPath().endsWith("[x]") && !d.prohibited()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_NOTE_X), null, strikethrough).ahWithText(context.formatMessage(RenderingContext.STRUC_DEF_SEE) - , spec("formats.html#choice"), null, context.formatMessage(RenderingContext.STRUC_DEF_CHOICE_DATA_TYPE), context.formatMessage(RenderingContext.STRUC_DEF_FURTHER_INFO)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_NOTE_X), null, strikethrough).ahWithText(context.formatPhrase(RenderingContext.STRUC_DEF_SEE) + , spec("formats.html#choice"), null, context.formatPhrase(RenderingContext.STRUC_DEF_CHOICE_DATA_TYPE), context.formatPhrase(RenderingContext.STRUC_DEF_FURTHER_INFO)); } - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_MODIFIER), "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_MODIFIER), "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); if (d.getMustHaveValue()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_PRIM_TYPE_VALUE)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_PRIM_TYPE_VALUE)); } else if (d.hasValueAlternatives()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, renderCanonicalList(context.formatMessage(RenderingContext.STRUC_DEF_PRIM_TYPE_PRESENT), d.getValueAlternatives())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, renderCanonicalList(context.formatPhrase(RenderingContext.STRUC_DEF_PRIM_TYPE_PRESENT), d.getValueAlternatives())); } else if (hasPrimitiveTypes(d)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_PRIM_ELE)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_PRIMITIVE), "elementdefinition.html#primitives", strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_PRIM_ELE)); } if (ToolingExtensions.hasAllowedUnits(d)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_ALLOWED), "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_ALLOWED), "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); } - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_MUST_SUPPORT), "conformance-rules.html#mustSupport", strikethrough, displayBoolean(d.getMustSupport(), d.getMustSupportElement(), "mustSupport", d, compare==null ? null : compare.getMustSupportElement(), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_MUST_SUPPORT_TYPES), "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_MUST_SUPPORT_TYPES), "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); } else if (hasChoices(d.getType())) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_MUST_SUPPORT_TYPES), "datatypes.html", strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_NO_MUST_SUPPORT)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_MUST_SUPPORT_TYPES), "datatypes.html", strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_NO_MUST_SUPPORT)); } } if (root && sd.getKind() == StructureDefinitionKind.LOGICAL) { Extension lt = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_TARGET); if (lt == null || !lt.hasValue()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_NOT_MARKED)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_NOT_MARKED)); } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) { } else if (lt.getValueBooleanType().hasValue()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_NOT_MARKED)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_NOT_MARKED)); } else if (lt.getValueBooleanType().booleanValue()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_CAN_TARGET)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_CAN_TARGET)); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_CANNOT_TARGET)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_CANNOT_TARGET)); } Extension lc = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_CONTAINER); @@ -3717,79 +3717,79 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); if (lct != null) { - tableRowLink(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL_CONT), null, strikethrough, lct.present(), lct.getWebPath()); + tableRowLink(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL_CONT), null, strikethrough, lct.present(), lct.getWebPath()); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOGICAL_CONT), null, strikethrough, uri); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOGICAL_CONT), null, strikethrough, uri); } } String ps = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_PROFILE_STYLE); if (ps != null) { if ("cda".equals(ps)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_VALID), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_TEMPLATEID)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_VALID), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_TEMPLATEID)); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_VALID), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_UNKNOWN_APPROACH, ps)+" "); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_VALID), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_UNKNOWN_APPROACH, ps)+" "); } } } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_IMPOSE_PROFILE), "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, - renderCanonicalListExt(context.formatMessage(RenderingContext.STRUC_DEF_PROF_REQ)+" ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_IMPOSE_PROFILE), "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, + renderCanonicalListExt(context.formatPhrase(RenderingContext.STRUC_DEF_PROF_REQ)+" ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_COMP_PROF), "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, - renderCanonicalListExt(context.formatMessage(RenderingContext.STRUC_DEF_PROF_COMP)+" ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_COMP_PROF), "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, + renderCanonicalListExt(context.formatPhrase(RenderingContext.STRUC_DEF_PROF_COMP)+" ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); } - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_OBLIGATIONS), null, strikethrough, describeObligations(d, root, sd)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_EXT_STYLE), context.getLink(KnownLinkType.JSON_NAMES), strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_JSON_ELE)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_EXT_STYLE), context.getLink(KnownLinkType.JSON_NAMES), strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_ELE)); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_EXT_STYLE), ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_JSON_ELE)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_EXT_STYLE), ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_ELE)); } } } if (!d.getPath().contains(".") && ToolingExtensions.hasExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_BINDING_STYLE), ToolingExtensions.WEB_BINDING_STYLE, strikethrough, - context.formatMessage(RenderingContext.STRUC_DEF_TYPE_BOUND, ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style")+" "); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_BINDING_STYLE), ToolingExtensions.WEB_BINDING_STYLE, strikethrough, + context.formatPhrase(RenderingContext.STRUC_DEF_TYPE_BOUND, ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style")+" "); } if (d.hasExtension(ToolingExtensions.EXT_DATE_FORMAT)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_DATE_FORM), null, strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DATE_FORMAT)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_DATE_FORM), 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, context.formatMessage(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_ID_IS)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_ID_IS)); } else if (ide.equals("required")) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_ID_REQ)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_ID_REQ)); } else if (ide.equals("required")) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_ID_NOT_ALLOW)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_ID_EXPECT), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_ID_NOT_ALLOW)); } } if (d.hasExtension(ToolingExtensions.EXT_ID_CHOICE_GROUP)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_CHOICE_GRP), null, strikethrough, context.formatMessage(RenderingContext.STRUC_DEF_REPEAT)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_CHOICE_GRP), null, strikethrough, context.formatPhrase(RenderingContext.STRUC_DEF_REPEAT)); } // 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, context.formatMessage(RenderingContext.STRUC_DEF_JSON_FORM), null, strikethrough, describeJson(d)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_JSON_FORM), 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, context.formatMessage(RenderingContext.STRUC_DEF_XML_FORM), null, strikethrough, describeXml(sd, d, root)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_XML_FORM), null, strikethrough, describeXml(sd, d, root)); } if (d.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_STRING_FORM), null, strikethrough).codeWithText(context.formatMessage(RenderingContext.STRUC_DEF_ELE_READ)+" ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), context.formatMessage(RenderingContext.STRUC_DEF_PREFIX_VALID)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_STRING_FORM), null, strikethrough).codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_ELE_READ)+" ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), context.formatPhrase(RenderingContext.STRUC_DEF_PREFIX_VALID)); } if (d.hasExtension(ToolingExtensions.EXT_STANDARDS_STATUS)) { @@ -3799,34 +3799,34 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (sdb != null) { StandardsStatus base = determineStandardsStatus(sdb, (ElementDefinition) d.getUserData("derived.pointer")); if (base != null) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()); } } else { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_STAND_STAT), "versions.html#std-process", strikethrough, ss.toDisplay()); } } if (mode != GEN_MODE_DIFF && d.hasIsSummary()) { - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_SUMMARY), "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_SUMMARY), "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); } - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_REQUIREMENTS), null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LABEL), null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_ALT_NAME), null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_DEF_CODES), null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_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, context.formatMessage(RenderingContext.STRUC_DEF_VALUE_REQ), 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, context.formatMessage(RenderingContext.STRUC_DEF_VALUE_ALT), null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_DEFAULT_VALUE), null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_MEAN_MISS), null, strikethrough, d.getMeaningWhenMissing()); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_FIXED), null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_PATT_VALUE), null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_EX), null, strikethrough, encodeValues(d.getExample())); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_INVAR), null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_LOINC), null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); - tableRow(tbl, context.formatMessage(RenderingContext.STRUC_DEF_SNOMED), null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_REQUIREMENTS), null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LABEL), null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_ALT_NAME), null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_DEF_CODES), null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_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, context.formatPhrase(RenderingContext.STRUC_DEF_VALUE_REQ), 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, context.formatPhrase(RenderingContext.STRUC_DEF_VALUE_ALT), null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_DEFAULT_VALUE), null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_MEAN_MISS), null, strikethrough, d.getMeaningWhenMissing()); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_FIXED), null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_PATT_VALUE), null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_EX), null, strikethrough, encodeValues(d.getExample())); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_INVAR), null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_LOINC), null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); + tableRow(tbl, context.formatPhrase(RenderingContext.STRUC_DEF_SNOMED), null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); tbl.tx("\r\n"); } @@ -3835,7 +3835,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(" "+(context.formatMessage(RenderingContext.STRUC_DEF_BECAUSE)+" ")); + x1.tx(" "+(context.formatPhrase(RenderingContext.STRUC_DEF_BECAUSE)+" ")); x1.copyAllContent(x2); } } @@ -3852,19 +3852,19 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (d.hasRepresentation(pr)) { switch (pr) { case CDATEXT: - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_CDA)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_CDA)); break; case TYPEATTR: - ret.codeWithText((context.formatMessage(RenderingContext.STRUC_DEF_XSI)+" "), "xsi:type", "attribute."); + ret.codeWithText((context.formatPhrase(RenderingContext.STRUC_DEF_XSI)+" "), "xsi:type", "attribute."); break; case XHTML: - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_XHTML)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_XHTML)); break; case XMLATTR: - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_XML_ATTRIBUTE)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_XML_ATTRIBUTE)); break; case XMLTEXT: - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_UNADORNED)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_UNADORNED)); break; default: } @@ -3875,11 +3875,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); } if (name != null) { - ret.codeWithText(context.formatMessage(RenderingContext.STRUC_DEF_NAMESPACE)+" ", name, "."); + ret.codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_NAMESPACE)+" ", name, "."); } name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED); if (name != null) { - ret.codeWithText(context.formatMessage(RenderingContext.STRUC_DEF_XML_ACTUAL), name, "."); + ret.codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_XML_ACTUAL), name, "."); } return ret; } @@ -3893,33 +3893,33 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (code != null) { switch (code) { case "present": - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_JSON_PRESENT)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_PRESENT)); break; case "absent": - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_JSON_NOT_PRESENT)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_NOT_PRESENT)); break; case "either": - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_JSON_MAY_PRESENT)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_MAY_PRESENT)); 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(context.formatMessage(RenderingContext.STRUC_DEF_JSON_PROPERTY_NAME), jn, null); + ul.li().codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_PROPERTY_NAME), jn, null); } else { - ul.li().codeWithText(context.formatMessage(RenderingContext.STRUC_DEF_JSON_CAN_NAME), jn, " " + context.formatMessage(RenderingContext.STRUC_DEF_JSON_EXT)); + ul.li().codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_CAN_NAME), jn, " " + context.formatPhrase(RenderingContext.STRUC_DEF_JSON_EXT)); } } code = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_PROP_KEY); if (code != null) { - ul.li().codeWithText(context.formatMessage(RenderingContext.STRUC_DEF_JSON_SINGLE), code, " "+ context.formatMessage(RenderingContext.STRUC_DEF_JSON_CHILD)); + ul.li().codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_JSON_SINGLE), code, " "+ context.formatPhrase(RenderingContext.STRUC_DEF_JSON_CHILD)); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_NULLABLE)) { - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_NULL_JSON)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_NULL_JSON)); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_INFERRED_JSON)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_INFERRED_JSON)); } switch (ul.getChildNodes().size()) { @@ -3938,12 +3938,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode ul = ret.ul(); if (root) { if (sdx.hasExtension(ToolingExtensions.EXT_OBLIGATION_PROFILE_FLAG)) { - ul.li().tx(context.formatMessage(RenderingContext.STRUC_DEF_OBLIG_ADD)); + ul.li().tx(context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG_ADD)); } for (Extension ext : sdx.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS)) { String iu = ext.getValue().primitiveValue(); XhtmlNode bb = ul.li(); - bb.tx(context.formatMessage(RenderingContext.STRUC_DEF_OBLIG_FROM)+" "); + bb.tx(context.formatPhrase(RenderingContext.STRUC_DEF_OBLIG_FROM)+" "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, iu); if (sd == null) { bb.code().tx(iu); @@ -3976,13 +3976,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(context.formatMessage(RenderingContext.STRUC_DEF_VALUE)+" "); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_VALUE)+" "); genCT(ret, url, vs); return ret; } else if (au instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) au; if (cc.getCoding().size() != 1) { - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_ONE_OF)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_ONE_OF)); } ret.tx(summarise(cc)); return ret; @@ -4055,23 +4055,23 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String sliceOrderString(ElementDefinitionSlicingComponent slicing) { if (slicing.getOrdered()) - return context.formatMessage(RenderingContext.STRUC_DEF_ORDERED); + return context.formatPhrase(RenderingContext.STRUC_DEF_ORDERED); else - return context.formatMessage(RenderingContext.STRUC_DEF_UNORDERED); + return context.formatPhrase(RenderingContext.STRUC_DEF_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(context.formatMessage(RenderingContext.STRUC_DEF_SET_SLICES)+" ", ed.getPath(), context.formatMessage(RenderingContext.STRUC_DEF_SET_ARE)); + x.codeWithText(context.formatPhrase(RenderingContext.STRUC_DEF_SET_SLICES)+" ", ed.getPath(), context.formatPhrase(RenderingContext.STRUC_DEF_SET_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(" "+context.formatMessage(RenderingContext.STRUC_DEF_AND) + " "); + x.tx(" "+context.formatPhrase(RenderingContext.STRUC_DEF_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(context.formatMessage(RenderingContext.STRUC_DEF_DESCRIM)); + x.tx(context.formatPhrase(RenderingContext.STRUC_DEF_DESCRIM)); StatusList list = new StatusList<>(); for (ElementDefinitionSlicingDiscriminatorComponent d : slicing.getDiscriminator()) { list.add(new DiscriminatorWithStatus(d)); @@ -4086,7 +4086,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { rc.render(x.li()); } } else { - x.tx(context.formatMessage(RenderingContext.STRUC_DEF_NO_DESCRIM)); + x.tx(context.formatPhrase(RenderingContext.STRUC_DEF_NO_DESCRIM)); } tableRow(tbl, "Slicing", "profiling.html#slicing", strikethrough, x); tbl.tx("\r\n"); @@ -4165,15 +4165,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(context.formatMessage(RenderingContext.STRUC_DEF_BUSINESS_ID)+" "); - ret.ah(corePath + "resource.html#identifiers").tx(context.formatMessage(RenderingContext.STRUC_DEF_DISCUSSION)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_BUSINESS_ID)+" "); + ret.ah(corePath + "resource.html#identifiers").tx(context.formatPhrase(RenderingContext.STRUC_DEF_DISCUSSION)); ret.tx(")"); return ret; } if (name.equals("version")) {// && !resource.equals("Device")) XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_BUSINESS_VERID)+" "); - ret.ah(corePath + "resource.html#versions").tx(context.formatMessage(RenderingContext.STRUC_DEF_DISCUSSION)); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_BUSINESS_VERID)+" "); + ret.ah(corePath + "resource.html#versions").tx(context.formatPhrase(RenderingContext.STRUC_DEF_DISCUSSION)); ret.tx(")"); return ret; } @@ -4205,7 +4205,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode t = compareSimpleTypeLists(d.getCondition(), compare == null ? null : compare.getCondition(), mode); if (t != null) { x.br(); - x.tx(context.formatMessage(RenderingContext.STRUC_DEF_INVARIANT)+" "); + x.tx(context.formatPhrase(RenderingContext.STRUC_DEF_INVARIANT)+" "); x.copyAllContent(t); } return x; @@ -4233,7 +4233,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } else { boolean first = true; if (types.size() > 1) { - ret.tx(context.formatMessage(RenderingContext.STRUC_DEF_CHOICE_OF)+" "); + ret.tx(context.formatPhrase(RenderingContext.STRUC_DEF_CHOICE_OF)+" "); } Map map = new HashMap(); for (TypeRefComponent t : compareTypes) { @@ -4279,11 +4279,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return null; case 2: XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" "+context.formatMessage(RenderingContext.STRUC_DEF_COMP_EX)); + x.tx(" "+context.formatPhrase(RenderingContext.STRUC_DEF_COMP_EX)); return x; case 3: x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" "+context.formatMessage(RenderingContext.STRUC_DEF_EX_TYPE)+" "); + x.tx(" "+context.formatPhrase(RenderingContext.STRUC_DEF_EX_TYPE)+" "); x.copyAllContent(describeTypes(value.getType(), false, value, compareValue, compMode, null, null, sd)); x.tx(")"); return x; @@ -4539,7 +4539,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", context.formatMessage(RenderingContext.STRUC_DEF_COPY_URL)).attribute("data-clipboard-text", binding.getValueSet()); + ispan.button("btn-copy", context.formatPhrase(RenderingContext.STRUC_DEF_COPY_URL)).attribute("data-clipboard-text", binding.getValueSet()); } span.tx(")"); } @@ -4557,17 +4557,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String conf(ElementDefinitionBindingComponent def) { if (def.getStrength() == null) { - return context.formatMessage(RenderingContext.STRUC_DEF_FOR_CODE)+" "; + return context.formatPhrase(RenderingContext.STRUC_DEF_FOR_CODE)+" "; } switch (def.getStrength()) { case EXAMPLE: - return context.formatMessage(RenderingContext.STRUC_DEF_EX_CODE)+" "; + return context.formatPhrase(RenderingContext.STRUC_DEF_EX_CODE)+" "; case PREFERRED: - return context.formatMessage(RenderingContext.STRUC_DEF_SHOULD_CODE)+" "; + return context.formatPhrase(RenderingContext.STRUC_DEF_SHOULD_CODE)+" "; case EXTENSIBLE: - return context.formatMessage(RenderingContext.STRUC_DEF_SUIT_SHALL_CODE)+" "; + return context.formatPhrase(RenderingContext.STRUC_DEF_SUIT_SHALL_CODE)+" "; case REQUIRED: - return context.formatMessage(RenderingContext.STRUC_DEF_SHALL_CODE)+" "; + return context.formatPhrase(RenderingContext.STRUC_DEF_SHALL_CODE)+" "; default: return "?sd-conf?"; } @@ -4733,17 +4733,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } return b.toString(); } else { - throw new FHIRException(context.formatMessage(RenderingContext.STRUC_DEF_ERR_DESC)); + throw new FHIRException(context.formatPhrase(RenderingContext.STRUC_DEF_ERR_DESC)); } } private String summarise(Coding coding) throws FHIRException { if ("http://snomed.info/sct".equals(coding.getSystem())) - return "" + (context.formatMessage(RenderingContext.STRUC_DEF_SNOMED_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_SNOMED_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://loinc.org".equals(coding.getSystem())) - return "" + (context.formatMessage(RenderingContext.STRUC_DEF_LOINC_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_LOINC_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://unitsofmeasure.org/".equals(coding.getSystem())) - return " (" + (context.formatMessage(RenderingContext.STRUC_DEF_UCUM)) + ": " + coding.getCode() + ")"; + return " (" + (context.formatPhrase(RenderingContext.STRUC_DEF_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 b11bbf6f7..d07fa3094 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 @@ -631,7 +631,7 @@ public class StructureMapRenderer extends TerminologyRenderer { } if (isClause) { XhtmlNode s= x.color(COLOR_SPECIAL); - s.setAttribute("title", formatMessage(RenderingContext.MAP_DEFAULT_COMMENT)); + s.setAttribute("title", formatPhrase(RenderingContext.MAP_DEFAULT_COMMENT)); s.tx("// "); s.tx(doco.replace("\r\n", " ").replace("\r", " ").replace("\n", " ")); } else { 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 6a2e8fdd6..f6264f09b 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(context.formatMessage(RenderingContext.SUB_TOPIC_RES_TRIG)); + TableData td = new TableData(context.formatPhrase(RenderingContext.SUB_TOPIC_RES_TRIG)); for (SubscriptionTopicResourceTriggerComponent rt : st.getResourceTrigger()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); } for (Enumeration t : rt.getSupportedInteraction()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_INT), t); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_INT), t); } if (rt.hasQueryCriteria()) { StringBuilder md = new StringBuilder(); if (rt.getQueryCriteria().hasPrevious()) { - md.append(context.formatMessage(RenderingContext.SUB_TOPIC_PREV, rt.getQueryCriteria().getPrevious()+"\r\n")+" "); + md.append(context.formatPhrase(RenderingContext.SUB_TOPIC_PREV, rt.getQueryCriteria().getPrevious()+"\r\n")+" "); } if (rt.getQueryCriteria().hasResultForCreate()) { - md.append(context.formatMessage(RenderingContext.SUB_TOPIC_CREATE, rt.getQueryCriteria().getResultForCreate()+"\r\n")+" "); + md.append(context.formatPhrase(RenderingContext.SUB_TOPIC_CREATE, rt.getQueryCriteria().getResultForCreate()+"\r\n")+" "); } if (rt.getQueryCriteria().hasCurrent()) { - md.append(context.formatMessage(RenderingContext.SUB_TOPIC_CREATE, rt.getQueryCriteria().getCurrent()+"\r\n")+" "); + md.append(context.formatPhrase(RenderingContext.SUB_TOPIC_CREATE, rt.getQueryCriteria().getCurrent()+"\r\n")+" "); } if (rt.getQueryCriteria().hasPrevious()) { - md.append(context.formatMessage(RenderingContext.SUB_TOPIC_DELETE, rt.getQueryCriteria().getResultForDelete()+"\r\n")+" "); + md.append(context.formatPhrase(RenderingContext.SUB_TOPIC_DELETE, rt.getQueryCriteria().getResultForDelete()+"\r\n")+" "); } if (rt.getQueryCriteria().hasRequireBoth()) { - md.append(context.formatMessage(RenderingContext.SUB_TOPIC_REQ, rt.getQueryCriteria().getRequireBoth()+"\r\n")+" "); + md.append(context.formatPhrase(RenderingContext.SUB_TOPIC_REQ, rt.getQueryCriteria().getRequireBoth()+"\r\n")+" "); } - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_CRITERIA), new MarkdownType(md.toString())); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_CRITERIA), new MarkdownType(md.toString())); } if (rt.hasFhirPathCriteriaElement()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_FHIR_PATH), rt.getFhirPathCriteriaElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_FHIR_PATH), rt.getFhirPathCriteriaElement()); } if (rt.hasDescription()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_DESC), rt.getDescriptionElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_DESC), 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(context.formatMessage(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); } if (rt.hasEvent()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_EVENT), rt.getEvent()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_EVENT), rt.getEvent()); } if (rt.hasDescription()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_DESC), rt.getDescriptionElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_DESC), 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(context.formatMessage(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); } if (rt.hasFilterParameter()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_FILT_PAR), rt.getFilterParameterElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_FILT_PAR), rt.getFilterParameterElement()); } if (rt.hasFilterDefinition()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_FILT_DEF), rt.getFilterDefinitionElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_FILT_DEF), rt.getFilterDefinitionElement()); } for (Enumeration t : rt.getComparator()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_COMP), t); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_COMP), t); } for (Enumeration t : rt.getModifier()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_MOD), t); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_MOD), 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(context.formatMessage(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_RES), rt.getResourceElement()); } for (StringType t : rt.getInclude()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_INCL), t); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_INCL), t); } for (StringType t : rt.getRevInclude()) { - tr.value(context.formatMessage(RenderingContext.SUB_TOPIC_REV_INCL), t); + tr.value(context.formatPhrase(RenderingContext.SUB_TOPIC_REV_INCL), 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 40f63e0ce..5565b6ec9 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,23 +209,23 @@ 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(context.formatMessage(RenderingContext.TERMINOLOGY_LVL)); + tr.td().b().tx(context.formatPhrase(RenderingContext.TERMINOLOGY_LVL)); } - tr.td().attribute("style", "white-space:nowrap").b().tx(formatMessage(RenderingContext.TX_CODE)); + tr.td().attribute("style", "white-space:nowrap").b().tx(formatPhrase(RenderingContext.TX_CODE)); if (hasDisplay) { - tr.td().b().tx(formatMessage(RenderingContext.TX_DISPLAY)); + tr.td().b().tx(formatPhrase(RenderingContext.TX_DISPLAY)); } if (definitions) { - tr.td().b().tx(formatMessage(RenderingContext.TX_DEFINITION)); + tr.td().b().tx(formatPhrase(RenderingContext.TX_DEFINITION)); } if (deprecated) { - tr.td().b().tx(formatMessage(RenderingContext.TX_DEPRECATED)); + tr.td().b().tx(formatPhrase(RenderingContext.TX_DEPRECATED)); } if (comments) { - tr.td().b().tx(formatMessage(RenderingContext.TX_COMMENTS)); + tr.td().b().tx(formatPhrase(RenderingContext.TX_COMMENTS)); } if (version) { - tr.td().b().tx(formatMessage(RenderingContext.TX_VERSION)); + tr.td().b().tx(formatPhrase(RenderingContext.TX_VERSION)); } if (properties != null) { for (PropertyComponent pc : properties) { @@ -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(context.formatMessage(RenderingContext.TERMINOLOGY_SNOMED)); + a.tx(context.formatPhrase(RenderingContext.TERMINOLOGY_SNOMED)); } 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", formatMessage(RenderingContext.TERM_REND_COPY, title)); + XhtmlNode span = x.span("cursor: pointer", formatPhrase(RenderingContext.TERM_REND_COPY, title)); 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 73fee97a7..6fdcea50a 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(context.formatMessage(RenderingContext.TEST_PLAN_CONT)); + p.b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_CONT)); 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(context.formatMessage(RenderingContext.TEST_PLAN_CATEGORY)+" "); + p.b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_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(context.formatMessage(RenderingContext.TEST_PLAN_SCOPE)+" "); + p.b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_SCOPE)+" "); renderReference(tp, p, tp.getScopeFirstRep()); } else { - x.para().b().tx(context.formatMessage(RenderingContext.TEST_PLAN_SCOPES)); + x.para().b().tx(context.formatPhrase(RenderingContext.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(context.formatMessage(RenderingContext.TEST_PLAN_DEP)+" "); + p.b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_DEP)+" "); 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(context.formatMessage(RenderingContext.TEST_PLAN_DEPEN)); + x.para().b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_DEPEN)); 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(context.formatMessage(RenderingContext.TEST_PLAN_DESC)); + li.addText(context.formatPhrase(RenderingContext.TEST_PLAN_DESC)); } 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(tc.hasSequence() ? formatMessage(RenderingContext.TEST_PLAN_CASE) : formatMessage(RenderingContext.TEST_PLAN_CASE_SEQ, tc.getSequence())); + x.h2().addText(tc.hasSequence() ? formatPhrase(RenderingContext.TEST_PLAN_CASE) : formatPhrase(RenderingContext.TEST_PLAN_CASE_SEQ, tc.getSequence())); if (tc.hasScope()) { if (tc.getScope().size() == 1) { p = x.para(); - p.b().tx(context.formatMessage(RenderingContext.TEST_PLAN_SCOPE)+" "); + p.b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_SCOPE)+" "); renderReference(tp, p, tc.getScopeFirstRep()); } else { - x.para().b().tx(context.formatMessage(RenderingContext.TEST_PLAN_SCOPES)); + x.para().b().tx(context.formatPhrase(RenderingContext.TEST_PLAN_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(context.formatMessage(RenderingContext.TEST_PLAN_DEP)); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_DEP)); 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(context.formatMessage(RenderingContext.TEST_PLAN_DEPEN)); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_DEPEN)); 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(context.formatMessage(RenderingContext.TEST_PLAN_DESC)); + li.addText(context.formatPhrase(RenderingContext.TEST_PLAN_DESC)); } 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(context.formatMessage(RenderingContext.TEST_PLAN_RUN)); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_RUN)); renderTestRun(x, tp, tc.getTestRunFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestRunComponent trun : tc.getTestRun()) { count++; - x.h3().addText(context.formatMessage(RenderingContext.TEST_PLAN_TEST_RUN, count)+" "); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_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(context.formatMessage(RenderingContext.TEST_PLAN_DATA)); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_DATA)); renderTestData(x, tp, tc.getTestDataFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestDataComponent tdata : tc.getTestData()) { count++; - x.h3().addText(context.formatMessage(RenderingContext.TEST_PLAN_TEST_DATA, count)+" "); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_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(context.formatMessage(RenderingContext.TEST_PLAN_ASS)); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_ASS)); renderAssertion(x, tp, tc.getAssertionFirstRep()); } else { int count = 0; for (TestPlanTestCaseAssertionComponent as : tc.getAssertion()) { count++; - x.h3().addText(context.formatMessage(RenderingContext.TEST_PLAN_ASSERTION, count)+" "); + x.h3().addText(context.formatPhrase(RenderingContext.TEST_PLAN_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(context.formatMessage(RenderingContext.TEST_PLAN_LANG)); - tr.td().b().addText(context.formatMessage(RenderingContext.TEST_PLAN_SOURCE)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_LANG)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_SOURCE)); 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(context.formatMessage(RenderingContext.TEST_PLAN_TYPE)); - tr.td().b().addText(context.formatMessage(RenderingContext.TEST_PLAN_CONTENT)); - tr.td().b().addText(context.formatMessage(RenderingContext.TEST_PLAN_SOURCE)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_TYPE)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_CONTENT)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_SOURCE)); 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(context.formatMessage(RenderingContext.TEST_PLAN_TYPE)); - tr.td().b().addText(context.formatMessage(RenderingContext.TEST_PLAN_CONTENT)); - tr.td().b().addText(context.formatMessage(RenderingContext.TEST_PLAN_RESULT)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_TYPE)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_CONTENT)); + tr.td().b().addText(context.formatPhrase(RenderingContext.TEST_PLAN_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 2e1685c28..01e962412 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 @@ -184,7 +184,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (header) { XhtmlNode h = x.addTag(getHeader()); - h.tx(context.formatMessage(RenderingContext.VALUE_SET_CONT)); + h.tx(context.formatPhrase(RenderingContext.VALUE_SET_CONT)); if (IsNotFixedExpansion(vs)) addMarkdown(x, vs.getDescription()); if (vs.hasCopyright()) @@ -206,9 +206,9 @@ public class ValueSetRenderer extends TerminologyRenderer { // } String msg = null; if (vs.getExpansion().getContains().isEmpty()) { - msg = context.formatMessage(RenderingContext.VALUE_SET_TOO_COSTLY); + msg = context.formatPhrase(RenderingContext.VALUE_SET_TOO_COSTLY); } else { - msg = context.formatMessage(RenderingContext.VALUE_SET_CODE_SELEC, countMembership(vs)); + msg = context.formatPhrase(RenderingContext.VALUE_SET_CODE_SELEC, countMembership(vs)); } x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { @@ -216,17 +216,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(context.formatMessage(RenderingContext.VALUE_SET_HAS)+(hasFragment ? context.formatMessage(RenderingContext.VALUE_SET_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(context.formatPhrase(RenderingContext.VALUE_SET_HAS)+(hasFragment ? context.formatPhrase(RenderingContext.VALUE_SET_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(context.formatMessage(RenderingContext.VALUE_SET_CONTAINS)+(hasFragment ? context.formatMessage(RenderingContext.VALUE_SET_AT_LEAST) : "")+vs.getExpansion().getTotal()+" concepts."); + x.para().tx(context.formatPhrase(RenderingContext.VALUE_SET_CONTAINS)+(hasFragment ? context.formatPhrase(RenderingContext.VALUE_SET_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 = context.formatMessage(RenderingContext.VALUE_SET_SEL); + String msg = context.formatPhrase(RenderingContext.VALUE_SET_SEL); x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { - x.para().tx(context.formatMessage(RenderingContext.VALUE_SET_NUMBER_CONCEPTS, count)); + x.para().tx(context.formatPhrase(RenderingContext.VALUE_SET_NUMBER_CONCEPTS, count)); } } @@ -244,21 +244,21 @@ public class ValueSetRenderer extends TerminologyRenderer { XhtmlNode t = x.table( "codes"); XhtmlNode tr = t.tr(); if (doLevel) - tr.td().b().tx(context.formatMessage(RenderingContext.VALUE_SET_LEVEL)); - tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatMessage(RenderingContext.VALUE_SET_CODE)); - tr.td().b().tx(context.formatMessage(RenderingContext.VALUE_SET_SYSTEM)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_LEVEL)); + tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_SYSTEM)); XhtmlNode tdDisp = tr.td(); - tdDisp.b().tx(context.formatMessage(RenderingContext.VALUE_SET_DISPLAY)); + tdDisp.b().tx(context.formatPhrase(RenderingContext.VALUE_SET_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(context.formatMessage(RenderingContext.VALUE_SET_INACTIVE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_INACTIVE)); } if (doDefinition) { - tr.td().b().tx(context.formatMessage(RenderingContext.VALUE_SET_DEF)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DEF)); doDesignations = false; for (String n : Utilities.sorted(properties.keySet())) { tr.td().b().ah(properties.get(n)).addText(n); @@ -294,15 +294,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_ADD_LANG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG)); } else if (langs.size() == 0) { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_DESIG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG)); } else { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_ADD_DESIG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_DESIG)); } t = x.table("codes"); tr = t.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.VALUE_SET_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE)); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -342,8 +342,8 @@ public class ValueSetRenderer extends TerminologyRenderer { } private boolean generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) { - generateContentModeNotice(x, expansion, "example", context.formatMessage(RenderingContext.VALUE_SET_EXP), vs); - return generateContentModeNotice(x, expansion, "fragment", context.formatMessage(RenderingContext.VALUE_SET_EXP_FRAG), vs); + generateContentModeNotice(x, expansion, "example", context.formatPhrase(RenderingContext.VALUE_SET_EXP), vs); + return generateContentModeNotice(x, expansion, "fragment", context.formatPhrase(RenderingContext.VALUE_SET_EXP_FRAG), vs); } private boolean generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) { @@ -486,14 +486,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(context.formatMessage(RenderingContext.VALUE_SET_EXPANSION)+" "); + p.tx(context.formatPhrase(RenderingContext.VALUE_SET_EXPANSION)+" "); 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(context.formatMessage(RenderingContext.VALUE_SET_EXPANSIONS)); + div.para().tx(context.formatPhrase(RenderingContext.VALUE_SET_EXPANSIONS)); ul = div.ul(); first = false; } @@ -513,30 +513,30 @@ public class ValueSetRenderer extends TerminologyRenderer { if (parts.length >= 5) { String m = describeModule(parts[4]); if (parts.length == 7) { - x.tx(context.formatMessage(RenderingContext.VALUE_SET_SNOMED_ADD, m, formatSCTDate(parts[6]))); + x.tx(context.formatPhrase(RenderingContext.VALUE_SET_SNOMED_ADD, m, formatSCTDate(parts[6]))); } else { - x.tx(context.formatMessage(RenderingContext.VALUE_SET_SNOMED, m)); + x.tx(context.formatPhrase(RenderingContext.VALUE_SET_SNOMED, m)); } } else { - x.tx(displaySystem(u)+" "+ context.formatMessage(RenderingContext.VALUE_SET_VERSION) + " " +v); + x.tx(displaySystem(u)+" "+ context.formatPhrase(RenderingContext.VALUE_SET_VERSION) + " " +v); } } else if (u.equals("http://loinc.org")) { String vd = describeLoincVer(v); if (vd != null) { - x.tx(context.formatMessage(RenderingContext.VALUE_SET_LOINCV)+v+" ("+vd+")"); + x.tx(context.formatPhrase(RenderingContext.VALUE_SET_LOINCV)+v+" ("+vd+")"); } else { - x.tx(context.formatMessage(RenderingContext.VALUE_SET_LOINCV)+v); + x.tx(context.formatPhrase(RenderingContext.VALUE_SET_LOINCV)+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()+" "+ context.formatMessage(RenderingContext.VALUE_SET_NO_VERSION)+cr.fhirType()+")"); + x.ah(cr.getWebPath()).tx(t+" "+cr.present()+" "+ context.formatPhrase(RenderingContext.VALUE_SET_NO_VERSION)+cr.fhirType()+")"); } else { - x.tx(t+" "+displaySystem(u)+" "+context.formatMessage(RenderingContext.VALUE_SET_NO_VERSION)+cr.fhirType()+")"); + x.tx(t+" "+displaySystem(u)+" "+context.formatPhrase(RenderingContext.VALUE_SET_NO_VERSION)+cr.fhirType()+")"); } } else { - x.tx(t+" "+displaySystem(u)+" "+ context.formatMessage(RenderingContext.VALUE_SET_NO_VER)); + x.tx(t+" "+displaySystem(u)+" "+ context.formatPhrase(RenderingContext.VALUE_SET_NO_VER)); } } else { CanonicalResource cr = (CanonicalResource) getContext().getWorker().fetchResource(Resource.class, u+"|"+v, source); @@ -547,7 +547,7 @@ public class ValueSetRenderer extends TerminologyRenderer { x.tx(t+" "+displaySystem(u)+" v"+v+" ("+cr.fhirType()+")"); } } else { - x.tx(t+" "+displaySystem(u)+" "+ context.formatMessage(RenderingContext.VALUE_SET_VERSION)+v); + x.tx(t+" "+displaySystem(u)+" "+ context.formatPhrase(RenderingContext.VALUE_SET_VERSION)+v); } } } @@ -619,21 +619,21 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describeModule(String module) { if ("900000000000207008".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_INT); + return context.formatPhrase(RenderingContext.VALUE_SET_INT); if ("731000124108".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_US); + return context.formatPhrase(RenderingContext.VALUE_SET_US); if ("32506021000036107".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_AUS); + return context.formatPhrase(RenderingContext.VALUE_SET_AUS); if ("449081005".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_SPAN); + return context.formatPhrase(RenderingContext.VALUE_SET_SPAN); if ("554471000005108".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_DANISH); + return context.formatPhrase(RenderingContext.VALUE_SET_DANISH); if ("11000146104".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_DUTCH); + return context.formatPhrase(RenderingContext.VALUE_SET_DUTCH); if ("45991000052106".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_SWEDISH); + return context.formatPhrase(RenderingContext.VALUE_SET_SWEDISH); if ("999000041000000102".equals(module)) - return context.formatMessage(RenderingContext.VALUE_SET_UK); + return context.formatPhrase(RenderingContext.VALUE_SET_UK); return module; } @@ -827,7 +827,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (doInactive) { td = tr.td(); if (c.getInactive()) { - td.tx(context.formatMessage(RenderingContext.VALUE_SET_INACT)); + td.tx(context.formatPhrase(RenderingContext.VALUE_SET_INACT)); } } if (doDefinition) { @@ -896,7 +896,7 @@ public class ValueSetRenderer extends TerminologyRenderer { CodeSystem e = getContext().getWorker().fetchCodeSystem(system); if (e == null || (e.getContent() != org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE && e.getContent() != org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT)) { if (isAbstract) - td.i().setAttribute("title", context.formatMessage(RenderingI18nContext.VS_ABSTRACT_CODE_HINT)).addText(code); + td.i().setAttribute("title", context.formatPhrase(RenderingContext.VS_ABSTRACT_CODE_HINT)).addText(code); else if ("http://snomed.info/sct".equals(system)) { td.ah(sctLink(code)).addText(code); } else if ("http://loinc.org".equals(system)) { @@ -910,7 +910,7 @@ public class ValueSetRenderer extends TerminologyRenderer { else href = href + "#"+e.getId()+"-"+Utilities.nmtokenize(code); if (isAbstract) - td.ah(href).setAttribute("title", context.formatMessage(RenderingI18nContext.VS_ABSTRACT_CODE_HINT)).i().addText(code); + td.ah(href).setAttribute("title", context.formatPhrase(RenderingContext.VS_ABSTRACT_CODE_HINT)).i().addText(code); else td.ah(href).addText(code); } @@ -959,26 +959,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(context.formatMessage(RenderingContext.VALUE_SET_RULES_INC)); + p.tx(context.formatPhrase(RenderingContext.VALUE_SET_RULES_INC)); XhtmlNode ul = x.ul(); for (ConceptSetComponent inc : vs.getCompose().getInclude()) { - hasExtensions = genInclude(ul, inc, context.formatMessage(RenderingContext.VALUE_SET_INC), langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, inc, context.formatPhrase(RenderingContext.VALUE_SET_INC), langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "include")) { - genInclude(ul, (ConceptSetComponent) inc, context.formatMessage(RenderingContext.VALUE_SET_INC), langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, context.formatPhrase(RenderingContext.VALUE_SET_INC), langs, doDesignations, maps, designations, index, vs); index++; } if (vs.getCompose().hasExclude() || VersionComparisonAnnotation.hasDeleted(vs.getCompose(), "exclude")) { p = x.para(); - p.tx(context.formatMessage(RenderingContext.VALUE_SET_RULES_EXC)); + p.tx(context.formatPhrase(RenderingContext.VALUE_SET_RULES_EXC)); ul = x.ul(); for (ConceptSetComponent exc : vs.getCompose().getExclude()) { - hasExtensions = genInclude(ul, exc, context.formatMessage(RenderingContext.VALUE_SET_EXCL), langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, exc, context.formatPhrase(RenderingContext.VALUE_SET_EXCL), langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "exclude")) { - genInclude(ul, (ConceptSetComponent) inc, context.formatMessage(RenderingContext.VALUE_SET_EXCL), langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, context.formatPhrase(RenderingContext.VALUE_SET_EXCL), langs, doDesignations, maps, designations, index, vs); index++; } } @@ -989,15 +989,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_ADD_LANG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG)); } else if (langs.size() == 0) { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_DESIG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG)); } else { - x.para().b().tx(context.formatMessage(RenderingContext.VALUE_SET_ADD_DESIG)); + x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_DESIG)); } XhtmlNode t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx(context.formatMessage(RenderingContext.VALUE_SET_CODE)); + tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE)); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -1016,14 +1016,14 @@ public class ValueSetRenderer extends TerminologyRenderer { } private void renderExpansionRules(XhtmlNode x, ConceptSetComponent inc, int index, Map definitions) throws FHIRException, IOException { - String s = context.formatMessage(RenderingContext.VALUE_SET_NOT_DEF); + String s = context.formatPhrase(RenderingContext.VALUE_SET_NOT_DEF); if (inc.hasExtension(ToolingExtensions.EXT_EXPAND_RULES)) { String rule = inc.getExtensionString(ToolingExtensions.EXT_EXPAND_RULES); if (rule != null) { switch (rule) { - case "all-codes": s = context.formatMessage(RenderingContext.VALUE_SET_ALL_CODE); - case "ungrouped": s = context.formatMessage(RenderingContext.VALUE_SET_NOT_FOUND); - case "groups-only": s = context.formatMessage(RenderingContext.VALUE_SET_CONT_STRUC); + case "all-codes": s = context.formatPhrase(RenderingContext.VALUE_SET_ALL_CODE); + case "ungrouped": s = context.formatPhrase(RenderingContext.VALUE_SET_NOT_FOUND); + case "groups-only": s = context.formatPhrase(RenderingContext.VALUE_SET_CONT_STRUC); } } } @@ -1032,8 +1032,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(), context.formatMessage(RenderingContext.VALUE_SET_CODE), context.formatMessage(RenderingContext.VALUE_SET_CODE_ITEM), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatMessage(RenderingContext.VALUE_SET_DISPLAY), context.formatMessage(RenderingContext.VALUE_SET_DISPLAY_ITEM), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_CODE), context.formatPhrase(RenderingContext.VALUE_SET_CODE_ITEM), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY_ITEM), null, 0)); for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) { renderExpandGroup(gen, model, ext, inc, definitions); @@ -1141,9 +1141,9 @@ public class ValueSetRenderer extends TerminologyRenderer { } switch (url) { case "http://snomed.info/sct#900000000000003001": - return context.formatMessage(RenderingContext.VALUE_SET_SPEC_NAME); + return context.formatPhrase(RenderingContext.VALUE_SET_SPEC_NAME); case "http://snomed.info/sct#900000000000013009": - return context.formatMessage(RenderingContext.VALUE_SET_SYNONYM); + return context.formatPhrase(RenderingContext.VALUE_SET_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; @@ -1177,14 +1177,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+" "+ context.formatMessage(RenderingContext.VALUE_SET_ALL_CODES_DEF) + " "); + li.addText(type+" "+ context.formatPhrase(RenderingContext.VALUE_SET_ALL_CODES_DEF) + " "); addCsRef(inc, li, e); } else { if (inc.getConcept().size() > 0) { - li.addText(type+" "+ context.formatMessage(RenderingContext.VALUE_SET_THESE_CODES_DEF) + " "); + li.addText(type+" "+ context.formatPhrase(RenderingContext.VALUE_SET_THESE_CODES_DEF) + " "); addCsRef(inc, li, e); if (inc.hasVersion()) { - li.addText(" "+ context.formatMessage(RenderingContext.VALUE_SET_VERSION) + " "); + li.addText(" "+ context.formatPhrase(RenderingContext.VALUE_SET_VERSION) + " "); li.code(inc.getVersion()); } @@ -1211,24 +1211,24 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.getFilter().size() > 0) { - li.addText(type+" "+ context.formatMessage(RenderingContext.VALUE_SET_CODES_FROM)); + li.addText(type+" "+ context.formatPhrase(RenderingContext.VALUE_SET_CODES_FROM)); addCsRef(inc, li, e); - li.tx(" "+ context.formatMessage(RenderingContext.VALUE_SET_WHERE)+" "); + li.tx(" "+ context.formatPhrase(RenderingContext.VALUE_SET_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(" "+ context.formatMessage(RenderingContext.VALUE_SET_AND)); + li.tx(" "+ context.formatPhrase(RenderingContext.VALUE_SET_AND)); } else { - li.tx(context.formatMessage(RenderingContext.VALUE_SET_COMMA)+" "); + li.tx(context.formatPhrase(RenderingContext.VALUE_SET_COMMA)+" "); } } XhtmlNode wli = renderStatus(f, li); if (f.getOp() == FilterOperator.EXISTS) { if (f.getValue().equals("true")) { - wli.tx(f.getProperty()+" "+ context.formatMessage(RenderingContext.VALUE_SET_EXISTS)); + wli.tx(f.getProperty()+" "+ context.formatPhrase(RenderingContext.VALUE_SET_EXISTS)); } else { - wli.tx(f.getProperty()+" "+ context.formatMessage(RenderingContext.VALUE_SET_DOESNT_EXIST)); + wli.tx(f.getProperty()+" "+ context.formatPhrase(RenderingContext.VALUE_SET_DOESNT_EXIST)); } } else { wli.tx(f.getProperty()+" "+describe(f.getOp())+" "); @@ -1256,7 +1256,7 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.hasValueSet()) { - li.tx(context.formatMessage(RenderingContext.VALUE_SET_WHERE_CODES)+" "); + li.tx(context.formatPhrase(RenderingContext.VALUE_SET_WHERE_CODES)+" "); boolean first = true; for (UriType vs : inc.getValueSet()) { if (first) @@ -1327,7 +1327,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (hasComments) { td = tr.td(); if (ExtensionHelper.hasExtension(c, ToolingExtensions.EXT_VS_COMMENT)) { - smartAddText(td, context.formatMessage(RenderingContext.VALUE_SET_NOTE, ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)+" ")); + smartAddText(td, context.formatPhrase(RenderingContext.VALUE_SET_NOTE, ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)+" ")); } } if (doDesignations) { @@ -1408,7 +1408,7 @@ public class ValueSetRenderer extends TerminologyRenderer { ValueSetExpansionOutcome vso = getContext().getWorker().expandVS(vs, true, false); ValueSet valueset = vso.getValueset(); if (valueset == null) - throw new TerminologyServiceException(context.formatMessage(RenderingContext.VALUE_SET_ERROR, vso.getError()+" ")); + throw new TerminologyServiceException(context.formatPhrase(RenderingContext.VALUE_SET_ERROR, vso.getError()+" ")); vse = valueset.getExpansion(); } catch (Exception e1) { @@ -1505,18 +1505,18 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describe(FilterOperator op) { if (op == null) - return " "+ context.formatMessage(RenderingContext.VALUE_SET_NULL); + return " "+ context.formatPhrase(RenderingContext.VALUE_SET_NULL); switch (op) { - case EQUAL: return " "+ context.formatMessage(RenderingContext.VALUE_SET_EQUAL); - case ISA: return " "+ context.formatMessage(RenderingContext.VALUE_SET_ISA); - case ISNOTA: return " "+ context.formatMessage(RenderingContext.VALUE_SET_ISNOTA); - case REGEX: return " "+ context.formatMessage(RenderingContext.VALUE_SET_REGEX); - case NULL: return " "+ context.formatMessage(RenderingContext.VALUE_SET_NULLS); - case IN: return " "+ context.formatMessage(RenderingContext.VALUE_SET_IN); - case NOTIN: return " "+ context.formatMessage(RenderingContext.VALUE_SET_NOTIN); - case DESCENDENTOF: return " "+ context.formatMessage(RenderingContext.VALUE_SET_DESCENDENTOF); - case EXISTS: return " "+ context.formatMessage(RenderingContext.VALUE_SET_EXISTS); - case GENERALIZES: return " "+ context.formatMessage(RenderingContext.VALUE_SET_GENERALIZES); + case EQUAL: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_EQUAL); + case ISA: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_ISA); + case ISNOTA: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_ISNOTA); + case REGEX: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_REGEX); + case NULL: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_NULLS); + case IN: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_IN); + case NOTIN: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_NOTIN); + case DESCENDENTOF: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_DESCENDENTOF); + case EXISTS: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_EXISTS); + case GENERALIZES: return " "+ context.formatPhrase(RenderingContext.VALUE_SET_GENERALIZES); } return null; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java index fa948f400..510038bd0 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java @@ -1061,15 +1061,22 @@ public class RenderingI18nContext extends I18nBase { public static final String TERM_REND_COPY = "TERM_REND_COPY"; public static final String TEST_PLAN_CASE = "TEST_PLAN_CASE"; public static final String TEST_PLAN_CASE_SEQ = "TEST_PLAN_CASE_SEQ"; - + protected String getMessagesSourceFileName() { return "rendering-phrases"; } - -@Override + + @Override protected String typeOfString() { return "phrase"; } - + + public String formatPhrase(String theMessage, Object... theMessageArguments) { + return formatMessage(theMessage, theMessageArguments); + } + + public String formatPhrasePlural(Integer plural, String theMessage, Object... theMessageArguments) { + return formatMessagePlural(plural, theMessage, theMessageArguments); + } } 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 7bd58dc38..5956321a3 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 @@ -671,11 +671,11 @@ public class HierarchicalTableGenerator { 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(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatMessage(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_CARD), i18n.formatMessage(RenderingI18nContext.SD_HEAD_CARD_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatMessage(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_DESC), i18n.formatMessage(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0)); if (isLogical) { model.getTitles().add(new Title(null, prefix+"structuredefinition.html#logical", "Implemented As", "How this logical data item is implemented in a concrete resource", null, 0)); } @@ -692,16 +692,16 @@ public class HierarchicalTableGenerator { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_NAME_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L_DESC), null, 0).setStyle("border-left: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_L_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_L_DESC), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_L_DESC), null, 0).setStyle("border-right: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R_DESC), null, 0).setStyle("border-left: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_R_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_R_DESC), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_R_DESC), null, 0).setStyle("border-right: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_COMP), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_COMP_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L_DESC), null, 0).setStyle("border-left: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_CARD_L), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_CARD_L_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_TYPE_L), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_TYPE_L_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_DESC_L), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_DESC_L_DESC), null, 0).setStyle("border-right: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R_DESC), null, 0).setStyle("border-left: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_CARD_R), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_CARD_R_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_TYPE_R), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_TYPE_R_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_DESC_R), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_DESC_R_DESC), null, 0).setStyle("border-right: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_COMP), i18n.formatPhrase(RenderingI18nContext.SD_COMP_HEAD_COMP_DESC), null, 0)); return model; } @@ -709,10 +709,10 @@ public class HierarchicalTableGenerator { public TableModel initGridTable(String prefix, String id) { TableModel model = new TableModel(id, false); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_CARD), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_CARD_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0)); return model; } @@ -755,10 +755,10 @@ public class HierarchicalTableGenerator { tc.setAttribute("class", "hierarchy"); tc.setAttribute("colspan", Integer.toString(model.getTitles().size())); tc.addTag("br"); - XhtmlNode a = tc.addTag("a").setAttribute("title", i18n.formatMessage(RenderingI18nContext.SD_LEGEND)).setAttribute("href", model.getDocoRef()); + XhtmlNode a = tc.addTag("a").setAttribute("title", i18n.formatPhrase(RenderingI18nContext.SD_LEGEND)).setAttribute("href", model.getDocoRef()); if (model.getDocoImg() != null) a.addTag("img").setAttribute("alt", "doco").setAttribute("style", "background-color: inherit").setAttribute("src", model.getDocoImg()); - a.addText(" "+i18n.formatMessage(RenderingI18nContext.SD_DOCO)); + a.addText(" "+i18n.formatPhrase(RenderingI18nContext.SD_DOCO)); } return table; } diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties index ffb4bc525..5d5dbef1f 100644 --- a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties @@ -909,7 +909,7 @@ CAPABILITY_SUPP_PROFS = Supported Profiles CAPABILITY_EXT_OP = Extended Operations CAPABILITY_INT_SUMM = Interaction summary CAPABILITY_SEARCH_PARS = Search Parameters -CAPABILITY_COMB_SEARCH_PARS = Combined Search Parameters +CAPABILITY_COMB_SEARCH_PAR = Combined Search Parameters CODE_SYS_IN_A_HIERARCHY = in a {0} hierarchy CODE_SYS_REPLACED_BY = (replaced by DATA_REND_ONGOING = (ongoing) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ComparisonService.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ComparisonService.java index bf02ee871..a82a10a1a 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ComparisonService.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ComparisonService.java @@ -13,6 +13,7 @@ import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.validation.ValidationEngine; import org.hl7.fhir.validation.cli.utils.Params; @@ -60,7 +61,7 @@ public class ComparisonService { public static void compareStructureDefinitions(String dest, ValidationEngine validator, String left, String right, StructureDefinition resLeft, StructureDefinition resRight) throws IOException, FHIRException, EOperationOutcome { System.out.println("Comparing StructureDefinitions " + left + " to " + right); - ComparisonSession session = new ComparisonSession(validator.getContext(), validator.getContext(), "Comparing Profiles", null, null); + ComparisonSession session = new ComparisonSession(new RenderingI18nContext(), validator.getContext(), validator.getContext(), "Comparing Profiles", null, null); session.compare(resLeft, resRight); System.out.println("Generating output to " + dest + "..."); diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/comparison/tests/ComparisonTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/comparison/tests/ComparisonTests.java index 8afdaaa93..8505eee5b 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/comparison/tests/ComparisonTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/comparison/tests/ComparisonTests.java @@ -65,6 +65,7 @@ import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.filesystem.ManagedFileAccess; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.json.model.*; import org.hl7.fhir.utilities.npm.CommonPackages; import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; @@ -155,7 +156,7 @@ public class ComparisonTests { prefix = loadResource("html-prefix.html"); suffix = loadResource("html-suffix.html"); - ComparisonSession session = new ComparisonSession(context, context, "Comparison Tests", null, null); + ComparisonSession session = new ComparisonSession(new RenderingI18nContext(), context, context, "Comparison Tests", null, null); if (content.has("version")) { session.setAnnotate(true); } From 468660bc1751a9576baf020cfea5a9063386c643 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 20 May 2024 04:37:59 -0500 Subject: [PATCH 2/3] Fix bugs with loading translations (#1592) --- .../fhir/r5/elementmodel/LanguageUtils.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java index d900a5fba..3a926422a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java @@ -335,7 +335,7 @@ public class LanguageUtils { return dstLang == null || srcLang == null ? false : dstLang.startsWith(srcLang) || "*".equals(srcLang); } - public static void fillSupplement(CodeSystem csSrc, CodeSystem csDst, List list) { + public void fillSupplement(CodeSystem csSrc, CodeSystem csDst, List list) { csDst.setUserData(SUPPLEMENT_SOURCE_RESOURCE, csSrc); csDst.setUserData(SUPPLEMENT_SOURCE_TRANSLATIONS, list); for (TranslationUnit tu : list) { @@ -388,11 +388,11 @@ public class LanguageUtils { } } - private static Object tail(String url) { + private String tail(String url) { return url.contains("/") ? url.substring(url.lastIndexOf("/")+1) : url; } - private static void addOrphanTranslation(CodeSystem cs, TranslationUnit tu) { + private void addOrphanTranslation(CodeSystem cs, TranslationUnit tu) { List list = (List) cs.getUserData(ORPHAN_TRANSLATIONS_NAME); if (list == null) { list = new ArrayList<>(); @@ -401,7 +401,7 @@ public class LanguageUtils { list.add(tu); } - public static String nameForLang(String lang) { + public String nameForLang(String lang) { // todo: replace with structures from loading languages properly switch (lang) { case "en" : return "English"; @@ -412,7 +412,7 @@ public class LanguageUtils { return Utilities.capitalize(lang); } - public static String titleForLang(String lang) { + public String titleForLang(String lang) { // todo: replace with structures from loading languages properly switch (lang) { case "en" : return "English"; @@ -423,15 +423,15 @@ public class LanguageUtils { return Utilities.capitalize(lang); } - public static boolean handlesAsResource(Resource resource) { + public boolean handlesAsResource(Resource resource) { return (resource instanceof CodeSystem && resource.hasUserData(SUPPLEMENT_SOURCE_RESOURCE)) || (resource instanceof StructureDefinition); } - public static boolean handlesAsElement(Element element) { + public boolean handlesAsElement(Element element) { return true; // for now... } - public static List generateTranslations(Resource res, String lang) { + public List generateTranslations(Resource res, String lang) { List list = new ArrayList<>(); if (res instanceof StructureDefinition) { StructureDefinition sd = (StructureDefinition) res; @@ -458,7 +458,7 @@ public class LanguageUtils { return list; } - private static void generateTranslations(List list, StructureDefinition sd, String lang) { + private void generateTranslations(List list, StructureDefinition sd, String lang) { addToList(list, lang, sd, "name", "name", sd.getNameElement()); addToList(list, lang, sd, "title", "title", sd.getTitleElement()); addToList(list, lang, sd, "publisher", "publisher", sd.getPublisherElement()); @@ -488,14 +488,14 @@ public class LanguageUtils { } } - private static void addToList(List list, String lang, Base ctxt, String name, String propName, DataType value) { + private void addToList(List list, String lang, Base ctxt, String name, String propName, DataType value) { if (value != null && value.hasPrimitiveValue()) { list.add(new TranslationUnit(lang, name, ctxt.getNamedProperty(propName).getDefinition(), value.primitiveValue(), value.getTranslation(lang))); } } - private static void generateTranslations(List list, ConceptDefinitionComponent cd, String lang, List inputs) { + private void generateTranslations(List list, ConceptDefinitionComponent cd, String lang, List inputs) { // we generate translation units for the display, the definition, and any designations and extensions that we find // the id of the designation is the use.code (there will be a use) and for the extension, the tail of the extension URL // todo: do we need to worry about name clashes? why would we, and more importantly, how would we solve that? @@ -512,7 +512,7 @@ public class LanguageUtils { } } - private static void addTranslationUnit(List list, String id, String srcText, String lang, List inputs) { + private void addTranslationUnit(List list, String id, String srcText, String lang, List inputs) { TranslationUnit existing = null; for (TranslationUnit t : inputs) { if (id.equals(t.getId())) { @@ -530,7 +530,7 @@ public class LanguageUtils { } } - private static String getDefinition(ConceptDefinitionComponent cd) { + private String getDefinition(ConceptDefinitionComponent cd) { ConceptPropertyComponent v = CodeSystemUtilities.getProperty(cd, "translation-context"); if (v != null && v.hasValue()) { return v.getValue().primitiveValue(); @@ -539,15 +539,15 @@ public class LanguageUtils { } } - public static List generateTranslations(Element e, String lang) { + public List generateTranslations(Element e, String lang) { List list = new ArrayList<>(); generateTranslations(e, lang, list); return list; } - private static void generateTranslations(Element e, String lang, List list) { + private void generateTranslations(Element e, String lang, List list) { if (e.getProperty().isTranslatable()) { - String id = e.getProperty().getDefinition().getPath(); + String id = pathForElement(e); // .getProperty().getDefinition().getPath(); String context = e.getProperty().getDefinition().getDefinition(); String src = e.primitiveValue(); String tgt = getTranslation(e, lang); @@ -561,7 +561,7 @@ public class LanguageUtils { } - private static String getTranslation(Element e, String lang) { + private String getTranslation(Element e, String lang) { if (!e.hasChildren()) { return null; } @@ -585,7 +585,7 @@ public class LanguageUtils { return null; } - public static boolean switchLanguage(Element e, String lang) { + public boolean switchLanguage(Element e, String lang) { if (e.getProperty().isTranslatable()) { String cnt = getTranslation(e, lang); e.removeExtension(ToolingExtensions.EXT_TRANSLATION); From 75a9d13050fd4750fcb823446e3e0a5501d97d1a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 20 May 2024 05:17:03 -0500 Subject: [PATCH 3/3] Add importing translations to native resources --- .../fhir/r5/elementmodel/LanguageUtils.java | 66 +++++++++++++++++-- .../hl7/fhir/r5/utils/ToolingExtensions.java | 20 ++++++ 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java index 3a926422a..928d5a726 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java @@ -21,6 +21,7 @@ import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingAdditiona import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent; import org.hl7.fhir.r5.model.Extension; import org.hl7.fhir.r5.model.MarkdownType; +import org.hl7.fhir.r5.model.Property; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StringType; import org.hl7.fhir.r5.model.StructureDefinition; @@ -128,13 +129,17 @@ public class LanguageUtils { } private String pathForElement(Element element) { + String bp = element.getBasePath(); + return pathForElement(bp, element.getProperty().getStructure().getType()); + } + + private String pathForElement(String path, String type) { // special case support for metadata elements prior to R5: if (crlist == null) { crlist = new ContextUtilities(context).getCanonicalResourceNames(); } - String bp = element.getBasePath(); - if (crlist.contains(element.getProperty().getStructure().getType())) { - String fp = bp.replace(element.getProperty().getStructure().getType()+".", "CanonicalResource."); + if (crlist.contains(type)) { + String fp = path.replace(type+".", "CanonicalResource."); if (Utilities.existsInList(fp, "CanonicalResource.url", "CanonicalResource.identifier", "CanonicalResource.version", "CanonicalResource.name", "CanonicalResource.title", "CanonicalResource.status", "CanonicalResource.experimental", "CanonicalResource.date", @@ -143,7 +148,7 @@ public class LanguageUtils { return fp; } } - return bp; + return path; } @@ -167,6 +172,22 @@ public class LanguageUtils { return r; } + public int importFromTranslations(Resource resource, List translations, List messages) { + Set usedUnits = new HashSet<>(); + int r = 0; + if (resource.fhirType().equals("StructureDefinition")) { + // todo... r = importFromTranslationsForSD(null, resource, translations, usedUnits); + } else { + r = importResourceFromTranslations(null, resource, translations, usedUnits, resource.fhirType()); + } + for (TranslationUnit t : translations) { + if (!usedUnits.contains(t)) { + messages.add(new ValidationMessage(Source.Publisher, IssueType.INFORMATIONAL, t.getId(), "Unused '"+t.getLanguage()+"' translation '"+t.getSrcText()+"' -> '"+t.getTgtText()+"'", IssueSeverity.INFORMATION)); + } + } + return r; + } + /* * */ @@ -224,6 +245,41 @@ public class LanguageUtils { return r; } + private int importResourceFromTranslations(Base parent, Base element, List translations, Set usedUnits, String path) { + int t = 0; + if (element.isPrimitive() && isTranslatable(element, path) && element instanceof org.hl7.fhir.r5.model.Element) { + org.hl7.fhir.r5.model.Element e = (org.hl7.fhir.r5.model.Element) element; + String base = element.primitiveValue(); + if (base != null) { + String epath = pathForElement(path, element.fhirType()); + Set tlist = findTranslations(epath, base, translations); + for (TranslationUnit translation : tlist) { + t++; + if (!handleAsSpecial(parent, element, translation)) { + ToolingExtensions.setLanguageTranslation(e, translation.getLanguage(), translation.getTgtText()); + usedUnits.add(translation); + } + } + } + } + for (Property c : element.children()) { + for (Base v : c.getValues()) { + if (!c.getName().equals("designation")) { + t = t + importResourceFromTranslations(element, v, translations, usedUnits, path+"."+c.getName()); + } + } + } + return t; + } + + private boolean handleAsSpecial(Base parent, Base element, TranslationUnit translation) { + return false; + } + + private boolean isTranslatable(Base element, String path) { + return Utilities.existsInList(element.fhirType(), "string", "markdown"); + } + private int importFromTranslations(Element parent, Element element, List translations, Set usedUnits) { int t = 0; if (element.isPrimitive() && isTranslatable(element)) { @@ -239,7 +295,7 @@ public class LanguageUtils { } } } - for (Element c: element.getChildren()) { + for (Element c : element.getChildren()) { if (!c.getName().equals("designation")) { t = t + importFromTranslations(element, c, translations, usedUnits); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java index 0231aee97..0c4b3eca2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java @@ -845,6 +845,26 @@ public class ToolingExtensions { element.getExtension().add(extension); } + public static void setLanguageTranslation(Element element, String lang, String value) { + if (Utilities.noString(lang) || Utilities.noString(value)) + return; + + for (Extension extension : element.getExtension()) { + if (EXT_TRANSLATION.equals(extension.getUrl())) { + String l = extension.getExtensionString("lang"); + if (lang.equals(l)) { + setStringExtension(extension, "content", value); + return; + } + } + } + + Extension extension = new Extension().setUrl(EXT_TRANSLATION); + extension.addExtension().setUrl("lang").setValue(new CodeType(lang)); + extension.addExtension().setUrl("content").setValue(new StringType(value)); + element.getExtension().add(extension); + } + public static boolean hasAllowedUnits(ElementDefinition eld) { for (Extension e : eld.getExtension()) if (e.getUrl().equals(EXT_ALLOWABLE_UNITS))