Skip to content

Commit

Permalink
#162: Implemented feature changes for CSM at hospitalization fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Nov 18, 2024
1 parent 0c42829 commit c07ea4f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,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 = 401;
public static final int DATABASE_VERSION = 402;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3913,6 +3913,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
currentVersion = 400;
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN vaccineType varchar(255);");

case 401:
currentVersion = 401;
getDao(Hospitalization.class).executeRaw("ALTER TABLE hospitalizations ADD COLUMN diseaseOnsetDate Date;");


// ATTENTION: break should only be done after last version
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class Hospitalization extends AbstractDomainObject {
@Enumerated(EnumType.STRING)
private InpatOutpat selectInpatientOutpatient;
@DatabaseField(dataType = DataType.DATE_LONG)
private Date diseaseOnsetDate;
@DatabaseField(dataType = DataType.DATE_LONG)
private Date dateFirstSeen;
@DatabaseField(dataType = DataType.DATE_LONG)
private Date notifyDistrictDate;
Expand Down Expand Up @@ -225,6 +227,14 @@ public InpatOutpat getSelectInpatientOutpatient() {
public void setSelectInpatientOutpatient(InpatOutpat selectInpatientOutpatient) {
this.selectInpatientOutpatient = selectInpatientOutpatient;}

public Date getDiseaseOnsetDate() {
return diseaseOnsetDate;
}

public void setDiseaseOnsetDate(Date diseaseOnsetDate) {
this.diseaseOnsetDate = diseaseOnsetDate;
}

public Date getDateFirstSeen() {
return dateFirstSeen;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void fillInnerFromDto(Hospitalization a, HospitalizationDto b) {
a.setHealthFacilityRecordNumber(b.getHealthFacilityRecordNumber());
a.setSelectInpatientOutpatient(b.getSelectInpatientOutpatient());
a.setDateFirstSeen(b.getDateFirstSeen());
a.setDiseaseOnsetDate(b.getDiseaseOnsetDate());
a.setNotifyDistrictDate(b.getNotifyDistrictDate());
a.setDateFormSentToDistrict(b.getDateFormSentToDistrict());
a.setAdmittedToHealthFacilityNew(b.getAdmittedToHealthFacilityNew());
Expand Down Expand Up @@ -122,6 +123,7 @@ public void fillInnerFromAdo(HospitalizationDto a, Hospitalization b) {
a.setHealthFacilityRecordNumber(b.getHealthFacilityRecordNumber());
a.setSelectInpatientOutpatient(b.getSelectInpatientOutpatient());
a.setDateFirstSeen(b.getDateFirstSeen());
a.setDiseaseOnsetDate(b.getDiseaseOnsetDate());
a.setNotifyDistrictDate(b.getNotifyDistrictDate());
a.setDateFormSentToDistrict(b.getDateFormSentToDistrict());
a.setAdmittedToHealthFacilityNew(b.getAdmittedToHealthFacilityNew());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ public void onLayoutBinding(final FragmentCaseEditHospitalizationLayoutBinding c

verifyPrevHospitalizationStatus();
});

if (disease != null) {
hideFieldsForDisease(disease, contentBinding.mainContent, FormType.HOSPITALIZATION_EDIT);
}
Expand All @@ -228,6 +227,7 @@ protected void onAfterLayoutBinding(FragmentCaseEditHospitalizationLayoutBinding
contentBinding.caseHospitalizationTerminationDateHospitalStay.initializeDateField(getFragmentManager());
contentBinding.caseDataOutcome.initializeSpinner(outcomeList);
contentBinding.caseHospitalizationSelectInpatientOutpatient.initializeSpinner(inpatientOutpatientList);
contentBinding.caseHospitalizationDiseaseOnsetDate.initializeDateField(getFragmentManager());

verifyPrevHospitalizationStatus();

Expand All @@ -236,6 +236,8 @@ protected void onAfterLayoutBinding(FragmentCaseEditHospitalizationLayoutBinding
handleAHF();
case NEW_INFLUENZA:
handleILI();
case CSM:
handleCSM();
}
}

Expand Down Expand Up @@ -286,4 +288,8 @@ private void handleILI() {
));
}

private void handleCSM(){
getContentBinding().caseHospitalizationDateFirstSeen.setCaption("DATE SEEN AT HEALTH FACILITY:");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@
app:enumClass="@{YesNoClass}"
style="@style/ControlSingleColumnStyle" />

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

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/caseHospitalization_selectInpatientOutpatient"
app:value="@={data.selectInpatientOutpatient}"
Expand All @@ -300,8 +305,6 @@
<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/caseHospitalization_dateFirstSeen"
app:value="@={data.dateFirstSeen}"
app:dependencyParentField="@{caseHospitalizationSeenAtAHealthFacility}"
app:dependencyParentValue="@{YesNoUnknown.YES}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlSwitchField
Expand Down

0 comments on commit c07ea4f

Please sign in to comment.