From 71ff42361b277dd30d6245435f986bca621434ae Mon Sep 17 00:00:00 2001 From: Flava177 Date: Wed, 13 Nov 2024 09:49:35 +0000 Subject: [PATCH] #178: Implemented features for ILi at person fragment. Added investigator personal data(fields). --- .../app/backend/common/DatabaseHelper.java | 10 +++- .../sormas/app/backend/person/Person.java | 49 +++++++++++++++++++ .../app/backend/person/PersonDtoHelper.java | 10 ++++ .../layout/fragment_person_edit_layout.xml | 46 +++++++++++++++-- 4 files changed, 111 insertions(+), 4 deletions(-) diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java index 706af519716..0886956f0b5 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java @@ -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; @@ -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; diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java index 0a8baa78662..bdb96f129c0 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/Person.java @@ -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() { } @@ -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; + } } diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java index 9f532f0128a..954c75b19c3 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/person/PersonDtoHelper.java @@ -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 @@ -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()); } diff --git a/sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml b/sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml index 82bddd231d2..46f5300599b 100644 --- a/sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml +++ b/sormas-app/app/src/main/res/layout/fragment_person_edit_layout.xml @@ -581,10 +581,10 @@ + + + + + + + + + + + + + + + + +