refactor language handling in R5 renderers

This commit is contained in:
Grahame Grieve 2024-03-22 22:49:31 +11:00
parent 53f484d11c
commit 02b6e80b6d
48 changed files with 560 additions and 389 deletions

View File

@ -70,6 +70,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -1281,7 +1282,7 @@ public class ProfileUtilities {
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder,
boolean inlineGraphics, boolean full, String corePath, Set<String> outputTracker)
throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML);
boolean deep = false;
@ -1566,7 +1567,7 @@ public class ProfileUtilities {
boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, Set<String> outputTracker)
throws IOException, FHIRException {
assert (diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false,
TableGenerationMode.XML);
List<ElementDefinition> list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement();

View File

@ -71,6 +71,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -1283,7 +1284,7 @@ public class ProfileUtilities {
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder,
boolean inlineGraphics, boolean full, String corePath, Set<String> outputTracker)
throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML);
boolean deep = false;
@ -1565,7 +1566,7 @@ public class ProfileUtilities {
boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, boolean logicalModel,
Set<String> outputTracker) throws IOException, FHIRException {
assert (diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false,
TableGenerationMode.XML);
List<ElementDefinition> list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement();

View File

@ -96,6 +96,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
@ -1620,8 +1621,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML);
boolean deep = false;
@ -1989,8 +1989,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath, boolean logicalModel, boolean allInvariants, Set<String> outputTracker) throws IOException, FHIRException {
assert(diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initNormalTable(corePath, false, true, profile.getId()+(diff ? "d" : "s"), false, TableGenerationMode.XML);
List<ElementDefinition> list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
@ -2005,8 +2004,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics);
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
@ -3482,8 +3480,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false);
TableModel model = initSpanningTable(gen, "", false, profile.getId());
Set<String> processed = new HashSet<String>();
SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix);

View File

@ -103,6 +103,7 @@ import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.TerminologyServiceOptions;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
@ -2386,8 +2387,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder,
boolean inlineGraphics, boolean full, String corePath, String imagePath, Set<String> outputTracker)
throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML);
boolean deep = false;
@ -2792,8 +2792,7 @@ public class ProfileUtilities extends TranslatingUtilities {
boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath,
boolean logicalModel, boolean allInvariants, Set<String> outputTracker) throws IOException, FHIRException {
assert (diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false,
TableGenerationMode.XML);
List<ElementDefinition> list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement();
@ -2817,8 +2816,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics,
String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker)
throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
@ -4969,8 +4967,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints,
String constraintPrefix, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false, true);
TableModel model = initSpanningTable(gen, "", false, profile.getId());
Set<String> processed = new HashSet<String>();
SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix);

View File

