From 1deb2b6ffcf57a802e7032e186ebd0af6b11da90 Mon Sep 17 00:00:00 2001 From: Flava177 Date: Sun, 13 Oct 2024 23:58:00 +0000 Subject: [PATCH] #180: Implemented hospitalization features for IDSR --- .../sormas/app/backend/common/DatabaseHelper.java | 4 ++++ .../app/backend/hospitalization/Hospitalization.java | 10 ++++++++++ .../hospitalization/HospitalizationDtoHelper.java | 2 ++ .../app/caze/edit/CaseEditHospitalizationFragment.java | 1 + 4 files changed, 17 insertions(+) diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java index d9b2fd7bfce..0cd3fb13477 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java @@ -3465,6 +3465,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int case 368: currentVersion = 368; getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN applicable varchar(255);"); + + case 363: + currentVersion = 363; + getDao(Hospitalization.class).executeRaw("ALTER TABLE hospitalizations ADD COLUMN dateFormSentToDistrict Date;"); // ATTENTION: break should only be done after last version break; default: diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/Hospitalization.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/Hospitalization.java index 8540309ac73..158c239bcce 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/Hospitalization.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/Hospitalization.java @@ -92,6 +92,8 @@ public class Hospitalization extends AbstractDomainObject { private Date dateFirstSeen; @DatabaseField(dataType = DataType.DATE_LONG) private Date notifyDistrictDate; + @DatabaseField(dataType = DataType.DATE_LONG) + private Date dateFormSentToDistrict; @Column(length = CHARACTER_LIMIT_BIG) private String hospitalRecordNumber; @@ -198,6 +200,14 @@ public Date getNotifyDistrictDate() { public void setNotifyDistrictDate(Date notifyDistrictDate) { this.notifyDistrictDate = notifyDistrictDate; } + + public Date getDateFormSentToDistrict() { + return dateFormSentToDistrict; + } + + public void setDateFormSentToDistrict(Date dateFormSentToDistrict) { + this.dateFormSentToDistrict = dateFormSentToDistrict; + } public void setDateFirstSeen(Date dateFirstSeen) { this.dateFirstSeen = dateFirstSeen; } diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/HospitalizationDtoHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/HospitalizationDtoHelper.java index cb05d075eef..4fabf8b2cf2 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/HospitalizationDtoHelper.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/hospitalization/HospitalizationDtoHelper.java @@ -79,6 +79,7 @@ public void fillInnerFromDto(Hospitalization a, HospitalizationDto b) { a.setSelectInpatientOutpatient(b.getSelectInpatientOutpatient()); a.setDateFirstSeen(b.getDateFirstSeen()); a.setNotifyDistrictDate(b.getNotifyDistrictDate()); + a.setDateFormSentToDistrict(b.getDateFormSentToDistrict()); // It would be better to merge with the existing hospitalizations @@ -117,6 +118,7 @@ public void fillInnerFromAdo(HospitalizationDto a, Hospitalization b) { a.setSelectInpatientOutpatient(b.getSelectInpatientOutpatient()); a.setDateFirstSeen(b.getDateFirstSeen()); a.setNotifyDistrictDate(b.getNotifyDistrictDate()); + a.setDateFormSentToDistrict(b.getDateFormSentToDistrict()); List previousHospitalizationDtos = new ArrayList<>(); for (PreviousHospitalization prevHosp : b.getPreviousHospitalizations()) { 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 816ab36ad6a..bd4f189a5d2 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 @@ -216,6 +216,7 @@ protected void onAfterLayoutBinding(FragmentCaseEditHospitalizationLayoutBinding contentBinding.caseHospitalizationIsolationDate.initializeDateField(getFragmentManager()); contentBinding.caseHospitalizationDateFirstSeen.initializeDateField(getFragmentManager()); contentBinding.caseHospitalizationNotifyDistrictDate.initializeDateField(getFragmentManager()); + contentBinding.caseHospitalizationDateFormSentToDistrict.initializeDateField(getFragmentManager()); contentBinding.caseHospitalizationPatientConditionOnAdmission.initializeSpinner(patientCondition); contentBinding.caseHospitalizationDateFormSentToDistrict.initializeDateField(getFragmentManager());