stable baseline

This commit is contained in:
Grahame Grieve 2024-05-25 04:25:47 -05:00
parent 34c8c262bc
commit 853b4fd9ca
18 changed files with 9487 additions and 8994 deletions

View File

@ -6383,7 +6383,7 @@ public class FHIRPathEngine {
sd = fetchStructureByType(element, expr); sd = fetchStructureByType(element, expr);
if (sd == null) { if (sd == null) {
throw makeException(expr, I18nConstants.FHIRPATH_DISCRIMINATOR_THIS_CANNOT_FIND, throw makeException(expr, I18nConstants.FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND,
element.getElement().getType().get(0).getProfile(), element.getElement().getId()); element.getElement().getType().get(0).getProfile(), element.getElement().getId());
} }
childDefinitions = profileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep()); childDefinitions = profileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());

View File

@ -110,7 +110,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTERS)); x.para().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTERS));
XhtmlNode tbl = x.table("grid"); XhtmlNode tbl = x.table("grid");
XhtmlNode tr = tbl.tr(); XhtmlNode tr = tbl.tr();
tr.td().b().tx(formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_CODE));
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_DESC)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_DESC));
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_OP)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_OP));
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_VALUE)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_FILTER_VALUE));
@ -132,8 +132,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
boolean hasURI = false; boolean hasURI = false;
boolean hasDescription = false; boolean hasDescription = false;
for (PropertyComponent p : cs.getProperty()) { for (PropertyComponent p : cs.getProperty()) {
String display = getPropertyDisplay(p); hasRendered = hasRendered || !p.getCode().equals(ToolingExtensions.getPresentation(p, p.getCodeElement()));
hasRendered = hasRendered || display != null;
hasURI = hasURI || p.hasUri(); hasURI = hasURI || p.hasUri();
hasDescription = hasDescription || p.hasDescription(); hasDescription = hasDescription || p.hasDescription();
} }
@ -145,7 +144,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
if (hasRendered) { if (hasRendered) {
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_NAME)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_NAME));
} }
tr.td().b().tx(formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_CODE));
if (hasURI) { if (hasURI) {
tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_URI)); tr.td().b().tx(formatPhrase(RenderingContext.CODESYSTEM_PROP_URI));
} }
@ -156,8 +155,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
for (PropertyComponent p : cs.getProperty()) { for (PropertyComponent p : cs.getProperty()) {
tr = tbl.tr(); tr = tbl.tr();
if (hasRendered) { if (hasRendered) {
String display = getPropertyDisplay(p); tr.td().tx(ToolingExtensions.getPresentation(p, p.getCodeElement()));
tr.td().tx(display);
} }
renderStatus(p, tr.td()).tx(p.getCode()); renderStatus(p, tr.td()).tx(p.getCode());
if (hasURI) { if (hasURI) {
@ -261,10 +259,10 @@ public class CodeSystemRenderer extends TerminologyRenderer {
} }
if (langs.size() >= 2) { if (langs.size() >= 2) {
Collections.sort(langs); Collections.sort(langs);
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG)); x.para().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_ADD_LANG));
t = x.table("codes"); t = x.table("codes");
XhtmlNode tr = t.tr(); XhtmlNode tr = t.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.CODE_SYS_CODE));
for (String lang : langs) for (String lang : langs)
tr.td().b().addText(describeLang(lang)); tr.td().b().addText(describeLang(lang));
for (ConceptDefinitionComponent c : cs.getConcept()) { for (ConceptDefinitionComponent c : cs.getConcept()) {

View File

@ -405,13 +405,13 @@ public class ConceptMapRenderer extends TerminologyRenderer {
if (grp.hasSource()) { if (grp.hasSource()) {
renderCanonical(cm, pp, grp.getSource()); renderCanonical(cm, pp, grp.getSource());
} else { } else {
pp.code(context.formatPhrase(RenderingContext.GENERAL_CODE_SYS_UNSPEC)); pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC));
} }
pp.tx(" to "); pp.tx(" to ");
if (grp.hasTarget()) { if (grp.hasTarget()) {
renderCanonical(cm, pp, grp.getTarget()); renderCanonical(cm, pp, grp.getTarget());
} else { } else {
pp.code(context.formatPhrase(RenderingContext.GENERAL_CODE_SYS_UNSPEC)); pp.code(context.formatPhrase(RenderingContext.CONC_MAP_CODE_SYS_UNSPEC));
} }
String display; String display;
@ -484,7 +484,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
String url = sources.get("code").iterator().next(); String url = sources.get("code").iterator().next();
renderCSDetailsLink(tr, url, true); renderCSDetailsLink(tr, url, true);
} else } else
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE));
for (String s : sources.keySet()) { for (String s : sources.keySet()) {
if (s != null && !s.equals("code")) { if (s != null && !s.equals("code")) {
if (sources.get(s).size() == 1) { if (sources.get(s).size() == 1) {
@ -501,7 +501,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
String url = targets.get("code").iterator().next(); String url = targets.get("code").iterator().next();
renderCSDetailsLink(tr, url, true); renderCSDetailsLink(tr, url, true);
} else } else
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODE));
for (String s : targets.keySet()) { for (String s : targets.keySet()) {
if (s != null && !s.equals("code")) { if (s != null && !s.equals("code")) {
if (targets.get(s).size() == 1) { if (targets.get(s).size() == 1) {
@ -698,7 +698,7 @@ public class ConceptMapRenderer extends TerminologyRenderer {
if (span2) { if (span2) {
td.colspan("2"); td.colspan("2");
} }
td.b().tx(context.formatPhrase(RenderingContext.GENERAL_CODES)); td.b().tx(context.formatPhrase(RenderingContext.CONC_MAP_CODES));
td.tx(" " + (context.formatPhrase(RenderingContext.CONC_MAP_FRM) + " ")); td.tx(" " + (context.formatPhrase(RenderingContext.CONC_MAP_FRM) + " "));
if (cs == null) if (cs == null)
td.tx(url); td.tx(url);

View File

@ -1208,7 +1208,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
} }
} }
x.span(null, context.formatPhrase(RenderingContext.GENERAL_CODES) +b.toString()).addText(s); x.span(null, context.formatPhrase(RenderingContext.DATA_REND_CODES) +b.toString()).addText(s);
} }
} }
@ -1252,7 +1252,6 @@ public class DataRenderer extends Renderer implements CodeResolver {
} }
protected void renderIdentifier(XhtmlNode x, Identifier ii) { protected void renderIdentifier(XhtmlNode x, Identifier ii) {
boolean pfx = true;
if (ii.hasType()) { if (ii.hasType()) {
if (ii.getType().hasText()) { if (ii.getType().hasText()) {
x.tx(context.getTranslated(ii.getType().getTextElement())); x.tx(context.getTranslated(ii.getType().getTextElement()));
@ -1260,9 +1259,8 @@ public class DataRenderer extends Renderer implements CodeResolver {
x.tx(context.getTranslated(ii.getType().getCoding().get(0).getDisplayElement())); x.tx(context.getTranslated(ii.getType().getCoding().get(0).getDisplayElement()));
} else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) { } else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) {
x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())); x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode()));
} else {
pfx = false;
} }
x.tx("/");
} else if (ii.hasSystem()) { } else if (ii.hasSystem()) {
NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem());
if (ns != null) { if (ns != null) {
@ -1280,13 +1278,9 @@ public class DataRenderer extends Renderer implements CodeResolver {
x.code(ii.getSystem()); x.code(ii.getSystem());
} }
} }
}
if (!Utilities.noString(ii.getValue())) {
if (pfx) {
x.tx("/"); x.tx("/");
} }
x.tx(ii.getValue()); x.tx(Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue());
}
if (ii.hasUse() || ii.hasPeriod()) { if (ii.hasUse() || ii.hasPeriod()) {
x.nbsp(); x.nbsp();
@ -1657,7 +1651,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
} }
if (td.hasCode()) { if (td.hasCode()) {
x.tx(", "); x.tx(", ");
x.b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); x.b().tx(context.formatPhrase(RenderingContext.DATA_REND_CODE));
x.tx(": "); x.tx(": ");
renderCodeableConcept(x, td.getCode()); renderCodeableConcept(x, td.getCode());
} }
@ -1687,7 +1681,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
} }
if (td.hasCode()) { if (td.hasCode()) {
tr = tbl.tr(); tr = tbl.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.DATA_REND_CODE));
renderCodeableConcept(tr.td(), td.getCode()); renderCodeableConcept(tr.td(), td.getCode());
} }
if (td.hasTiming()) { if (td.hasTiming()) {
@ -1802,7 +1796,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
private String displayTiming(Timing s) throws FHIRException { private String displayTiming(Timing s) throws FHIRException {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
if (s.hasCode()) if (s.hasCode())
b.append(context.formatPhrase(RenderingContext.GENERAL_CODE, displayCodeableConcept(s.getCode())) + " "); b.append(context.formatPhrase(RenderingContext.DATA_REND_GETCODE, displayCodeableConcept(s.getCode())) + " ");
if (s.getEvent().size() > 0) { if (s.getEvent().size() > 0) {
CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder(); CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder();

View File

@ -138,7 +138,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer {
} }
if (valued(pw)) { if (valued(pw)) {
XhtmlNode p = x.para(); XhtmlNode p = x.para();
p.b().tx(context.formatPhrase(RenderingContext.GENERAL_CODECON)); p.b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODECON));
XhtmlNode ul = x.ul(); XhtmlNode ul = x.ul();
for (BaseWrapper v : pw.getValues()) { for (BaseWrapper v : pw.getValues()) {
render(ul.li(), v); render(ul.li(), v);
@ -218,7 +218,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer {
if (issued) cs++; if (issued) cs++;
if (effectiveTime) cs++; if (effectiveTime) cs++;
XhtmlNode tr = tbl.tr(); XhtmlNode tr = tbl.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_CODE));
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_VALUE)); tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_VALUE));
if (refRange) { if (refRange) {
tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REFRAN)); tr.td().b().tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_REFRAN));

View File