@ -19,6 +19,7 @@ import org.hl7.fhir.r4b.model.Coding;
import org.hl7.fhir.r4b.model.PrimitiveType;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -291,7 +292,7 @@ public abstract class CanonicalResourceComparer extends ResourceComparer {
public XhtmlNode renderMetadata(CanonicalResourceComparison<? extends CanonicalResource> comparison, String id,
String prefix) throws FHIRException, IOException {
// columns: code, display (left|right), properties (left|right)
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Name", "Property Name", null, 100));

View File

@ -34,6 +34,7 @@ import org.hl7.fhir.r4b.model.PrimitiveType;
import org.hl7.fhir.r4b.model.Resource;
import org.hl7.fhir.r4b.model.StructureDefinition;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -867,7 +868,7 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer {
// comments
public XhtmlNode renderStatements(CapabilityStatementComparison comparison, String id, String prefix)
throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Type", "The type of item", null, 100));

View File

@ -16,6 +16,7 @@ import org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent;
import org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent;
import org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -348,7 +349,7 @@ public class CodeSystemComparer extends CanonicalResourceComparer {
public XhtmlNode renderConcepts(CodeSystemComparison comparison, String id, String prefix)
throws FHIRException, IOException {
// columns: code, display (left|right), properties (left|right)
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Code", "The code for the concept", null, 100));

View File

@ -33,6 +33,7 @@ import org.hl7.fhir.r4b.model.ValueSet;
import org.hl7.fhir.r4b.utils.DefinitionNavigator;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
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;
@ -1027,8 +1028,7 @@ public class ProfileComparer extends CanonicalResourceComparer {
public XhtmlNode renderStructure(ProfileComparison comp, String id, String prefix, String corePath)
throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false, true);
gen.setTranslator(session.getContextRight().translator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false, true);
TableModel model = gen.initComparisonTable(corePath, id);
genElementComp(null /* oome back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null,
true);

View File

@ -19,6 +19,7 @@ import org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent;
import org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -577,7 +578,7 @@ public class ValueSetComparer extends CanonicalResourceComparer {
}
public XhtmlNode renderCompose(ValueSetComparison csc, String id, String prefix) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Item", "The type of item being compared", null, 100));
@ -778,7 +779,7 @@ public class ValueSetComparer extends CanonicalResourceComparer {
boolean hasAbstract = findAbstract(csc.getExpansion());
boolean hasInactive = findInactive(csc.getExpansion());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
if (hasSystem) {

View File

@ -121,6 +121,7 @@ import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
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.validation.ValidationMessage.IssueType;
@ -3874,8 +3875,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder,
boolean inlineGraphics, boolean full, String corePath, String imagePath, Set<String> outputTracker,
RenderingContext rc) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId() + (full ? "f" : "n"), true,
TableGenerationMode.XHTML);
@ -4443,8 +4443,7 @@ public class ProfileUtilities extends TranslatingUtilities {
boolean logicalModel, boolean allInvariants, Set<String> outputTracker, boolean active, boolean mustSupport,
RenderingContext rc) throws IOException, FHIRException {
assert (diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), active,
active ? TableGenerationMode.XHTML : TableGenerationMode.XML);
List<ElementDefinition> list = new ArrayList<>();
@ -4545,8 +4544,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics,
String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker)
throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true);
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
@ -7116,8 +7114,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints,
String constraintPrefix, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false, true);
TableModel model = initSpanningTable(gen, "", false, profile.getId());
Set<String> processed = new HashSet<String>();
SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix);

View File

@ -29,6 +29,7 @@ import org.hl7.fhir.r4b.renderers.utils.RenderingContext;
import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
import org.hl7.fhir.r4b.utils.ToolingExtensions;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
import org.hl7.fhir.utilities.xhtml.NodeType;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell;
@ -74,7 +75,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
if (doOpts) {
x.b().tx("Structure");
}
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(),
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(),
true);
TableModel model = gen.new TableModel("qtree=" + q.getId(), !forResource);
model.setAlternating(true);
@ -511,7 +512,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
}
private boolean renderLogic(XhtmlNode x, Questionnaire q) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(),
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(),
true);
TableModel model = gen.new TableModel("qtree=" + q.getId(), true);
model.setAlternating(true);

View File

@ -30,6 +30,7 @@ import org.hl7.fhir.r4b.renderers.utils.RenderingContext;
import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
import org.hl7.fhir.r4b.utils.ToolingExtensions;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
import org.hl7.fhir.utilities.xhtml.NodeType;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell;
@ -79,7 +80,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
}
public boolean renderTree(XhtmlNode x, ResourceWrapper qr) throws UnsupportedEncodingException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(),
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(),
true);
TableModel model = gen.new TableModel("qtree=" + qr.getId(), false);
model.setAlternating(true);
@ -107,7 +108,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
}
public boolean renderTree(XhtmlNode x, QuestionnaireResponse q) throws UnsupportedEncodingException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(),
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(),
true);
TableModel model = gen.new TableModel("qtree=" + q.getId(), true);
model.setAlternating(true);

View File

@ -19,6 +19,7 @@ import org.hl7.fhir.r5.model.DataType;
import org.hl7.fhir.r5.model.PrimitiveType;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -591,7 +592,7 @@ public abstract class CanonicalResourceComparer extends ResourceComparer {
public XhtmlNode renderMetadata(CanonicalResourceComparison<? extends CanonicalResource> comparison, String id, String prefix) throws FHIRException, IOException {
// columns: code, display (left|right), properties (left|right)
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Name", "Property Name", null, 100));

View File

@ -30,6 +30,7 @@ import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -742,7 +743,7 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer {
// 6 columns: path | left value | left doco | right value | right doco | comments
public XhtmlNode renderStatements(CapabilityStatementComparison comparison, String id, String prefix) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Type", "The type of item", null, 100));

View File

@ -17,6 +17,7 @@ import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent;
import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent;
import org.hl7.fhir.r5.model.CodeSystem.PropertyComponent;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -519,7 +520,7 @@ public class CodeSystemComparer extends CanonicalResourceComparer {
public XhtmlNode renderConcepts(CodeSystemComparison comparison, String id, String prefix) throws FHIRException, IOException {
// columns: code, display (left|right), properties (left|right)
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Code", "The code for the concept", null, 100));

View File

@ -42,6 +42,7 @@ 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.RenderingI18nContext;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
@ -1251,8 +1252,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(Utilities.path("[tmp]", "compare"), false, true);
gen.setTranslator(session.getContextRight().translator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), 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);

View File

@ -18,6 +18,7 @@ import org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent;
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome;
import org.hl7.fhir.utilities.Utilities;
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.validation.ValidationMessage.IssueType;
@ -588,7 +589,7 @@ public class ValueSetComparer extends CanonicalResourceComparer {
}
public XhtmlNode renderCompose(ValueSetComparison csc, String id, String prefix) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Item", "The type of item being compared", null, 100));
@ -779,7 +780,7 @@ public class ValueSetComparer extends CanonicalResourceComparer {
boolean hasAbstract = findAbstract(csc.getExpansion());
boolean hasInactive = findInactive(csc.getExpansion());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
if (hasSystem) {

View File

@ -171,6 +171,7 @@ public class ProfilePathProcessor {
ElementDefinition currentBase = cursors.base.getElement().get(cursors.baseCursor);
String currentBasePath = profileUtilities.fixedPathSource(getContextPathSource(), currentBase.getPath(), getRedirector());
debugProcessPathsIteration(cursors, currentBasePath);
checkDiffAssignedAndCursor(cursors);
List<ElementDefinition> diffMatches = profileUtilities.getDiffMatches(getDifferential(), currentBasePath, cursors.diffCursor, getDiffLimit(), getProfileName()); // get a list of matching elements in scope
// in the simple case, source is not sliced.
@ -195,6 +196,25 @@ public class ProfilePathProcessor {
return res;
}
private void checkDiffAssignedAndCursor(ProfilePathProcessorState cursors) {
// int i = 0;
// List<ElementDefinition> list = getDifferential().getElement();
// for (ElementDefinition ed : list) {
// boolean assigned = ed.hasUserData("derived.pointer");
// if (i < cursors.diffCursor) {
// if (!assigned) {
// throw new Error("what?");
// }
// } else if (i > cursors.diffCursor) {
// if (assigned) {
// throw new Error("what!?");
// }
// }
// i++;
// }
}
private void debugProcessPathsIteration(ProfilePathProcessorState cursors, String currentBasePath) {
if (profileUtilities.isDebug()) {
System.out.println(getDebugIndent() + " - " + currentBasePath + ": "+

View File

@ -99,7 +99,6 @@ import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome;
import org.hl7.fhir.r5.terminologies.utilities.ValidationResult;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.TranslatingUtilities;
import org.hl7.fhir.r5.utils.XVerExtensionManager;
import org.hl7.fhir.r5.utils.XVerExtensionManager.XVerExtensionStatus;
import org.hl7.fhir.r5.utils.formats.CSVWriter;
@ -136,7 +135,7 @@ import org.hl7.fhir.utilities.xml.SchematronWriter.Section;
* @author Grahame
*
*/
public class ProfileUtilities extends TranslatingUtilities {
public class ProfileUtilities {
private static boolean suppressIgnorableExceptions;

View File

@ -139,7 +139,6 @@ import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.TranslationServices;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.i18n.I18nBase;
@ -275,7 +274,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
private int expandCodesLimit = 1000;
protected ILoggingService logger = new SystemOutLoggingService();
protected Parameters expParameters;
private TranslationServices translator = new NullTranslator();
private Map<String, PackageInformation> packages = new HashMap<>();
@Getter
@ -310,7 +308,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
protected void copy(BaseWorkerContext other) {
synchronized (other.lock) { // tricky, because you need to lock this as well, but it's really not in use yet
allResourcesById.putAll(other.allResourcesById);
translator = other.translator;
codeSystems.copy(other.codeSystems);
valueSets.copy(other.valueSets);
maps.copy(other.maps);
@ -2640,55 +2637,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
}
public TranslationServices translator() {
return translator;
}
public void setTranslator(TranslationServices translator) {
this.translator = translator;
}
public class NullTranslator implements TranslationServices {
@Override
public String translate(String context, String value, String targetLang) {
return value;
}
@Override
public String translate(String context, String value) {
return value;
}
@Override
public String toStr(float value) {
return null;
}
@Override
public String toStr(Date value) {
return null;
}
@Override
public String translateAndFormat(String contest, String lang, String value, Object... args) {
return String.format(value, args);
}
@Override
public Map<String, String> translations(String value) {
// TODO Auto-generated method stub
return null;
}
@Override
public Set<String> listTranslations(String category) {
// TODO Auto-generated method stub
return null;
}
}
public void reportStatus(JsonObject json) {
synchronized (lock) {
json.addProperty("codeystem-count", codeSystems.size());

View File

@ -72,7 +72,6 @@ import org.hl7.fhir.r5.utils.validation.IResourceValidator;
import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.TranslationServices;
import org.hl7.fhir.utilities.npm.BasePackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.validation.ValidationMessage;
@ -388,6 +387,8 @@ public interface IWorkerContext {
/**
* Access to the contexts internationalised error messages
*
* For rendering internationalization, see RenderingContext
*
* @param theMessage
* @param theMessageArguments
@ -506,7 +507,6 @@ public interface IWorkerContext {
// todo: figure these out
public Map<String, NamingSystem> getNSUrlMap();
public TranslationServices translator();
public void setLogger(@Nonnull ILoggingService logger);
public ILoggingService getLogger();

View File

@ -68,7 +68,7 @@ public class BundleRenderer extends ResourceRenderer {
// nothing
} else {
XhtmlNode root = new XhtmlNode(NodeType.Element, "div");
root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue()));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue()));
int i = 0;
for (BaseWrapper be : entries) {
i++;
@ -85,9 +85,9 @@ public class BundleRenderer extends ResourceRenderer {
}
root.hr();
if (be.has("fullUrl")) {
root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue()));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue()));
} else {
root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i)));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i)));
}
// if (be.hasRequest())
// renderRequest(root, be.getRequest());
@ -96,7 +96,7 @@ public class BundleRenderer extends ResourceRenderer {
// if (be.hasResponse())
// renderResponse(root, be.getResponse());
if (be.has("resource")) {
root.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.get("resource").fhirType()));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESOURCE, be.get("resource").fhirType()));
ResourceWrapper rw = be.getChildByName("resource").getAsResource();
XhtmlNode xn = rw.getNarrative();
if (xn == null || xn.isEmpty()) {
@ -286,9 +286,9 @@ public class BundleRenderer extends ResourceRenderer {
start = 1;
docMode = true;
x.hr();
x.h2().addText(formatMessage(RENDER_BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode()));
x.h2().addText(formatMessage(RenderingContext.RENDER_BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode()));
} else {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode()));
}
int i = 0;
for (BundleEntryComponent be : b.getEntry()) {
@ -307,17 +307,17 @@ public class BundleRenderer extends ResourceRenderer {
x.hr();
if (docMode) {
if (be.hasFullUrl() && be.hasResource()) {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_URD, Integer.toString(i), be.getFullUrl(), be.getResource().fhirType(), be.getResource().getIdBase()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_DOC_ENTRY_URD, Integer.toString(i), be.getFullUrl(), be.getResource().fhirType(), be.getResource().getIdBase()));
} else if (be.hasFullUrl()) {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_U, Integer.toString(i), be.getFullUrl()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_DOC_ENTRY_U, Integer.toString(i), be.getFullUrl()));
} else if (be.hasResource()) {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_RD, Integer.toString(i), be.getResource().fhirType(), be.getResource().getIdBase()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_DOC_ENTRY_RD, Integer.toString(i), be.getResource().fhirType(), be.getResource().getIdBase()));
}
} else {
if (be.hasFullUrl()) {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl()));
} else {
x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i)));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i)));
}
if (be.hasRequest())
renderRequest(x, be.getRequest());
@ -328,7 +328,7 @@ public class BundleRenderer extends ResourceRenderer {
}
if (be.hasResource()) {
if (!docMode) {
x.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.getResource().fhirType()));
x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESOURCE, be.getResource().fhirType()));
}
if (be.hasResource()) {
XhtmlNode xn = null;
@ -401,42 +401,42 @@ public class BundleRenderer extends ResourceRenderer {
private void renderSearch(XhtmlNode root, BundleEntrySearchComponent search) {
StringBuilder b = new StringBuilder();
b.append(formatMessage(RENDER_BUNDLE_SEARCH));
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH));
if (search.hasMode())
b.append(formatMessage(RENDER_BUNDLE_SEARCH_MODE, search.getMode().toCode()));
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH_MODE, search.getMode().toCode()));
if (search.hasScore()) {
if (search.hasMode())
b.append(",");
b.append(formatMessage(RENDER_BUNDLE_SEARCH_SCORE, search.getScore()));
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH_SCORE, search.getScore()));
}
root.para().addText(b.toString());
}
private void renderResponse(XhtmlNode root, BundleEntryResponseComponent response) {
root.para().addText(formatMessage(RENDER_BUNDLE_RESPONSE));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESPONSE));
StringBuilder b = new StringBuilder();
b.append(response.getStatus()+"\r\n");
if (response.hasLocation())
b.append(formatMessage(RENDER_BUNDLE_LOCATION, response.getLocation())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_LOCATION, response.getLocation())+"\r\n");
if (response.hasEtag())
b.append(formatMessage(RENDER_BUNDLE_ETAG, response.getEtag())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_ETAG, response.getEtag())+"\r\n");
if (response.hasLastModified())
b.append(formatMessage(RENDER_BUNDLE_LAST_MOD, response.getEtag())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_LAST_MOD, response.getEtag())+"\r\n");
root.pre().addText(b.toString());
}
private void renderRequest(XhtmlNode root, BundleEntryRequestComponent request) {
root.para().addText(formatMessage(RENDER_BUNDLE_REQUEST));
root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_REQUEST));
StringBuilder b = new StringBuilder();
b.append(request.getMethod()+" "+request.getUrl()+"\r\n");
if (request.hasIfNoneMatch())
b.append(formatMessage(RENDER_BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n");
if (request.hasIfModifiedSince())
b.append(formatMessage(RENDER_BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n");
if (request.hasIfMatch())
b.append(formatMessage(RENDER_BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n");
if (request.hasIfNoneExist())
b.append(formatMessage(RENDER_BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n");
b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n");
root.pre().addText(b.toString());
}

View File

@ -82,13 +82,13 @@ public class CodeSystemRenderer extends TerminologyRenderer {
private void generateFilters(XhtmlNode x, CodeSystem cs) {
if (cs.hasFilter()) {
x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Filters", getContext().getLang()));
x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTERS));
XhtmlNode tbl = x.table("grid");
XhtmlNode tr = tbl.tr();
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang()));
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Description", getContext().getLang()));
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "operator", getContext().getLang()));
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Value", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_CODE));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_DESC));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_OP));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_VALUE));
for (CodeSystemFilterComponent f : cs.getFilter()) {
tr = tbl.tr();
renderStatus(f, tr.td()).tx(f.getCode());
@ -112,20 +112,20 @@ public class CodeSystemRenderer extends TerminologyRenderer {
hasDescription = hasDescription || p.hasDescription();
}
x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Properties", getContext().getLang()));
x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "This code system defines the following properties for its concepts", getContext().getLang()));
x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROPS));
x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROPS_DESC));
XhtmlNode tbl = x.table("grid");
XhtmlNode tr = tbl.tr();
if (hasRendered) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Name", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_NAME));
}
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_CODE));
if (hasURI) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "URI", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_URI));
}
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Type", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_TYPE));
if (hasDescription) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Description", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_DESC));
}
for (PropertyComponent p : cs.getProperty()) {
tr = tbl.tr();
@ -149,10 +149,10 @@ public class CodeSystemRenderer extends TerminologyRenderer {
private String sentenceForContent(CodeSystemContentMode mode, CodeSystem cs) {
switch (mode) {
case COMPLETE: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_COMPLETE);
case EXAMPLE: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_EXAMPLE);
case FRAGMENT: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_FRAGMENT);
case NOTPRESENT: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_NOTPRESENT);
case COMPLETE: return formatMessage(I18nConstants.RND_CS_CONTENT_COMPLETE);
case EXAMPLE: return formatMessage(I18nConstants.RND_CS_CONTENT_EXAMPLE);
case FRAGMENT: return formatMessage(I18nConstants.RND_CS_CONTENT_FRAGMENT);
case NOTPRESENT: return formatMessage(I18nConstants.RND_CS_CONTENT_NOTPRESENT);
case SUPPLEMENT:
boolean properties = CodeSystemUtilities.hasProperties(cs);
boolean designations = CodeSystemUtilities.hasDesignations(cs);
@ -166,7 +166,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
} else {
features = "features"; // ?
}
return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_SUPPLEMENT, features);
return formatMessage(I18nConstants.RND_CS_CONTENT_SUPPLEMENT, features);
default:
throw new FHIRException("Unknown CodeSystemContentMode mode");
}
@ -174,7 +174,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
private boolean generateCodeSystemContent(XhtmlNode x, CodeSystem cs, boolean hasExtensions, List<UsedConceptMap> maps, boolean props) throws FHIRFormatError, DefinitionException, IOException {
if (props) {
x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Concepts", getContext().getLang()));
x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_CONCEPTS));
}
XhtmlNode p = x.para();
renderStatus(cs.getUrlElement(), p.param("cs")).code().tx(cs.getUrl());
@ -463,7 +463,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
td = tr.td();
Boolean b = CodeSystemUtilities.isDeprecated(cs, c, false);
if (b != null && b) {
smartAddText(td, getContext().getWorker().translator().translate("xhtml-gen-cs", "Deprecated", getContext().getLang()));
smartAddText(td, formatMessage(RenderingContext.RENDER_CODESYSTEM_DEPRECATED));
hasExtensions = true;
if (ToolingExtensions.hasExtension(c, ToolingExtensions.EXT_REPLACED_BY)) {
Coding cc = (Coding) ToolingExtensions.getExtension(c, ToolingExtensions.EXT_REPLACED_BY).getValue();

View File

@ -70,7 +70,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
if (doOpts) {
x.b().tx("Structure");
}
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
TableModel model = gen.new TableModel("qtree="+q.getId(), context.getRules() == GenerationRules.IG_PUBLISHER);
model.setAlternating(true);
if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) {
@ -460,7 +460,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
}
private boolean renderLogic(XhtmlNode x, Questionnaire q) throws FHIRException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
TableModel model = gen.new TableModel("qtree="+q.getId(), true);
model.setAlternating(true);
if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) {

View File

@ -62,7 +62,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
}
public boolean renderTree(XhtmlNode x, ResourceWrapper qr) throws UnsupportedEncodingException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
TableModel model = gen.new TableModel("qtree="+qr.getId(), false);
model.setAlternating(true);
if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) {
@ -89,7 +89,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
}
public boolean renderTree(XhtmlNode x, QuestionnaireResponse q) throws UnsupportedEncodingException, IOException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
TableModel model = gen.new TableModel("qtree="+q.getId(), true);
model.setAlternating(true);
if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) {

View File

@ -1,13 +1,15 @@
package org.hl7.fhir.r5.renderers;
import java.util.Date;
import org.hl7.fhir.r5.comparison.VersionComparisonAnnotation;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.renderers.utils.RenderingContext;
import org.hl7.fhir.r5.renderers.utils.RenderingContext.GenerationRules;
import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType;
import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode;
import org.hl7.fhir.r5.utils.TranslatingUtilities;
import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.StandardsStatus;
import org.hl7.fhir.utilities.Utilities;
@ -33,7 +35,7 @@ import org.hl7.fhir.utilities.xhtml.XhtmlNode;
* @author graha
*
*/
public class Renderer extends TranslatingUtilities {
public class Renderer {
protected RenderingContext context;
@ -46,36 +48,8 @@ public class Renderer extends TranslatingUtilities {
}
protected static final String RENDER_BUNDLE_HEADER_ROOT = "RENDER_BUNDLE_HEADER_ROOT";
protected static final String RENDER_BUNDLE_HEADER_ENTRY = "RENDER_BUNDLE_HEADER_ENTRY";
protected static final String RENDER_BUNDLE_HEADER_ENTRY_URL = "RENDER_BUNDLE_HEADER_ENTRY_URL";
protected static final String RENDER_BUNDLE_RESOURCE = "RENDER_BUNDLE_RESOURCE";
protected static final String RENDER_BUNDLE_SEARCH = "RENDER_BUNDLE_SEARCH";
protected static final String RENDER_BUNDLE_SEARCH_MODE = "RENDER_BUNDLE_SEARCH_MODE";
protected static final String RENDER_BUNDLE_SEARCH_SCORE = "RENDER_BUNDLE_SEARCH_SCORE";
protected static final String RENDER_BUNDLE_RESPONSE = "RENDER_BUNDLE_RESPONSE";
protected static final String RENDER_BUNDLE_LOCATION = "RENDER_BUNDLE_LOCATION";
protected static final String RENDER_BUNDLE_ETAG = "RENDER_BUNDLE_ETAG";
protected static final String RENDER_BUNDLE_LAST_MOD = "RENDER_BUNDLE_LAST_MOD";
protected static final String RENDER_BUNDLE_REQUEST = "RENDER_BUNDLE_REQUEST";
protected static final String RENDER_BUNDLE_IF_NON_MATCH = "RENDER_BUNDLE_IF_NON_MATCH";
protected static final String RENDER_BUNDLE_IF_MOD = "RENDER_BUNDLE_IF_MOD";
protected static final String RENDER_BUNDLE_IF_MATCH = "RENDER_BUNDLE_IF_MATCH";
protected static final String RENDER_BUNDLE_IF_NONE = "RENDER_BUNDLE_IF_NONE";
protected static final String RENDER_BUNDLE_DOCUMENT_CONTENT = "RENDER_BUNDLE_DOCUMENT_CONTENT";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_URD";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_U = "RENDER_BUNDLE_HEADER_DOC_ENTRY_U";
protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_RD";
/** the plan here is to make this have it's own implementation of messages, rather than using the
* validator messages, for better alignment with publisher I18n strategy
*
* @param theMessage
* @param theMessageArguments
* @return
*/
protected String formatMessage(String theMessage, Object... theMessageArguments) {
return context.getWorker().formatMessage(theMessage, theMessageArguments);
return context.formatMessage(theMessage, theMessageArguments);
}
public void genStandardsStatus(XhtmlNode td, StandardsStatus ss) {
@ -227,4 +201,20 @@ public class Renderer extends TranslatingUtilities {
}
}
public String egt(@SuppressWarnings("rawtypes") Enumeration<? extends Enum> value) {
if (value == null || !value.hasPrimitiveValue()) {
return null;
} else {
return (value == null || !value.hasPrimitiveValue()) ? null : value.asStringValue();
}
}
public String toStr(int value) {
return Integer.toString(value);
}
public String toStr(Date value) {
return value.toString();
}
}

View File

@ -525,7 +525,7 @@ public abstract class ResourceRenderer extends DataRenderer {
protected void generateCopyright(XhtmlNode x, CanonicalResource cs) {
XhtmlNode p = x.para();
p.b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Copyright Statement:", context.getLang()));
p.b().tx(getContext().formatMessage(RenderingContext.RENDER_RESOURCE_COPYRIGHT));
smartAddText(p, " " + cs.getCopyright());
}

View File

@ -509,8 +509,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true);
TableModel model = gen.initGridTable(corePath, profile.getId());
List<ElementDefinition> list = profile.getSnapshot().getElement();
List<StructureDefinition> profiles = new ArrayList<StructureDefinition>();
@ -549,8 +548,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath,
boolean logicalModel, boolean allInvariants, Set<String> outputTracker, boolean mustSupport, RenderingContext rc, String anchorPrefix) throws IOException, FHIRException {
assert(diff != snapshot);// check it's ok to get rid of one of these
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true);
List<ElementDefinition> list;
if (diff)
@ -1767,13 +1765,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
if (e.hasContentReference()) {
ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference(), profile);
if (ed == null)
c.getPieces().add(gen.new Piece(null, translate("sd.table", "Unknown reference to %s", e.getContentReference()), null));
c.getPieces().add(gen.new Piece(null, "Unknown reference to "+ e.getContentReference(), null));
else {
if (ed.getSource() == profile) {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null));
c.getPieces().add(gen.new Piece(null, "See ", null));
c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), tail(ed.getElement().getPath()), ed.getElement().getPath()));
} else {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null));
c.getPieces().add(gen.new Piece(null, "See ", null));
c.getPieces().add(gen.new Piece(pfx(corePath, ed.getSource().getWebPath())+"#"+ed.getElement().getPath(), tail(ed.getElement().getPath())+" ("+ed.getSource().getTypeName()+")", ed.getElement().getPath()));
}
}
@ -2741,7 +2739,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
private String describeSlice(ElementDefinitionSlicingComponent slicing) {
return translate("sd.table", "%s, %s by %s", slicing.getOrdered() ? translate("sd.table", "Ordered") : translate("sd.table", "Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator()));
return formatMessage("%s, %s by %s", slicing.getOrdered() ? translate("sd.table", "Ordered") : translate("sd.table", "Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator()));
}
@ -2928,8 +2926,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set<String> outputTracker) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, false, true);
TableModel model = initSpanningTable(gen, "", false, profile.getId());
Set<String> processed = new HashSet<String>();
SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix);
@ -3033,8 +3030,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set<String> outputTracker, RenderingContext rc) throws IOException, FHIRException {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true);
gen.setTranslator(getTranslator());
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true);
TableModel model = gen.initNormalTable(corePath, false, true, ed.getId()+(full ? "f" : "n"), true, TableGenerationMode.XHTML);
boolean deep = false;

View File

@ -211,21 +211,21 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
if (hasHierarchy) {
tr.td().b().tx("Lvl");
}
tr.td().attribute("style", "white-space:nowrap").b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang()));
tr.td().attribute("style", "white-space:nowrap").b().tx(formatMessage(RenderingContext.RENDER_TX_CODE));
if (hasDisplay) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Display", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DISPLAY));
}
if (definitions) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Definition", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DEFINITION));
}
if (deprecated) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Deprecated", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DEPRECATED));
}
if (comments) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Comments", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_COMMENTS));
}
if (version) {
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Version", getContext().getLang()));
tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_VERSION));
}
if (properties != null) {
for (PropertyComponent pc : properties) {
@ -236,7 +236,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
display = pc.getCode();
}
}
tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", display, getContext().getLang()));
tr.td().b().tx(display);
}
}
if (doDesignations) {

View File

@ -1030,7 +1030,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
}
x.br();
x.tx(s);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true);
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true);
TableModel model = gen.new TableModel("exp.h="+index, context.getRules() == GenerationRules.IG_PUBLISHER);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("vs.exp.header", "Code"), translate("vs.exp.hint", "The code for the item"), null, 0));

