Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3419 - Create new field “Suspicious case” to cases #4320

Merged
merged 4 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ public class CaseDataDto extends PseudonymizableDto {

public static final String BLOOD_ORGAN_OR_TISSUE_DONATED = "bloodOrganOrTissueDonated";

public static final String NOT_A_CASE_REASON_NEGATIVE_TEST = "notACaseReasonNegativeTest";
public static final String NOT_A_CASE_REASON_PHYSICIAN_INFORMATION = "notACaseReasonPhysicianInformation";
public static final String NOT_A_CASE_REASON_DIFFERENT_PATHOGEN = "notACaseReasonDifferentPathogen";
public static final String NOT_A_CASE_REASON_OTHER = "notACaseReasonOther";
public static final String NOT_A_CASE_REASON_DETAILS = "notACaseReasonDetails";

// Fields are declared in the order they should appear in the import template

@Outbreaks
Expand Down Expand Up @@ -575,6 +581,21 @@ public class CaseDataDto extends PseudonymizableDto {
@HideForCountriesExcept
private YesNoUnknown bloodOrganOrTissueDonated;

@HideForCountriesExcept
private boolean notACaseReasonNegativeTest;

@HideForCountriesExcept
private boolean notACaseReasonPhysicianInformation;

@HideForCountriesExcept
private boolean notACaseReasonDifferentPathogen;

@HideForCountriesExcept
private boolean notACaseReasonOther;

@HideForCountriesExcept
private String notACaseReasonDetails;

public static CaseDataDto build(PersonReferenceDto person, Disease disease) {
return build(person, disease, null);
}
Expand Down Expand Up @@ -1592,4 +1613,45 @@ public boolean isOwnershipHandedOver() {
public void setOwnershipHandedOver(boolean ownershipHandedOver) {
this.ownershipHandedOver = ownershipHandedOver;
}

public boolean isNotACaseReasonNegativeTest() {
return notACaseReasonNegativeTest;
}

public void setNotACaseReasonNegativeTest(boolean notACaseReasonNegativeTest) {
this.notACaseReasonNegativeTest = notACaseReasonNegativeTest;
}

public boolean isNotACaseReasonPhysicianInformation() {
return notACaseReasonPhysicianInformation;
}

public void setNotACaseReasonPhysicianInformation(boolean notACaseReasonPhysicianInformation) {
this.notACaseReasonPhysicianInformation = notACaseReasonPhysicianInformation;
}

public boolean isNotACaseReasonDifferentPathogen() {
return notACaseReasonDifferentPathogen;
}

public void setNotACaseReasonDifferentPathogen(boolean notACaseReasonDifferentPathogen) {
this.notACaseReasonDifferentPathogen = notACaseReasonDifferentPathogen;
}

public boolean isNotACaseReasonOther() {
return notACaseReasonOther;
}

public void setNotACaseReasonOther(boolean notACaseReasonOther) {
this.notACaseReasonOther = notACaseReasonOther;
}

public String getNotACaseReasonDetails() {
return notACaseReasonDetails;
}

public void setNotACaseReasonDetails(String notACaseReasonDetails) {
this.notACaseReasonDetails = notACaseReasonDetails;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public class CaseExportDto implements Serializable {
@SensitiveData
private String pointOfEntry;
private CaseClassification caseClassification;
private Boolean notACaseReasonNegativeTest;
private Boolean notACaseReasonPhysicianInformation;
private Boolean notACaseReasonDifferentPathogen;
private Boolean notACaseReasonOther;
private String notACaseReasonDetails;
private CaseIdentificationSource caseIdentificationSource;
private InvestigationStatus investigationStatus;
private CaseClassification maxSourceCaseClassification;
Expand Down Expand Up @@ -281,7 +286,8 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
String districtUuid, String district, String communityUuid, String community,
String healthFacility, String healthFacilityUuid, String healthFacilityDetails, String pointOfEntry,
String pointOfEntryUuid, String pointOfEntryDetails, CaseClassification caseClassification,
InvestigationStatus investigationStatus, CaseOutcome outcome, Date outcomeDate, YesNoUnknown bloodOrganOrTissueDonated,
Boolean notACaseReasonNegativeTest, Boolean notACaseReasonPhysicianInformation, Boolean notACaseReasonDifferentPathogen, Boolean notACaseReasonOther,
String notACaseReasonDetails, InvestigationStatus investigationStatus, CaseOutcome outcome, Date outcomeDate, YesNoUnknown bloodOrganOrTissueDonated,
FollowUpStatus followUpStatus, Date followUpUntil,
Boolean nosocomialOutbreak, InfectionSetting infectionSetting,
// Quarantine
Expand Down Expand Up @@ -334,6 +340,11 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
this.district = district;
this.community = community;
this.caseClassification = caseClassification;
this.notACaseReasonNegativeTest = notACaseReasonNegativeTest;
this.notACaseReasonPhysicianInformation = notACaseReasonPhysicianInformation;
this.notACaseReasonDifferentPathogen = notACaseReasonDifferentPathogen;
this.notACaseReasonOther = notACaseReasonOther;
this.notACaseReasonDetails = notACaseReasonDetails;
this.investigationStatus = investigationStatus;
this.outcome = outcome;
this.outcomeDate = outcomeDate;
Expand Down Expand Up @@ -1641,7 +1652,52 @@ public String getReportingDistrict() {
return reportingDistrict;
}

@Order(153)
@Order(154)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE })
@ExportProperty(CaseDataDto.NOT_A_CASE_REASON_NEGATIVE_TEST)
@ExportGroup(ExportGroupType.CORE)
public Boolean getNotACaseReasonNegativeTest() {
return notACaseReasonNegativeTest;
}

@Order(155)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE })
@ExportProperty(CaseDataDto.NOT_A_CASE_REASON_PHYSICIAN_INFORMATION)
@ExportGroup(ExportGroupType.CORE)
public Boolean getNotACaseReasonPhysicianInformation() {
return notACaseReasonPhysicianInformation;
}

@Order(156)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE })
@ExportProperty(CaseDataDto.NOT_A_CASE_REASON_DIFFERENT_PATHOGEN)
@ExportGroup(ExportGroupType.CORE)
public Boolean getNotACaseReasonDifferentPathogen() {
return notACaseReasonDifferentPathogen;
}

