Skip to content

Commit

Permalink
#180: Implemented epidata features for IDSR
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Oct 14, 2024
1 parent b7c2a04 commit 8c2d769
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,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 = 369;
public static final int DATABASE_VERSION = 370;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3457,18 +3457,14 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(Sample.class).executeRaw("ALTER TABLE samples ADD COLUMN dateFormSentToDistrict DATE;");
getDao(Sample.class).executeRaw("ALTER TABLE samples ADD COLUMN dateFormReceivedAtDistrict DATE;");
getDao(Sample.class).executeRaw("ALTER TABLE samples ADD COLUMN labLocation VARCHAR(255);");
// ATTENTION: break should only be done after last version
break;
default:
throw new IllegalStateException("onUpgrade() with unknown oldVersion " + oldVersion);

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;");
case 369:
currentVersion = 369;
getDao(EpiData.class).executeRaw("ALTER TABLE epidata ADD COLUMN recentTravelOutbreak varchar(255);");
getDao(EpiData.class).executeRaw("ALTER TABLE epidata ADD COLUMN contactSimilarOutbreak varchar(255);");
getDao(EpiData.class).executeRaw("ALTER TABLE epidata ADD COLUMN contactSickAnimals varchar(255);");
// 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 @@ -60,6 +60,12 @@ public class EpiData extends PseudonymizableAdo {
@Enumerated(EnumType.STRING)
private YesNo activityAsCaseDetailsKnown;
@Enumerated(EnumType.STRING)
private YesNo recentTravelOutbreak;
@Enumerated(EnumType.STRING)
private YesNo contactSimilarOutbreak;
@Enumerated(EnumType.STRING)
private YesNo contactSickAnimals;
@Enumerated(EnumType.STRING)
private YesNo contactWithSourceCaseKnown;
@Enumerated(EnumType.STRING)
private YesNo highTransmissionRiskArea;
Expand Down Expand Up @@ -152,6 +158,30 @@ public void setActivityAsCaseDetailsKnown(YesNo activityAsCaseDetailsKnown) {
this.activityAsCaseDetailsKnown = activityAsCaseDetailsKnown;
}

public YesNo getRecentTravelOutbreak() {
return recentTravelOutbreak;
}

public void setRecentTravelOutbreak(YesNo recentTravelOutbreak) {
this.recentTravelOutbreak = recentTravelOutbreak;
}

public YesNo getContactSimilarOutbreak() {
return contactSimilarOutbreak;
}

public void setContactSimilarOutbreak(YesNo contactSimilarOutbreak) {
this.contactSimilarOutbreak = contactSimilarOutbreak;
}

public YesNo getContactSickAnimals() {
return contactSickAnimals;
}

public void setContactSickAnimals(YesNo contactSickAnimals) {
this.contactSickAnimals = contactSickAnimals;
}

public YesNo getContactWithSourceCaseKnown() {
return contactWithSourceCaseKnown;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public void fillInnerFromDto(EpiData target, EpiDataDto source) {

target.setExposureDetailsKnown(source.getExposureDetailsKnown());
target.setActivityAsCaseDetailsKnown(source.getActivityAsCaseDetailsKnown());
target.setRecentTravelOutbreak(source.getRecentTravelOutbreak());
target.setContactSimilarOutbreak(source.getContactSimilarOutbreak());
target.setContactSickAnimals(source.getContactSickAnimals());
target.setContactWithSourceCaseKnown(source.getContactWithSourceCaseKnown());
target.setHighTransmissionRiskArea(source.getHighTransmissionRiskArea());
target.setLargeOutbreaksArea(source.getLargeOutbreaksArea());
Expand Down Expand Up @@ -167,6 +170,9 @@ public void fillInnerFromAdo(EpiDataDto target, EpiData source) {

target.setExposureDetailsKnown(source.getExposureDetailsKnown());
target.setActivityAsCaseDetailsKnown(source.getActivityAsCaseDetailsKnown());
target.setRecentTravelOutbreak(source.getRecentTravelOutbreak());
target.setContactSimilarOutbreak(source.getContactSimilarOutbreak());
target.setContactSickAnimals(source.getContactSickAnimals());
target.setContactWithSourceCaseKnown(source.getContactWithSourceCaseKnown());
target.setHighTransmissionRiskArea(source.getHighTransmissionRiskArea());
target.setLargeOutbreaksArea(source.getLargeOutbreaksArea());
Expand Down
18 changes: 18 additions & 0 deletions sormas-app/app/src/main/res/layout/fragment_edit_epid_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@
app:enumClass="@{YesNoClass}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlSwitchField
android:id="@+id/epiData_recentTravelOutbreak"
app:value="@={data.recentTravelOutbreak}"
app:enumClass="@{YesNoClass}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlSwitchField
android:id="@+id/epiData_contactSimilarOutbreak"
app:value="@={data.contactSimilarOutbreak}"
app:enumClass="@{YesNoClass}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlSwitchField
android:id="@+id/epiData_contactSickAnimals"
app:value="@={data.contactSickAnimals}"
app:enumClass="@{YesNoClass}"
style="@style/ControlSingleColumnStyle"/>

<LinearLayout
android:id="@+id/activityascase_layout"
android:layout_width="match_parent"
Expand Down

0 comments on commit 8c2d769

Please sign in to comment.