Skip to content

Commit

Permalink
#180: Implemented pathogentest features for IDSR. Added labLocation, …
Browse files Browse the repository at this point in the history
…dateLabResultsSentClinician fields
  • Loading branch information
Flava177 committed Oct 14, 2024
1 parent 2c28fec commit 88ae4ea
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand All @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
}
}

Expand Down Expand Up @@ -262,10 +265,11 @@ private void handleYellowFever() {
.collect(Collectors.toList());

List<Item> itemList = DataUtils.toItems(values1);

getContentBinding().pathogenTestFinalClassification.initializeSpinner(itemList);

}


private void handleIDSR(){
getContentBinding().pathogenTestTestedDisease.setEnabled(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
app:value="@={data.labDetails}"
style="@style/ControlSingleColumnStyle" />

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

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/pathogenTest_testResult"
app:required="true"
Expand Down Expand Up @@ -200,6 +205,11 @@
app:value="@={data.dateLabResultsSentDistrict}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlDateField
android:id="@+id/pathogenTest_dateLabResultsSentClinician"
app:value="@={data.dateLabResultsSentClinician}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/pathogenTest_finalClassification"
app:value="@={data.finalClassification}"
Expand Down

0 comments on commit 88ae4ea

Please sign in to comment.