fix value set expansion bugs

This commit is contained in:
Grahame Grieve 2024-06-14 21:56:23 +10:00
parent e731c0c059
commit e4abcd1be3
2 changed files with 8 additions and 6 deletions

View File

@ -216,7 +216,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (vs.getExpansion().hasTotal()) {
if (count != vs.getExpansion().getTotal()) {
x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px")
.addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal()));
.addText(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_HAS_AT_LEAST : RenderingContext.VALUE_SET_HAS, vs.getExpansion().getTotal(), count));
} else {
x.para().tx(context.formatPhrase(hasFragment ? RenderingContext.VALUE_SET_CONTAINS_AT_LEAST : RenderingContext.VALUE_SET_CONTAINS, vs.getExpansion().getTotal()));
}

View File

@ -319,7 +319,9 @@ public class ValueSetExpander extends ValueSetProcessBase {
}
String s = key(n);
if (wc.getMap().containsKey(s) || wc.getExcludeKeys().contains(s)) {
if (wc.getExcludeKeys().contains(s)) {
return null;
} else if (wc.getMap().containsKey(s)) {
wc.setCanBeHierarchy(false);
} else {
wc.getCodes().add(n);
@ -832,8 +834,9 @@ public class ValueSetExpander extends ValueSetProcessBase {
throws ETooCostly, FileNotFoundException, IOException, FHIRException, CodeSystemProviderExtension {
compose.checkNoModifiers("ValueSet.compose", "expanding");
// Exclude comes first because we build up a map of things to exclude
for (ConceptSetComponent inc : compose.getExclude())
for (ConceptSetComponent inc : compose.getExclude()) {
excludeCodes(dwc, inc, expParams, exp, valueSet);
}
dwc.setCanBeHierarchy(!expParams.getParameterBool("excludeNested") && dwc.getExcludeKeys().isEmpty() && dwc.getExcludeSystems().isEmpty() && dwc.getOffsetParam() == 0);
includeAbstract = !expParams.getParameterBool("excludeNotForUI");
boolean first = true;
@ -898,9 +901,8 @@ public class ValueSetExpander extends ValueSetProcessBase {
}
}
}
if (evs.hasTotal()) {
dwc.incTotal(evs.getTotal());
} else {
if (!evs.hasTotal()) {
// because if there's no total, we can't know if we got everything
dwc.setNoTotal(true);
}
for (ValueSetExpansionParameterComponent p : evs.getParameter()) {