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 14, 2024
1 parent de8cbdb commit 1deb2b6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
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 @@ -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<PreviousHospitalizationDto> previousHospitalizationDtos = new ArrayList<>();
for (PreviousHospitalization prevHosp : b.getPreviousHospitalizations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 1deb2b6

Please sign in to comment.