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 a0c28a2350f..184f95030ed 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 @@ -200,7 +200,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 = 364; + public static final int DATABASE_VERSION = 366; private static DatabaseHelper instance = null; @@ -3307,6 +3307,14 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int getDao(EpiData.class).executeRaw("ALTER TABLE epidata ADD COLUMN contactSickAnimals varchar(255);"); getDao(Sample.class).executeRaw("ALTER TABLE samples ADD COLUMN suspectedDisease VARCHAR(255);"); + case 364: + currentVersion = 364; + getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN dateLabResultsSentClinician Date;"); + + case 365: + currentVersion = 365; + getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN labLocation VARCHAR(255);"); + // ATTENTION: break should only be done after last version break; default: diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTest.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTest.java index d917a0e5c4c..ce4d1c88fa0 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTest.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTest.java @@ -117,6 +117,8 @@ public class PathogenTest extends PseudonymizableAdo { @Column private String labDetails; + @Column + private String labLocation; @DatabaseField(foreign = true, foreignAutoRefresh = true) private User labUser; @@ -125,7 +127,8 @@ public class PathogenTest extends PseudonymizableAdo { private boolean viaLims; @DatabaseField(dataType = DataType.DATE_LONG) private Date dateLabResultsSentDistrict; - + @DatabaseField(dataType = DataType.DATE_LONG) + private Date dateLabResultsSentClinician; @Enumerated(EnumType.STRING) private FinalClassification finalClassification; @@ -275,6 +278,14 @@ public void setLabDetails(String labDetails) { this.labDetails = labDetails; } + public String getLabLocation() { + return labLocation; + } + + public void setLabLocation(String labLocation) { + this.labLocation = labLocation; + } + public boolean isFourFoldIncreaseAntibodyTiter() { return fourFoldIncreaseAntibodyTiter; } @@ -331,6 +342,13 @@ public void setDateLabResultsSentDistrict(Date dateLabResultsSentDistrict) { this.dateLabResultsSentDistrict = dateLabResultsSentDistrict; } + public Date getDateLabResultsSentClinician() { + return dateLabResultsSentClinician; + } + + public void setDateLabResultsSentClinician(Date dateLabResultsSentClinician) { + this.dateLabResultsSentClinician = dateLabResultsSentClinician; + } public FinalClassification getFinalClassification() { return finalClassification; } diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTestDtoHelper.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTestDtoHelper.java index 373b9f1dc9a..8e09b7c3c46 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTestDtoHelper.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/backend/sample/PathogenTestDtoHelper.java @@ -78,10 +78,12 @@ protected void fillInnerFromDto(PathogenTest target, PathogenTestDto source) { target.setCqValue(source.getCqValue()); target.setReportDate(source.getReportDate()); target.setDateLabResultsSentDistrict(source.getDateLabResultsSentDistrict()); + target.setDateLabResultsSentClinician(source.getDateLabResultsSentClinician()); target.setFinalClassification(source.getFinalClassification()); target.setViaLims(source.isViaLims()); target.setLab(DatabaseHelper.getFacilityDao().getByReferenceDto(source.getLab())); target.setLabDetails(source.getLabDetails()); + target.setLabLocation(source.getLabLocation()); target.setLabUser(DatabaseHelper.getUserDao().getByReferenceDto(source.getLabUser())); target.setPseudonymized(source.isPseudonymized()); @@ -114,6 +116,7 @@ protected void fillInnerFromAdo(PathogenTestDto target, PathogenTest source) { target.setLab(null); } target.setLabDetails(source.getLabDetails()); + target.setLabLocation(source.getLabLocation()); target.setTestResultVerified(source.getTestResultVerified()); target.setTestResultText(source.getTestResultText()); @@ -122,6 +125,7 @@ protected void fillInnerFromAdo(PathogenTestDto target, PathogenTest source) { target.setCqValue(source.getCqValue()); target.setReportDate(source.getReportDate()); target.setDateLabResultsSentDistrict(source.getDateLabResultsSentDistrict()); + target.setDateLabResultsSentClinician(source.getDateLabResultsSentClinician()); target.setFinalClassification(source.getFinalClassification()); target.setViaLims(source.isViaLims()); diff --git a/sormas-app/app/src/main/java/de/symeda/sormas/app/pathogentest/edit/PathogenTestEditFragment.java b/sormas-app/app/src/main/java/de/symeda/sormas/app/pathogentest/edit/PathogenTestEditFragment.java index 40bd4e1db57..caab617f473 100644 --- a/sormas-app/app/src/main/java/de/symeda/sormas/app/pathogentest/edit/PathogenTestEditFragment.java +++ b/sormas-app/app/src/main/java/de/symeda/sormas/app/pathogentest/edit/PathogenTestEditFragment.java @@ -222,6 +222,7 @@ public void onChange(ControlPropertyField field) { contentBinding.pathogenTestReportDate.initializeDateField(getFragmentManager()); contentBinding.pathogenTestTestDateTime.initializeDateTimeField(getFragmentManager()); contentBinding.pathogenTestDateLabResultsSentDistrict.initializeDateField(getFragmentManager()); + contentBinding.pathogenTestDateLabResultsSentClinician.initializeDateField(getFragmentManager()); if (sample.getSamplePurpose() == SamplePurpose.INTERNAL) { contentBinding.pathogenTestLab.setRequired(false); @@ -231,6 +232,8 @@ public void onChange(ControlPropertyField field) { switch (record.getSample().getAssociatedCase().getDisease()){ case YELLOW_FEVER: handleYellowFever(); + case IMMEDIATE_CASE_BASED_FORM_OTHER_CONDITIONS: + handleIDSR(); } } @@ -262,10 +265,11 @@ private void handleYellowFever() { .collect(Collectors.toList()); List itemList = DataUtils.toItems(values1); - getContentBinding().pathogenTestFinalClassification.initializeSpinner(itemList); + } - + private void handleIDSR(){ + getContentBinding().pathogenTestTestedDisease.setEnabled(false); } } diff --git a/sormas-app/app/src/main/res/layout/fragment_pathogen_test_edit_layout.xml b/sormas-app/app/src/main/res/layout/fragment_pathogen_test_edit_layout.xml index c56f30577dc..2b8aeaa0dac 100644 --- a/sormas-app/app/src/main/res/layout/fragment_pathogen_test_edit_layout.xml +++ b/sormas-app/app/src/main/res/layout/fragment_pathogen_test_edit_layout.xml @@ -140,6 +140,11 @@ app:value="@={data.labDetails}" style="@style/ControlSingleColumnStyle" /> + + + +