Fix erroneous handling of designations with a matching language to the base display

This commit is contained in:
Grahame Grieve 2023-08-22 12:08:53 +10:00
parent 013cff09b7
commit e11f03bd8a
1 changed files with 6 additions and 1 deletions

View File

@ -207,7 +207,12 @@ public class ValueSetExpander extends ValueSetProcessBase {
String dstLang = focus.getLanguage(); String dstLang = focus.getLanguage();
boolean usedDisplay = false; boolean usedDisplay = false;
ConceptDefinitionDesignationComponent tu = expParams.hasParameter("displayLanguage") ? getMatchingLang(designations, expParams.getParameterString("displayLanguage")) : null; ConceptDefinitionDesignationComponent tu;
if (LanguageUtils.langsMatch(dstLang, dispLang)) {
tu = null; // use display
} else {
tu = expParams.hasParameter("displayLanguage") ? getMatchingLang(designations, expParams.getParameterString("displayLanguage")) : null;
}
if (tu != null) { if (tu != null) {
n.setDisplay(tu.getValue()); n.setDisplay(tu.getValue());
} else if (display != null && (srcLang == null || dstLang == null || LanguageUtils.langsMatch(dstLang, srcLang))) { } else if (display != null && (srcLang == null || dstLang == null || LanguageUtils.langsMatch(dstLang, srcLang))) {