Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
4137 covid vaccine (SORMAS-Foundation#4270)
Browse files Browse the repository at this point in the history
* SORMAS-Foundation#4137 enabled and extended covid vaccination info on cases (BE + WEB)

* SORMAS-Foundation#4137 extend vaccination info in the android app

* SORMAS-Foundation#4137 - Added lazy loading for sample properties

Necessary because too many columns were loaded when trying to fetch all pathogen tests for cases:

Caused by: org.postgresql.util.PSQLException: FEHLER: target lists can have at most 1664 entries

* SORMAS-Foundation#4137 fixed labels and added the new field to detailed export

* SORMAS-Foundation#4137 fixed vaccine name/manufacturer logic

* SORMAS-Foundation#4137 WIP new vaccination info entity added to contacts end event participants

* SORMAS-Foundation#4137 generate vaccination info for existing contacts and event participants + handle missing vaccination info coming from mobile app

* SORMAS-Foundation#4137 disabled vaccination onf for contacts and event participant in the mobile app

* SORMAS-Foundation#4137 added vaccination info history table + fixed tests

* SORMAS-Foundation#4137 fix DateHelper test

Co-authored-by: lgal <Valamim1>
Co-authored-by: Maté Strysewske <mate.strysewske@vitagroup.ag>
  • Loading branch information
leventegal-she and MateStrysewske authored Feb 5, 2021
1 parent 8dc3f0b commit 9010260
Show file tree
Hide file tree
Showing 47 changed files with 2,237 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ public CaseExportDto(long id, long personId, long personAddressId, long epiDataI
String phone, String phoneOwner, String emailAddress, EducationType educationType, String educationDetails,
OccupationType occupationType, String occupationDetails, ArmedForcesRelationType ArmedForcesRelationType, YesNoUnknown contactWithSourceCaseKnown,
//Date onsetDate,
// vaccination info
Vaccination vaccination, String vaccinationDoses, VaccinationInfoSource vaccinationInfoSource, Date firstVaccinationDate, Date lastVaccinationDate,
Vaccine vaccineName, String otherVaccineName, VaccineManufacturer vaccineManufacturer, String otherVaccineManufacturer,
String vaccineInn, String vaccineBatchNumber, String vaccineUniiCode, String vaccineAtcCode,

YesNoUnknown postpartum, Trimester trimester,
long eventCount, String externalID, String externalToken,
String birthName, String birthCountryIsoCode, String birthCountryName, String citizenshipIsoCode, String citizenshipCountryName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.symeda.sormas.api.utils.pseudonymization.Pseudonymizer;
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LatitudePseudonymizer;
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.LongitudePseudonymizer;
import de.symeda.sormas.api.vaccinationinfo.VaccinationInfoDto;

public class ContactDto extends PseudonymizableDto {

Expand Down Expand Up @@ -123,6 +124,8 @@ public class ContactDto extends PseudonymizableDto {

public static final String REPORTING_DISTRICT = "reportingDistrict";

public static final String VACCINATION_INFO = "vaccinationInfo";

private CaseReferenceDto caze;
private String caseIdExternalSystem;
@SensitiveData
Expand Down Expand Up @@ -273,6 +276,8 @@ public class ContactDto extends PseudonymizableDto {
@HideForCountriesExcept
private DistrictReferenceDto reportingDistrict;

private VaccinationInfoDto vaccinationInfo;

public static ContactDto build() {
final ContactDto contact = new ContactDto();
contact.setUuid(DataHelper.createUuid());
Expand All @@ -282,6 +287,7 @@ public static ContactDto build() {
contact.setContactStatus(ContactStatus.ACTIVE);
contact.setEpiData(EpiDataDto.build());
contact.setHealthConditions(HealthConditionsDto.build());
contact.setVaccinationInfo(VaccinationInfoDto.build());

return contact;
}
Expand Down Expand Up @@ -888,4 +894,12 @@ public YesNoUnknown getReturningTraveler() {
public void setReturningTraveler(YesNoUnknown returningTraveler) {
this.returningTraveler = returningTraveler;
}

public VaccinationInfoDto getVaccinationInfo() {
return vaccinationInfo;
}

public void setVaccinationInfo(VaccinationInfoDto vaccinationInfo) {
this.vaccinationInfo = vaccinationInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
import de.symeda.sormas.api.caze.CaseClassification;
import de.symeda.sormas.api.caze.CaseDataDto;
import de.symeda.sormas.api.caze.CaseJurisdictionDto;
import de.symeda.sormas.api.caze.Vaccination;
import de.symeda.sormas.api.caze.VaccinationInfoSource;
import de.symeda.sormas.api.caze.Vaccine;
import de.symeda.sormas.api.caze.VaccineManufacturer;
import de.symeda.sormas.api.epidata.EpiDataDto;
import de.symeda.sormas.api.facility.FacilityHelper;
import de.symeda.sormas.api.i18n.I18nProperties;
Expand All @@ -50,6 +54,7 @@
import de.symeda.sormas.api.utils.YesNoUnknown;
import de.symeda.sormas.api.utils.pseudonymization.Pseudonymizer;
import de.symeda.sormas.api.utils.pseudonymization.valuepseudonymizers.PostalCodePseudonymizer;
import de.symeda.sormas.api.vaccinationinfo.VaccinationInfoDto;

public class ContactExportDto implements Serializable {

Expand Down Expand Up @@ -166,7 +171,19 @@ public class ContactExportDto implements Serializable {
private Date quarantineOfficialOrderSentDate;
private YesNoUnknown returningTraveler;

private ContactJurisdictionDto jurisdiction;
private Vaccination vaccination;
private String vaccinationDoses;
private VaccinationInfoSource vaccinationInfoSource;
private Date firstVaccinationDate;
private Date lastVaccinationDate;
private Vaccine vaccineName;
private String otherVaccineName;
private VaccineManufacturer vaccineManufacturer;
private String otherVaccineManufacturer;
private String vaccineInn;
private String vaccineBatchNumber;
private String vaccineUniiCode;
private String vaccineAtcCode;

private Long eventCount;
private String latestEventId;
Expand All @@ -182,6 +199,8 @@ public class ContactExportDto implements Serializable {

private String reportingDistrict;

private ContactJurisdictionDto jurisdiction;

//@formatter:off
public ContactExportDto(long id, long personId, String uuid, String sourceCaseUuid, CaseClassification caseClassification, Disease disease, String diseaseDetails,
ContactClassification contactClassification, Boolean multiDayContact, Date firstContactDate, Date lastContactDate,
Expand All @@ -199,7 +218,13 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
String facility, String facilityUuid, String facilityDetails,
String phone, String phoneOwner, String emailAddress, OccupationType occupationType, String occupationDetails, ArmedForcesRelationType armedForcesRelationType,
String region, String district, String community,
long epiDataId, YesNoUnknown contactWithSourceCaseKnown, YesNoUnknown returningTraveler, String externalID, String externalToken,
long epiDataId, YesNoUnknown contactWithSourceCaseKnown, YesNoUnknown returningTraveler,
// vaccination info
Vaccination vaccination, String vaccinationDoses, VaccinationInfoSource vaccinationInfoSource, Date firstVaccinationDate, Date lastVaccinationDate,
Vaccine vaccineName, String otherVaccineName, VaccineManufacturer vaccineManufacturer, String otherVaccineManufacturer,
String vaccineInn, String vaccineBatchNumber, String vaccineUniiCode, String vaccineAtcCode,

String externalID, String externalToken,
String birthName, String birthCountryIsoCode, String birthCountryName, String citizenshipIsoCode, String citizenshipCountryName,
String reportingDistrict,
String reportingUserUuid, String regionUuid, String districtUuid, String communityUuid,
Expand Down Expand Up @@ -267,6 +292,21 @@ public ContactExportDto(long id, long personId, String uuid, String sourceCaseUu
this.epiDataId = epiDataId;
this.contactWithSourceCaseKnown = contactWithSourceCaseKnown;
this.returningTraveler = returningTraveler;

this.vaccination = vaccination;
this.vaccinationDoses = vaccinationDoses;
this.vaccinationInfoSource = vaccinationInfoSource;
this.firstVaccinationDate = firstVaccinationDate;
this.lastVaccinationDate = lastVaccinationDate;
this.vaccineName = vaccineName;
this.otherVaccineName = otherVaccineName;
this.vaccineManufacturer = vaccineManufacturer;
this.otherVaccineManufacturer = otherVaccineManufacturer;
this.vaccineInn = vaccineInn;
this.vaccineBatchNumber = vaccineBatchNumber;
this.vaccineUniiCode = vaccineUniiCode;
this.vaccineAtcCode = vaccineAtcCode;

this.externalID = externalID;
this.externalToken = externalToken;
this.birthName = birthName;
Expand Down Expand Up @@ -793,7 +833,98 @@ public void setReturningTraveler(YesNoUnknown returningTraveler) {
this.returningTraveler = returningTraveler;
}

@Order(71)
@Order(80)
@ExportProperty(VaccinationInfoDto.VACCINATION)
@ExportGroup(ExportGroupType.VACCINATION)
public Vaccination getVaccination() {
return vaccination;
}

@Order(81)
@ExportProperty(VaccinationInfoDto.VACCINATION_DOSES)
@ExportGroup(ExportGroupType.VACCINATION)
public String getVaccinationDoses() {
return vaccinationDoses;
}

@Order(82)
@ExportProperty(VaccinationInfoDto.VACCINATION_INFO_SOURCE)
@ExportGroup(ExportGroupType.VACCINATION)
public VaccinationInfoSource getVaccinationInfoSource() {
return vaccinationInfoSource;
}

@Order(83)
@ExportProperty(VaccinationInfoDto.FIRST_VACCINATION_DATE)
@ExportGroup(ExportGroupType.VACCINATION)
public Date getFirstVaccinationDate() {
return firstVaccinationDate;
}

@Order(84)
@ExportProperty(VaccinationInfoDto.LAST_VACCINATION_DATE)
@ExportGroup(ExportGroupType.VACCINATION)
public Date getLastVaccinationDate() {
return lastVaccinationDate;
}

@Order(85)
@ExportProperty(VaccinationInfoDto.VACCINE_NAME)
@ExportGroup(ExportGroupType.VACCINATION)
public Vaccine getVaccineName() {
return vaccineName;
}

@Order(86)
@ExportProperty(VaccinationInfoDto.OTHER_VACCINE_NAME)
@ExportGroup(ExportGroupType.VACCINATION)
public String getOtherVaccineName() {
return otherVaccineName;
}

@Order(87)
@ExportProperty(VaccinationInfoDto.VACCINE_MANUFACTURER)
@ExportGroup(ExportGroupType.VACCINATION)
public VaccineManufacturer getVaccineManufacturer() {
return vaccineManufacturer;
}

@Order(88)
@ExportProperty(VaccinationInfoDto.OTHER_VACCINE_MANUFACTURER)
@ExportGroup(ExportGroupType.VACCINATION)
public String getOtherVaccineManufacturer() {
return otherVaccineManufacturer;
}

@Order(89)
@ExportProperty(VaccinationInfoDto.VACCINE_INN)
@ExportGroup(ExportGroupType.VACCINATION)
public String getVaccineInn() {
return vaccineInn;
}

@Order(90)
@ExportProperty(VaccinationInfoDto.VACCINE_BATCH_NUMBER)
@ExportGroup(ExportGroupType.VACCINATION)
public String getVaccineBatchNumber() {
return vaccineBatchNumber;
}

@Order(91)
@ExportProperty(VaccinationInfoDto.VACCINE_UNII_CODE)
@ExportGroup(ExportGroupType.VACCINATION)
public String getVaccineUniiCode() {
return vaccineUniiCode;
}

@Order(92)
@ExportProperty(VaccinationInfoDto.VACCINE_ATC_CODE)
@ExportGroup(ExportGroupType.VACCINATION)
public String getVaccineAtcCode() {
return vaccineAtcCode;
}

@Order(100)
@ExportProperty(LATEST_EVENT_ID)
@ExportGroup(ExportGroupType.EVENT)
public String getLatestEventId() {
Expand All @@ -804,7 +935,7 @@ public void setLatestEventId(String latestEventId) {
this.latestEventId = latestEventId;
}

@Order(72)
@Order(101)
@ExportProperty(LATEST_EVENT_TITLE)
@ExportGroup(ExportGroupType.EVENT)
public String getLatestEventTitle() {
Expand All @@ -815,46 +946,46 @@ public void setLatestEventTitle(String latestEventTitle) {
this.latestEventTitle = latestEventTitle;
}

@Order(73)
@Order(102)
@ExportProperty(EVENT_COUNT)
@ExportGroup(ExportGroupType.EVENT)
public Long getEventCount() {
return eventCount;
}

@Order(80)
@Order(103)
@ExportProperty(PersonDto.BIRTH_NAME)
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
public String getBirthName() {
return birthName;
}

@Order(81)
@Order(104)
@ExportProperty(PersonDto.BIRTH_COUNTRY)
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
public String getBirthCountry() {
return birthCountry;
}

@Order(82)
@Order(105)
@ExportProperty(PersonDto.CITIZENSHIP)
@ExportGroup(ExportGroupType.SENSITIVE)
@HideForCountriesExcept
public String getCitizenship() {
return citizenship;
}

@Order(83)
@Order(106)
@ExportProperty(ContactDto.REPORTING_DISTRICT)
@ExportGroup(ExportGroupType.ADDITIONAL)
@HideForCountriesExcept
public String getReportingDistrict() {
return reportingDistrict;
}

@Order(84)
@Order(107)
@ExportProperty(ContactDto.EXTERNAL_TOKEN)
@ExportGroup(ExportGroupType.CORE)
public String getExternalToken() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.symeda.sormas.api.utils.Required;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto;
import de.symeda.sormas.api.vaccinationinfo.VaccinationInfoDto;

public class EventParticipantDto extends PseudonymizableDto {

Expand All @@ -41,6 +42,7 @@ public class EventParticipantDto extends PseudonymizableDto {
public static final String REPORTING_USER = "reportingUser";
public static final String REGION = "region";
public static final String DISTRICT = "district";
public static final String VACCINATION_INFO = "vaccinationInfo";

private UserReferenceDto reportingUser;
@Required
Expand All @@ -54,6 +56,8 @@ public class EventParticipantDto extends PseudonymizableDto {
private RegionReferenceDto region;
private DistrictReferenceDto district;

private VaccinationInfoDto vaccinationInfo;

public static EventParticipantDto build(EventReferenceDto event, UserReferenceDto reportingUser) {
EventParticipantDto eventParticipant = new EventParticipantDto();
eventParticipant.setUuid(DataHelper.createUuid());
Expand Down Expand Up @@ -146,4 +150,12 @@ public DistrictReferenceDto getDistrict() {
public void setDistrict(DistrictReferenceDto district) {
this.district = district;
}

public VaccinationInfoDto getVaccinationInfo() {
return vaccinationInfo;
}

public void setVaccinationInfo(VaccinationInfoDto vaccinationInfo) {
this.vaccinationInfo = vaccinationInfo;
}
}
Loading

0 comments on commit 9010260

Please sign in to comment.