Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1370,10 +1370,7 @@ public static SymptomsDto build() {
MATERNAL_DEATHS,
PERINATAL_DEATHS,
INFLUENZA,
INFLUENZA_A,
INFLUENZA_B,
H_METAPNEUMOVIRUS,
RESPIRATORY_SYNCYTIAL_VIRUS,
PARAINFLUENZA_1_4,
ADENOVIRUS,
RHINOVIRUS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,10 @@ public boolean isAnySymptomSetToYes(FieldGroup fieldGroup, List<String> sourcePr
return false;
}

public boolean isAnySymptomVisible(FieldGroup fieldGroup, List<String> sourcePropertyIds, List<Object> sourceValues) {
return true;
}

@SuppressWarnings("rawtypes")
private void addListenerForOnsetFields(ComboBox onsetSymptom, DateField onsetDateField) {
List<String> allPropertyIds =
Expand All @@ -1196,9 +1200,9 @@ private void addListenerForOnsetFields(ComboBox onsetSymptom, DateField onsetDat
onsetDateField.setEnabled(true);
} else {
onsetSymptom.removeItem(sourceField.getCaption());
final Date onsetDate = getValue().getOnsetDate();
boolean isOnsetDateFieldEnabled = isAnySymptomSetToYes(getFieldGroup(), allPropertyIds, Arrays.asList(SymptomState.YES));
onsetDateField.setEnabled(isOnsetDateFieldEnabled);
Date onsetDate = getValue().getOnsetDate();
onsetDateField.setEnabled(isOnsetDateFieldEnabled || !onsetSymptom.isVisible());
if (onsetDate != null) {
onsetDateField.setValue(onsetDate);
} else if (!isOnsetDateFieldEnabled) {
Expand All @@ -1209,7 +1213,9 @@ private void addListenerForOnsetFields(ComboBox onsetSymptom, DateField onsetDat
});
}
onsetSymptom.setEnabled(false); // will be updated by listener if needed
onsetDateField.setEnabled(false); // will be updated by listener if needed

// make onsetDate editable for diseases that have no symptoms (a.k. no first symptom)
onsetDateField.setEnabled(!onsetSymptom.isVisible());
}

private void setUpMonkeypoxVisibilities() {
Expand Down
Loading