Skip to content

Commit

Permalink
#180: Added Disease diagnosis and event diagnosis to case create for …
Browse files Browse the repository at this point in the history
…IDSR
  • Loading branch information
Flava177 committed Oct 8, 2024
1 parent 0fd90de commit 8aa442e
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class DiseaseFieldConfigurations {

diseaseFieldConfigurations.put(new DiseaseFormTypeKey(Disease.YELLOW_FEVER, FormType.CASE_EDIT),
Arrays.asList(
R.id.case_uuid_investigationStatus_fields_layout, R.id.caseData_reportDate, R.id.caseData_reportingUser, R.id.classifying_fields_layout, R.id.caseData_caseClassification,R.id.caseData_epidNumber, R.id.caseData_disease, R.id.caseData_caseOrigin, R.id.caseData_headingCaseResponsibleJurisidction, R.id.region_district_fields_layout, R.id.caseData_responsibleCommunity, R.id.caseData_healthFacility, R.id.caseData_healthFacilityDetails, R.id.caseData_headingAdditionalMedicalInformation, R.id.caseData_vaccinationStatus, R.id.caseData_vaccinationType, R.id.caseData_numberOfDoses, R.id.caseData_reportingOfficerTitle, R.id.caseData_functionOfReportingOfficer, R.id.caseData_reportingOfficerContactPhone, R.id.caseData_reportingOfficerEmail
R.id.case_uuid_investigationStatus_fields_layout, R.id.caseData_reportDate, R.id.caseData_reportingUser, R.id.classifying_fields_layout, R.id.caseData_caseClassification,R.id.caseData_epidNumber, R.id.caseData_disease, R.id.caseData_caseOrigin, R.id.caseData_headingCaseResponsibleJurisidction, R.id.region_district_fields_layout, R.id.caseData_responsibleCommunity, R.id.caseData_healthFacility, R.id.caseData_healthFacilityDetails, R.id.caseData_medicalInformationHeading, R.id.caseData_vaccinationStatus, R.id.caseData_vaccinationType, R.id.caseData_numberOfDoses, R.id.caseData_reportingOfficerTitle, R.id.caseData_functionOfReportingOfficer, R.id.caseData_reportingOfficerContactPhone, R.id.caseData_reportingOfficerEmail
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import de.symeda.sormas.api.caze.DengueFeverType;
import de.symeda.sormas.api.caze.EndOfIsolationReason;
import de.symeda.sormas.api.caze.HospitalWardType;
import de.symeda.sormas.api.caze.IdsrType;
import de.symeda.sormas.api.caze.InfectionSetting;
import de.symeda.sormas.api.caze.InvestigationStatus;
import de.symeda.sormas.api.caze.PlagueType;
Expand Down Expand Up @@ -123,6 +124,12 @@ public class Case extends PseudonymizableAdo {
private String diseaseVariantString;
private DiseaseVariant diseaseVariant;

@Enumerated(EnumType.STRING)
private IdsrType idsrDiagnosis;

@Column(name = "specifyEventDiagnosis")
private String specifyEventDiagnosis;

@Column(length = CHARACTER_LIMIT_DEFAULT)
private String diseaseDetails;

Expand Down Expand Up @@ -452,6 +459,22 @@ public void setDiseaseVariantString(String diseaseVariantString) {
this.diseaseVariantString = diseaseVariantString;
}

public IdsrType getIdsrDiagnosis() {
return idsrDiagnosis;
}

public void setIdsrDiagnosis(IdsrType idsrDiagnosis) {
this.idsrDiagnosis = idsrDiagnosis;
}

public String getSpecifyEventDiagnosis() {
return specifyEventDiagnosis;
}

public void setSpecifyEventDiagnosis(String specifyEventDiagnosis) {
this.specifyEventDiagnosis = specifyEventDiagnosis;
}

@Transient
public DiseaseVariant getDiseaseVariant() {
if (StringUtils.isBlank(diseaseVariantString)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ public Case build(Person person, Case caze) {
newCase.setDiseaseDetails(caze.getDiseaseDetails());
newCase.setPlagueType(caze.getPlagueType());
newCase.setDengueFeverType(caze.getDengueFeverType());
newCase.setIdsrDiagnosis(caze.getIdsrDiagnosis());
newCase.setSpecifyEventDiagnosis(caze.getSpecifyEventDiagnosis());
}

return newCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public void fillInnerFromDto(Case target, CaseDataDto source) {
target.setDisease(source.getDisease());
target.setDiseaseVariant(source.getDiseaseVariant());
target.setDiseaseDetails(source.getDiseaseDetails());
target.setIdsrDiagnosis(source.getIdsrDiagnosis());
target.setSpecifyEventDiagnosis(source.getSpecifyEventDiagnosis());
target.setDiseaseVariantDetails(source.getDiseaseVariantDetails());
target.setPlagueType(source.getPlagueType());
target.setDengueFeverType(source.getDengueFeverType());
Expand Down Expand Up @@ -269,6 +271,8 @@ public void fillInnerFromAdo(CaseDataDto target, Case source) {
target.setDisease(source.getDisease());
target.setDiseaseVariant(source.getDiseaseVariant());
target.setDiseaseDetails(source.getDiseaseDetails());
target.setIdsrDiagnosis(source.getIdsrDiagnosis());
target.setSpecifyEventDiagnosis(source.getSpecifyEventDiagnosis());
target.setDiseaseVariantDetails(source.getDiseaseVariantDetails());
target.setPlagueType(source.getPlagueType());
target.setDengueFeverType(source.getDengueFeverType());
Expand Down
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 = 361;
public static final int DATABASE_VERSION = 362;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3289,6 +3289,11 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN virusDetectionGenotype varchar(255);");
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN dateLabResultsSentDistrict Date;");
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN finalClassification varchar(255);");

case 361:
currentVersion = 361;
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN idsrDiagnosis varchar(255);");
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN specifyEventDiagnosis 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 @@ -29,6 +29,7 @@
import de.symeda.sormas.api.FormType;
import de.symeda.sormas.api.caze.CaseOrigin;
import de.symeda.sormas.api.caze.DengueFeverType;
import de.symeda.sormas.api.caze.IdsrType;
import de.symeda.sormas.api.caze.PlagueType;
import de.symeda.sormas.api.caze.RabiesType;
import de.symeda.sormas.api.customizableenum.CustomizableEnumType;
Expand Down Expand Up @@ -86,6 +87,7 @@ public class CaseNewFragment extends BaseEditFragment<FragmentCaseNewLayoutBindi
private List<Item> facilityOrHomeList;
private List<Item> facilityTypeGroupList;
private List<Item> caseTransmissionClassificationsList;
private List<Item> idsrTypeList;

public static CaseNewFragment newInstance(Case activityRootData) {
return newInstance(CaseNewFragment.class, CaseNewActivity.buildBundle().get(), activityRootData);
Expand Down Expand Up @@ -143,6 +145,7 @@ record = getActivityRootData();

facilityOrHomeList = DataUtils.toItems(TypeOfPlace.FOR_CASES, true);
facilityTypeGroupList = DataUtils.toItems(FacilityTypeGroup.getAccomodationGroups(), true);
idsrTypeList = DataUtils.getEnumItems(IdsrType.class, true);
}

@Override
Expand Down Expand Up @@ -226,6 +229,7 @@ public void onLayoutBinding(FragmentCaseNewLayoutBinding contentBinding) {

contentBinding.caseDataDisease.initializeSpinner(diseaseList, DiseaseConfigurationCache.getInstance().getDefaultDisease());
contentBinding.caseDataDiseaseVariant.initializeSpinner(diseaseVariantList);
contentBinding.caseDataIdsrDiagnosis.initializeSpinner(idsrTypeList);

contentBinding.caseDataPlagueType.initializeSpinner(plagueTypeList);
contentBinding.caseDataDengueFeverType.initializeSpinner(dengueFeverTypeList);
Expand Down
15 changes: 15 additions & 0 deletions sormas-app/app/src/main/res/layout/fragment_case_new_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

<data>
<import type="de.symeda.sormas.api.Disease" />
<import type="de.symeda.sormas.api.caze.IdsrType" />
<import type="de.symeda.sormas.api.user.UserRight" />
<import type="de.symeda.sormas.api.event.TypeOfPlace" />
<import type="de.symeda.sormas.api.i18n.I18nProperties" />
Expand Down Expand Up @@ -58,6 +59,20 @@
app:required="true"
app:value="@={data.disease}" />

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/caseData_idsrDiagnosis"
style="@style/ControlSingleColumnStyle"
app:dependencyParentField="@{caseDataDisease}"
app:dependencyParentValue="@{Disease.IMMEDIATE_CASE_BASED_FORM_OTHER_CONDITIONS}"
app:value="@={data.idsrDiagnosis}" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/caseData_specifyEventDiagnosis"
style="@style/ControlSingleColumnStyle"
app:dependencyParentField="@{caseDataIdsrDiagnosis}"
app:dependencyParentValue="@{IdsrType.OTHER}"
app:value="@={data.specifyEventDiagnosis}" />

<de.symeda.sormas.app.component.controls.ControlCheckBoxField
android:id="@+id/rapid_case_entry_checkBox"
android:visibility="gone"
Expand Down

0 comments on commit 8aa442e

Please sign in to comment.