Skip to content

Commit

Permalink
#8111 - Preserv symptom date if it was set
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcaruntu-vita committed Mar 15, 2022
1 parent d874e30 commit 3ec3002
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -32,6 +32,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -1028,7 +1029,10 @@ private void addListenerForOnsetFields(ComboBox onsetSymptom, DateField onsetDat
onsetSymptom.removeItem(sourceField.getCaption());
boolean isOnsetDateFieldEnabled = isAnySymptomSetToYes(getFieldGroup(), allPropertyIds, Arrays.asList(SymptomState.YES));
onsetDateField.setEnabled(isOnsetDateFieldEnabled);
if (!isOnsetDateFieldEnabled) {
Date onsetDate = getValue().getOnsetDate();
if (onsetDate != null) {
onsetDateField.setValue(onsetDate);
} else if (!isOnsetDateFieldEnabled) {
onsetDateField.setValue(null);
}
}
Expand Down

0 comments on commit 3ec3002

Please sign in to comment.