From aef93eaf6973ce921dff7a52584efe7cba9178c3 Mon Sep 17 00:00:00 2001 From: Levente Gal <62599627+leventegal-she@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:02:38 +0200 Subject: [PATCH] #13203 Additional lab message fields (#13214) Co-authored-by: Levente Gal --- .../symeda/sormas/api/caze/CaseDataDto.java | 1 + .../externalmessage/ExternalMessageDto.java | 22 ++++++++++++++++++ .../processing/AbstractProcessingFlow.java | 3 +++ .../externalmessage/ExternalMessage.java | 23 +++++++++++++++++++ .../ExternalMessageFacadeEjb.java | 6 +++++ .../src/main/resources/sql/sormas_schema.sql | 10 ++++++++ .../symeda/sormas/ui/caze/CaseDataForm.java | 3 ++- 7 files changed, 67 insertions(+), 1 deletion(-) diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java index aae97fc38d0..34b1a8d986a 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java @@ -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; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageDto.java index 207ec0ae899..ecd24b99bee 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageDto.java @@ -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; @@ -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) @@ -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; } @@ -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(); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/AbstractProcessingFlow.java b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/AbstractProcessingFlow.java index fefeb32f8ab..5fc5b5bf63f 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/AbstractProcessingFlow.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/AbstractProcessingFlow.java @@ -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; } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessage.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessage.java index 4785bc2b3e5..0e084a75d4d 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessage.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessage.java @@ -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; @@ -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; @@ -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; + } } diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjb.java index b21a7c3e732..a71d7d99e0f 100644 --- a/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjb.java +++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjb.java @@ -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; } @@ -368,6 +371,9 @@ public ExternalMessageDto toDto(ExternalMessage source) { target.setAssignee(source.getAssignee().toReference()); } + target.setVaccinationStatus(source.getVaccinationStatus()); + target.setAdmittedToHealthFacility(source.getAdmittedToHealthFacility()); + return target; } diff --git a/sormas-backend/src/main/resources/sql/sormas_schema.sql b/sormas-backend/src/main/resources/sql/sormas_schema.sql index b8e97a8d26f..02d53bd8d33 100644 --- a/sormas-backend/src/main/resources/sql/sormas_schema.sql +++ b/sormas-backend/src/main/resources/sql/sormas_schema.sql @@ -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. *** diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java index c30e6cb8328..94a3cac8154 100644 --- a/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java +++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java @@ -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);