Skip to content

Commit

Permalink
#180: Implemented hospitalization features for IDSR
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Oct 13, 2024
1 parent 7d5252d commit 9477361
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {

// public static final int DATABASE_VERSION = 307;
//public static final int DATABASE_VERSION = 343;
public static final int DATABASE_VERSION = 363;
public static final int DATABASE_VERSION = 364;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3298,6 +3298,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
case 362:
currentVersion = 362;
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,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;

// just for reference, not persisted in DB
private List<PreviousHospitalization> previousHospitalizations = new ArrayList<>();
Expand Down Expand Up @@ -190,6 +192,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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -114,6 +115,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<PreviousHospitalizationDto> previousHospitalizationDtos = new ArrayList<>();
for (PreviousHospitalization prevHosp : b.getPreviousHospitalizations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,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.caseDataOutcome.initializeSpinner(outcomeList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@
android:id="@+id/caseHospitalization_notifyDistrictDate"
app:value="@={data.notifyDistrictDate}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/caseHospitalization_dateFormSentToDistrict"
app:value="@={data.dateFormSentToDistrict}"
style="@style/ControlSingleColumnStyle" />
</LinearLayout>

<LinearLayout
Expand Down

0 comments on commit 9477361

Please sign in to comment.