fix bug handling invalid codes when expanding

This commit is contained in:
Grahame Grieve 2023-08-21 16:29:54 +10:00
parent 9457b79ac1
commit 69d2a12a2b
1 changed files with 5 additions and 3 deletions

View File

@ -877,9 +877,9 @@ public class ValueSetExpander extends ValueSetProcessBase {
def.checkNoModifiers("Code in Code System", "expanding"); def.checkNoModifiers("Code in Code System", "expanding");
inactive = CodeSystemUtilities.isInactive(cs, def); inactive = CodeSystemUtilities.isInactive(cs, def);
isAbstract = CodeSystemUtilities.isNotSelectable(cs, def); isAbstract = CodeSystemUtilities.isNotSelectable(cs, def);
addCode(dwc, inc.getSystem(), c.getCode(), !Utilities.noString(c.getDisplay()) ? c.getDisplay() : def.getDisplay(), c.hasDisplay() ? vsSrc.getLanguage() : cs.getLanguage(), null, mergeDesignations(def, convertDesignations(c.getDesignation())),
expParams, isAbstract, inactive, imports, noInactive, false, exp.getProperty(), makeCSProps(def.getDefinition(), def.getProperty()), null, def.getExtension(), c.getExtension(), exp);
} }
addCode(dwc, inc.getSystem(), c.getCode(), !Utilities.noString(c.getDisplay()) ? c.getDisplay() : def == null ? null : def.getDisplay(), c.hasDisplay() ? vsSrc.getLanguage() : cs.getLanguage(), null, mergeDesignations(def, convertDesignations(c.getDesignation())),
expParams, isAbstract, inactive, imports, noInactive, false, exp.getProperty(), def == null ? null : makeCSProps(def.getDefinition(), def.getProperty()), null, def == null ? null : def.getExtension(), c.getExtension(), exp);
} }
} }
if (inc.getFilter().size() > 0) { if (inc.getFilter().size() > 0) {
@ -963,7 +963,9 @@ public class ValueSetExpander extends ValueSetProcessBase {
private List<ConceptDefinitionDesignationComponent> mergeDesignations(ConceptDefinitionComponent def, private List<ConceptDefinitionDesignationComponent> mergeDesignations(ConceptDefinitionComponent def,
List<ConceptDefinitionDesignationComponent> list) { List<ConceptDefinitionDesignationComponent> list) {
List<ConceptDefinitionDesignationComponent> res = new ArrayList<>(); List<ConceptDefinitionDesignationComponent> res = new ArrayList<>();
if (def != null) {
res.addAll(def.getDesignation()); res.addAll(def.getDesignation());
}
res.addAll(list); res.addAll(list);
return res; return res;
} }