@Order(157)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE })
@ExportProperty(CaseDataDto.NOT_A_CASE_REASON_OTHER)
@ExportGroup(ExportGroupType.CORE)
public Boolean getNotACaseReasonOther() {
return notACaseReasonOther;
}

@Order(158)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE })
@ExportProperty(CaseDataDto.NOT_A_CASE_REASON_DETAILS)
@ExportGroup(ExportGroupType.CORE)
public String getNotACaseReasonDetails() {
return notACaseReasonDetails;
}

@Order(159)
@ExportTarget(caseExportTypes = {
CaseExportType.CASE_SURVEILLANCE,
CaseExportType.CASE_MANAGEMENT })
Expand Down Expand Up @@ -1772,6 +1828,26 @@ public void setCaseClassification(CaseClassification caseClassification) {
this.caseClassification = caseClassification;
}

public void setNotACaseReasonNegativeTest(Boolean notACaseReasonNegativeTest) {
this.notACaseReasonNegativeTest = notACaseReasonNegativeTest;
}

public void setNotACaseReasonPhysicianInformation(Boolean notACaseReasonPhysicianInformation) {
this.notACaseReasonPhysicianInformation = notACaseReasonPhysicianInformation;
}

public void setNotACaseReasonDifferentPathogen(Boolean notACaseReasonDifferentPathogen) {
this.notACaseReasonDifferentPathogen = notACaseReasonDifferentPathogen;
}

public void setNotACaseReasonOther(Boolean notACaseReasonOther) {
this.notACaseReasonOther = notACaseReasonOther;
}

public void setNotACaseReasonDetails(String notACaseReasonDetails) {
this.notACaseReasonDetails = notACaseReasonDetails;
}

