Skip to content

Commit

Permalink
#182: Implemented food sample testing(sixty day) for Food Borne on an…
Browse files Browse the repository at this point in the history
…droid
  • Loading branch information
Flava177 committed Dec 8, 2024
1 parent 39cb996 commit 915d776
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
import de.symeda.sormas.api.FormType;
import de.symeda.sormas.api.utils.InjectionSite;
import de.symeda.sormas.api.utils.NormalWasted;
import de.symeda.sormas.api.utils.PackagingType;
import de.symeda.sormas.api.utils.ParalysisSite;
import de.symeda.sormas.api.utils.SymptomLevel;
import de.symeda.sormas.api.utils.YesNo;
import de.symeda.sormas.api.utils.YesNoUnknown;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers;
import de.symeda.sormas.app.BaseEditFragment;
Expand All @@ -40,6 +42,7 @@ public class CaseEditSixtyDayFragment extends BaseEditFragment<FragmentCaseEditS
private SixtyDay record;
private Case caze;
private List<Item> cardRecallList;
private List<Item> packageTypeList;

// Static methods

Expand Down Expand Up @@ -75,6 +78,7 @@ public SixtyDay getPrimaryData() {
protected void prepareFragmentData() {
caze = getActivityRootData();
record = caze.getSixtyDay();
packageTypeList = DataUtils.getEnumItems(PackagingType.class, true);
}

@Override
Expand All @@ -83,13 +87,21 @@ public void onLayoutBinding(final FragmentCaseEditSixtydayLayoutBinding contentB
contentBinding.setData(record);
contentBinding.setCaze(caze);
contentBinding.setYesNoClass(YesNo.class);
contentBinding.setYesNoUnknownClass(YesNoUnknown.class);
contentBinding.setInjectionSiteClass(InjectionSite.class);
contentBinding.setSymptomLevelClass(SymptomLevel.class);
contentBinding.setNormalWastedClass(NormalWasted.class);
contentBinding.setParalysisSiteClass(ParalysisSite.class);
contentBinding.sixtyDayDateOfFollowup.initializeDateField(getFragmentManager());
contentBinding.sixtyDayDateBirth.initializeDateField(getFragmentManager());
contentBinding.sixtyDayDateSubmissionForms.initializeDateField(getFragmentManager());
contentBinding.sixtyDayDateOfManufacture.initializeDateField(getFragmentManager());
contentBinding.sixtyDayExpirationDate.initializeDateField(getFragmentManager());
contentBinding.sixtyDayPackagingType.initializeSpinner(packageTypeList);

if (caze.getDisease() != null) {
super.hideFieldsForDisease(caze.getDisease(), contentBinding.mainContent, FormType.SIXTY_DAY_FOLLOW_UP_EDIT);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@
<import type="de.symeda.sormas.api.utils.SymptomLevel" />
<import type="de.symeda.sormas.api.utils.NormalWasted" />
<import type="de.symeda.sormas.api.utils.ParalysisSite" />
<import type="de.symeda.sormas.api.i18n.Strings" />
<import type="de.symeda.sormas.api.i18n.I18nProperties" />

<variable name="data" type="de.symeda.sormas.app.backend.sixtyday.SixtyDay" />
<variable name="caze" type="de.symeda.sormas.app.backend.caze.Case" />
<variable name="YesNoClass" type="Class" />
<variable name="YesNoUnknownClass" type="Class" />
<variable name="injectionSiteClass" type="Class" />
<variable name="symptomLevelClass" type="Class" />
<variable name="normalWastedClass" type="Class" />
Expand Down Expand Up @@ -230,6 +233,157 @@

</LinearLayout>

<de.symeda.sormas.app.component.controls.ControlSwitchField
android:id="@+id/sixtyDay_foodAvailableTesting"
app:value="@{data.foodAvailableTesting}"
app:enumClass="@{YesNoUnknownClass}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlSwitchField
android:id="@+id/sixtyDay_labTestConducted"
app:value="@{data.labTestConducted}"
app:enumClass="@{YesNoUnknownClass}"
style="@style/ControlSingleColumnStyle" />

<TextView
android:id="@+id/sixtyDay_headingProvide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{I18nProperties.getString(Strings.headingProvide)}"
style="@style/SubHeadingStyle" />

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

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_specifyFoodsSources"
app:value="@={data.specifyFoodsSources}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_specifySources"
app:value="@={data.specifySources}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_productName"
app:value="@={data.productName}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_batchNumber"
app:value="@={data.batchNumber}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/sixtyDay_dateOfManufacture"
app:value="@={data.dateOfManufacture}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/sixtyDay_expirationDate"
app:value="@={data.expirationDate}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_packageSize"
app:value="@{data.packageSize}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/sixtyDay_packagingType"
app:value="@{data.packagingType}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_placeOfPurchase"
app:value="@{data.placeOfPurchase}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_nameOfManufacturer"
app:value="@{data.nameOfManufacturer}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_address"
app:value="@{data.address}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/sixtyDay_foodTel"
app:value="@{data.foodTel}"
app:dependencyParentField="@{sixtyDayFoodAvailableTesting}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>


</LinearLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,124 @@

</LinearLayout>

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_foodAvailableTesting"
app:value="@{data.foodAvailableTesting}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_labTestConducted"
app:value="@{data.labTestConducted}"
style="@style/ControlSingleColumnStyle" />

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_specifyFoodsSources"
app:value="@{data.specifyFoodsSources}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_specifySources"
app:value="@{data.specifySources}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_productName"
app:value="@{data.productName}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_batchNumber"
app:value="@{data.batchNumber}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_dateOfManufacture"
app:value="@{data.dateOfManufacture}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_expirationDate"
app:value="@{data.expirationDate}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_packageSize"
app:value="@{data.packageSize}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_packagingType"
app:value="@{data.packagingType}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_placeOfPurchase"
app:value="@{data.placeOfPurchase}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_nameOfManufacturer"
app:value="@{data.nameOfManufacturer}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>

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

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_address"
app:value="@{data.address}"
style="@style/ControlFirstOfTwoColumnsStyle" />

<de.symeda.sormas.app.component.controls.ControlTextReadField
android:id="@+id/sixtyDay_foodTel"
app:value="@{data.foodTel}"
style="@style/ControlSecondOfTwoColumnsStyle" />

</LinearLayout>


</LinearLayout>
</ScrollView>
Expand Down

0 comments on commit 915d776

Please sign in to comment.