Skip to content

Commit

Permalink
#162: Filtered present condition values for CSM. Added vaccine type a…
Browse files Browse the repository at this point in the history
…nd to render on vaccinated toggle for CSM at case edit.
  • Loading branch information
Flava177 committed Nov 18, 2024
1 parent 434f5ff commit 01cd992
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ public enum PresentCondition {
Disease.MEASLES }, hide = true)
DEAD,
@Diseases(value = {
Disease.CORONAVIRUS, Disease.MEASLES }, hide = true)
Disease.CORONAVIRUS, Disease.MEASLES, Disease.CSM }, hide = true)
BURIED,
@Diseases(value = {Disease.CSM }, hide = true)
UNKNOWN;

public boolean isDeceased() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import de.symeda.sormas.api.infrastructure.facility.FacilityType;
import de.symeda.sormas.api.utils.CardOrHistory;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.VaccineTypes;
import de.symeda.sormas.api.utils.YesNo;
import de.symeda.sormas.api.utils.YesNoUnknown;
import de.symeda.sormas.app.backend.caze.maternalhistory.MaternalHistory;
Expand Down Expand Up @@ -246,6 +247,8 @@ public class Case extends PseudonymizableAdo {
@Enumerated(EnumType.STRING)
@DatabaseField(columnName = "vaccinationType")
private CardOrHistory vaccinationType;
@Enumerated(EnumType.STRING)
private VaccineTypes vaccineType;
private String numberOfDoses;
@DatabaseField(columnName = "vaccinationDate", dataType = DataType.DATE_LONG)
private Date vaccinationDate;
Expand Down Expand Up @@ -841,6 +844,14 @@ public void setVaccinationType(CardOrHistory vaccinationType) {
this.vaccinationType = vaccinationType;
}

public VaccineTypes getVaccineType() {
return vaccineType;
}

public void setVaccineType(VaccineTypes vaccineType) {
this.vaccineType = vaccineType;
}

public String getNumberOfDoses() {
return numberOfDoses;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public void fillInnerFromDto(Case target, CaseDataDto source) {

target.setVaccinationStatus(source.getVaccinationStatus());
target.setVaccinationType(source.getVaccinationType());
target.setVaccineType(source.getVaccineType());
target.setNumberOfDoses(source.getNumberOfDoses());
target.setVaccinationDate(source.getVaccinationDate());
target.setSmallpoxVaccinationScar(source.getSmallpoxVaccinationScar());
Expand Down Expand Up @@ -464,6 +465,7 @@ public void fillInnerFromAdo(CaseDataDto target, Case source) {
target.setPregnant(source.getPregnant());
target.setVaccinationStatus(source.getVaccinationStatus());
target.setVaccinationType(source.getVaccinationType());
target.setVaccineType(source.getVaccineType());
target.setNumberOfDoses(source.getNumberOfDoses());
target.setVaccinationDate(source.getVaccinationDate());
target.setSmallpoxVaccinationScar(source.getSmallpoxVaccinationScar());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 400;
public static final int DATABASE_VERSION = 401;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3909,6 +3909,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN secondTestedDisease VARCHAR(255);");
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN testResultForSecondDisease VARCHAR(255);");

case 400:
currentVersion = 400;
getDao(Case.class).executeRaw("ALTER TABLE cases ADD COLUMN vaccineType varchar(255);");


// ATTENTION: break should only be done after last version
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import de.symeda.sormas.api.user.JurisdictionLevel;
import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.api.utils.CardOrHistory;
import de.symeda.sormas.api.utils.VaccineTypes;
import de.symeda.sormas.api.utils.YesNoUnknown;
import de.symeda.sormas.api.utils.fieldaccess.UiFieldAccessCheckers;
import de.symeda.sormas.api.utils.fieldvisibility.FieldVisibilityCheckers;
Expand Down Expand Up @@ -140,6 +141,7 @@ public class CaseEditFragment extends BaseEditFragment<FragmentCaseEditLayoutBin
private boolean differentPlaceOfStayJurisdiction;
private List<Item> idsrTypeList;
private List<Item> notifyByList;
private List<Item> vaccineList;

// Static methods

Expand Down Expand Up @@ -426,6 +428,7 @@ record = getActivityRootData();
caseConfirmationBasisList = DataUtils.getEnumItems(CaseConfirmationBasis.class, true);
idsrTypeList = DataUtils.getEnumItems(IdsrType.class, true);
notifyByList = DataUtils.getEnumItems(NotifiedList.class, true);
vaccineList = DataUtils.getEnumItems(VaccineTypes.class, true);
}

@Override
Expand Down Expand Up @@ -611,6 +614,7 @@ public void onChange(ControlPropertyField field) {
contentBinding.setFilteredVaccinationStatusValues(filteredValues);
contentBinding.caseDataIdsrDiagnosis.initializeSpinner(idsrTypeList);
contentBinding.caseDataNotifiedByList.initializeSpinner(notifyByList);
contentBinding.caseDataVaccineType.initializeSpinner(vaccineList);

contentBinding.caseDataQuarantineTo.addValueChangedListener(new ValueChangeListener() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,14 @@
app:dependencyParentVisibility="@{true}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlSpinnerField
android:id="@+id/caseData_vaccineType"
app:value="@={data.vaccineType}"
app:dependencyParentField="@{caseDataVaccinationStatus}"
app:dependencyParentValue="@{VaccinationStatus.VACCINATED}"
app:dependencyParentVisibility="@{true}"
style="@style/ControlSingleColumnStyle" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/caseData_numberOfDoses"
app:value="@={data.numberOfDoses}"
Expand Down

0 comments on commit 01cd992

Please sign in to comment.