View File

@ -24,9 +24,10 @@ import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
import org.hl7.fhir.utilities.StandardsStatus;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
import org.hl7.fhir.utilities.validation.ValidationOptions;
public class RenderingContext {
public class RenderingContext extends RenderingI18nContext {
// provides liquid templates, if they are available for the content
public interface ILiquidTemplateProvider {
@ -538,9 +539,8 @@ public class RenderingContext {
}
}
public RenderingContext setLocale(Locale locale) {
public void setLocale(Locale locale) {
this.locale = locale;
return this;
}

View File

@ -1,62 +0,0 @@
package org.hl7.fhir.r5.utils;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.PrimitiveType;
public class TranslatingUtilities extends org.hl7.fhir.utilities.TranslatingUtilities {
public interface TranslationServices extends org.hl7.fhir.utilities.TranslationServices {
String gt(@SuppressWarnings("rawtypes") PrimitiveType value);
String egt(@SuppressWarnings("rawtypes") Enumeration<? extends Enum> value);
}
public String gt(@SuppressWarnings("rawtypes") PrimitiveType value) {
if (value == null || !value.hasPrimitiveValue()) {
return null;
} else {
return hasTranslator() ? ((TranslationServices) getTranslator()).gt(value) : value.asStringValue();
}
}
public String egt(@SuppressWarnings("rawtypes") Enumeration<? extends Enum> value) {
if (value == null || !value.hasPrimitiveValue()) {
return null;
} else {
return (value == null || !value.hasPrimitiveValue()) ? null : hasTranslator() ? ((TranslationServices) getTranslator()).egt(value) : value.asStringValue();
}
}
}

View File

@ -21,7 +21,7 @@ public abstract class I18nBase {
public static final String PLURAL_SUFFIX = "PLURAL";
public static final String KEY_DELIMITER = "_";
private Locale locale;
private ResourceBundle i18nMessages;
private ResourceBundle messages;
private PluralRules pluralRules;
private boolean warnAboutMissingMessages = true;
@ -42,7 +42,7 @@ public abstract class I18nBase {
* Verifies if a {@link ResourceBundle} has been loaded for the current {@link Locale}. If not, it triggers a load.
*/
private void checkResourceBundleIsLoaded() {
if (i18nMessages == null) {
if (messages == null) {
setValidationMessageLanguage(getLocale());
}
}
@ -74,7 +74,7 @@ public abstract class I18nBase {
}
protected boolean messageKeyExistsForLocale(String message) {
return i18nMessages.containsKey(message);
return messages.containsKey(message);
}
@ -113,9 +113,9 @@ public abstract class I18nBase {
String message = theMessage;
if (messageExistsForLocale(theMessage, (theMessageArguments != null && theMessageArguments.length > 0))) {
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
message = MessageFormat.format(i18nMessages.getString(theMessage).trim(), theMessageArguments);
message = MessageFormat.format(messages.getString(theMessage).trim(), theMessageArguments);
} else {
message = i18nMessages.getString(theMessage).trim();
message = messages.getString(theMessage).trim();
}
}
return message;
@ -152,7 +152,11 @@ public abstract class I18nBase {
* @param locale {@link Locale} to load resources for.
*/
public void setValidationMessageLanguage(Locale locale) {
i18nMessages = ResourceBundle.getBundle("Messages", locale);
messages = ResourceBundle.getBundle(getMessagesSourceFileName(), locale);
}
protected String getMessagesSourceFileName() {
return "Messages";
}
public void setPluralRules(Locale locale) {

View File

@ -0,0 +1,99 @@
package org.hl7.fhir.utilities.i18n;
public class RenderingI18nContext extends I18nBase {
public static final String RENDER_BUNDLE_HEADER_ROOT = "RENDER_BUNDLE_HEADER_ROOT";
public static final String RENDER_BUNDLE_HEADER_ENTRY = "RENDER_BUNDLE_HEADER_ENTRY";
public static final String RENDER_BUNDLE_HEADER_ENTRY_URL = "RENDER_BUNDLE_HEADER_ENTRY_URL";
public static final String RENDER_BUNDLE_RESOURCE = "RENDER_BUNDLE_RESOURCE";
public static final String RENDER_BUNDLE_SEARCH = "RENDER_BUNDLE_SEARCH";
public static final String RENDER_BUNDLE_SEARCH_MODE = "RENDER_BUNDLE_SEARCH_MODE";
public static final String RENDER_BUNDLE_SEARCH_SCORE = "RENDER_BUNDLE_SEARCH_SCORE";
public static final String RENDER_BUNDLE_RESPONSE = "RENDER_BUNDLE_RESPONSE";
public static final String RENDER_BUNDLE_LOCATION = "RENDER_BUNDLE_LOCATION";
public static final String RENDER_BUNDLE_ETAG = "RENDER_BUNDLE_ETAG";
public static final String RENDER_BUNDLE_LAST_MOD = "RENDER_BUNDLE_LAST_MOD";
public static final String RENDER_BUNDLE_REQUEST = "RENDER_BUNDLE_REQUEST";
public static final String RENDER_BUNDLE_IF_NON_MATCH = "RENDER_BUNDLE_IF_NON_MATCH";
public static final String RENDER_BUNDLE_IF_MOD = "RENDER_BUNDLE_IF_MOD";
public static final String RENDER_BUNDLE_IF_MATCH = "RENDER_BUNDLE_IF_MATCH";
public static final String RENDER_BUNDLE_IF_NONE = "RENDER_BUNDLE_IF_NONE";
public static final String RENDER_BUNDLE_DOCUMENT_CONTENT = "RENDER_BUNDLE_DOCUMENT_CONTENT";
public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_URD";
public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_U = "RENDER_BUNDLE_HEADER_DOC_ENTRY_U";
public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_RD";
public static final String SD_HEAD_NAME = "SD_HEAD_NAME";
public static final String SD_HEAD_NAME_DESC = "SD_HEAD_NAME_DESC";
public static final String SD_HEAD_FLAGS = "SD_HEAD_FLAGS";
public static final String SD_HEAD_FLAGS_DESC = "SD_HEAD_FLAGS_DESC";
public static final String SD_HEAD_CARD = "SD_HEAD_CARD";
public static final String SD_HEAD_CARD_DESC = "SD_HEAD_CARD_DESC";
public static final String SD_HEAD_TYPE = "SD_HEAD_TYPE";
public static final String SD_HEAD_TYPE_DESC = "SD_HEAD_TYPE_DESC";
public static final String SD_HEAD_DESC = "SD_HEAD_DESC";
public static final String SD_HEAD_DESC_DESC = "SD_HEAD_DESC_DESC";
public static final String SD_COMP_HEAD_NAME = "SD_COMP_HEAD_NAME";
public static final String SD_COMP_HEAD_NAME_DESC = "SD_COMP_HEAD_NAME_DESC";
public static final String SD_COMP_HEAD_FLAGS_L = "SD_COMP_HEAD_FLAGS_L";
public static final String SD_COMP_HEAD_FLAGS_L_DESC ="SD_COMP_HEAD_FLAGS_L_DESC";
public static final String SD_COMP_HEAD_CARD_L = "SD_COMP_HEAD_CARD_L";
public static final String SD_COMP_HEAD_CARD_L_DESC ="SD_COMP_HEAD_CARD_L_DESC";
public static final String SD_COMP_HEAD_TYPE_L = "SD_COMP_HEAD_TYPE_L";
public static final String SD_COMP_HEAD_TYPE_L_DESC ="SD_COMP_HEAD_TYPE_L_DESC";
public static final String SD_COMP_HEAD_DESC_L = "SD_COMP_HEAD_DESC_L";
public static final String SD_COMP_HEAD_DESC_L_DESC ="SD_COMP_HEAD_DESC_L_DESC";
public static final String SD_COMP_HEAD_FLAGS_R = "SD_COMP_HEAD_FLAGS_R";
public static final String SD_COMP_HEAD_FLAGS_R_DESC ="SD_COMP_HEAD_FLAGS_R_DESC";
public static final String SD_COMP_HEAD_CARD_R = "SD_COMP_HEAD_CARD_R";
public static final String SD_COMP_HEAD_CARD_R_DESC ="SD_COMP_HEAD_CARD_R_DESC";
public static final String SD_COMP_HEAD_TYPE_R = "SD_COMP_HEAD_TYPE_R";
public static final String SD_COMP_HEAD_TYPE_R_DESC ="SD_COMP_HEAD_TYPE_R_DESC";
public static final String SD_COMP_HEAD_DESC_R = "SD_COMP_HEAD_DESC_R";
public static final String SD_COMP_HEAD_DESC_R_DESC ="SD_COMP_HEAD_DESC_R_DESC";
public static final String SD_COMP_HEAD_COMP = "SD_COMP_HEAD_COMP";
public static final String SD_COMP_HEAD_COMP_DESC = "SD_COMP_HEAD_COMP_DESC";
public static final String SD_GRID_HEAD_NAME = "SD_GRID_HEAD_NAME";
public static final String SD_GRID_HEAD_NAME_DESC = "SD_GRID_HEAD_NAME_DESC";
public static final String SD_GRID_HEAD_CARD = "SD_GRID_HEAD_CARD";
public static final String SD_GRID_HEAD_CARD_DESC = "SD_GRID_HEAD_CARD_DESC";
public static final String SD_GRID_HEAD_TYPE = "SD_GRID_HEAD_TYPE";
public static final String SD_GRID_HEAD_TYPE_DESC = "SD_GRID_HEAD_TYPE_DESC";
public static final String SD_GRID_HEAD_DESC = "SD_GRID_HEAD_DESC";
public static final String SD_GRID_HEAD_DESC_DESC = "SD_GRID_HEAD_DESC_DESC";
public static final String SD_LEGEND = "SD_LEGEND";
public static final String SD_DOCO = "SD_DOCO";
public static final String RENDER_RESOURCE_COPYRIGHT = "RENDER_RESOURCE_COPYRIGHT";
public static final String RENDER_CODESYSTEM_FILTERS = "RENDER_CODESYSTEM_FILTERS";
public static final String RENDER_CODESYSTEM_FILTER_CODE = "RENDER_CODESYSTEM_FILTER_CODE";
public static final String RENDER_CODESYSTEM_FILTER_DESC = "RENDER_CODESYSTEM_FILTER_DESC";
public static final String RENDER_CODESYSTEM_FILTER_OP = "RENDER_CODESYSTEM_FILTER_OP";
public static final String RENDER_CODESYSTEM_FILTER_VALUE = "RENDER_CODESYSTEM_FILTER_VALUE";
public static final String RENDER_CODESYSTEM_PROPS = "RENDER_CODESYSTEM_PROPS";
public static final String RENDER_CODESYSTEM_PROPS_DESC = "RENDER_CODESYSTEM_PROPS_DESC";
public static final String RENDER_CODESYSTEM_PROP_NAME = "RENDER_CODESYSTEM_PROP_NAME";
public static final String RENDER_CODESYSTEM_PROP_CODE = "RENDER_CODESYSTEM_PROP_CODE";
public static final String RENDER_CODESYSTEM_PROP_URI = "RENDER_CODESYSTEM_PROP_CODE";
public static final String RENDER_CODESYSTEM_PROP_TYPE = "RENDER_CODESYSTEM_PROP_CODE";
public static final String RENDER_CODESYSTEM_PROP_DESC = "RENDER_CODESYSTEM_PROP_DESC";
public static final String RENDER_CODESYSTEM_CONCEPTS = "RENDER_CODESYSTEM_CONCEPTS";
public static final String RENDER_CODESYSTEM_DEPRECATED = "RENDER_CODESYSTEM_DEPRECATED";
public static final String RENDER_TX_CODE = "RENDER_TX_CODE";
public static final String RENDER_TX_DISPLAY = "RENDER_TX_DISPLAY";
public static final String RENDER_TX_DEFINITION = "RENDER_TX_DEFINITION";
public static final String RENDER_TX_DEPRECATED = "RENDER_TX_DEPRECATED";
public static final String RENDER_TX_COMMENTS = "RENDER_TX_COMMENTS";
public static final String RENDER_TX_VERSION = "RENDER_TX_VERSION";
protected String getMessagesSourceFileName() {
return "rendering-phrases";
}
}

View File

@ -85,11 +85,11 @@ import org.commonmark.renderer.html.HtmlRenderer;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.TranslatingUtilities;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.i18n.RenderingI18nContext;
public class HierarchicalTableGenerator extends TranslatingUtilities {
public class HierarchicalTableGenerator {
public enum TableGenerationMode {
XML, XHTML
}
@ -626,13 +626,16 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
private boolean inLineGraphics;
private TableGenerationMode mode;
private RenderingI18nContext i18n;
public HierarchicalTableGenerator() {
public HierarchicalTableGenerator(RenderingI18nContext i18n) {
super();
this.i18n = i18n;
}
public HierarchicalTableGenerator(String dest, boolean inlineGraphics) {
public HierarchicalTableGenerator(RenderingI18nContext i18n, String dest, boolean inlineGraphics) {
super();
this.i18n = i18n;
this.dest = dest;
this.inLineGraphics = inlineGraphics;
this.makeTargets = true;
@ -646,8 +649,9 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
}
public HierarchicalTableGenerator(String dest, boolean inlineGraphics, boolean makeTargets) {
public HierarchicalTableGenerator(RenderingI18nContext i18n, String dest, boolean inlineGraphics, boolean makeTargets) {
super();
this.i18n = i18n;
this.dest = dest;
this.inLineGraphics = inlineGraphics;
this.makeTargets = makeTargets;
@ -666,11 +670,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
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(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Flags"), translate("sd.hint", "Information about the use of the element"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "Reference to the type of the element"), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the element"), null, 0));
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));
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));
}
@ -687,16 +691,16 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
model.setDocoImg(Utilities.pathURL(prefix, "help16.png"));
}
model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table"));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Flags"), translate("sd.hint", "Information about the use of the element - Left Structure"), null, 0).setStyle("border-left: 1px grey solid"));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance - Left Structure"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Type"), translate("sd.hint", "Reference to the type of the element - Left Structure"), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Description & Constraints"), translate("sd.hint", "Additional information about the element - Left Structure"), null, 0).setStyle("border-right: 1px grey solid"));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "R Flags"), translate("sd.hint", "Information about the use of the element - Left Structure"), null, 0).setStyle("border-left: 1px grey solid"));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "R Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance - Left Structure"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Type"), translate("sd.hint", "Reference to the type of the element - Left Structure"), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Description & Constraints"), translate("sd.hint", "Additional information about the element - Left Structure"), null, 0).setStyle("border-right: 1px grey solid"));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Comments"), translate("sd.hint", "Comments about the comparison"), null, 0));
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));
return model;
}
@ -704,11 +708,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
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(), translate("sd.head", "Name"), translate("sd.hint", "The name of the element (Slice name in brackets). Mouse-over provides definition"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance. Super-scripts indicate additional constraints on appearance"), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "Reference to the type of the element"), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Constraints and Usage"), translate("sd.hint", "Fixed values, length limits, vocabulary bindings and other usage notes"), null, 0));
return model;
}
@ -750,10 +754,10 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
tc.setAttribute("class", "hierarchy");
tc.setAttribute("colspan", Integer.toString(model.getTitles().size()));
tc.addTag("br");
XhtmlNode a = tc.addTag("a").setAttribute("title", translate("sd.doco", "Legend for this format")).setAttribute("href", model.getDocoRef());
XhtmlNode a = tc.addTag("a").setAttribute("title", i18n.formatMessage(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(" "+translate("sd.doco", "Documentation for this format"));
a.addText(" "+i18n.formatMessage(RenderingI18nContext.SD_DOCO));
}
return table;
}

