Skip to content

Commit

Permalink
#178: Implemented changes for ILI at symptoms. Filtered outcome values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Nov 15, 2024
1 parent 0aa89ef commit 646dfc1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public class DiseaseFieldConfigurations {
)
);

diseaseFieldConfigurations.put(new DiseaseFormTypeKey(Disease.YELLOW_FEVER, FormType.SYMPTOMS_EDIT),
Arrays.asList(
R.id.symptoms_temperatureAndSource, R.id.symptoms_description, R.id.btns, R.id.symptoms_backache, R.id.symptoms_bodyAche, R.id.symptoms_chillsSweats, R.id.symptoms_fatigueWeakness, R.id.symptoms_fever, R.id.symptoms_headache, R.id.symptoms_jaundice, R.id.symptoms_vomiting, R.id.symptoms_nausea, R.id.symptoms_otherComplications, R.id.symptoms_otherComplicationsText, R.id.symptoms_onsetDate, R.id.symptoms_outcome
)
);
}

public static List<Integer> getFields(Disease disease, FormType formType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ public void onAfterLayoutBinding(FragmentSymptomsEditLayoutBinding contentBindin

contentBinding.symptomsOnsetDate.initializeDateField(getFragmentManager());
contentBinding.symptomsLesionsOnsetDate.initializeDateField(getFragmentManager());
contentBinding.symptomsTemperature.initializeSpinner(DataUtils.addEmptyItem(bodyTempList));
contentBinding.symptomsTemperatureSource.initializeSpinner(DataUtils.addEmptyItem(tempSourceList));
contentBinding.symptomsTemperature.initializeSpinner(bodyTempList);
contentBinding.symptomsTemperatureSource.initializeSpinner(tempSourceList);
contentBinding.symptomsCongenitalHeartDiseaseType.initializeSpinner(congenitalHeartDiseaseList);
contentBinding.symptomsOnsetSymptom.initializeSpinner(DataUtils.toItems(null, true));
contentBinding.symptomsDateFirstWormEmergence.initializeDateField(getFragmentManager());
Expand All @@ -219,6 +219,7 @@ public void onAfterLayoutBinding(FragmentSymptomsEditLayoutBinding contentBindin
if (disease == Disease.CONGENITAL_RUBELLA||disease == Disease.MONKEYPOX) {
contentBinding.complicationsHeading.setVisibility(GONE);
}
//TODO: CHANGE FROM IF TO SWITCH AND REMOVE REDUNDANCY CODE

if (disease == Disease.YELLOW_FEVER || disease == Disease.AHF){

Expand All @@ -245,6 +246,30 @@ public void onAfterLayoutBinding(FragmentSymptomsEditLayoutBinding contentBindin
contentBinding.symptomsSignsAndSymptons.setVisibility(GONE);
}

if (disease == Disease.NEW_INFLUENZA){
contentBinding.symptomsTemperature.setCaption("BODY TEMPERATURE AT THE TIME OF INVESTIGATION");

contentBinding.symptomsPatientHaveFever.addValueChangedListener(field -> {
int visibility = field.getValue() == YesNo.YES ? VISIBLE : GONE;
contentBinding.symptomsTemperature.setVisibility(visibility);
contentBinding.symptomsTemperatureSource.setVisibility(visibility);

});


Set<CaseOutcome> outcomesToRemove = Set.of(
CaseOutcome.NO_OUTCOME,
CaseOutcome.ON_TREATMENT,
CaseOutcome.REFERRED,
CaseOutcome.UNKNOWN,
CaseOutcome.RECOVERED
);

contentBinding.symptomsOutcome.initializeSpinner(outcomeList);
outcomeList.removeIf(item -> outcomesToRemove.contains(item.getValue()));

}

contentBinding.symptomsCongenitalHeartDisease.addValueChangedListener(e -> {
if (e.getValue() != SymptomState.YES) {
contentBinding.symptomsCongenitalHeartDiseaseDetails.setVisibility(GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,17 @@
android:id="@+id/main_content"
style="@style/LayoutSingleContentSpaceBelowStyle">

<LinearLayout
android:id="@+id/symptoms_temperatureAndSource"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/symptoms_temperature"
app:value="@={data.temperature}"
app:goneIfVariable="@{symptomsContext}"
app:goneIfValue="@{SymptomsContext.CLINICAL_VISIT}"
style="@style/ControlFirstOfTwoColumnsStyle" />
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/symptoms_temperatureSource"
app:value="@={data.temperatureSource}"
app:goneIfVariable="@{symptomsContext}"
app:goneIfValue="@{SymptomsContext.CLINICAL_VISIT}"
style="@style/ControlSecondOfTwoColumnsStyle" />
style="@style/ControlSingleColumnStyle" />

</LinearLayout>

<TextView
style="@style/SubHeadingCompactStyle"
Expand All @@ -100,8 +90,6 @@

<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/symptoms_dateOfOnset"
app:dependencyParentField="@{symptomsPatientHaveFever}"
app:dependencyParentValue="@{YesNo.YES}"
app:value="@={data.dateOfOnset}"
style="@style/ControlSingleColumnStyle" />

Expand Down

0 comments on commit 646dfc1

Please sign in to comment.