Commit 2ac98e22 authored by Thomas Huster's avatar Thomas Huster
Browse files

[22205] fix findings component on edit dialog, order of group children

parent 6c9ecf9d
......@@ -7,6 +7,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
......@@ -504,4 +505,11 @@ public class Observation
// TODO Auto-generated method stub
return null;
}
@Override
public String toString() {
StringJoiner sj = new StringJoiner(", ");
getCoding().stream().forEach(c -> sj.add(c.getCode() + "|" + c.getSystem()));
return super.toString() + " coding [" + sj.toString() + "]";
}
}
......@@ -2,7 +2,6 @@ package ch.elexis.core.findings.ui.dialogs;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.jface.action.Action;
......@@ -82,8 +81,6 @@ public class FindingsEditDialog extends TitleAreaDialog {
StringBuilder sb = new StringBuilder();
refChildrens.stream().forEach(o -> sb.append(o.getCoding().get(0).getDisplay())
.append((o).isDeleted()).append(","));
// use reverse order for references to create ui components
Collections.reverse(refChildrens);
List<ObservationComponent> compChildrens = item.getComponents();
if (refChildrens.isEmpty() && compChildrens.isEmpty()) {
current = createComposite((Composite) current, item, null);
......@@ -158,6 +155,7 @@ public class FindingsEditDialog extends TitleAreaDialog {
if (iFinding instanceof IObservation) {
ObservationType type = ((IObservation) iFinding).getObservationType();
switch (type) {
case COMP:
case NUMERIC:
case TEXT:
return new CompositeTextUnit(parent, iFinding, backboneComponent);
......@@ -166,7 +164,9 @@ public class FindingsEditDialog extends TitleAreaDialog {
case DATE:
return new CompositeDate(parent, iFinding, backboneComponent);
default:
throw new IllegalStateException("No composite for observation type [" + type + "]");
throw new IllegalStateException(
"No composite for observation type [" + type + "] of ["
+ iFinding + "]");
}
}
throw new IllegalStateException("No composite for finding [" + iFinding + "]");
......
package ch.elexis.core.findings.util;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
......@@ -34,7 +33,6 @@ public class FindingsTextUtil {
List<IObservation> children =
observation.getTargetObseravtions(ObservationLinkType.REF);
Collections.reverse(children);
for (int i = 0; i < children.size(); i++) {
if (i > 0) {
stringBuilder.append(", ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment