Skip to content

Commit

Permalink
#178: Implemented features for ILi at person fragment. Added investig…
Browse files Browse the repository at this point in the history
…ator personal data(fields).
  • Loading branch information
Flava177 committed Nov 15, 2024
1 parent e7c0279 commit 71ff423
Show file tree
Hide file tree
Showing 4 changed files with 111 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 = 396;
public static final int DATABASE_VERSION = 397;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3878,6 +3878,14 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN sampleTestResultImmuno VARCHAR(255);");
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN sampleTestResultImmunoDate DATE;");

case 396:
currentVersion = 396;
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN investigatorName varchar(255) ;");
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN investigatorTitle varchar(255) ;");
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN investigatorUnit varchar(255) ;");
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN investigatorAddress varchar(255) ;");
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN investigatorTel varchar(255) ;");


// ATTENTION: break should only be done after last version
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ public class Person extends PseudonymizableAdo {
private YesNoUnknown cordTreatedWithAnything;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String cordTreatedWithAnythingWhere;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String investigatorName;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String investigatorTitle;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String investigatorUnit;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String investigatorAddress;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String investigatorTel;

public Person() {
}
Expand Down Expand Up @@ -996,4 +1006,43 @@ public String getCordTreatedWithAnythingWhere() {
public void setCordTreatedWithAnythingWhere(String cordTreatedWithAnythingWhere) {
this.cordTreatedWithAnythingWhere = cordTreatedWithAnythingWhere;
}
public String getInvestigatorName() {
return investigatorName;
}

public void setInvestigatorName(String investigatorName) {
this.investigatorName = investigatorName;
}

public String getInvestigatorTitle() {
return investigatorTitle;
}

public void setInvestigatorTitle(String investigatorTitle) {
this.investigatorTitle = investigatorTitle;
}

public String getInvestigatorUnit() {
return investigatorUnit;
}

public void setInvestigatorUnit(String investigatorUnit) {
this.investigatorUnit = investigatorUnit;
}

public String getInvestigatorAddress() {
return investigatorAddress;
}

public void setInvestigatorAddress(String investigatorAddress) {
this.investigatorAddress = investigatorAddress;
}

public String getInvestigatorTel() {
return investigatorTel;
}

public void setInvestigatorTel(String investigatorTel) {
this.investigatorTel = investigatorTel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public void fillInnerFromDto(Person target, PersonDto source) {
target.setCutCordWithSterileBlade(source.getCutCordWithSterileBlade());
target.setCordTreatedWithAnything(source.getCordTreatedWithAnything());
target.setCordTreatedWithAnythingWhere(source.getCordTreatedWithAnythingWhere());
target.setInvestigatorName(source.getInvestigatorName());
target.setInvestigatorTitle(source.getInvestigatorTitle());
target.setInvestigatorUnit(source.getInvestigatorUnit());
target.setInvestigatorAddress(source.getInvestigatorAddress());
target.setInvestigatorTel(source.getInvestigatorTel());
}

@Override
Expand Down Expand Up @@ -326,6 +331,11 @@ public void fillInnerFromAdo(PersonDto target, Person source) {
target.setCutCordWithSterileBlade(source.getCutCordWithSterileBlade());
target.setCordTreatedWithAnything(source.getCordTreatedWithAnything());
target.setCordTreatedWithAnythingWhere(source.getCordTreatedWithAnythingWhere());
target.setInvestigatorName(source.getInvestigatorName());
target.setInvestigatorTitle(source.getInvestigatorTitle());
target.setInvestigatorUnit(source.getInvestigatorUnit());
target.setInvestigatorAddress(source.getInvestigatorAddress());
target.setInvestigatorTel(source.getInvestigatorTel());

}

Expand Down
46 changes: 43 additions & 3 deletions sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,10 @@
<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_occupationDetails"
app:value="@={data.occupationDetails}"
app:customizableEnumField="@{personOccupationType}"
app:customizableEnumProperty="@{OccupationType.HAS_DETAILS}"
app:customizableEnumValue="@{Boolean.TRUE}"
style="@style/ControlSingleColumnStyle" />
<!--app:customizableEnumField="@{personOccupationType}"
app:customizableEnumProperty="@{OccupationType.HAS_DETAILS}"
app:customizableEnumValue="@{Boolean.TRUE}"-->

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -825,6 +825,7 @@
android:layout_marginBottom="@dimen/parentLayoutVerticalPadding">

<RelativeLayout
android:id="@+id/personContactDetailList_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:alternateBottomMarginIfEmpty="@{personContactDetailList}"
Expand Down Expand Up @@ -891,6 +892,45 @@
app:value="@={data.internalToken}"
style="@style/ControlSingleColumnStyle"/>

<LinearLayout
android:id="@+id/person_investigatorNameTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_investigatorName"
app:value="@={data.investigatorName}"
style="@style/ControlFirstOfTwoColumnsStyle"/>

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_investigatorTitle"
app:value="@={data.investigatorTitle}"
style="@style/ControlSecondOfTwoColumnsStyle"/>
</LinearLayout>

<LinearLayout
android:id="@+id/person_investigatorUnitAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_investigatorUnit"
app:value="@={data.investigatorUnit}"
style="@style/ControlFirstOfTwoColumnsStyle"/>

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_investigatorAddress"
app:value="@={data.investigatorAddress}"
style="@style/ControlSecondOfTwoColumnsStyle"/>
</LinearLayout>

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/person_investigatorTel"
app:value="@={data.investigatorTel}"
style="@style/ControlSingleColumnStyle"/>

<ImageView style="@style/FullHorizontalDividerStyle" />

<TextView
Expand Down

0 comments on commit 71ff423

Please sign in to comment.