View File

@ -1043,4 +1043,51 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
}
public int compareTo(XhtmlNode other) {
return compare(this, other);
}
private static int compare(XhtmlNode base, XhtmlNode other) {
if (base == null || other == null) {
return 0;
} else if (base.getNodeType() != other.getNodeType()) {
return base.getNodeType().ordinal() - other.getNodeType().ordinal();
} else switch (base.getNodeType()) {
case Comment: return base.getContent().compareTo(other.getContent());
case DocType: return 0;
case Element:
int r = base.getName().compareTo(other.getName());
if (r != 0) {
return r;
}
case Document:
if (base.getAttributes().size() != other.getAttributes().size()) {
return base.getAttributes().size() - other.getAttributes().size();
} else {
for (String n : base.getAttributes().keySet()) {
String vb = base.getAttributes().get(n);
String vo = other.getAttributes().get(n);
r = vo == null ? -1 : vb.compareTo(vo);
if (r != 0) {
return r;
}
}
}
if (base.getChildNodes().size() != other.getChildNodes().size()) {
return base.getChildNodes().size() - other.getChildNodes().size();
} else {
for (int i = 0; i < base.getChildNodes().size(); i++) {
r = compare(base, other);
if (r != 0) {
return r;
}
}
}
return 0;
case Instruction: return 0;
case Text: return base.getContent().compareTo(other.getContent());
default: return 0;
}
}
}

