Skip to content

Commit

Permalink
#13203 Additional lab message fields (#13214)
Browse files Browse the repository at this point in the history
Co-authored-by: Levente Gal <[email protected]>
  • Loading branch information
leventegal-she and Levente Gal authored Dec 17, 2024
1 parent cc710f7 commit aef93ea
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
Disease.UNSPECIFIED_VHF,
Disease.ANTHRAX,
Disease.CORONAVIRUS,
Disease.RESPIRATORY_SYNCYTIAL_VIRUS,
Disease.OTHER })
@Outbreaks
private VaccinationStatus vaccinationStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.audit.AuditIncludeProperty;
import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.caze.VaccinationStatus;
import de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportReferenceDto;
import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.externalmessage.labmessage.SampleReportDto;
Expand All @@ -41,6 +42,7 @@
import de.symeda.sormas.api.utils.DependingOnFeatureType;
import de.symeda.sormas.api.utils.FieldConstraints;
import de.symeda.sormas.api.utils.HideForCountriesExcept;
import de.symeda.sormas.api.utils.YesNoUnknown;

@AuditedClass
@DependingOnFeatureType(featureType = FeatureType.EXTERNAL_MESSAGES)
Expand Down Expand Up @@ -161,6 +163,10 @@ public class ExternalMessageDto extends SormasToSormasShareableDto {
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
private String personAdditionalDetails;

private VaccinationStatus vaccinationStatus;

private YesNoUnknown admittedToHealthFacility;

public ExternalMessageType getType() {
return type;
}
Expand Down Expand Up @@ -433,6 +439,22 @@ public void setSurveillanceReport(SurveillanceReportReferenceDto surveillanceRep
this.surveillanceReport = surveillanceReport;
}

public VaccinationStatus getVaccinationStatus() {
return vaccinationStatus;
}

public void setVaccinationStatus(VaccinationStatus vaccinationStatus) {
this.vaccinationStatus = vaccinationStatus;
}

public YesNoUnknown getAdmittedToHealthFacility() {
return admittedToHealthFacility;
}

public void setAdmittedToHealthFacility(YesNoUnknown admittedToHealthFacility) {
this.admittedToHealthFacility = admittedToHealthFacility;
}

public static ExternalMessageDto build() {

ExternalMessageDto message = new ExternalMessageDto();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ protected CaseDataDto buildCase(PersonDto person, ExternalMessageDto externalMes
caseDto.setHealthFacility(processingFacade.getFacilityReferenceByUuid(FacilityDto.NONE_FACILITY_UUID));
}

caseDto.setVaccinationStatus(externalMessageDto.getVaccinationStatus());
caseDto.getHospitalization().setAdmittedToHealthFacility(externalMessageDto.getAdmittedToHealthFacility());

return caseDto;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
import com.vladmihalcea.hibernate.type.array.ListArrayType;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.caze.VaccinationStatus;
import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.externalmessage.ExternalMessageStatus;
import de.symeda.sormas.api.externalmessage.ExternalMessageType;
import de.symeda.sormas.api.person.PhoneNumberType;
import de.symeda.sormas.api.person.PresentCondition;
import de.symeda.sormas.api.person.Sex;
import de.symeda.sormas.api.utils.YesNoUnknown;
import de.symeda.sormas.backend.caze.surveillancereport.SurveillanceReport;
import de.symeda.sormas.backend.common.AbstractDomainObject;
import de.symeda.sormas.backend.disease.DiseaseVariantConverter;
Expand Down Expand Up @@ -126,6 +128,9 @@ public class ExternalMessage extends AbstractDomainObject {
private String tsv;
private String personAdditionalDetails;

private VaccinationStatus vaccinationStatus;
private YesNoUnknown admittedToHealthFacility;

@Enumerated(EnumType.STRING)
public ExternalMessageType getType() {
return type;
Expand Down Expand Up @@ -460,4 +465,22 @@ public String getPersonAdditionalDetails() {
public void setPersonAdditionalDetails(String personAdditionalDetails) {
this.personAdditionalDetails = personAdditionalDetails;
}

@Enumerated(EnumType.STRING)
public VaccinationStatus getVaccinationStatus() {
return vaccinationStatus;
}

public void setVaccinationStatus(VaccinationStatus vaccinationStatus) {
this.vaccinationStatus = vaccinationStatus;
}

@Enumerated(EnumType.STRING)
public YesNoUnknown getAdmittedToHealthFacility() {
return admittedToHealthFacility;
}

public void setAdmittedToHealthFacility(YesNoUnknown admittedToHealthFacility) {
this.admittedToHealthFacility = admittedToHealthFacility;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ ExternalMessage fillOrBuildEntity(@NotNull ExternalMessageDto source, ExternalMe
target.setSampleReports(sampleReports);
}
target.setSurveillanceReport(surveillanceReportService.getByReferenceDto(source.getSurveillanceReport()));
target.setVaccinationStatus(source.getVaccinationStatus());
target.setAdmittedToHealthFacility(source.getAdmittedToHealthFacility());

return target;
}

Expand Down Expand Up @@ -368,6 +371,9 @@ public ExternalMessageDto toDto(ExternalMessage source) {
target.setAssignee(source.getAssignee().toReference());
}

target.setVaccinationStatus(source.getVaccinationStatus());
target.setAdmittedToHealthFacility(source.getAdmittedToHealthFacility());

return target;
}

Expand Down
10 changes: 10 additions & 0 deletions sormas-backend/src/main/resources/sql/sormas_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13724,4 +13724,14 @@ VALUES (nextval('entity_seq'), generate_base32_uuid(), now(), now(), 'DISEASE_VA
'RESPIRATORY_SYNCYTIAL_VIRUS');

INSERT INTO schema_version (version_number, comment) VALUES (555, 'RSV disease variants #13204');

-- 2024-12-12 Additional lab message fields #13203
ALTER TABLE externalmessage
ADD COLUMN vaccinationstatus varchar(255),
ADD COLUMN admittedtohealthfacility varchar(255);
ALTER TABLE externalmessage_history
ADD COLUMN vaccinationstatus varchar(255),
ADD COLUMN admittedtohealthfacility varchar(255);

INSERT INTO schema_version (version_number, comment) VALUES (556, 'Additional lab message fields #13203');
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,8 @@ protected void addFields() {
addField(CaseDataDto.TRIMESTER, NullableOptionGroup.class);
FieldHelper.setVisibleWhen(getFieldGroup(), CaseDataDto.TRIMESTER, CaseDataDto.PREGNANT, Arrays.asList(YesNoUnknown.YES), true);

addField(CaseDataDto.VACCINATION_STATUS);
addField(CaseDataDto.VACCINATION_STATUS, TextField.class);
// getContent().addComponent(new Label("Debug vaccination"), CaseDataDto.VACCINATION_STATUS);
addFields(CaseDataDto.SMALLPOX_VACCINATION_SCAR, CaseDataDto.SMALLPOX_VACCINATION_RECEIVED);
addDateField(CaseDataDto.SMALLPOX_LAST_VACCINATION_DATE, DateField.class, 0);

Expand Down

0 comments on commit aef93ea

Please sign in to comment.