@ -49,7 +49,7 @@ public class ListRenderer extends ResourceRenderer {
td.tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" "); td.tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.get("status").primitiveValue())+" ");
} }
if (list.has("code")) { if (list.has("code")) {
td.tx(context.formatPhrase(RenderingContext.GENERAL_CODE, displayBase(list.get("code")))+" "); td.tx(context.formatPhrase(RenderingContext.LIST_REND_CODE, displayBase(list.get("code")))+" ");
} }
tr = t.tr(); tr = t.tr();
td = tr.td(); td = tr.td();
@ -122,7 +122,7 @@ public class ListRenderer extends ResourceRenderer {
tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" "); tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_STAT, list.getStatus().getDisplay())+" ");
} }
if (list.hasCode()) { if (list.hasCode()) {
tr.td().tx(context.formatPhrase(RenderingContext.GENERAL_CODE, display(list.getCode()))+" "); tr.td().tx(context.formatPhrase(RenderingContext.LIST_REND_CODE, display(list.getCode()))+" ");
} }
tr = t.tr(); tr = t.tr();
if (list.hasSubject()) { if (list.hasSubject()) {

View File

@ -83,9 +83,9 @@ public class OperationDefinitionRenderer extends TerminologyRenderer {
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_USE)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_USE));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_NAME)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_NAME));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_SCO)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_SCO));
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CARDINALITY)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_CARD));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_TYPE)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_TYPE));
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_BINDING)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_BIND));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_DOC)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_DEF_DOC));
for (OperationDefinitionParameterComponent p : opd.getParameter()) { for (OperationDefinitionParameterComponent p : opd.getParameter()) {
genOpParam(tbl, "", p, opd); genOpParam(tbl, "", p, opd);

View File

@ -47,7 +47,7 @@ public class OperationOutcomeRenderer extends ResourceRenderer {
XhtmlNode tr = tbl.tr(); XhtmlNode tr = tbl.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SEV)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_SEV));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_LOC)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_LOC));
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_CODE));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DET)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DET));
tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DIAG)); tr.td().b().tx(context.formatPhrase(RenderingContext.OP_OUT_DIAG));
if (hasSource) if (hasSource)

View File

@ -81,7 +81,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table");
model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_LINKID)), (context.formatPhrase(RenderingContext.QUEST_LINK)), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_LINKID)), (context.formatPhrase(RenderingContext.QUEST_LINK)), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TEXT)), (context.formatPhrase(RenderingContext.QUEST_TEXTFOR)), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TEXT)), (context.formatPhrase(RenderingContext.QUEST_TEXTFOR)), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.GENERAL_CARDINALITY)), (context.formatPhrase(RenderingContext.QUEST_TIMES)), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_CARD)), (context.formatPhrase(RenderingContext.QUEST_TIMES)), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TYPE)), (context.formatPhrase(RenderingContext.QUEST_TYPE_ITEM)), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_TYPE)), (context.formatPhrase(RenderingContext.QUEST_TYPE_ITEM)), null, 0));
if (hasFlags) { if (hasFlags) {
model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_FLAG)), (context.formatPhrase(RenderingContext.QUEST_ATTRIBUTES)), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), (context.formatPhrase(RenderingContext.QUEST_FLAG)), (context.formatPhrase(RenderingContext.QUEST_ATTRIBUTES)), null, 0));
@ -1030,7 +1030,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer {
if (qi.hasCode()) { if (qi.hasCode()) {
XhtmlNode tr = tbl.tr(); XhtmlNode tr = tbl.tr();
tr.td().tx(Utilities.pluralize(context.formatPhrase(RenderingContext.GENERAL_CODE), qi.getCode().size())); tr.td().tx(Utilities.pluralize(context.formatPhrase(RenderingContext.QUEST_CODE), qi.getCode().size()));
XhtmlNode ul = tr.td().ul(); XhtmlNode ul = tr.td().ul();
for (Coding c : qi.getCode()) { for (Coding c : qi.getCode()) {
renderCodingWithDetails(ul.li(), c); renderCodingWithDetails(ul.li(), c);

View File

@ -2981,7 +2981,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
} }
model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); // todo: change to graph definition model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); // todo: change to graph definition
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_PROPERTY), context.formatPhrase(RenderingContext.STRUC_DEF_PROF_RES), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_PROPERTY), context.formatPhrase(RenderingContext.STRUC_DEF_PROF_RES), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.GENERAL_CARD), context.formatPhrase(RenderingContext.STRUC_DEF_MAX_MIN), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_CARD), context.formatPhrase(RenderingContext.STRUC_DEF_MAX_MIN), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_CONTENT), context.formatPhrase(RenderingContext.STRUC_DEF_WHAT), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_CONTENT), context.formatPhrase(RenderingContext.STRUC_DEF_WHAT), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_DESC), context.formatPhrase(RenderingContext.STRUC_DEF_DESC_PROF), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.STRUC_DEF_DESC), context.formatPhrase(RenderingContext.STRUC_DEF_DESC_PROF), null, 0));
return model; return model;
@ -4739,7 +4739,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
private String summarise(Coding coding) throws FHIRException { private String summarise(Coding coding) throws FHIRException {
if ("http://snomed.info/sct".equals(coding.getSystem())) if ("http://snomed.info/sct".equals(coding.getSystem()))
return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_SNOMED)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_SNOMED_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")");
if ("http://loinc.org".equals(coding.getSystem())) if ("http://loinc.org".equals(coding.getSystem()))
return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_LOINC_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); return "" + (context.formatPhrase(RenderingContext.STRUC_DEF_LOINC_CODE)) + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")");
if ("http://unitsofmeasure.org/".equals(coding.getSystem())) if ("http://unitsofmeasure.org/".equals(coding.getSystem()))

View File