View File

@ -663,22 +663,6 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} must have a derivation, since
VALIDATION_VAL_PROFILE_OTHER_VERSION = Profile is for a different version of FHIR ({0}) so has been ignored
VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profile for this version of FHIR - all OK
VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profile is for this version of FHIR, but is an invalid type {0}
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} of type {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Search:
RENDER_BUNDLE_SEARCH_MODE = Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = Score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
BUNDLE_RULE_NONE = No Rule
BUNDLE_RULE_UNKNOWN = Bundle Rule refers to invalid resource {0}
BUNDLE_RULE_INVALID_INDEX = Bundle Rules index is invalid ({0})
@ -961,11 +945,6 @@ SD_OBGLIGATION_INHERITS_PROFILE_NO_TARGET = Unable to read a value from this ext
SD_OBGLIGATION_INHERITS_PROFILE_TARGET_NOT_FOUND = The profile ''{0}'' could not be found
SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_TYPE = The profile ''{0}'' is not marked as an obligation profile
SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_BASE = The profile ''{0}'' has a different base ''{1}'' from that expected ''{2}''
RND_CS_CONTENT_COMPLETE = This <param name="cased"/> code system <param name="cs"/> defines the following code<if test="code-count != 1">s</if><param name="h"/>:
RND_CS_CONTENT_EXAMPLE = This <param name="cased"/> code system <param name="cs"/> provides some code<if test="code-count != 1">s</if><param name="h"/> <b>that are example only</b>:
RND_CS_CONTENT_FRAGMENT = This <param name="cased"/> code system <param name="cs"/> provides <b>a fragment</b> that includes following code<if test="code-count != 1">s</if><param name="h"/>:
RND_CS_CONTENT_NOTPRESENT = This <param name="cased"/> code system <param name="cs"/> defines codes<param name="h"/>, but no codes are represented here
RND_CS_CONTENT_SUPPLEMENT = This code system <param name="cs"/> defines {0} on the following code<if test="code-count != 1">s</if>:
QUESTIONNAIRE_Q_UNKNOWN_DERIVATION = The questionnaire ''{0}'' referred to in the derivation could not be found
QUESTIONNAIRE_Q_NO_DERIVATION_TYPE = The questionnaire ''{0}'' has no derivation type specified using the ''http://hl7.org/fhir/StructureDefinition/questionnaire-derivationType'' extension, so derivation has not been checked
QUESTIONNAIRE_Q_NO_DERIVATION_TYPE_VALUE = The derivation extension has no value

View File

@ -702,22 +702,6 @@ SD_MUST_HAVE_DERIVATION=StructureDefinition {0} muss eine Ableitung haben, da si
VALIDATION_VAL_PROFILE_OTHER_VERSION=Profil ist f\u00fcr eine andere Version von FHIR ({0}) und wurde daher ignoriert
VALIDATION_VAL_PROFILE_THIS_VERSION_OK=Profil f\u00fcr diese Version von FHIR - alles OK
VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER=Profil ist f\u00fcr diese Version von FHIR, aber ist ein ung\u00fcltiger Typ {0}
RENDER_BUNDLE_HEADER_ROOT=Bundle {0} vom Typ {1}
RENDER_BUNDLE_HEADER_ENTRY=Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL=Entry {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE=Ressource {0}:
RENDER_BUNDLE_SEARCH=Suche:
RENDER_BUNDLE_SEARCH_MODE=Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE=Score = {0}
RENDER_BUNDLE_RESPONSE=Response:
RENDER_BUNDLE_LOCATION=Location = {0}
RENDER_BUNDLE_ETAG=ETag = {0}
RENDER_BUNDLE_LAST_MOD=LastModified = {0}
RENDER_BUNDLE_REQUEST=Request:
RENDER_BUNDLE_IF_NON_MATCH=If-None-Match = {0}
RENDER_BUNDLE_IF_MOD=If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH=If-Match = {0}
RENDER_BUNDLE_IF_NONE=If-None-Exist = {0}
BUNDLE_RULE_NONE=Keine Regel
BUNDLE_RULE_UNKNOWN=Bundle Rule verweist auf ung\u00fcltige Ressource {0}
BUNDLE_RULE_INVALID_INDEX=Bundle Rules Index ist ung\u00fcltig ({0})

View File

@ -654,22 +654,6 @@ SD_MUST_HAVE_DERIVATION = El recurso StructureDefinition {0} debe tener una deri
VALIDATION_VAL_PROFILE_OTHER_VERSION = El perfil es para una versión diferente de FHIR ({0}) así que fue ignorado
VALIDATION_VAL_PROFILE_THIS_VERSION_OK = El perfil es para esta versión de FHIR- Todo OK
VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = El perfil es para esta versión de FHIR, pero es de tipo inválido {0}
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} De tipo {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - FullURL = {1}
RENDER_BUNDLE_RESOURCE = Recurso {0}:
RENDER_BUNDLE_SEARCH = Búsqueda:
RENDER_BUNDLE_SEARCH_MODE = mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = score = {0}
RENDER_BUNDLE_RESPONSE = Respuesta:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
BUNDLE_RULE_NONE = Sin reglas
BUNDLE_RULE_UNKNOWN = LA regla del Bundle refiere a un recurso inválido {0}
BUNDLE_RULE_INVALID_INDEX = El indice de la regla de Bundle no es válido ({0})

View File

@ -644,22 +644,6 @@ VALIDATION_VAL_PROFILE_THIS_VERSION_OK = このバージョンのFHIRのプロ
VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = プロファイルはこのバージョンのFHIRのためのものですが、無効な型{0}です
BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_one =
BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_other = {0}個のプロファイルが{1}リソースに対して見つかりました。現時点では一つ以上はサポートされていません。(タイプ{2}: {3})
RENDER_BUNDLE_HEADER_ROOT = タイプ {1} のバンドル {0}
RENDER_BUNDLE_HEADER_ENTRY = エントリ {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = エントリ {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Search:
RENDER_BUNDLE_SEARCH_MODE = Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = Score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
BUNDLE_RULE_NONE = No Rule
BUNDLE_RULE_UNKNOWN = Bundle Ruleは無効なリソース {0} を参照しています
BUNDLE_RULE_INVALID_INDEX = Bundle Rulesのインデックスが無効です ({0})
@ -936,11 +920,6 @@ SD_OBGLIGATION_INHERITS_PROFILE_NO_TARGET = このextensionから値を読み
SD_OBGLIGATION_INHERITS_PROFILE_TARGET_NOT_FOUND = プロファイル ''{0}'' が見つかりませんでした
SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_TYPE = プロファイル ''{0}'' はobligationプロファイルとしてマークされていません
SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_BASE = プロファイル ''{0}'' は予期された ''{2}'' ではなく、異なるベース''{1}'' を持っています
RND_CS_CONTENT_COMPLETE = この<param name="cased"/>コードシステム <param name="cs"/> は次のコード<if test="code-count != 1">たち</if><param name="h"/>を定義します:
RND_CS_CONTENT_EXAMPLE = この<param name="cased"/>コードシステム <param name="cs"/> はいくつかの例コード<if test="code-count != 1">たち</if><param name="h"/>を提供します:
RND_CS_CONTENT_FRAGMENT = この<param name="cased"/>コードシステム <param name="cs"/> は以下のコード<param name="h"/>を含むフラグメントを提供します:
RND_CS_CONTENT_NOTPRESENT = このコードシステム <param name="cs"/> はコード<param name="h"/>を定義しますが、ここではコードは表現されていません
RND_CS_CONTENT_SUPPLEMENT = このコードシステム <param name="cs"/> は次のコードに {0} を定義します:
QUESTIONNAIRE_Q_UNKNOWN_DERIVATION = 派生に参照されるQuestionnaire ''{0}'' が見つかりませんでした
QUESTIONNAIRE_Q_NO_DERIVATION_TYPE = Questionnaire ''{0}'' は ''http://hl7.org/fhir/StructureDefinition/questionnaire-derivationType'' 拡張を使用して派生タイプが指定されていないため、派生がチェックされていません
QUESTIONNAIRE_Q_NO_DERIVATION_TYPE_VALUE = 派生extensionには値がありません

View File

@ -644,22 +644,6 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} moet een derivation bevatten,
VALIDATION_VAL_PROFILE_OTHER_VERSION = Profiel is voor een andere versie van FHIR ({0}) dus wordt genegeerd
VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profiel voor deze versie van FHIR - alles in orde
VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profiel is voor deze versie van FHIR, maar heeft een onjuist type {0}
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} van type {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Zoeken:
RENDER_BUNDLE_SEARCH_MODE = mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
BUNDLE_RULE_NONE = Geen regel
BUNDLE_RULE_UNKNOWN = Bundle-regel wijst naar ongeldige resource {0}
BUNDLE_RULE_INVALID_INDEX = Index van Bundle-regels is ongeldig ({0})

View File

@ -0,0 +1,83 @@
# Rendering
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} of type {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Search:
RENDER_BUNDLE_SEARCH_MODE = Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = Score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
SD_HEAD_NAME = Name
SD_HEAD_NAME_DESC = The logical name of the element
SD_HEAD_FLAGS = Flags
SD_HEAD_FLAGS_DESC = Information about the use of the element
SD_HEAD_CARD = Card.
SD_HEAD_CARD_DESC = Minimum and Maximum # of times the the element can appear in the instance
SD_HEAD_TYPE = Type
SD_HEAD_TYPE_DESC = Reference to the type of the element
SD_HEAD_DESC = Description & Constraints
SD_HEAD_DESC_DESC = Additional information about the element
SD_COMP_HEAD_NAME = Name
SD_COMP_HEAD_NAME_DESC = The logical name of the element
SD_COMP_HEAD_FLAGS_L = L Flags
SD_COMP_HEAD_FLAGS_L_DESC = Information about the use of the element - Left Structure
SD_COMP_HEAD_CARD_L = L Card.
SD_COMP_HEAD_CARD_L_DESC = Minimum and Maximum # of times the the element can appear in the instance - Left Structure
SD_COMP_HEAD_TYPE_L = L Type
SD_COMP_HEAD_TYPE_L_DESC = Reference to the type of the element - Left Structure
SD_COMP_HEAD_DESC_L = L Description & Constraints
SD_COMP_HEAD_DESC_L_DESC = Additional information about the element - Left Structure
SD_COMP_HEAD_FLAGS_R = R Flags
SD_COMP_HEAD_FLAGS_R_DESC = Information about the use of the element - Right Structure
SD_COMP_HEAD_CARD_R = R Card.
SD_COMP_HEAD_CARD_R_DESC = Minimum and Maximum # of times the the element can appear in the instance - Right Structure
SD_COMP_HEAD_TYPE_R = R Type
SD_COMP_HEAD_TYPE_R_DESC = Reference to the type of the element - Right Structure
SD_COMP_HEAD_DESC_R = R Description & Constraints
SD_COMP_HEAD_DESC_R_DESC = Additional information about the element - Right Structure
SD_COMP_HEAD_COMP = Comments
SD_COMP_HEAD_COMP_DESC = Comments about the comparison
SD_GRID_HEAD_NAME = Name
SD_GRID_HEAD_NAME_DESC = The name of the element (Slice name in brackets). Mouse-over provides definition
SD_GRID_HEAD_CARD = Card.
SD_GRID_HEAD_CARD_DESC = Minimum and Maximum # of times the the element can appear in the instance. Super-scripts indicate additional constraints on appearance
SD_GRID_HEAD_TYPE = Type
SD_GRID_HEAD_TYPE_DESC = Reference to the type of the element
SD_GRID_HEAD_DESC = Constraints and Usage
SD_GRID_HEAD_DESC_DESC = Fixed values, length limits, vocabulary bindings and other usage notes
SD_LEGEND = Legend for this format
SD_DOCO = Documentation for this format
RENDER_RESOURCE_COPYRIGHT = Copyright Statement:
RENDER_CODESYSTEM_FILTERS = Filters
RENDER_CODESYSTEM_FILTER_CODE = Code
RENDER_CODESYSTEM_FILTER_DESC = Description
RENDER_CODESYSTEM_FILTER_OP = Operator
RENDER_CODESYSTEM_FILTER_VALUE = Value
RENDER_CODESYSTEM_PROPS = Properties
RENDER_CODESYSTEM_PROPS_DESC = This code system defines the following properties for its concepts
RENDER_CODESYSTEM_PROP_NAME = Name
RENDER_CODESYSTEM_PROP_CODE = Code
RENDER_CODESYSTEM_PROP_URI = URI
RENDER_CODESYSTEM_PROP_TYPE = Type
RENDER_CODESYSTEM_PROP_DESC = Description
RND_CS_CONTENT_COMPLETE = This <param name="cased"/> code system <param name="cs"/> defines the following code<if test="code-count != 1">s</if><param name="h"/>:
RND_CS_CONTENT_EXAMPLE = This <param name="cased"/> code system <param name="cs"/> provides some code<if test="code-count != 1">s</if><param name="h"/> <b>that are example only</b>:
RND_CS_CONTENT_FRAGMENT = This <param name="cased"/> code system <param name="cs"/> provides <b>a fragment</b> that includes following code<if test="code-count != 1">s</if><param name="h"/>:
RND_CS_CONTENT_NOTPRESENT = This <param name="cased"/> code system <param name="cs"/> defines codes<param name="h"/>, but no codes are represented here
RND_CS_CONTENT_SUPPLEMENT = This code system <param name="cs"/> defines {0} on the following code<if test="code-count != 1">s</if>:
RENDER_CODESYSTEM_CONCEPTS = Concepts
RENDER_CODESYSTEM_DEPRECATED = Deprecated
RENDER_TX_CODE = Code
RENDER_TX_DISPLAY = Display
RENDER_TX_DEFINITION = Definition
RENDER_TX_DEPRECATED = Deprecated
RENDER_TX_COMMENTS = Comments
RENDER_TX_VERSION = Version

View File

@ -0,0 +1,17 @@
# Rendering
RENDER_BUNDLE_HEADER_ROOT=Bundle {0} vom Typ {1}
RENDER_BUNDLE_HEADER_ENTRY=Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL=Entry {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE=Ressource {0}:
RENDER_BUNDLE_SEARCH=Suche:
RENDER_BUNDLE_SEARCH_MODE=Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE=Score = {0}
RENDER_BUNDLE_RESPONSE=Response:
RENDER_BUNDLE_LOCATION=Location = {0}
RENDER_BUNDLE_ETAG=ETag = {0}
RENDER_BUNDLE_LAST_MOD=LastModified = {0}
RENDER_BUNDLE_REQUEST=Request:
RENDER_BUNDLE_IF_NON_MATCH=If-None-Match = {0}
RENDER_BUNDLE_IF_MOD=If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH=If-Match = {0}
RENDER_BUNDLE_IF_NONE=If-None-Exist = {0}

View File

@ -0,0 +1,17 @@
# Rendering
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} De tipo {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - FullURL = {1}
RENDER_BUNDLE_RESOURCE = Recurso {0}:
RENDER_BUNDLE_SEARCH = Búsqueda:
RENDER_BUNDLE_SEARCH_MODE = mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = score = {0}
RENDER_BUNDLE_RESPONSE = Respuesta:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}

View File

@ -0,0 +1,22 @@
# Rendering
RENDER_BUNDLE_HEADER_ROOT = タイプ {1} のバンドル {0}
RENDER_BUNDLE_HEADER_ENTRY = エントリ {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = エントリ {0} - fullUrl = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Search:
RENDER_BUNDLE_SEARCH_MODE = Mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = Score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}
RND_CS_CONTENT_COMPLETE = この<param name="cased"/>コードシステム <param name="cs"/> は次のコード<if test="code-count != 1">たち</if><param name="h"/>を定義します:
RND_CS_CONTENT_EXAMPLE = この<param name="cased"/>コードシステム <param name="cs"/> はいくつかの例コード<if test="code-count != 1">たち</if><param name="h"/>を提供します:
RND_CS_CONTENT_FRAGMENT = この<param name="cased"/>コードシステム <param name="cs"/> は以下のコード<param name="h"/>を含むフラグメントを提供します:
RND_CS_CONTENT_NOTPRESENT = このコードシステム <param name="cs"/> はコード<param name="h"/>を定義しますが、ここではコードは表現されていません
RND_CS_CONTENT_SUPPLEMENT = このコードシステム <param name="cs"/> は次のコードに {0} を定義します:

View File

@ -0,0 +1,17 @@
# Rendering
RENDER_BUNDLE_HEADER_ROOT = Bundle {0} van type {1}
RENDER_BUNDLE_HEADER_ENTRY = Entry {0}
RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1}
RENDER_BUNDLE_RESOURCE = Resource {0}:
RENDER_BUNDLE_SEARCH = Zoeken:
RENDER_BUNDLE_SEARCH_MODE = mode = {0}
RENDER_BUNDLE_SEARCH_SCORE = score = {0}
RENDER_BUNDLE_RESPONSE = Response:
RENDER_BUNDLE_LOCATION = Location = {0}
RENDER_BUNDLE_ETAG = ETag = {0}
RENDER_BUNDLE_LAST_MOD = LastModified = {0}
RENDER_BUNDLE_REQUEST = Request:
RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0}
RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0}
RENDER_BUNDLE_IF_MATCH = If-Match = {0}
RENDER_BUNDLE_IF_NONE = If-None-Exist = {0}

