diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/CaseSection.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/CaseSection.java index 90fa9c56902..dae2e8b9af7 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/CaseSection.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/CaseSection.java @@ -31,7 +31,9 @@ public enum CaseSection PORT_HEALTH_INFO(R.string.caption_case_port_health_info, R.drawable.ic_transfer_case_24dp), SYMPTOMS(R.string.caption_symptoms, R.drawable.ic_healing_black_24dp), HEALTH_CONDITIONS(R.string.caption_case_health_conditions, R.drawable.ic_dvr_black_24dp), + FOOD_HISTORY(R.string.caption_case_food_history, R.drawable.ic_dvr_black_24dp), EPIDEMIOLOGICAL_DATA(R.string.caption_case_epidemiological_data, R.drawable.ic_pets_black_24dp), + SIXTY_DAY_FOLLOW_UP(R.string.caption_case_sixy_day, R.drawable.ic_keyboard_arrow_up_24dp), SAMPLES(R.string.caption_case_samples, R.drawable.ic_drawer_sample_blue_24dp), CONTACTS(R.string.caption_case_contacts, R.drawable.ic_drawer_contact_blue_24dp), PRESCRIPTIONS(R.string.caption_case_prescriptions, R.drawable.ic_receipt_black_24dp), @@ -42,10 +44,8 @@ public enum CaseSection IMMUNIZATIONS(R.string.caption_case_immunizations, R.drawable.ic_drawer_immunization_24dp), VACCINATIONS(R.string.caption_case_vaccinations, R.drawable.ic_drawer_vaccines_24), RISK_FACTORS(R.string.caption_case_risk_factors, R.drawable.ic_warning_black_24dp), - FOOD_HISTORY(R.string.caption_case_food_history, R.drawable.ic_dvr_black_24dp), INVESTIGATION_NOTES(R.string.caption_case_investigation_notes, R.drawable.ic_drawer_case_blue_24dp), - AFP_IMMUNIZATION(R.string.caption_case_afp_immunization, R.drawable.ic_drawer_immunization_24dp), - SIXTY_DAY_FOLLOW_UP(R.string.caption_case_sixy_day, R.drawable.ic_keyboard_arrow_up_24dp); + AFP_IMMUNIZATION(R.string.caption_case_afp_immunization, R.drawable.ic_drawer_immunization_24dp); private int friendlyNameResourceId; private int iconResourceId; diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditHospitalizationFragment.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditHospitalizationFragment.java index 9790eadfc82..e1997bf143a 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditHospitalizationFragment.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/caze/edit/CaseEditHospitalizationFragment.java @@ -245,6 +245,29 @@ public void onLayoutBinding(final FragmentCaseEditHospitalizationLayoutBinding c null, false); + InfrastructureFieldsDependencyHandler.instance.initializeFacilityFields( + record, + contentBinding.locationTypeRegion, + initialPlaceOfRegions, + record.getSoughtRegion(), + contentBinding.locationTypeDistrict, + initialPlaceOfDistricts, + record.getSoughtDistrict(), + contentBinding.locationTypeCommunity, + initialPlaceOfCommunities, + record.getSoughtCommunity(), + null, + null, + null, + null, + null, + null, + contentBinding.caseHospitalizationNameOfFacility, + initialPlaceOfFacilities, + record.getNameOfFacility(), + null, + false); + if (disease == Disease.MONKEYPOX) { InfrastructureFieldsDependencyHandler.instance.initializeRegionFields( contentBinding.locationTypeRegion, diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/component/menu/DiseaseMenuCaptionHandler.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/component/menu/DiseaseMenuCaptionHandler.java index 8aa84417748..879b2e786f5 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/component/menu/DiseaseMenuCaptionHandler.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/component/menu/DiseaseMenuCaptionHandler.java @@ -25,12 +25,14 @@ public static List updateMenuCaptionsForDisease(List // Get the index for each section we want to modify int personInfoIndex = CaseSection.PERSON_INFO.ordinal(); int foodSampleIndex = CaseSection.SIXTY_DAY_FOLLOW_UP.ordinal(); + int hospitalizationIndex = CaseSection.HOSPITALIZATION.ordinal(); // Update captions based on disease switch (disease) { case FOODBORNE_ILLNESS: updateMenuCaption(menuItems, personInfoIndex, R.string.caption_patient_client, context); updateMenuCaption(menuItems, foodSampleIndex, R.string.caption_case_food_sample_testing, context); + updateMenuCaption(menuItems, hospitalizationIndex, R.string.caption_symptoms, context); break; case NEW_INFLUENZA: updateMenuCaption(menuItems, personInfoIndex, R.string.caption_demographic_details, context); diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsDuringDialog.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsDuringDialog.java index 4d8207064e7..902ec75f35f 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsDuringDialog.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsDuringDialog.java @@ -55,7 +55,6 @@ public PatientTravelDetailsDuring getData() { @Override protected void setContentBinding(Context context, ViewDataBinding binding, String layoutName) { contentBinding = (DialogPatientTravelDetailsDuringEditLayoutBinding) binding; - binding.setVariable(BR.data, data); } @@ -74,8 +73,14 @@ protected void onPositiveClick() { setLiveValidationDisabled(false); try { FragmentValidator.validate(getContext(), contentBinding); -// this.data.setDateOfTravel(contentBinding.patientTravelDetailsDuringDateOfTravel.getValue()); -// this.data.setPlaceOfTravel(contentBinding.patientTravelDetailsDuringPlaceOfTravel.getValue()); + this.data.setDateOfTravel(contentBinding.patientTravelDetailsDuringDateOfTravel.getValue()); + + Object placeOfTravelValue = contentBinding.patientTravelDetailsDuringPlaceOfTravel.getValue(); + if (placeOfTravelValue instanceof TravelLocation) { + this.data.setPlaceOfTravel((TravelLocation) placeOfTravelValue); + } else { + throw new ValidationException("Invalid type for place of travel. Expected TravelLocation."); + } } catch (ValidationException e) { NotificationHelper.showDialogNotification(PatientTravelDetailsDuringDialog.this, ERROR, e.getMessage()); return; diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsPriorDialog.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsPriorDialog.java index 769a0da3e73..da4ce70c8ff 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsPriorDialog.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/riskfactor/PatientTravelDetailsPriorDialog.java @@ -72,6 +72,14 @@ protected void onPositiveClick() { setLiveValidationDisabled(false); try { FragmentValidator.validate(getContext(), contentBinding); + this.data.setDateOfTravel(contentBinding.patientTravelDetailsPriorDateOfTravel.getValue()); + + Object placeOfTravelValue = contentBinding.patientTravelDetailsPriorPlaceOfTravel.getValue(); + if (placeOfTravelValue instanceof TravelLocation) { + this.data.setPlaceOfTravel((TravelLocation) placeOfTravelValue); + } else { + throw new ValidationException("Invalid type for place of travel. Expected TravelLocation."); + } } catch (ValidationException e) { NotificationHelper.showDialogNotification(PatientTravelDetailsPriorDialog.this, ERROR, e.getMessage()); return; diff --git a/sormas-app/app/src/main/res/layout/fragment_case_edit_hospitalization_layout.xml b/sormas-app/app/src/main/res/layout/fragment_case_edit_hospitalization_layout.xml index 4546a7464fa..706e8adf771 100644 --- a/sormas-app/app/src/main/res/layout/fragment_case_edit_hospitalization_layout.xml +++ b/sormas-app/app/src/main/res/layout/fragment_case_edit_hospitalization_layout.xml @@ -347,6 +347,7 @@