Don't produce 2 columns for status for deprecated codes

This commit is contained in:
Grahame Grieve 2020-07-30 12:00:30 +10:00
parent bde55f1872
commit 4b5470f825
1 changed files with 9 additions and 5 deletions

View File

@ -138,6 +138,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
boolean display = false;
boolean hierarchy = false;
boolean version = false;
boolean ignoreStatus = false;
List<PropertyComponent> properties = new ArrayList<>();
for (PropertyComponent cp : cs.getProperty()) {
if (showPropertyInTable(cp)) {
@ -147,12 +148,15 @@ public class CodeSystemRenderer extends TerminologyRenderer {
}
if (exists) {
properties.add(cp);
if ("status".equals(cp.getCode())) {
ignoreStatus = true;
}
}
}
}
for (ConceptDefinitionComponent c : cs.getConcept()) {
commentS = commentS || conceptsHaveComments(c);
deprecated = deprecated || conceptsHaveDeprecated(cs, c);
deprecated = deprecated || conceptsHaveDeprecated(cs, c, ignoreStatus);
display = display || conceptsHaveDisplay(c);
version = version || conceptsHaveVersion(c);
hierarchy = hierarchy || c.hasConcept();
@ -255,11 +259,11 @@ public class CodeSystemRenderer extends TerminologyRenderer {
return false;
}
private boolean conceptsHaveDeprecated(CodeSystem cs, ConceptDefinitionComponent c) {
if (CodeSystemUtilities.isDeprecated(cs, c))
private boolean conceptsHaveDeprecated(CodeSystem cs, ConceptDefinitionComponent c, boolean ignoreStatus) {
if (CodeSystemUtilities.isDeprecated(cs, c, ignoreStatus))
return true;
for (ConceptDefinitionComponent g : c.getConcept())
if (conceptsHaveDeprecated(cs, g))
if (conceptsHaveDeprecated(cs, g, ignoreStatus))
return true;
return false;
}
@ -325,7 +329,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
}
if (deprecated) {
td = tr.td();
Boolean b = CodeSystemUtilities.isDeprecated(cs, c);
Boolean b = CodeSystemUtilities.isDeprecated(cs, c, false);
if (b != null && b) {
smartAddText(td, getContext().getWorker().translator().translate("xhtml-gen-cs", "Deprecated", getContext().getLang()));
hasExtensions = true;