View File

@ -0,0 +1,57 @@
package org.hl7.fhir.validation.generator;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.loaders.loaderR5.R4BToR5Loader;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
public class InstanceGenerator {
public static void main(String[] args) throws FHIRException, IOException {
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build();
NpmPackage npm = pcm.loadPackage("hl7.fhir.r4.core");
SimpleWorkerContext context = new SimpleWorkerContext.SimpleWorkerContextBuilder().withAllowLoadingDuplicates(true).fromPackage(npm);
context.loadFromPackage(pcm.loadPackage("hl7.fhir.us.core#6.0.0"), new R4BToR5Loader(null, null, null));
var gen = new InstanceGenerator(context);
StructureDefinition sd = context.fetchResource(StructureDefinition.class, args[0]);
FhirFormat fmt = FhirFormat.valueOf(args[1].toUpperCase());
FileOutputStream f = new FileOutputStream(args[2]);
List<String> messages = gen.generateInstance(sd, fmt, f);
if (messages.isEmpty()) {
System.out.println("Generated OK");
} else {
System.out.println("Generation failed:");
for (String msg : messages) {
System.out.println(" - "+msg);
}
}
}
private IWorkerContext context;
protected InstanceGenerator(IWorkerContext context) {
super();
this.context = context;
}
/**
* main public entry point. populates the outputstream, or produces at least one error message in the output
*
*/
public List<String> generateInstance(StructureDefinition profile, FhirFormat format, OutputStream destination) {
List<String> res = new ArrayList<>();
res.add("Not done yet");
return res;
}
}

View File

@ -21,7 +21,7 @@
<commons_compress_version>1.26.0</commons_compress_version>
<guava_version>32.0.1-jre</guava_version>
<hapi_fhir_version>6.4.1</hapi_fhir_version>
<validator_test_case_version>1.5.3</validator_test_case_version>
<validator_test_case_version>1.5.4-SNAPSHOT</validator_test_case_version>
<jackson_version>2.16.0</jackson_version>
<junit_jupiter_version>5.9.2</junit_jupiter_version>
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>