public void setInvestigationStatus(InvestigationStatus investigationStatus) {
this.investigationStatus = investigationStatus;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ public interface Captions {
String CaseData_nationalLevelDate = "CaseData.nationalLevelDate";
String CaseData_noneHealthFacilityDetails = "CaseData.noneHealthFacilityDetails";
String CaseData_nosocomialOutbreak = "CaseData.nosocomialOutbreak";
String CaseData_notACaseReasonDetails = "CaseData.notACaseReasonDetails";
String CaseData_notACaseReasonDifferentPathogen = "CaseData.notACaseReasonDifferentPathogen";
String CaseData_notACaseReasonNegativeTest = "CaseData.notACaseReasonNegativeTest";
String CaseData_notACaseReasonOther = "CaseData.notACaseReasonOther";
String CaseData_notACaseReasonPhysicianInformation = "CaseData.notACaseReasonPhysicianInformation";
String CaseData_notifyingClinic = "CaseData.notifyingClinic";
String CaseData_notifyingClinicDetails = "CaseData.notifyingClinicDetails";
String CaseData_numberOfVisits = "CaseData.numberOfVisits";
Expand Down
5 changes: 5 additions & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ CaseData.prohibitionToWorkFrom=Prohibition to work from
CaseData.prohibitionToWorkUntil=Prohibition to work until
CaseData.reportingDistrict=Reporting district
CaseData.bloodOrganOrTissueDonated=Blood/organ/tissue donation in the last 6 months
CaseData.notACaseReasonNegativeTest=Negative test result for disease
CaseData.notACaseReasonPhysicianInformation=Information provided by physician
CaseData.notACaseReasonDifferentPathogen=Verification of different pathogen
CaseData.notACaseReasonOther=Other
CaseData.notACaseReasonDetails=Reason details

# CaseExport
CaseExport.address=Address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,18 @@ public class Case extends PseudonymizableAdo {
@DatabaseField
private boolean ownershipHandedOver;

@DatabaseField
private boolean notACaseReasonNegativeTest;
@DatabaseField
private boolean notACaseReasonPhysicianInformation;
@DatabaseField
private boolean notACaseReasonDifferentPathogen;
@DatabaseField
private boolean notACaseReasonOther;

@Column(length = COLUMN_LENGTH_DEFAULT)
private String notACaseReasonDetails;

public boolean isUnreferredPortHealthCase() {
return caseOrigin == CaseOrigin.POINT_OF_ENTRY && healthFacility == null;
}
Expand Down Expand Up @@ -1327,4 +1339,44 @@ public boolean isOwnershipHandedOver() {
public void setOwnershipHandedOver(boolean ownershipHandedOver) {
this.ownershipHandedOver = ownershipHandedOver;
}

public boolean isNotACaseReasonNegativeTest() {
return notACaseReasonNegativeTest;
}

public void setNotACaseReasonNegativeTest(boolean notACaseReasonNegativeTest) {
this.notACaseReasonNegativeTest = notACaseReasonNegativeTest;
}

public boolean isNotACaseReasonPhysicianInformation() {
return notACaseReasonPhysicianInformation;
}

public void setNotACaseReasonPhysicianInformation(boolean notACaseReasonPhysicianInformation) {
this.notACaseReasonPhysicianInformation = notACaseReasonPhysicianInformation;
}

public boolean isNotACaseReasonDifferentPathogen() {
return notACaseReasonDifferentPathogen;
}

public void setNotACaseReasonDifferentPathogen(boolean notACaseReasonDifferentPathogen) {
this.notACaseReasonDifferentPathogen = notACaseReasonDifferentPathogen;
}

public boolean isNotACaseReasonOther() {
return notACaseReasonOther;
}

public void setNotACaseReasonOther(boolean notACaseReasonOther) {
this.notACaseReasonOther = notACaseReasonOther;
}

public String getNotACaseReasonDetails() {
return notACaseReasonDetails;
}

public void setNotACaseReasonDetails(String notACaseReasonDetails) {
this.notACaseReasonDetails = notACaseReasonDetails;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ public void fillInnerFromDto(Case target, CaseDataDto source) {
target.setSormasToSormasOriginInfo(
sormasToSormasOriginInfoDtoHelper.fillOrCreateFromDto(target.getSormasToSormasOriginInfo(), source.getSormasToSormasOriginInfo()));
target.setOwnershipHandedOver(source.isOwnershipHandedOver());

target.setNotACaseReasonNegativeTest(source.isNotACaseReasonNegativeTest());
target.setNotACaseReasonPhysicianInformation(source.isNotACaseReasonPhysicianInformation());
target.setNotACaseReasonDifferentPathogen(source.isNotACaseReasonDifferentPathogen());
target.setNotACaseReasonOther(source.isNotACaseReasonOther());
target.setNotACaseReasonDetails(source.getNotACaseReasonDetails());
}

@Override
Expand Down Expand Up @@ -453,6 +459,13 @@ public void fillInnerFromAdo(CaseDataDto target, Case source) {
if (source.getSormasToSormasOriginInfo() != null) {
target.setSormasToSormasOriginInfo(sormasToSormasOriginInfoDtoHelper.adoToDto(source.getSormasToSormasOriginInfo()));
}
target.setOwnershipHandedOver(source.isOwnershipHandedOver());

target.setNotACaseReasonNegativeTest(source.isNotACaseReasonNegativeTest());
target.setNotACaseReasonPhysicianInformation(source.isNotACaseReasonPhysicianInformation());
target.setNotACaseReasonDifferentPathogen(source.isNotACaseReasonDifferentPathogen());
target.setNotACaseReasonOther(source.isNotACaseReasonOther());
target.setNotACaseReasonDetails(source.getNotACaseReasonDetails());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
public static final String DATABASE_NAME = "sormas.db";
// any time you make changes to your database objects, you may have to increase the database version

public static final int DATABASE_VERSION = 272;
public static final int DATABASE_VERSION = 273;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -1940,6 +1940,13 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int

case 271:
currentVersion = 271;
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN notACaseReasonNegativeTest boolean DEFAULT false;");
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN notACaseReasonPhysicianInformation boolean DEFAULT false;");
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN notACaseReasonDifferentPathogen boolean DEFAULT false;");
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN notACaseReasonOther boolean DEFAULT false;");

case 272:
currentVersion = 272;
getDao(Exposure.class).executeRaw("ALTER TABLE cases ADD COLUMN caseIdentificationSource varchar(255);");

// ATTENTION: break should only be done after last version
Expand Down
35 changes: 35 additions & 0 deletions sormas-app/app/src/main/res/layout/fragment_case_edit_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,41 @@
app:userEditRight="@{UserRight.CASE_CLASSIFY}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlCheckBoxField
android:id="@+id/caseData_notACaseReasonNegativeTest"
app:dependencyParentField="@{caseDataCaseClassification}"
app:dependencyParentValue="@{CaseClassification.NO_CASE}"
app:value="@={data.notACaseReasonNegativeTest}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlCheckBoxField
android:id="@+id/caseData_notACaseReasonPhysicianInformation"
app:dependencyParentField="@{caseDataCaseClassification}"
app:dependencyParentValue="@{CaseClassification.NO_CASE}"
app:value="@={data.notACaseReasonPhysicianInformation}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlCheckBoxField
android:id="@+id/caseData_notACaseReasonDifferentPathogen"
app:dependencyParentField="@{caseDataCaseClassification}"
app:dependencyParentValue="@{CaseClassification.NO_CASE}"
app:value="@={data.notACaseReasonDifferentPathogen}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlCheckBoxField
android:id="@+id/caseData_notACaseReasonOther"
app:dependencyParentField="@{caseDataCaseClassification}"
app:dependencyParentValue="@{CaseClassification.NO_CASE}"
app:value="@={data.notACaseReasonOther}"
style="@style/ControlSingleColumnStyle"/>

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/caseData_notACaseReasonDetails"
app:dependencyParentField="@{caseDataNotACaseReasonOther}"
app:dependencyParentValue="@{true}"
app:value="@={data.notACaseReasonDetails}"
style="@style/ControlSingleColumnStyle" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Loading