Skip to content

Commit

Permalink
#180: Implemented symptom features for IDSR
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Oct 14, 2024
1 parent 1deb2b6 commit b7c2a04
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ public void onAfterLayoutBinding(FragmentSymptomsEditLayoutBinding contentBindin
);
}

if( disease == Disease.IMMEDIATE_CASE_BASED_FORM_OTHER_CONDITIONS){
contentBinding.btnClearAll.setVisibility(GONE);
contentBinding.btnClearedToNo.setVisibility(GONE);
contentBinding.btnClearedToUnknown.setVisibility(GONE);
contentBinding.symptomsOnsetSymptom.setVisibility(GONE);
contentBinding.symptomsDescription.setVisibility(GONE);
contentBinding.symptomsSignsAndSymptons.setVisibility(GONE);
}

contentBinding.symptomsCongenitalHeartDisease.addValueChangedListener(e -> {
if (e.getValue() != SymptomState.YES) {
contentBinding.symptomsCongenitalHeartDiseaseDetails.setVisibility(GONE);
Expand Down Expand Up @@ -300,8 +309,12 @@ public void onChange(ControlPropertyField field) {
}

onsetSymptomField.initializeSpinner(DataUtils.addEmptyItem(initialSpinnerItems));
onsetSymptomField.setEnabled(onsetSymptomField.getAdapter().getCount() > 1); // first is "empty item"
onsetDateField.setEnabled(isAnySymptomSetToYes());

if ( disease != Disease.IMMEDIATE_CASE_BASED_FORM_OTHER_CONDITIONS) {
onsetSymptomField.setEnabled(onsetSymptomField.getAdapter().getCount() > 1); // first is "empty item"
onsetDateField.setEnabled(isAnySymptomSetToYes());
}

}

private boolean isAnySymptomSetToYes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

<TextView
style="@style/SubHeadingCompactStyle"
android:id="@+id/symptoms_signsAndSymptons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/heading_symptoms"/>
Expand Down

0 comments on commit b7c2a04

Please sign in to comment.