Skip to content

Commit

Permalink
Merge branch 'gh-release-android-fixes' into gh-release-1.87.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Jan 23, 2025
2 parents f289e26 + 3d752ff commit 9e19704
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public static List<PageMenuItem> updateMenuCaptionsForDisease(List<PageMenuItem>
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
<de.symeda.sormas.app.component.controls.ControlDateTimeField
android:id="@+id/caseHospitalization_onsetOfSymptomDatetime"
app:value="@={data.onsetOfSymptomDatetime}"
app:required="true"
style="@style/ControlSingleColumnStyle" />

<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_approximateAge"
app:value="@={data.approximateAge}"
app:required="true"
app:inputType="number"
app:maxLength="3"
style="@style/ControlFirstOfTwoColumnsStyle" />
Expand Down

0 comments on commit 9e19704

Please sign in to comment.