@ -211,7 +211,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
if (hasHierarchy) { if (hasHierarchy) {
tr.td().b().tx(context.formatPhrase(RenderingContext.TERMINOLOGY_LVL)); tr.td().b().tx(context.formatPhrase(RenderingContext.TERMINOLOGY_LVL));
} }
tr.td().attribute("style", "white-space:nowrap").b().tx(formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().attribute("style", "white-space:nowrap").b().tx(formatPhrase(RenderingContext.TX_CODE));
if (hasDisplay) { if (hasDisplay) {
tr.td().b().tx(formatPhrase(RenderingContext.TX_DISPLAY)); tr.td().b().tx(formatPhrase(RenderingContext.TX_DISPLAY));
} }
@ -229,7 +229,13 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
} }
if (properties != null) { if (properties != null) {
for (PropertyComponent pc : properties) { for (PropertyComponent pc : properties) {
String display = getPropertyDisplay(pc); String display = ToolingExtensions.getPresentation(pc, pc.getCodeElement());
if (display == null || display.equals(pc.getCode()) && pc.hasUri()) {
display = getDisplayForProperty(pc.getUri());
if (display == null) {
display = pc.getCode();
}
}
tr.td().b().tx(display); tr.td().b().tx(display);
} }
} }
@ -248,17 +254,6 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
return tr; return tr;
} }
protected String getPropertyDisplay(PropertyComponent pc) {
String display = ToolingExtensions.getPresentation(pc, pc.getCodeElement());
if (display == null || display.equals(pc.getCode()) && pc.hasUri()) {
display = getDisplayForProperty(pc.getUri());
if (display == null) {
display = pc.getCode();
}
}
return display;
}
protected String getDisplayForProperty(String uri) { protected String getDisplayForProperty(String uri) {
if (Utilities.noString(uri)){ if (Utilities.noString(uri)){

View File

@ -208,7 +208,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (vs.getExpansion().getContains().isEmpty()) { if (vs.getExpansion().getContains().isEmpty()) {
msg = context.formatPhrase(RenderingContext.VALUE_SET_TOO_COSTLY); msg = context.formatPhrase(RenderingContext.VALUE_SET_TOO_COSTLY);
} else { } else {
msg = context.formatPhrase(RenderingContext.GENERAL_CODE_SELEC, countMembership(vs)); msg = context.formatPhrase(RenderingContext.VALUE_SET_CODE_SELEC, countMembership(vs));
} }
x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg);
} else { } else {
@ -216,9 +216,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (vs.getExpansion().hasTotal()) { if (vs.getExpansion().hasTotal()) {
if (count != vs.getExpansion().getTotal()) { if (count != vs.getExpansion().getTotal()) {
x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px") x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px")
.addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal(), count)); .addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal()));
} else { } else {
x.para().tx(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_CONTAINS_AT_LEAST : RenderingContext.VALUE_SET_CONTAINS, vs.getExpansion().getTotal(), count)); x.para().tx(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_CONTAINS_AT_LEAST : RenderingContext.VALUE_SET_CONTAINS, vs.getExpansion().getTotal()));
} }
} else if (count == 1000) { } else if (count == 1000) {
// it's possible that there's exactly 1000 codes, in which case wht we're about to do is wrong // it's possible that there's exactly 1000 codes, in which case wht we're about to do is wrong
@ -245,7 +245,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
XhtmlNode tr = t.tr(); XhtmlNode tr = t.tr();
if (doLevel) if (doLevel)
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_LEVEL)); tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_LEVEL));
tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().attribute("style", "white-space:nowrap").b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_SYSTEM)); tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_SYSTEM));
XhtmlNode tdDisp = tr.td(); XhtmlNode tdDisp = tr.td();
tdDisp.b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY)); tdDisp.b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY));
@ -294,7 +294,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (!doDesignations && langs.size() + designations.size() > 0) { if (!doDesignations && langs.size() + designations.size() > 0) {
Collections.sort(langs); Collections.sort(langs);
if (designations.size() == 0) { if (designations.size() == 0) {
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG)); x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG));
} else if (langs.size() == 0) { } else if (langs.size() == 0) {
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG)); x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG));
} else { } else {
@ -302,7 +302,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
} }
t = x.table("codes"); t = x.table("codes");
tr = t.tr(); tr = t.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
for (String url : designations.keySet()) { for (String url : designations.keySet()) {
tr.td().b().addText(designations.get(url)); tr.td().b().addText(designations.get(url));
} }
@ -989,7 +989,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (!doDesignations && langs.size() + designations.size() > 0) { if (!doDesignations && langs.size() + designations.size() > 0) {
Collections.sort(langs); Collections.sort(langs);
if (designations.size() == 0) { if (designations.size() == 0) {
x.para().b().tx(context.formatPhrase(RenderingContext.GENERAL_ADD_LANG)); x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_ADD_LANG));
} else if (langs.size() == 0) { } else if (langs.size() == 0) {
x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG)); x.para().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_DESIG));
} else { } else {
@ -997,7 +997,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
} }
XhtmlNode t = x.table("codes"); XhtmlNode t = x.table("codes");
XhtmlNode tr = t.tr(); XhtmlNode tr = t.tr();
tr.td().b().tx(context.formatPhrase(RenderingContext.GENERAL_CODE)); tr.td().b().tx(context.formatPhrase(RenderingContext.VALUE_SET_CODE));
for (String url : designations.keySet()) { for (String url : designations.keySet()) {
tr.td().b().addText(designations.get(url)); tr.td().b().addText(designations.get(url));
} }
@ -1032,7 +1032,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, 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); TableModel model = gen.new TableModel("exp.h="+index, context.getRules() == GenerationRules.IG_PUBLISHER);
model.setAlternating(true); model.setAlternating(true);
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.GENERAL_CODE), context.formatPhrase(RenderingContext.GENERAL_CODE_ITEM), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_CODE), context.formatPhrase(RenderingContext.VALUE_SET_CODE_ITEM), null, 0));
model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY_ITEM), null, 0)); model.getTitles().add(gen.new Title(null, model.getDocoRef(), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY), context.formatPhrase(RenderingContext.VALUE_SET_DISPLAY_ITEM), null, 0));
for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) { for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) {
@ -1211,7 +1211,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
} }
} }
if (inc.getFilter().size() > 0) { if (inc.getFilter().size() > 0) {
li.addText(type+" "+ context.formatPhrase(RenderingContext.GENERAL_CODES_FROM)); li.addText(type+" "+ context.formatPhrase(RenderingContext.VALUE_SET_CODES_FROM));
addCsRef(inc, li, e); addCsRef(inc, li, e);
li.tx(" "+ context.formatPhrase(RenderingContext.VALUE_SET_WHERE)+" "); li.tx(" "+ context.formatPhrase(RenderingContext.VALUE_SET_WHERE)+" ");
for (int i = 0; i < inc.getFilter().size(); i++) { for (int i = 0; i < inc.getFilter().size(); i++) {

View File

@ -17,7 +17,7 @@ public class I18nConstantMaintainer {
rename("/Users/grahamegrieve/work/core", "OP_DEF_CARD", "GENERAL_CARDINALITY"); rename("/Users/grahamegrieve/work/core", "OP_DEF_CARD", "GENERAL_CARDINALITY");
replace("/Users/grahamegrieve/work/core", "QUEST_CARD", "GENERAL_CARDINALITY"); replace("/Users/grahamegrieve/work/core", "QUEST_CARD", "GENERAL_CARDINALITY");
// rename("/Users/grahamegrieve/work/core", "CODEPROP_CODE", "GENERAL_CODE"); rename("/Users/grahamegrieve/work/core", "CODEPROP_CODE", "GENERAL_CODE");
replace("/Users/grahamegrieve/work/core", "CODE_SYS_CODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "CODE_SYS_CODE", "GENERAL_CODE");
replace("/Users/grahamegrieve/work/core", "CONC_MAP_CODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "CONC_MAP_CODE", "GENERAL_CODE");
replace("/Users/grahamegrieve/work/core", "DATA_REND_CODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "DATA_REND_CODE", "GENERAL_CODE");
@ -28,13 +28,382 @@ public class I18nConstantMaintainer {
replace("/Users/grahamegrieve/work/core", "VALUE_SET_CODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "VALUE_SET_CODE", "GENERAL_CODE");
replace("/Users/grahamegrieve/work/core", "DATA_REND_GETCODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "DATA_REND_GETCODE", "GENERAL_CODE");
replace("/Users/grahamegrieve/work/core", "LIST_REND_CODE", "GENERAL_CODE"); replace("/Users/grahamegrieve/work/core", "LIST_REND_CODE", "GENERAL_CODE");
// Comment
rename("/Users/grahamegrieve/work/core", "CONC_MAP_CMNT", "GENERAL_COMMENT");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_COM", "GENERAL_COMMENT");
// Comments
rename("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_COMP", "GENERAL_COMMENTS");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_COMMENTS", "GENERAL_COMMENTS");
replace("/Users/grahamegrieve/work/core", "TX_COMMENTS", "GENERAL_COMMENTS");
// Comparators
rename("/Users/grahamegrieve/work/core", "SEARCH_PAR_COMP", "GENERAL_COMPARATORS");
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_COMP", "GENERAL_COMPARATORS");
// Component
rename("/Users/grahamegrieve/work/core", "ADD_BIND_COMPONENT", "GENERAL_COMPONENT");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_COMP", "GENERAL_COMPONENT");
// Conformance
rename("/Users/grahamegrieve/work/core", "CAPABILITY_CONF", "GENERAL_CONFORMANCE");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_CONFORMANCE", "GENERAL_CONFORMANCE");
// Contact:
rename("/Users/grahamegrieve/work/core", "PAT_NOK_CONTACT", "GENERAL_CONTACT");
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_CONT", "GENERAL_CONTACT");
// Content
rename("/Users/grahamegrieve/work/core", "CODE_SYS_CONTENT", "GENERAL_CONTENT");
replace("/Users/grahamegrieve/work/core", "EX_SCEN_CONT", "GENERAL_CONTENT");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_CONTENT", "GENERAL_CONTENT");
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_CONTENT", "GENERAL_CONTENT");
// Copyright
rename("/Users/grahamegrieve/work/core", "CANON_REND_COPYRIGHT", "GENERAL_COPYRIGHT");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_COPY", "GENERAL_COPYRIGHT");
replace("/Users/grahamegrieve/work/core", "QUEST_COPYRIGHT", "GENERAL_COPYRIGHT");
// Criteria
rename("/Users/grahamegrieve/work/core", "CAPABILITY_CRIT", "GENERAL_CRIT");
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_CRITERIA", "GENERAL_CRIT");
// Defining URL
rename("/Users/grahamegrieve/work/core", "CANON_REND_URL", "GENERAL_DEFINING_URL");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_URL", "GENERAL_DEFINING_URL");
// Definition
rename("/Users/grahamegrieve/work/core", "CANON_REND_DEFINITION", "GENERAL_DEFINITION");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_DEF", "GENERAL_DEFINITION");
replace("/Users/grahamegrieve/work/core", "QUEST_DEFINITION", "GENERAL_DEFINITION");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DEFINITION", "GENERAL_DEFINITION");
replace("/Users/grahamegrieve/work/core", "TX_DEFINITION", "GENERAL_DEFINITION");
replace("/Users/grahamegrieve/work/core", "VALUE_SET_DEF", "GENERAL_DEFINITION");
// Definition:
rename("/Users/grahamegrieve/work/core", "QUEST_DEF", "GENERAL_DEFINITION_COLON");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DEF", "GENERAL_DEFINITION_COLON");
// Deprecated
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_DEPRECATED", "CODESYSTEM_DEPRECATED");
replace("/Users/grahamegrieve/work/core", "TX_DEPRECATED", "CODESYSTEM_DEPRECATED");
// Description
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_DESC", "GENERAL_DESC");
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_DESC", "GENERAL_DESC");
replace("/Users/grahamegrieve/work/core", "EX_SCEN_DESC", "GENERAL_DESC");
replace("/Users/grahamegrieve/work/core", "QUEST_DESCRIPTION", "GENERAL_DESC");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DESC", "GENERAL_DESC");
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_DESC", "GENERAL_DESC");
// Description & Constraints
rename("/Users/grahamegrieve/work/core", "QUEST_DESC", "GENERAL_DESC_CONST");
replace("/Users/grahamegrieve/work/core", "SD_HEAD_DESC", "GENERAL_DESC_CONST");
// Details
rename("/Users/grahamegrieve/work/core", "OP_OUT_DET", "GENERAL_DETAILS");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_DETAILS", "GENERAL_DETAILS");
// Display
rename("/Users/grahamegrieve/work/core", "TX_DISPLAY", "TX_DISPLAY");
replace("/Users/grahamegrieve/work/core", "VALUE_SET_DISPLAY", "TX_DISPLAY");
// Documentation
rename("/Users/grahamegrieve/work/core", "ADD_BIND_DOC", "GENERAL_DOCUMENTATION");
replace("/Users/grahamegrieve/work/core", "CAPABILITY_DOC", "GENERAL_DOCUMENTATION");
replace("/Users/grahamegrieve/work/core", "OBLIG_DOC", "GENERAL_DOCUMENTATION");
replace("/Users/grahamegrieve/work/core", "OP_DEF_DOC", "GENERAL_DOCUMENTATION");
// Example
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_EX", "GENERAL_EXAMPLE");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_EXAMPLE", "GENERAL_EXAMPLE");
// Experimental
rename("/Users/grahamegrieve/work/core", "QUEST_EXPER", "GENERAL_EXPER");
replace("/Users/grahamegrieve/work/core", "RES_REND_EXP", "GENERAL_EXPER");
// Filter
rename("/Users/grahamegrieve/work/core", "DATA_REND_FILT", "GENERAL_FILTER");
replace("/Users/grahamegrieve/work/core", "OBLIG_FILT", "GENERAL_FILTER");
// Flags
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_FLAG", "GENERAL_FLAGS");
replace("/Users/grahamegrieve/work/core", "QUEST_FLAG", "GENERAL_FLAGS");
replace("/Users/grahamegrieve/work/core", "SD_HEAD_FLAGS", "GENERAL_FLAGS");
// Id is required to be present (this is the default for resources but not elements)
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_ID_MAY", "STRUC_DEF_ID_MAY");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_ID_REQ", "STRUC_DEF_ID_MAY");
// Instances of this logical model are not marked to be the target of a Reference
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_NOT_MARK", "STRUC_DEF_NOT_MARK");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NOT_MARKED", "STRUC_DEF_NOT_MARK");
// Instances of this logical model can be the target of a Reference
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_CAN_TARGET", "STRUC_DEF_CAN_TARGET");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REF", "STRUC_DEF_CAN_TARGET");
// Instances of this type are validated using an unknown approach: {0}
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_UNKNOWN_APPROACH", "STRUC_DEF_UNKNOWN_APPROACH");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_VALID_UNKNOWN", "STRUC_DEF_UNKNOWN_APPROACH");
// Location
rename("/Users/grahamegrieve/work/core", "OP_OUT_LOC", "GENERAL_LOCATION");
replace("/Users/grahamegrieve/work/core", "PROV_LOC", "GENERAL_LOCATION");
// Logical Container
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_LOGIC", "STRUC_DEF_LOGICAL_CONT");
// Maturity
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MATURITY", "CANON_REND_MATURITY");
// Max Length:
rename("/Users/grahamegrieve/work/core", "QUEST_MAX", "GENERAL_MAX_LENGTH");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MAX_LENGTH", "GENERAL_MAX_LENGTH");
// Modifiers
rename("/Users/grahamegrieve/work/core", "SEARCH_PAR_MOD", "GENERAL_MODIFIERS");
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_MOD", "GENERAL_MODIFIERS");
// Name
rename("/Users/grahamegrieve/work/core", "CANON_REND_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "DATA_REND_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "EX_SCEN_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "OP_DEF_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "QUEST_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "SD_GRID_HEAD_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "SD_HEAD_NAME", "GENERAL_NAME");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NAME", "GENERAL_NAME");
// Not done yet
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_NOTDONE", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "OP_OUT_NOT", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "PROV_NOT", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "QUEST_NOT_DONE", "GENERAL_TODO");
// Note
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_NOTE", "GENERAL_NOTE");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_NOTE_C", "GENERAL_NOTE");
// OID
rename("/Users/grahamegrieve/work/core", "CODE_SYS_OID", "GENERAL_OID");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_OID", "GENERAL_OID");
replace("/Users/grahamegrieve/work/core", "VALUE_SET_OID", "GENERAL_OID");
// Obligations
rename("/Users/grahamegrieve/work/core", "OBLIG_OBLIG", "GENERAL_OBLIG");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_OBLIGATIONS", "GENERAL_OBLIG");
// Parameter
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PAR", "GENERAL_PAR");
replace("/Users/grahamegrieve/work/core", "SEARCH_PAR_PAR", "GENERAL_PAR");
// Parameters
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PARS", "GENERAL_PARS");
replace("/Users/grahamegrieve/work/core", "LIB_REND_PARA", "GENERAL_PARS");
replace("/Users/grahamegrieve/work/core", "OP_DEF_PAR", "GENERAL_PARS");
replace("/Users/grahamegrieve/work/core", "PAR_REND_PAR", "GENERAL_PARS");
// Preferred
rename("/Users/grahamegrieve/work/core", "ADD_BIND_PREFERRED", "GENERAL_PREFERRED");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_PREF", "GENERAL_PREFERRED");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_PREF", "GENERAL_PREFERRED");
// Profile
rename("/Users/grahamegrieve/work/core", "CAPABILITY_PROF", "GENERAL_PROF");
replace("/Users/grahamegrieve/work/core", "RES_REND_PROF", "GENERAL_PROF");
replace("/Users/grahamegrieve/work/core", "RES_REND_PROFILE", "GENERAL_PROF");
replace("/Users/grahamegrieve/work/core", "TEXT_ICON_PROFILE", "GENERAL_PROF");
// Properties
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_PROPS", "GENERAL_PROPS");
replace("/Users/grahamegrieve/work/core", "CONC_MAP_PROP", "GENERAL_PROPS");
// Publisher
rename("/Users/grahamegrieve/work/core", "CANON_REND_PUBLISHER", "CANON_REND_PUBLISHER");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_PUB", "CANON_REND_PUBLISHER");
// Purpose
rename("/Users/grahamegrieve/work/core", "ADD_BIND_PUR", "GENERAL_PURPOSE");
replace("/Users/grahamegrieve/work/core", "QUEST_PURPOSE", "GENERAL_PURPOSE");
// Reference to the type of the element
replace("/Users/grahamegrieve/work/core", "SD_HEAD_TYPE_DESC", "SD_GRID_HEAD_TYPE_DESC");
// References:
rename("/Users/grahamegrieve/work/core", "ACTOR_DEF_REF", "GENERAL_REFS");
replace("/Users/grahamegrieve/work/core", "REQ_REFERENCES", "GENERAL_REFS");
// Request
rename("/Users/grahamegrieve/work/core", "DIAG_REP_REND_REQUEST", "GENERAL_REQUEST");
replace("/Users/grahamegrieve/work/core", "EX_SCEN_REQ", "GENERAL_REQUEST");
// Required
rename("/Users/grahamegrieve/work/core", "ADD_BIND_REQUIRED", "GENERAL_REQUIRED");
replace("/Users/grahamegrieve/work/core", "QUEST_REQ", "GENERAL_REQUIRED");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REQ", "GENERAL_REQUIRED");
// Resource
rename("/Users/grahamegrieve/work/core", "RES_REND_RESOURCE", "GENERAL_RESOURCE");
replace("/Users/grahamegrieve/work/core", "SEARCH_PAR_REND_RES", "GENERAL_RESOURCE");
replace("/Users/grahamegrieve/work/core", "SUB_TOPIC_RES", "GENERAL_RESOURCE");
replace("/Users/grahamegrieve/work/core", "TEXT_ICON_RESOURCE", "GENERAL_RESOURCE");
// SNOMED-CT
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_SNOMED_CT", "GENERAL_SNOMED_CT");
replace("/Users/grahamegrieve/work/core", "TERMINOLOGY_SNOMED", "GENERAL_SNOMED_CT");
// Security Label
rename("/Users/grahamegrieve/work/core", "RES_REND_SECURITY", "GENERAL_SECURITY_LABEL");
replace("/Users/grahamegrieve/work/core", "RES_REND_SECURITY_LABEL", "GENERAL_SECURITY_LABEL");
// Source:
rename("/Users/grahamegrieve/work/core", "LIST_REND_SRC", "GENERAL_SRC");
replace("/Users/grahamegrieve/work/core", "REQ_SOURCES", "GENERAL_SRC");
// Starter
rename("/Users/grahamegrieve/work/core", "ADD_BIND_STARTER", "GENERAL_STARTER");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_START", "GENERAL_STARTER");
// Status
rename("/Users/grahamegrieve/work/core", "CANON_REND_STATUS", "GENERAL_STATUS");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_STAT", "GENERAL_STATUS");
replace("/Users/grahamegrieve/work/core", "QUEST_STATUS", "GENERAL_STATUS");
// Subject
rename("/Users/grahamegrieve/work/core", "DATA_REND_SUB", "GENERAL_SUBJ");
replace("/Users/grahamegrieve/work/core", "DIAG_REP_REND_SUB", "GENERAL_SUBJ");
replace("/Users/grahamegrieve/work/core", "QUEST_SUB", "GENERAL_SUBJ");
// Summary
rename("/Users/grahamegrieve/work/core", "CAPABILITY_SUMM", "GENERAL_SUMM");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_SUM", "GENERAL_SUMM");
replace("/Users/grahamegrieve/work/core", "PROV_SUM", "GENERAL_SUMM");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUMMARY", "GENERAL_SUMM");
// The logical name of the element
rename("/Users/grahamegrieve/work/core", "SD_COMP_HEAD_NAME_DESC", "GENERAL_LOGICAL_NAME");
replace("/Users/grahamegrieve/work/core", "SD_HEAD_NAME_DESC", "GENERAL_LOGICAL_NAME");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_LOGIC_NAME", "GENERAL_LOGICAL_NAME");
// The minimum allowable value set - any conformant system SHALL support all these codes
rename("/Users/grahamegrieve/work/core", "ADD_BIND_MIN_ALLOW", "GENERAL_BIND_MIN_ALLOW");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MIN_ALLOW", "GENERAL_BIND_MIN_ALLOW");
// This content has been removed since {0}
rename("/Users/grahamegrieve/work/core", "REND_ROW_REMOVED_SINCE", "GENERAL_REMOVED_SINCE");
replace("/Users/grahamegrieve/work/core", "REND_SINCE_DELETED", "GENERAL_REMOVED_SINCE");
// This element can be extended by named JSON elements
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_JSON_ELE", "STRUC_DEF_EXT_JSON");
// This element is a modifier element
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_MOD_ELEMENT", "STRUC_DEF_MOD");
// This element is included in summaries
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUMM", "STRUC_DEF_ELE_INCLUDED");
// This element must be supported
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_SUPP", "STRUC_DEF_ELE_MUST_SUPP");
// This is a repeating choice group that does not appear directly in the instance
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_REP_CHOICE", "STRUC_DEF_REPEAT");
// This value set is a good set of codes to start with when designing your system
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_START_DEF", "ADD_BIND_DESIG_SYS");
// Title
rename("/Users/grahamegrieve/work/core", "CANON_REND_TITLE", "GENERAL_TITLE");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_TITLE", "GENERAL_TITLE");
replace("/Users/grahamegrieve/work/core", "QUEST_TITLE", "GENERAL_TITLE");
// Type
rename("/Users/grahamegrieve/work/core", "CAPABILITY_TYP", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "DATA_REND_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "EX_SCEN_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "OP_DEF_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "PROV_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "QUEST_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "SD_GRID_HEAD_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "SD_HEAD_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_TYPE", "GENERAL_TYPE");
replace("/Users/grahamegrieve/work/core", "TEST_PLAN_TYPE", "GENERAL_TYPE");
// UCUM
rename("/Users/grahamegrieve/work/core", "DATA_REND_UCUM", "GENERAL_UCUM");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_UCUM", "GENERAL_UCUM");
// URI
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_PROP_URI", "GENERAL_URI");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_URI", "GENERAL_URI");
// URL
rename("/Users/grahamegrieve/work/core", "QUEST_URL", "GENERAL_URL");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_URL", "GENERAL_URL");
// Usage
rename("/Users/grahamegrieve/work/core", "ADD_BIND_USE", "GENERAL_USAGE");
replace("/Users/grahamegrieve/work/core", "OBLIG_USE", "GENERAL_USAGE");
// Value
rename("/Users/grahamegrieve/work/core", "CODESYSTEM_FILTER_VALUE", "GENERAL_VALUE");
replace("/Users/grahamegrieve/work/core", "DATA_REND_VALUE", "GENERAL_VALUE");
replace("/Users/grahamegrieve/work/core", "DIAG_REP_REND_VALUE", "GENERAL_VALUE");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_VALUE", "GENERAL_VALUE");
// Value Set
rename("/Users/grahamegrieve/work/core", "CODE_SYS_VALUE_SET", "GENERAL_VALUESET");
replace("/Users/grahamegrieve/work/core", "QUEST_VALUE_SET", "GENERAL_VALUESET");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_VALUE", "GENERAL_VALUESET");
// Version
rename("/Users/grahamegrieve/work/core", "CANON_REND_VER", "GENERAL_VER");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_VER", "GENERAL_VER");
replace("/Users/grahamegrieve/work/core", "QUEST_VERSION", "GENERAL_VER");
replace("/Users/grahamegrieve/work/core", "RES_REND_VERSION", "GENERAL_VER");
replace("/Users/grahamegrieve/work/core", "TX_VERSION", "GENERAL_VER");
// XML
rename("/Users/grahamegrieve/work/core", "CANON_REND_XML", "GENERAL_XML");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_XML", "GENERAL_XML");
// for OID based terminology systems
rename("/Users/grahamegrieve/work/core", "CODE_SYS_FOR_OID", "CODE_SYS_FOR_OID");
replace("/Users/grahamegrieve/work/core", "NAME_SYS_FOROID", "CODE_SYS_FOR_OID");
replace("/Users/grahamegrieve/work/core", "VALUE_SET_OID_TERM_SYS", "CODE_SYS_FOR_OID");
// is prefixed to the value before validation
rename("/Users/grahamegrieve/work/core", "STRUC_DEF_PREFIXED", "STRUC_DEF_PREFIXED");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_PREFIX_VALID", "STRUC_DEF_PREFIXED");
// todo
replace("/Users/grahamegrieve/work/core", "OP_OUT_TODO", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "QUEST_TODO", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "RES_REND_TODO", "GENERAL_TODO");
replace("/Users/grahamegrieve/work/core", "STRUC_DEF_TODO", "GENERAL_TODO");
// version
rename("/Users/grahamegrieve/work/core", "EX_SCEN_VER", "GENERAL_VER_LOW");
replace("/Users/grahamegrieve/work/core", "VALUE_SET_VERSION", "GENERAL_VER_LOW");
// {0}, {1} by {2}
rename("/Users/grahamegrieve/work/core", "SD_SLICING_INFO", "SD_SLICING_INFO");
replace("/Users/grahamegrieve/work/core", "SD_SUMMARY_INFO", "SD_SLICING_INFO");
} }
private static void replace(String dir, String src, String tgt) throws FileNotFoundException, IOException { private static void replace(String dir, String src, String tgt) throws FileNotFoundException, IOException {
if (!src.equals(tgt)) {
System.out.println("Replace "+src+" with "+tgt+" in "+dir); System.out.println("Replace "+src+" with "+tgt+" in "+dir);
int count = replace(new File(dir), src, tgt); int count = replace(new File(dir), src, tgt);
System.out.println("Done. "+count+" files changed"); System.out.println("Done. "+count+" files changed");
} }
}
private static int replace(File file, String src, String tgt) throws FileNotFoundException, IOException { private static int replace(File file, String src, String tgt) throws FileNotFoundException, IOException {
int count = 0; int count = 0;
@ -47,18 +416,34 @@ public class I18nConstantMaintainer {
if ("java".equals(ext)) { if ("java".equals(ext)) {
String source = TextFile.fileToString(file); String source = TextFile.fileToString(file);
boolean mod = false; boolean mod = false;
if (source.contains("I18nConstants."+src)) { if (source.contains("I18nConstants."+src+",")) {
source = source.replace("I18nConstants."+src, "I18nConstants."+tgt); source = source.replace("I18nConstants."+src+",", "I18nConstants."+tgt+",");
mod = true; mod = true;
} }
if (source.contains("RenderingI18nContext."+src)) { if (source.contains("I18nConstants."+src+")")) {
source = source.replace("RenderingI18nContext."+src, "RenderingI18nContext."+tgt); source = source.replace("I18nConstants."+src+")", "I18nConstants."+tgt+")");
mod = true; mod = true;
} }
if (source.contains("RenderingContext."+src)) {
source = source.replace("RenderingContext."+src, "RenderingContext."+tgt); if (source.contains("RenderingI18nContext."+src+",")) {
source = source.replace("RenderingI18nContext."+src+",", "RenderingI18nContext."+tgt+",");
mod = true; mod = true;
} }
if (source.contains("RenderingI18nContext."+src+")")) {
source = source.replace("RenderingI18nContext."+src+")", "RenderingI18nContext."+tgt+")");
mod = true;
}
if (source.contains("RenderingContext."+src+",")) {
source = source.replace("RenderingContext."+src+",", "RenderingContext."+tgt+",");
mod = true;
}
if (source.contains("RenderingContext."+src+")")) {
source = source.replace("RenderingContext."+src+")", "RenderingContext."+tgt+")");
mod = true;
}
if (file.getName().equals("I18nConstants.java") && source.contains(src)) { if (file.getName().equals("I18nConstants.java") && source.contains(src)) {
source = removeLines(source, src); source = removeLines(source, src);
mod = true; mod = true;
@ -88,7 +473,7 @@ public class I18nConstantMaintainer {
String[] lines = Utilities.splitLines(source); String[] lines = Utilities.splitLines(source);
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for (String s : lines) { for (String s : lines) {
if (!s.contains(src)) { if (!(s.contains(src+"\"") || s.contains(src+"=") || s.contains(src+" "))) {
b.append(s); b.append(s);
b.append("\r\n"); b.append("\r\n");
} }
@ -97,10 +482,12 @@ public class I18nConstantMaintainer {
} }
private static void rename(String dir, String src, String tgt) throws FileNotFoundException, IOException { private static void rename(String dir, String src, String tgt) throws FileNotFoundException, IOException {
if (!src.equals(tgt)) {
System.out.println("Rename "+src+" to "+tgt+" in "+dir); System.out.println("Rename "+src+" to "+tgt+" in "+dir);
int count = rename(new File(dir), src, tgt); int count = rename(new File(dir), src, tgt);
System.out.println("Done. "+count+" files changed"); System.out.println("Done. "+count+" files changed");
} }
}
private static int rename(File file, String src, String tgt) throws FileNotFoundException, IOException { private static int rename(File file, String src, String tgt) throws FileNotFoundException, IOException {
int count = 0; int count = 0;
@ -113,26 +500,62 @@ public class I18nConstantMaintainer {
if ("java".equals(ext)) { if ("java".equals(ext)) {
String source = TextFile.fileToString(file); String source = TextFile.fileToString(file);
boolean mod = false; boolean mod = false;
if (source.contains("I18nConstants."+src)) {
source = source.replace("I18nConstants."+src, "I18nConstants."+tgt); if (source.contains("I18nConstants."+src+",")) {
source = source.replace("I18nConstants."+src+",", "I18nConstants."+tgt+",");
mod = true; mod = true;
} }
if (source.contains("RenderingI18nContext."+src)) { if (source.contains("I18nConstants."+src+")")) {
source = source.replace("RenderingI18nContext."+src, "RenderingI18nContext."+tgt); source = source.replace("I18nConstants."+src+")", "I18nConstants."+tgt+")");
mod = true; mod = true;
} }
if (source.contains("RenderingContext."+src)) {
source = source.replace("RenderingContext."+src, "RenderingContext."+tgt); if (source.contains("RenderingI18nContext."+src+",")) {
source = source.replace("RenderingI18nContext."+src+",", "RenderingI18nContext."+tgt+",");
mod = true; mod = true;
} }
if (file.getName().equals("I18nConstants.java") && source.contains(src)) { if (source.contains("RenderingI18nContext."+src+")")) {
source = source.replace(src, tgt); source = source.replace("RenderingI18nContext."+src+")", "RenderingI18nContext."+tgt+")");
mod = true; mod = true;
} }
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src)) {
source = source.replace(src, tgt); if (source.contains("RenderingContext."+src+",")) {
source = source.replace("RenderingContext."+src+",", "RenderingContext."+tgt+",");
mod = true; mod = true;
} }
if (source.contains("RenderingContext."+src+")")) {
source = source.replace("RenderingContext."+src+")", "RenderingContext."+tgt+")");
mod = true;
}
if (file.getName().equals("I18nConstants.java") && source.contains(src+" =")) {
source = source.replace(src+" =", tgt+" =");
mod = true;
}
if (file.getName().equals("I18nConstants.java") && source.contains(src+"=")) {
source = source.replace(src+"=", tgt+" =");
mod = true;
}
if (file.getName().equals("I18nConstants.java") && source.contains(src+" =")) {
source = source.replace(src+" =", tgt+" =");
mod = true;
}
if (file.getName().equals("I18nConstants.java") && source.contains(src+"=")) {
source = source.replace(src+"=", tgt+" =");
mod = true;
}
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src+" =")) {
source = source.replace(src+" =", tgt+" =");
mod = true;
}
if (file.getName().equals("RenderingI18nContext.java") && source.contains(src+"=")) {
source = source.replace(src+"=", tgt+" =");
mod = true;
}
if (mod) { if (mod) {
TextFile.stringToFile(source, file); TextFile.stringToFile(source, file);
count++; count++;

View File

@ -1079,6 +1079,11 @@ public class I18nConstants {
public static final String _HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_ = "_has_children__and_multiple_types__in_profile_"; public static final String _HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_ = "_has_children__and_multiple_types__in_profile_";
public static final String _HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE = "_has_children__for_type__in_profile__but_cant_find_type"; public static final String _HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE = "_has_children__for_type__in_profile__but_cant_find_type";
public static final String _HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_ = "_has_no_children__and_no_types_in_profile_"; public static final String _HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_ = "_has_no_children__and_no_types_in_profile_";
public static final String TERMINOLOGY_TX_CODE_NOTVALID = "Terminology_TX_Code_NotValid";
public static final String TERMINOLOGY_TX_CODE_UNKNOWN = "Terminology_TX_Code_Unknown";
public static final String TERMINOLOGY_TX_CODE_VALUESET = "Terminology_TX_Code_ValueSet";
public static final String TERMINOLOGY_TX_CODE_VALUESETMAX = "Terminology_TX_Code_ValueSetMax";
public static final String TERMINOLOGY_TX_CODE_VALUESET_EXT = "Terminology_TX_Code_ValueSet_Ext";
//public static final String DUPLICATE_RESOURCE_VERSION = "DUPLICATE_RESOURCE_VERSION"; //public static final String DUPLICATE_RESOURCE_VERSION = "DUPLICATE_RESOURCE_VERSION";
//public static final String FHIRPATH_BAD_DATE = "FHIRPATH_BAD_DATE"; //public static final String FHIRPATH_BAD_DATE = "FHIRPATH_BAD_DATE";

View File

@ -43,24 +43,27 @@ public class POGenerator {
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
new POGenerator().execute(args[0], args[1]); new POGenerator().execute(args[0]);
} }
private List<String> prefixes = new ArrayList<>(); private List<String> prefixes = new ArrayList<>();
private void execute(String source, String dest) throws IOException { private void execute(String source) throws IOException {
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-de.po")); generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-de.po"), Utilities.path(source, "rendering-phrases_de.properties"), true);
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-es.po")); generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-es.po"), Utilities.path(source, "rendering-phrases_es.properties"), false);
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-ja.po")); generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-ja.po"), Utilities.path(source, "rendering-phrases_ja.properties"), false);
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(dest, "rendering-phrases-nl.po")); generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-nl.po"), Utilities.path(source, "rendering-phrases_nl.properties"), false);
generate(Utilities.path(source, "rendering-phrases.properties"), Utilities.path(source, "source", "rendering-phrases-pt-BR.po"), Utilities.path(source, "rendering-phrases_pt-BR.properties"), false);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-de.po"), Utilities.path(source, "Messages_de.properties"), true);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-es.po"), Utilities.path(source, "Messages_es.properties"), false);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-ja.po"), Utilities.path(source, "Messages_ja.properties"), false);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-nl.po"), Utilities.path(source, "Messages_nl.properties"), false);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(source, "source", "validator-messages-pt-BR.po"), Utilities.path(source, "Messages_pt-BR.properties"), false);
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-de.po"));
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-es.po"));
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-ja.po"));
generate(Utilities.path(source, "Messages.properties"), Utilities.path(dest, "validator-messages-nl.po"));
} }
private void generate(String source, String dest) throws IOException { private void generate(String source, String dest, String tgt, boolean firstRun) throws IOException {
// load the destination file // load the destination file
// load the source file // load the source file
// update the destination object set for changes from the source file // update the destination object set for changes from the source file
@ -95,10 +98,12 @@ public class POGenerator {
objects.removeIf(o -> o.orphan); objects.removeIf(o -> o.orphan);
Collections.sort(objects, new POObjectSorter()); Collections.sort(objects, new POObjectSorter());
Map<String, Integer> sources = new HashMap<>(); Map<String, Integer> sources = new HashMap<>();
Set<String> dups = new HashSet<>();
for (POObject o : objects) { for (POObject o : objects) {
if (sources.containsKey(o.msgid)) { if (sources.containsKey(o.msgid)) {
Integer c = sources.get(o.msgid)+1; Integer c = sources.get(o.msgid)+1;
sources.put(o.msgid, c); sources.put(o.msgid, c);
dups.add(o.msgid);
// System.out.println("Duplicate in "+dest.substring(dest.lastIndexOf("/")+1)+": "+o.msgid+" on ("+CommaSeparatedStringBuilder.join(",", listIds(objects, o.msgid))+")"); // System.out.println("Duplicate in "+dest.substring(dest.lastIndexOf("/")+1)+": "+o.msgid+" on ("+CommaSeparatedStringBuilder.join(",", listIds(objects, o.msgid))+")");
} else { } else {
sources.put(o.msgid, 1); sources.put(o.msgid, 1);
@ -110,7 +115,29 @@ public class POGenerator {
o.duplicate = true; o.duplicate = true;
} }
} }
if (firstRun) {
for (String s : Utilities.sorted(dups)) {
String mid = null;
boolean first = true;
for (POObject o : objects) {
if (o.msgid.equals(s) && o.msgidPlural == null) {
if (mid == null) {
mid = o.id;
} else {
if (first) {
System.out.println("");
System.out.println("// "+s);
System.out.println("rename(\"/Users/grahamegrieve/work/core\", \""+mid+"\", \""+mid+"\");");
first = false;
}
System.out.println("replace(\"/Users/grahamegrieve/work/core\", \""+o.id+"\", \""+mid+"\");");
}
}
}
}
}
savePOFile(dest, objects); savePOFile(dest, objects);
savePropFile(tgt, objects);
} }
private Set<String> listIds(List<POObject> objects, String msgid) { private Set<String> listIds(List<POObject> objects, String msgid) {
@ -198,12 +225,12 @@ public class POGenerator {
// we don't care; nothing to do // we don't care; nothing to do
} }
} else if (mode == 2) { } else if (mode == 2) {
if (!value.equals(o.msgid)) { if (!value.equals(o.msgidPlural)) {
// the english string has changed, and the other language string is now out of date // the english string has changed, and the other language string is now out of date
// if (o.oldMsgId != null) { // if (o.oldMsgId != null) {
// o.oldMsgId = o.msgid; // o.oldMsgId = o.msgid;
// } // }
o.msgid = value; o.msgidPlural = value;
if (o.msgstr.size() > 1 && !Utilities.noString(o.msgstr.get(1))) { if (o.msgstr.size() > 1 && !Utilities.noString(o.msgstr.get(1))) {
o.msgstr.set(1, "!!"+o.msgstr.get(1)); o.msgstr.set(1, "!!"+o.msgstr.get(1));
} }
@ -295,4 +322,27 @@ public class POGenerator {
return res; return res;
} }
private void savePropFile(String tgt, List<POObject> objects) throws IOException {
String nameLine = TextFile.fileToLines(tgt)[0];
String[] parts = nameLine.substring(1).trim().split("\\=");
String[] names = parts[1].split("\\,");
StringBuilder b = new StringBuilder();
b.append(nameLine+"\r\n");
for (POObject o : objects) {
if (o.msgidPlural == null) {
b.append(o.id+" = "+(o.msgstr.size() > 0 ? o.msgstr.get(0) : "")+"\r\n");
} else {
for (int i = 0; i < names.length; i++) {
b.append(o.id+"_"+names[i].trim()+" = "+(o.msgstr.size() > i ? o.msgstr.get(i) : "")+"\r\n");
}
}
}
TextFile.stringToFile(b.toString(), tgt);
}
} }

View File

@ -153,17 +153,20 @@ public class RenderingI18nContext extends I18nBase {
public static final String CODESYSTEM_CONTENT_SUPPLEMENT = "CODESYSTEM_CONTENT_SUPPLEMENT"; public static final String CODESYSTEM_CONTENT_SUPPLEMENT = "CODESYSTEM_CONTENT_SUPPLEMENT";
public static final String CODESYSTEM_DEPRECATED = "CODESYSTEM_DEPRECATED"; public static final String CODESYSTEM_DEPRECATED = "CODESYSTEM_DEPRECATED";
public static final String CODESYSTEM_FILTERS = "CODESYSTEM_FILTERS"; public static final String CODESYSTEM_FILTERS = "CODESYSTEM_FILTERS";
public static final String GENERAL_CODE = "GENERAL_CODE"; public static final String CODESYSTEM_FILTER_CODE = "CODESYSTEM_FILTER_CODE";
public static final String CODESYSTEM_FILTER_DESC = "CODESYSTEM_FILTER_DESC"; public static final String CODESYSTEM_FILTER_DESC = "CODESYSTEM_FILTER_DESC";
public static final String CODESYSTEM_FILTER_OP = "CODESYSTEM_FILTER_OP"; public static final String CODESYSTEM_FILTER_OP = "CODESYSTEM_FILTER_OP";
public static final String CODESYSTEM_FILTER_VALUE = "CODESYSTEM_FILTER_VALUE"; public static final String CODESYSTEM_FILTER_VALUE = "CODESYSTEM_FILTER_VALUE";
public static final String CODESYSTEM_PROPS = "CODESYSTEM_PROPS"; public static final String CODESYSTEM_PROPS = "CODESYSTEM_PROPS";
public static final String CODESYSTEM_PROPS_DESC = "CODESYSTEM_PROPS_DESC"; public static final String CODESYSTEM_PROPS_DESC = "CODESYSTEM_PROPS_DESC";
public static final String CODESYSTEM_PROP_CODE = "CODESYSTEM_PROP_CODE";
public static final String CODESYSTEM_PROP_DESC = "CODESYSTEM_PROP_DESC"; public static final String CODESYSTEM_PROP_DESC = "CODESYSTEM_PROP_DESC";
public static final String CODESYSTEM_PROP_NAME = "CODESYSTEM_PROP_NAME"; public static final String CODESYSTEM_PROP_NAME = "CODESYSTEM_PROP_NAME";
public static final String CODESYSTEM_PROP_TYPE = "CODESYSTEM_PROP_TYPE"; public static final String CODESYSTEM_PROP_TYPE = "CODESYSTEM_PROP_TYPE";
public static final String CODESYSTEM_PROP_URI = "CODESYSTEM_PROP_URI"; public static final String CODESYSTEM_PROP_URI = "CODESYSTEM_PROP_URI";
public static final String GENERAL_ADD_LANG = "GENERAL_ADD_LANG"; public static final String CODE_SYS_ADD_LANG = "CODE_SYS_ADD_LANG";
public static final String CODE_SYS_CODE = "CODE_SYS_CODE";
public static final String CODE_SYS_CODE_NOT_HERE = "CODE_SYS_CODE_NOT_HERE";
public static final String CODE_SYS_COMPLETE = "CODE_SYS_COMPLETE"; public static final String CODE_SYS_COMPLETE = "CODE_SYS_COMPLETE";
public static final String CODE_SYS_CONTENT = "CODE_SYS_CONTENT"; public static final String CODE_SYS_CONTENT = "CODE_SYS_CONTENT";
public static final String CODE_SYS_COPY = "CODE_SYS_COPY"; public static final String CODE_SYS_COPY = "CODE_SYS_COPY";
@ -184,6 +187,9 @@ public class RenderingI18nContext extends I18nBase {
public static final String CODE_SYS_UNKN_MODE = "CODE_SYS_UNKN_MODE"; public static final String CODE_SYS_UNKN_MODE = "CODE_SYS_UNKN_MODE";
public static final String CODE_SYS_VALUE_SET = "CODE_SYS_VALUE_SET"; public static final String CODE_SYS_VALUE_SET = "CODE_SYS_VALUE_SET";
public static final String CONC_MAP_CMNT = "CONC_MAP_CMNT"; public static final String CONC_MAP_CMNT = "CONC_MAP_CMNT";
public static final String CONC_MAP_CODE = "CONC_MAP_CODE";
public static final String CONC_MAP_CODES = "CONC_MAP_CODES";
public static final String CONC_MAP_CODE_SYS_UNSPEC = "CONC_MAP_CODE_SYS_UNSPEC";
public static final String CONC_MAP_FRM = "CONC_MAP_FRM"; public static final String CONC_MAP_FRM = "CONC_MAP_FRM";
public static final String CONC_MAP_FROM = "CONC_MAP_FROM"; public static final String CONC_MAP_FROM = "CONC_MAP_FROM";
public static final String CONC_MAP_GRP = "CONC_MAP_GRP"; public static final String CONC_MAP_GRP = "CONC_MAP_GRP";
@ -212,6 +218,8 @@ public class RenderingI18nContext extends I18nBase {
public static final String DATA_REND_BFMEALS = "DATA_REND_BFMEALS"; public static final String DATA_REND_BFMEALS = "DATA_REND_BFMEALS";
public static final String DATA_REND_BFSLEEP = "DATA_REND_BFSLEEP"; public static final String DATA_REND_BFSLEEP = "DATA_REND_BFSLEEP";
public static final String DATA_REND_BY = "DATA_REND_BY"; public static final String DATA_REND_BY = "DATA_REND_BY";
public static final String DATA_REND_CODE = "DATA_REND_CODE";
public static final String DATA_REND_CODES = "DATA_REND_CODES";
public static final String DATA_REND_COND = "DATA_REND_COND"; public static final String DATA_REND_COND = "DATA_REND_COND";
public static final String DATA_REND_COUNT = "DATA_REND_COUNT"; public static final String DATA_REND_COUNT = "DATA_REND_COUNT";
public static final String DATA_REND_DATA = "DATA_REND_DATA"; public static final String DATA_REND_DATA = "DATA_REND_DATA";
@ -226,6 +234,7 @@ public class RenderingI18nContext extends I18nBase {
public static final String DATA_REND_FACT = "DATA_REND_FACT"; public static final String DATA_REND_FACT = "DATA_REND_FACT";
public static final String DATA_REND_FAX = "DATA_REND_FAX"; public static final String DATA_REND_FAX = "DATA_REND_FAX";
public static final String DATA_REND_FILT = "DATA_REND_FILT"; public static final String DATA_REND_FILT = "DATA_REND_FILT";
public static final String DATA_REND_GETCODE = "DATA_REND_GETCODE";
public static final String DATA_REND_GLN = "DATA_REND_GLN"; public static final String DATA_REND_GLN = "DATA_REND_GLN";
public static final String DATA_REND_ICD = "DATA_REND_ICD"; public static final String DATA_REND_ICD = "DATA_REND_ICD";
public static final String DATA_REND_INT = "DATA_REND_INT"; public static final String DATA_REND_INT = "DATA_REND_INT";
@ -264,6 +273,8 @@ public class RenderingI18nContext extends I18nBase {
public static final String DATA_REND_VALUESET = "DATA_REND_VALUESET"; public static final String DATA_REND_VALUESET = "DATA_REND_VALUESET";
public static final String DATA_REND_VERSION = "DATA_REND_VERSION"; public static final String DATA_REND_VERSION = "DATA_REND_VERSION";
public static final String DIAG_REP_REND_AGE = "DIAG_REP_REND_AGE"; public static final String DIAG_REP_REND_AGE = "DIAG_REP_REND_AGE";
public static final String DIAG_REP_REND_CODE = "DIAG_REP_REND_CODE";
public static final String DIAG_REP_REND_CODECON = "DIAG_REP_REND_CODECON";
public static final String DIAG_REP_REND_ERR = "DIAG_REP_REND_ERR"; public static final String DIAG_REP_REND_ERR = "DIAG_REP_REND_ERR";
public static final String DIAG_REP_REND_FLAG = "DIAG_REP_REND_FLAG"; public static final String DIAG_REP_REND_FLAG = "DIAG_REP_REND_FLAG";
public static final String DIAG_REP_REND_FOR = "DIAG_REP_REND_FOR"; public static final String DIAG_REP_REND_FOR = "DIAG_REP_REND_FOR";
@ -322,6 +333,7 @@ public class RenderingI18nContext extends I18nBase {
public static final String LIB_REND_REV = "LIB_REND_REV"; public static final String LIB_REND_REV = "LIB_REND_REV";
public static final String LIB_REND_SHOW = "LIB_REND_SHOW"; public static final String LIB_REND_SHOW = "LIB_REND_SHOW";
public static final String LIB_REND_SIZE = "LIB_REND_SIZE"; public static final String LIB_REND_SIZE = "LIB_REND_SIZE";
public static final String LIST_REND_CODE = "LIST_REND_CODE";
public static final String LIST_REND_DAT = "LIST_REND_DAT"; public static final String LIST_REND_DAT = "LIST_REND_DAT";
public static final String LIST_REND_DATE = "LIST_REND_DATE"; public static final String LIST_REND_DATE = "LIST_REND_DATE";
public static final String LIST_REND_DEL = "LIST_REND_DEL"; public static final String LIST_REND_DEL = "LIST_REND_DEL";
@ -357,8 +369,8 @@ public class RenderingI18nContext extends I18nBase {
public static final String OBLIG_FILT = "OBLIG_FILT"; public static final String OBLIG_FILT = "OBLIG_FILT";
public static final String OBLIG_OBLIG = "OBLIG_OBLIG"; public static final String OBLIG_OBLIG = "OBLIG_OBLIG";
public static final String OBLIG_USE = "OBLIG_USE"; public static final String OBLIG_USE = "OBLIG_USE";
public static final String GENERAL_BINDING = "GENERAL_BINDING"; public static final String OP_DEF_BIND = "OP_DEF_BIND";
public static final String GENERAL_CARDINALITY = "GENERAL_CARDINALITY"; public static final String OP_DEF_CARD = "OP_DEF_CARD";
public static final String OP_DEF_DOC = "OP_DEF_DOC"; public static final String OP_DEF_DOC = "OP_DEF_DOC";
public static final String OP_DEF_INPAR = "OP_DEF_INPAR"; public static final String OP_DEF_INPAR = "OP_DEF_INPAR";
public static final String OP_DEF_NAME = "OP_DEF_NAME"; public static final String OP_DEF_NAME = "OP_DEF_NAME";
@ -370,6 +382,7 @@ public class RenderingI18nContext extends I18nBase {
public static final String OP_DEF_URL = "OP_DEF_URL"; public static final String OP_DEF_URL = "OP_DEF_URL";
public static final String OP_DEF_URLS = "OP_DEF_URLS"; public static final String OP_DEF_URLS = "OP_DEF_URLS";
public static final String OP_DEF_USE = "OP_DEF_USE"; public static final String OP_DEF_USE = "OP_DEF_USE";
public static final String OP_OUT_CODE = "OP_OUT_CODE";
public static final String OP_OUT_DET = "OP_OUT_DET"; public static final String OP_OUT_DET = "OP_OUT_DET";
public static final String OP_OUT_DIAG = "OP_OUT_DIAG"; public static final String OP_OUT_DIAG = "OP_OUT_DIAG";
public static final String OP_OUT_LOC = "OP_OUT_LOC"; public static final String OP_OUT_LOC = "OP_OUT_LOC";
@ -446,7 +459,9 @@ public class RenderingI18nContext extends I18nBase {
public static final String QUEST_ATTRIBUTES = "QUEST_ATTRIBUTES"; public static final String QUEST_ATTRIBUTES = "QUEST_ATTRIBUTES";
public static final String QUEST_CALC = "QUEST_CALC"; public static final String QUEST_CALC = "QUEST_CALC";
public static final String QUEST_CAND = "QUEST_CAND"; public static final String QUEST_CAND = "QUEST_CAND";
public static final String QUEST_CARD = "QUEST_CARD";
public static final String QUEST_CAT = "QUEST_CAT"; public static final String QUEST_CAT = "QUEST_CAT";
public static final String QUEST_CODE = "QUEST_CODE";
public static final String QUEST_CONT = "QUEST_CONT"; public static final String QUEST_CONT = "QUEST_CONT";
public static final String QUEST_COPYRIGHT = "QUEST_COPYRIGHT"; public static final String QUEST_COPYRIGHT = "QUEST_COPYRIGHT";
public static final String QUEST_DEF = "QUEST_DEF"; public static final String QUEST_DEF = "QUEST_DEF";
@ -586,14 +601,16 @@ public class RenderingI18nContext extends I18nBase {
public static final String SD_COMP_HEAD_TYPE_R = "SD_COMP_HEAD_TYPE_R"; 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_TYPE_R_DESC ="SD_COMP_HEAD_TYPE_R_DESC";
public static final String SD_DOCO = "SD_DOCO"; public static final String SD_DOCO = "SD_DOCO";
public static final String GENERAL_CARD = "GENERAL_CARD"; public static final String SD_GRID_HEAD_CARD = "SD_GRID_HEAD_CARD";
public static final String GENERAL_CARD_DESC = "GENERAL_CARD_DESC"; public static final String SD_GRID_HEAD_CARD_DESC = "SD_GRID_HEAD_CARD_DESC";
public static final String SD_GRID_HEAD_DESC = "SD_GRID_HEAD_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_GRID_HEAD_DESC_DESC = "SD_GRID_HEAD_DESC_DESC";
public static final String SD_GRID_HEAD_NAME = "SD_GRID_HEAD_NAME"; 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_NAME_DESC = "SD_GRID_HEAD_NAME_DESC";
public static final String SD_GRID_HEAD_TYPE = "SD_GRID_HEAD_TYPE"; 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_TYPE_DESC = "SD_GRID_HEAD_TYPE_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_DESC = "SD_HEAD_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_HEAD_DESC_DESC = "SD_HEAD_DESC_DESC";
public static final String SD_HEAD_FLAGS = "SD_HEAD_FLAGS"; public static final String SD_HEAD_FLAGS = "SD_HEAD_FLAGS";
@ -648,6 +665,9 @@ public class RenderingI18nContext extends I18nBase {
public static final String STRUC_DEF_APPROP_CON = "STRUC_DEF_APPROP_CON"; public static final String STRUC_DEF_APPROP_CON = "STRUC_DEF_APPROP_CON";
public static final String STRUC_DEF_AS_SHOWN = "STRUC_DEF_AS_SHOWN"; public static final String STRUC_DEF_AS_SHOWN = "STRUC_DEF_AS_SHOWN";
public static final String STRUC_DEF_BECAUSE = "STRUC_DEF_BECAUSE"; public static final String STRUC_DEF_BECAUSE = "STRUC_DEF_BECAUSE";
public static final String STRUC_DEF_BINDING = "STRUC_DEF_BINDING";
public static final String STRUC_DEF_BINDINGS = "STRUC_DEF_BINDINGS";
public static final String STRUC_DEF_BINDING_STYLE = "STRUC_DEF_BINDING_STYLE";
public static final String STRUC_DEF_BIND_STYLE = "STRUC_DEF_BIND_STYLE"; public static final String STRUC_DEF_BIND_STYLE = "STRUC_DEF_BIND_STYLE";
public static final String STRUC_DEF_BLACK = "STRUC_DEF_BLACK"; public static final String STRUC_DEF_BLACK = "STRUC_DEF_BLACK";
public static final String STRUC_DEF_BUSINESS_ID = "STRUC_DEF_BUSINESS_ID"; public static final String STRUC_DEF_BUSINESS_ID = "STRUC_DEF_BUSINESS_ID";
@ -658,6 +678,7 @@ public class RenderingI18nContext extends I18nBase {
public static final String STRUC_DEF_CANT_FIND = "STRUC_DEF_CANT_FIND"; public static final String STRUC_DEF_CANT_FIND = "STRUC_DEF_CANT_FIND";
public static final String STRUC_DEF_CAN_TARGET = "STRUC_DEF_CAN_TARGET"; public static final String STRUC_DEF_CAN_TARGET = "STRUC_DEF_CAN_TARGET";
public static final String STRUC_DEF_CAP = "STRUC_DEF_CAP"; public static final String STRUC_DEF_CAP = "STRUC_DEF_CAP";
public static final String STRUC_DEF_CARD = "STRUC_DEF_CARD";
public static final String STRUC_DEF_CDA = "STRUC_DEF_CDA"; public static final String STRUC_DEF_CDA = "STRUC_DEF_CDA";
public static final String STRUC_DEF_CHILD = "STRUC_DEF_CHILD"; public static final String STRUC_DEF_CHILD = "STRUC_DEF_CHILD";
public static final String STRUC_DEF_CHOICE = "STRUC_DEF_CHOICE"; public static final String STRUC_DEF_CHOICE = "STRUC_DEF_CHOICE";
@ -849,6 +870,7 @@ public class RenderingI18nContext extends I18nBase {
public static final String STRUC_DEF_SLICE_NAME = "STRUC_DEF_SLICE_NAME"; public static final String STRUC_DEF_SLICE_NAME = "STRUC_DEF_SLICE_NAME";
public static final String STRUC_DEF_SLICE_PAR = "STRUC_DEF_SLICE_PAR"; public static final String STRUC_DEF_SLICE_PAR = "STRUC_DEF_SLICE_PAR";
public static final String STRUC_DEF_SNOMED = "STRUC_DEF_SNOMED"; public static final String STRUC_DEF_SNOMED = "STRUC_DEF_SNOMED";
public static final String STRUC_DEF_SNOMED_CODE = "STRUC_DEF_SNOMED_CODE";
public static final String STRUC_DEF_SNOMED_CT = "STRUC_DEF_SNOMED_CT"; public static final String STRUC_DEF_SNOMED_CT = "STRUC_DEF_SNOMED_CT";
public static final String STRUC_DEF_STAND_STAT = "STRUC_DEF_STAND_STAT"; public static final String STRUC_DEF_STAND_STAT = "STRUC_DEF_STAND_STAT";
public static final String STRUC_DEF_STAND_STATUS = "STRUC_DEF_STAND_STATUS"; public static final String STRUC_DEF_STAND_STATUS = "STRUC_DEF_STAND_STATUS";
@ -956,17 +978,23 @@ public class RenderingI18nContext extends I18nBase {
public static final String TEXT_ICON_REUSE = "TEXT_ICON_REUSE"; public static final String TEXT_ICON_REUSE = "TEXT_ICON_REUSE";
public static final String TEXT_ICON_SLICE = "TEXT_ICON_SLICE"; public static final String TEXT_ICON_SLICE = "TEXT_ICON_SLICE";
public static final String TEXT_ICON_SLICE_ITEM = "TEXT_ICON_SLICE_ITEM"; public static final String TEXT_ICON_SLICE_ITEM = "TEXT_ICON_SLICE_ITEM";
public static final String TX_CODE = "TX_CODE";
public static final String TX_COMMENTS = "TX_COMMENTS"; public static final String TX_COMMENTS = "TX_COMMENTS";
public static final String TX_DEFINITION = "TX_DEFINITION"; public static final String TX_DEFINITION = "TX_DEFINITION";
public static final String TX_DEPRECATED = "TX_DEPRECATED"; public static final String TX_DEPRECATED = "TX_DEPRECATED";
public static final String TX_DISPLAY = "TX_DISPLAY"; public static final String TX_DISPLAY = "TX_DISPLAY";
public static final String TX_VERSION = "TX_VERSION"; public static final String TX_VERSION = "TX_VERSION";
public static final String VALUE_SET_ADD_DESIG = "VALUE_SET_ADD_DESIG"; public static final String VALUE_SET_ADD_DESIG = "VALUE_SET_ADD_DESIG";
public static final String VALUE_SET_ADD_LANG = "VALUE_SET_ADD_LANG";
public static final String VALUE_SET_ALL_CODE = "VALUE_SET_ALL_CODE"; public static final String VALUE_SET_ALL_CODE = "VALUE_SET_ALL_CODE";
public static final String VALUE_SET_ALL_CODES_DEF = "VALUE_SET_ALL_CODES_DEF"; public static final String VALUE_SET_ALL_CODES_DEF = "VALUE_SET_ALL_CODES_DEF";
public static final String VALUE_SET_AND = "VALUE_SET_AND"; public static final String VALUE_SET_AND = "VALUE_SET_AND";
public static final String VALUE_SET_HAS_AT_LEAST = "VALUE_SET_HAS_AT_LEAST"; public static final String VALUE_SET_HAS_AT_LEAST = "VALUE_SET_HAS_AT_LEAST";
public static final String VALUE_SET_AUS = "VALUE_SET_AUS"; public static final String VALUE_SET_AUS = "VALUE_SET_AUS";
public static final String VALUE_SET_CODE = "VALUE_SET_CODE";
public static final String VALUE_SET_CODES_FROM = "VALUE_SET_CODES_FROM";
public static final String VALUE_SET_CODE_ITEM = "VALUE_SET_CODE_ITEM";
public static final String VALUE_SET_CODE_SELEC = "VALUE_SET_CODE_SELEC";
public static final String VALUE_SET_COMMA = "VALUE_SET_COMMA"; public static final String VALUE_SET_COMMA = "VALUE_SET_COMMA";
public static final String VALUE_SET_CONT = "VALUE_SET_CONT"; public static final String VALUE_SET_CONT = "VALUE_SET_CONT";
public static final String VALUE_SET_CONTAINS = "VALUE_SET_CONTAINS"; public static final String VALUE_SET_CONTAINS = "VALUE_SET_CONTAINS";

View File

@ -673,7 +673,7 @@ public class HierarchicalTableGenerator {
model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views")); model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views"));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_CARD_DESC), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0));
if (isLogical) { if (isLogical) {
@ -710,7 +710,7 @@ public class HierarchicalTableGenerator {
public TableModel initGridTable(String prefix, String id) { public TableModel initGridTable(String prefix, String id) {
TableModel model = new TableModel(id, false); TableModel model = new TableModel(id, false);
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD), i18n.formatPhrase(RenderingI18nContext.GENERAL_CARD_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_CARD_DESC), null, 0));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100));
model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0)); model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatPhrase(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0));

View File

@ -1171,7 +1171,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
CodeSystem cs = getCodeSystem(system); CodeSystem cs = getCodeSystem(system);
if (rule(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, cs != null, I18nConstants.TERMINOLOGY_TX_SYSTEM_UNKNOWN, system)) { if (rule(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, cs != null, I18nConstants.TERMINOLOGY_TX_SYSTEM_UNKNOWN, system)) {
ConceptDefinitionComponent def = getCodeDefinition(cs, code); ConceptDefinitionComponent def = getCodeDefinition(cs, code);
if (warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, def != null, I18nConstants.TERMINOLOGY_TX_CODE_UNKNOWN, system, code)) if (warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, def != null, I18nConstants.UNKNOWN_CODESYSTEM, system, code))
return warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, display == null || display.equals(def.getDisplay()), I18nConstants.TERMINOLOGY_TX_DISPLAY_WRONG, def.getDisplay()) && ok; return warning(errors, NO_RULE_DATE, IssueType.CODEINVALID, element.line(), element.col(), path, display == null || display.equals(def.getDisplay()), I18nConstants.TERMINOLOGY_TX_DISPLAY_WRONG, def.getDisplay()) && ok;
} }
return false; return false;