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 8738ac8e5e8..c74d32d4965 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 @@ -28,11 +28,14 @@ import de.symeda.sormas.api.audit.AuditedClass; import de.symeda.sormas.api.caze.CaseClassification; import de.symeda.sormas.api.caze.RadiographyCompatibility; +import de.symeda.sormas.api.caze.SyphilisPresentation; import de.symeda.sormas.api.caze.VaccinationStatus; import de.symeda.sormas.api.caze.surveillancereport.SurveillanceReportReferenceDto; import de.symeda.sormas.api.clinicalcourse.ComplianceWithTreatment; +import de.symeda.sormas.api.clinicalcourse.HivStatus; import de.symeda.sormas.api.disease.DiseaseVariant; import de.symeda.sormas.api.epidata.ClusterType; +import de.symeda.sormas.api.epidata.ProbableRouteOfTransmission; import de.symeda.sormas.api.exposure.ModeOfTransmission; import de.symeda.sormas.api.externalmessage.labmessage.SampleReportDto; import de.symeda.sormas.api.externalmessage.survey.ExternalSurveyResponseData; @@ -80,6 +83,10 @@ public class ExternalMessageDto extends SormasToSormasShareableDto { public static final String PERSON_BIRTH_DATE_DD = "personBirthDateDD"; public static final String PERSON_BIRTH_DATE_MM = "personBirthDateMM"; public static final String PERSON_BIRTH_DATE_YYYY = "personBirthDateYYYY"; + public static final String PERSON_BIRTH_COUNTRY = "personBirthCountry"; + public static final String PERSON_CITIZENSHIP = "personCitizenship"; + public static final String SYPHILIS_PRESENTATION = "syphilisPresentation"; + public static final String STI_PROPHYLAXIS = "stiProphylaxis"; public static final String PERSON_POSTAL_CODE = "personPostalCode"; public static final String PERSON_CITY = "personCity"; public static final String PERSON_PHONE = "personPhone"; @@ -129,6 +136,11 @@ public class ExternalMessageDto extends SormasToSormasShareableDto { public static final String MALARIA_INFECTED_YEAR = "malariaInfectedYear"; public static final String AIRPORT_WORKER = "airportWorker"; public static final String HEALTHCARE_PROFESSIONAL = "healthcareProfessional"; + public static final String HIV_STATUS = "hivStatus"; + public static final String PROBABLE_ROUTE_OF_TRANSMISSION = "probableRouteOfTransmission"; + public static final String CONTACT_WITH_SEX_WORKER = "contactWithSexWorker"; + public static final String MOTHER_COUNTRY_OF_BIRTH = "motherCountryOfBirth"; + public static final String MOTHER_CITIZENSHIP = "motherCitizenship"; @AuditIncludeProperty private ExternalMessageType type; @@ -166,6 +178,14 @@ public class ExternalMessageDto extends SormasToSormasShareableDto { private Integer personBirthDateDD; private Integer personBirthDateMM; private Integer personBirthDateYYYY; + @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) + private CountryReferenceDto personBirthCountry; + @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) + private CountryReferenceDto personCitizenship; + @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) + private SyphilisPresentation syphilisPresentation; + @HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG) + private YesNoUnknown stiProphylaxis; @Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong) private String personPostalCode; @Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong) @@ -301,6 +321,12 @@ public class ExternalMessageDto extends SormasToSormasShareableDto { private String clusterTypeText; private Boolean clusterRelated; + private HivStatus hivStatus; + private ProbableRouteOfTransmission probableRouteOfTransmission; + private YesNoUnknown contactWithSexWorker; + private CountryReferenceDto motherCountryOfBirth; + private CountryReferenceDto motherCitizenship; + /** * Will only be present for: {@link ExternalMessageType#SURVEY_RESPONSE} to represent the pair. */ @@ -515,6 +541,38 @@ public void setPersonCountry(CountryReferenceDto personCountry) { this.personCountry = personCountry; } + public CountryReferenceDto getPersonBirthCountry() { + return personBirthCountry; + } + + public void setPersonBirthCountry(CountryReferenceDto personBirthCountry) { + this.personBirthCountry = personBirthCountry; + } + + public CountryReferenceDto getPersonCitizenship() { + return personCitizenship; + } + + public void setPersonCitizenship(CountryReferenceDto personCitizenship) { + this.personCitizenship = personCitizenship; + } + + public SyphilisPresentation getSyphilisPresentation() { + return syphilisPresentation; + } + + public void setSyphilisPresentation(SyphilisPresentation syphilisPresentation) { + this.syphilisPresentation = syphilisPresentation; + } + + public YesNoUnknown getStiProphylaxis() { + return stiProphylaxis; + } + + public void setStiProphylaxis(YesNoUnknown stiProphylaxis) { + this.stiProphylaxis = stiProphylaxis; + } + public FacilityReferenceDto getPersonFacility() { return personFacility; } @@ -1073,6 +1131,46 @@ public void setModeOfTransmissionType(String modeOfTransmissionType) { this.modeOfTransmissionType = modeOfTransmissionType; } + public HivStatus getHivStatus() { + return hivStatus; + } + + public void setHivStatus(HivStatus hivStatus) { + this.hivStatus = hivStatus; + } + + public ProbableRouteOfTransmission getProbableRouteOfTransmission() { + return probableRouteOfTransmission; + } + + public void setProbableRouteOfTransmission(ProbableRouteOfTransmission probableRouteOfTransmission) { + this.probableRouteOfTransmission = probableRouteOfTransmission; + } + + public YesNoUnknown getContactWithSexWorker() { + return contactWithSexWorker; + } + + public void setContactWithSexWorker(YesNoUnknown contactWithSexWorker) { + this.contactWithSexWorker = contactWithSexWorker; + } + + public CountryReferenceDto getMotherCountryOfBirth() { + return motherCountryOfBirth; + } + + public void setMotherCountryOfBirth(CountryReferenceDto motherCountryOfBirth) { + this.motherCountryOfBirth = motherCountryOfBirth; + } + + public CountryReferenceDto getMotherCitizenship() { + return motherCitizenship; + } + + public void setMotherCitizenship(CountryReferenceDto motherCitizenship) { + this.motherCitizenship = motherCitizenship; + } + @Nullable public ExternalSurveyResponseData getSurveyResponseData() { return surveyResponseData; 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 de73e328b24..3ea74fc79f8 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 @@ -192,6 +192,7 @@ protected CaseDataDto buildCase(PersonDto person, ExternalMessageDto externalMes caseDto.setReportingUser(user.toReference()); caseDto.setReportDate( externalMessageDto.getCaseReportDate() != null ? externalMessageDto.getCaseReportDate() : externalMessageDto.getMessageDateTime()); + caseDto.setSyphilisPresentation(externalMessageDto.getSyphilisPresentation()); if (processingFacade.isFeatureEnabled(FeatureType.HIDE_JURISDICTION_FIELDS)) { caseDto.setResponsibleRegion(processingFacade.getDefaultRegionReference()); diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageMapper.java b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageMapper.java index bf8478e441a..0bcc881f5c4 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageMapper.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageMapper.java @@ -84,6 +84,8 @@ public List mapToPerson(PersonDto person) { Mapping.of(person::setBirthdateDD, person.getBirthdateDD(), externalMessage.getPersonBirthDateDD(), PersonDto.BIRTH_DATE_DD), Mapping.of(person::setBirthdateMM, person.getBirthdateMM(), externalMessage.getPersonBirthDateMM(), PersonDto.BIRTH_DATE_MM), Mapping.of(person::setBirthdateYYYY, person.getBirthdateYYYY(), externalMessage.getPersonBirthDateYYYY(), PersonDto.BIRTH_DATE_YYYY), + Mapping.of(person::setBirthCountry, person.getBirthCountry(), externalMessage.getPersonBirthCountry(), PersonDto.BIRTH_COUNTRY), + Mapping.of(person::setCitizenship, person.getCitizenship(), externalMessage.getPersonCitizenship(), PersonDto.CITIZENSHIP), Mapping.of(person::setSex, person.getSex(), externalMessage.getPersonSex(), PersonDto.SEX), Mapping.of( person::setPresentCondition, diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/doctordeclaration/AbstractDoctorDeclarationMessageProcessingFlow.java b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/doctordeclaration/AbstractDoctorDeclarationMessageProcessingFlow.java index 4bbdba4c868..928a7e1e077 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/doctordeclaration/AbstractDoctorDeclarationMessageProcessingFlow.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/doctordeclaration/AbstractDoctorDeclarationMessageProcessingFlow.java @@ -219,6 +219,8 @@ protected void postBuildHealthConditions(CaseDataDto caseDto, ExternalMessageDto postBuildTuberculosisHealthConditions(healthConditionsDto, externalMessageDto); } else if (Disease.MALARIA.equals(externalMessageDto.getDisease())) { postBuildMalariaHealthConditions(healthConditionsDto, externalMessageDto); + } else if (Disease.SYPHILIS.equals(externalMessageDto.getDisease())) { + postBuildSyphilisHealthConditions(healthConditionsDto, externalMessageDto); } else { logger.debug("[POST BUILD HEALTH CONDITIONS] Health conditions not set for case. Disease: {}", externalMessageDto.getDisease()); } @@ -227,6 +229,11 @@ protected void postBuildHealthConditions(CaseDataDto caseDto, ExternalMessageDto caseDto.setHealthConditions(healthConditionsDto); } + private void postBuildSyphilisHealthConditions(HealthConditionsDto healthConditionsDto, ExternalMessageDto externalMessageDto) { + healthConditionsDto.setHivStatus(externalMessageDto.getHivStatus()); + healthConditionsDto.setStiProphylaxis(externalMessageDto.getStiProphylaxis()); + } + /** * Sets malaria-specific health conditions for the case from the external message. * @@ -324,17 +331,18 @@ protected boolean hasCaseHospitalizationMismatch(CaseDataDto caze, ExternalMessa boolean admittedMismatch = !Objects.equals(existingHospitalization.getAdmittedToHealthFacility(), externalMessage.getAdmittedToHealthFacility()); - boolean hospitalizationFacilityNameMismatch = - !Objects.equals( - caze.getHealthFacility() != null ? caze.getHealthFacility().getCaption() : null, - externalMessage.getHospitalizationFacilityName()); - boolean hospitalizationFacilityExternalIdMismatch = - !Objects.equals( - caze.getHealthFacility() != null ? caze.getHealthFacility().getExternalId() : null, - externalMessage.getHospitalizationFacilityExternalId()); + boolean hospitalizationFacilityNameMismatch = !Objects.equals( + caze.getHealthFacility() != null ? caze.getHealthFacility().getCaption() : null, + externalMessage.getHospitalizationFacilityName()); + boolean hospitalizationFacilityExternalIdMismatch = !Objects.equals( + caze.getHealthFacility() != null ? caze.getHealthFacility().getExternalId() : null, + externalMessage.getHospitalizationFacilityExternalId()); - boolean mismatch = admissionDateMismatch || dischargeDateMismatch || admittedMismatch - || hospitalizationFacilityNameMismatch || hospitalizationFacilityExternalIdMismatch; + boolean mismatch = admissionDateMismatch + || dischargeDateMismatch + || admittedMismatch + || hospitalizationFacilityNameMismatch + || hospitalizationFacilityExternalIdMismatch; if (mismatch) { logger.debug("[MESSAGE PROCESSING] Hospitalization mismatch detected for existing case with UUID: {}", caze.getUuid()); @@ -494,6 +502,10 @@ protected void postBuildExposure(CaseDataDto caseDto, ExternalMessageDto externa epiData.setHealthcareProfessional(externalMessageDto.getHealthcareProfessional()); epiData.setModeOfTransmission(externalMessageDto.getModeOfTransmission()); epiData.setModeOfTransmissionType(externalMessageDto.getModeOfTransmissionType()); + epiData.setProbableRouteOfTransmission(externalMessageDto.getProbableRouteOfTransmission()); + epiData.setContactWithSexWorker(externalMessageDto.getContactWithSexWorker()); + epiData.setMotherCitizenship(externalMessageDto.getMotherCitizenship()); + epiData.setMotherCountryOfBirth(externalMessageDto.getMotherCountryOfBirth()); } } else { diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java index d0da104ce6f..6a6583e9512 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java @@ -2048,6 +2048,7 @@ public interface Captions { String ExternalMessage = "ExternalMessage"; String ExternalMessage_assignee = "ExternalMessage.assignee"; String ExternalMessage_caseReportDate = "ExternalMessage.caseReportDate"; + String ExternalMessage_contactWithSexWorker = "ExternalMessage.contactWithSexWorker"; String externalMessage_deleteNewlyCreatedCase = "externalMessage.deleteNewlyCreatedCase"; String externalMessage_deleteNewlyCreatedContact = "externalMessage.deleteNewlyCreatedContact"; String externalMessage_deleteNewlyCreatedEventParticipant = "externalMessage.deleteNewlyCreatedEventParticipant"; @@ -2055,10 +2056,13 @@ public interface Captions { String ExternalMessage_disease = "ExternalMessage.disease"; String ExternalMessage_diseaseVariant = "ExternalMessage.diseaseVariant"; String ExternalMessage_diseaseVariantDetails = "ExternalMessage.diseaseVariantDetails"; + String ExternalMessage_hivStatus = "ExternalMessage.hivStatus"; String ExternalMessage_labExternalId = "ExternalMessage.labExternalId"; String ExternalMessage_labMessageDetails = "ExternalMessage.labMessageDetails"; String ExternalMessage_labSampleId = "ExternalMessage.labSampleId"; String ExternalMessage_messageDateTime = "ExternalMessage.messageDateTime"; + String ExternalMessage_motherCitizenship = "ExternalMessage.motherCitizenship"; + String ExternalMessage_motherCountryOfBirth = "ExternalMessage.motherCountryOfBirth"; String ExternalMessage_personBirthDate = "ExternalMessage.personBirthDate"; String ExternalMessage_personBirthDateDD = "ExternalMessage.personBirthDateDD"; String ExternalMessage_personBirthDateMM = "ExternalMessage.personBirthDateMM"; @@ -2074,6 +2078,7 @@ public interface Captions { String ExternalMessage_personPostalCode = "ExternalMessage.personPostalCode"; String ExternalMessage_personSex = "ExternalMessage.personSex"; String ExternalMessage_personStreet = "ExternalMessage.personStreet"; + String ExternalMessage_probableRouteOfTransmission = "ExternalMessage.probableRouteOfTransmission"; String ExternalMessage_reporterCity = "ExternalMessage.reporterCity"; String ExternalMessage_reporterName = "ExternalMessage.reporterName"; String ExternalMessage_reporterPostalCode = "ExternalMessage.reporterPostalCode"; diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java index a0b27a0b922..fac91594c1e 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java @@ -1040,7 +1040,8 @@ public static SymptomsDto build() { @HideForCountries @SymptomGrouping(SymptomGroup.GASTROINTESTINAL) @Complication({ - DENGUE }) + DENGUE, + SYPHILIS }) private SymptomState jaundice; @Diseases({ diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties index c2ec1be8a72..0200c100630 100644 --- a/sormas-api/src/main/resources/captions.properties +++ b/sormas-api/src/main/resources/captions.properties @@ -1822,6 +1822,11 @@ ExternalMessage.personExternalId=External ID ExternalMessage.personNationalHealthId=National health ID ExternalMessage.personPhoneNumberType=Phone number type ExternalMessage.personCountry=Country +ExternalMessage.hivStatus=HIV status +ExternalMessage.probableRouteOfTransmission=Probable route of transmission +ExternalMessage.contactWithSexWorker=Contact with sex worker +ExternalMessage.motherCountryOfBirth=Mother country of birth +ExternalMessage.motherCitizenship=Mother citizenship externalMessageFetch=Fetch messages surveyFetch=Fetch Surveys externalMessageProcess=Process diff --git a/sormas-api/src/main/resources/enum.properties b/sormas-api/src/main/resources/enum.properties index 1091b4303f1..6554ac5b0eb 100644 --- a/sormas-api/src/main/resources/enum.properties +++ b/sormas-api/src/main/resources/enum.properties @@ -1276,6 +1276,8 @@ PathogenTestType.HISTOPATHOLOGY = Histopathology PathogenTestType.IGG_SERUM_ANTIBODY = ELISA IgG PathogenTestType.IGM_SERUM_ANTIBODY = ELISA IgM PathogenTestType.IGA_SERUM_ANTIBODY = ELISA IgA +PathogenTestType.NON_TREPONEMAL_TEST=Non-treponemal test +PathogenTestType.TREPONEMAL_TEST=Treponemal test PathogenTestType.ISOLATION = Isolation PathogenTestType.MICROSCOPY = Microscopy PathogenTestType.NEUTRALIZING_ANTIBODIES = Neutralizing antibodies 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 055bdb04c6d..f03cb4ee9e4 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 @@ -45,11 +45,14 @@ import de.symeda.sormas.api.Disease; import de.symeda.sormas.api.caze.CaseClassification; import de.symeda.sormas.api.caze.RadiographyCompatibility; +import de.symeda.sormas.api.caze.SyphilisPresentation; import de.symeda.sormas.api.caze.VaccinationStatus; import de.symeda.sormas.api.clinicalcourse.ComplianceWithTreatment; +import de.symeda.sormas.api.clinicalcourse.HivStatus; import de.symeda.sormas.api.disease.DiseaseVariant; import de.symeda.sormas.api.disease.DiseaseVariantConverter; import de.symeda.sormas.api.epidata.ClusterType; +import de.symeda.sormas.api.epidata.ProbableRouteOfTransmission; import de.symeda.sormas.api.exposure.ModeOfTransmission; import de.symeda.sormas.api.externalmessage.ExternalMessageStatus; import de.symeda.sormas.api.externalmessage.ExternalMessageType; @@ -97,6 +100,10 @@ public class ExternalMessage extends AbstractDomainObject { public static final String PERSON_BIRTH_DATE_DD = "personBirthDateDD"; public static final String PERSON_BIRTH_DATE_MM = "personBirthDateMM"; public static final String PERSON_BIRTH_DATE_YYYY = "personBirthDateYYYY"; + public static final String PERSON_BIRTH_COUNTRY = "personBirthCountry"; + public static final String PERSON_CITIZENSHIP = "personCitizenship"; + public static final String SYPHILIS_PRESENTATION = "syphilisPresentation"; + public static final String STI_PROPHYLAXIS = "stiProphylaxis"; public static final String PERSON_POSTAL_CODE = "personPostalCode"; public static final String PERSON_CITY = "personCity"; public static final String PERSON_STREET = "personStreet"; @@ -141,6 +148,11 @@ public class ExternalMessage extends AbstractDomainObject { public static final String OTHER_DIAGNOSTIC_CRITERIA = "otherDiagnosticCriteria"; public static final String AIRPORT_WORKER = "airportWorker"; public static final String HEALTHCARE_PROFESSIONAL = "healthcareProfessional"; + public static final String HIV_STATUS = "hivStatus"; + public static final String PROBABLE_ROUTE_OF_TRANSMISSION = "probableRouteOfTransmission"; + public static final String CONTACT_WITH_SEX_WORKER = "contactWithSexWorker"; + public static final String MOTHER_COUNTRY_OF_BIRTH = "motherCountryOfBirth"; + public static final String MOTHER_CITIZENSHIP = "motherCitizenship"; private ExternalMessageType type; private Disease disease; @@ -165,6 +177,10 @@ public class ExternalMessage extends AbstractDomainObject { private Integer personBirthDateDD; private Integer personBirthDateMM; private Integer personBirthDateYYYY; + private Country personBirthCountry; + private Country personCitizenship; + private SyphilisPresentation syphilisPresentation; + private YesNoUnknown stiProphylaxis; private String personPostalCode; private String personCity; private String personStreet; @@ -253,6 +269,12 @@ public class ExternalMessage extends AbstractDomainObject { private String clusterTypeText; private Boolean clusterRelated; + private HivStatus hivStatus; + private ProbableRouteOfTransmission probableRouteOfTransmission; + private YesNoUnknown contactWithSexWorker; + private Country motherCountryOfBirth; + private Country motherCitizenship; + private ExternalMessageAdditionalDataType additionalDataType; private String additionalDataJson; @@ -503,6 +525,42 @@ public void setPersonCountry(Country personCountry) { this.personCountry = personCountry; } + @ManyToOne(fetch = FetchType.LAZY) + public Country getPersonBirthCountry() { + return personBirthCountry; + } + + public void setPersonBirthCountry(Country personBirthCountry) { + this.personBirthCountry = personBirthCountry; + } + + @ManyToOne(fetch = FetchType.LAZY) + public Country getPersonCitizenship() { + return personCitizenship; + } + + public void setPersonCitizenship(Country personCitizenship) { + this.personCitizenship = personCitizenship; + } + + @Enumerated(EnumType.STRING) + public SyphilisPresentation getSyphilisPresentation() { + return syphilisPresentation; + } + + public void setSyphilisPresentation(SyphilisPresentation syphilisPresentation) { + this.syphilisPresentation = syphilisPresentation; + } + + @Enumerated(EnumType.STRING) + public YesNoUnknown getStiProphylaxis() { + return stiProphylaxis; + } + + public void setStiProphylaxis(YesNoUnknown stiProphylaxis) { + this.stiProphylaxis = stiProphylaxis; + } + @ManyToOne(fetch = FetchType.LAZY) public Facility getPersonFacility() { return personFacility; @@ -1118,4 +1176,49 @@ public void setClusterRelated(Boolean clusterRelated) { this.clusterRelated = clusterRelated; } + @Enumerated(EnumType.STRING) + public HivStatus getHivStatus() { + return hivStatus; + } + + public void setHivStatus(HivStatus hivStatus) { + this.hivStatus = hivStatus; + } + + @Enumerated(EnumType.STRING) + public ProbableRouteOfTransmission getProbableRouteOfTransmission() { + return probableRouteOfTransmission; + } + + public void setProbableRouteOfTransmission(ProbableRouteOfTransmission probableRouteOfTransmission) { + this.probableRouteOfTransmission = probableRouteOfTransmission; + } + + @Enumerated(EnumType.STRING) + public YesNoUnknown getContactWithSexWorker() { + return contactWithSexWorker; + } + + public void setContactWithSexWorker(YesNoUnknown contactWithSexWorker) { + this.contactWithSexWorker = contactWithSexWorker; + } + + @ManyToOne(fetch = FetchType.LAZY) + public Country getMotherCountryOfBirth() { + return motherCountryOfBirth; + } + + public void setMotherCountryOfBirth(Country motherCountryOfBirth) { + this.motherCountryOfBirth = motherCountryOfBirth; + } + + @ManyToOne(fetch = FetchType.LAZY) + public Country getMotherCitizenship() { + return motherCitizenship; + } + + public void setMotherCitizenship(Country motherCitizenship) { + this.motherCitizenship = motherCitizenship; + } + } 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 d0c0623c265..ab473f0feaf 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 @@ -208,6 +208,10 @@ ExternalMessage fillOrBuildEntity(@NotNull ExternalMessageDto source, ExternalMe target.setPersonBirthDateDD(source.getPersonBirthDateDD()); target.setPersonBirthDateMM(source.getPersonBirthDateMM()); target.setPersonBirthDateYYYY(source.getPersonBirthDateYYYY()); + target.setPersonBirthCountry(countryService.getByReferenceDto(source.getPersonBirthCountry())); + target.setPersonCitizenship(countryService.getByReferenceDto(source.getPersonCitizenship())); + target.setSyphilisPresentation(source.getSyphilisPresentation()); + target.setStiProphylaxis(source.getStiProphylaxis()); target.setPersonCity(source.getPersonCity()); target.setPersonExternalId(source.getPersonExternalId()); target.setPersonNationalHealthId(source.getPersonNationalHealthId()); @@ -297,6 +301,11 @@ ExternalMessage fillOrBuildEntity(@NotNull ExternalMessageDto source, ExternalMe target.setHealthcareProfessional(source.getHealthcareProfessional()); target.setModeOfTransmission(source.getModeOfTransmission()); target.setModeOfTransmissionType(source.getModeOfTransmissionType()); + target.setHivStatus(source.getHivStatus()); + target.setProbableRouteOfTransmission(source.getProbableRouteOfTransmission()); + target.setContactWithSexWorker(source.getContactWithSexWorker()); + target.setMotherCountryOfBirth(countryService.getByReferenceDto(source.getMotherCountryOfBirth())); + target.setMotherCitizenship(countryService.getByReferenceDto(source.getMotherCitizenship())); target.setClusterIdentifier(source.getClusterIdentifier()); target.setClusterType(source.getClusterType()); target.setClusterTypeText(source.getClusterTypeText()); @@ -548,6 +557,10 @@ public ExternalMessageDto toDto(ExternalMessage source) { target.setPersonBirthDateDD(source.getPersonBirthDateDD()); target.setPersonBirthDateMM(source.getPersonBirthDateMM()); target.setPersonBirthDateYYYY(source.getPersonBirthDateYYYY()); + target.setPersonBirthCountry(CountryFacadeEjb.toReferenceDto(source.getPersonBirthCountry())); + target.setPersonCitizenship(CountryFacadeEjb.toReferenceDto(source.getPersonCitizenship())); + target.setSyphilisPresentation(source.getSyphilisPresentation()); + target.setStiProphylaxis(source.getStiProphylaxis()); target.setPersonCity(source.getPersonCity()); target.setPersonExternalId(source.getPersonExternalId()); target.setPersonNationalHealthId(source.getPersonNationalHealthId()); @@ -637,6 +650,11 @@ public ExternalMessageDto toDto(ExternalMessage source) { target.setClusterType(source.getClusterType()); target.setClusterTypeText(source.getClusterTypeText()); target.setClusterRelated(source.getClusterRelated()); + target.setHivStatus(source.getHivStatus()); + target.setProbableRouteOfTransmission(source.getProbableRouteOfTransmission()); + target.setContactWithSexWorker(source.getContactWithSexWorker()); + target.setMotherCountryOfBirth(CountryFacadeEjb.toReferenceDto(source.getMotherCountryOfBirth())); + target.setMotherCitizenship(CountryFacadeEjb.toReferenceDto(source.getMotherCitizenship())); ExternalMessageAdditionalDataType additionalDataType = source.getAdditionalDataType(); String additionalDataJson = source.getAdditionalDataJson(); diff --git a/sormas-backend/src/main/resources/sql/sormas_schema.sql b/sormas-backend/src/main/resources/sql/sormas_schema.sql index e3ebcb538a5..0745a21b2d8 100644 --- a/sormas-backend/src/main/resources/sql/sormas_schema.sql +++ b/sormas-backend/src/main/resources/sql/sormas_schema.sql @@ -17159,4 +17159,36 @@ USING ( INSERT INTO schema_version (version_number, comment) VALUES (662, '#13991 - Add excludeFromReporting field for Luxembourg ECDC reporting'); + + +-- Add syphilis-specific fields to ExternalMessage for Luxembourg #14239 +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS hivstatus varchar(255); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS probablerouteoftransmission varchar(255); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS contactwithsexworker varchar(255); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS mothercountryofbirth_id bigint; +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS mothercitizenship_id bigint; +ALTER TABLE externalmessage ADD CONSTRAINT fk_externalmessage_mothercountryofbirth_id FOREIGN KEY (mothercountryofbirth_id) REFERENCES country(id); +ALTER TABLE externalmessage ADD CONSTRAINT fk_externalmessage_mothercitizenship_id FOREIGN KEY (mothercitizenship_id) REFERENCES country(id); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS personbirthcountry_id bigint; +ALTER TABLE externalmessage ADD CONSTRAINT fk_externalmessage_personbirthcountry_id FOREIGN KEY (personbirthcountry_id) REFERENCES country(id); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS personcitizenship_id bigint; +ALTER TABLE externalmessage ADD CONSTRAINT fk_externalmessage_personcitizenship_id FOREIGN KEY (personcitizenship_id) REFERENCES country(id); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS syphilispresentation varchar(255); +ALTER TABLE externalmessage ADD COLUMN IF NOT EXISTS stiprophylaxis varchar(255); + +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS hivstatus varchar(255); +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS probablerouteoftransmission varchar(255); +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS contactwithsexworker varchar(255); +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS mothercountryofbirth_id bigint; +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS mothercitizenship_id bigint; +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS personbirthcountry_id bigint; +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS personcitizenship_id bigint; +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS syphilispresentation varchar(255); +ALTER TABLE externalmessage_history ADD COLUMN IF NOT EXISTS stiprophylaxis varchar(255); + + +INSERT INTO schema_version (version_number, comment) VALUES (663, 'Add syphilis-specific fields to ExternalMessage for Luxembourg #14239'); + + + -- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. *** diff --git a/sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjbMappingTest.java b/sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjbMappingTest.java index d22805e54d5..6526147107c 100644 --- a/sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjbMappingTest.java +++ b/sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/ExternalMessageFacadeEjbMappingTest.java @@ -146,10 +146,15 @@ public void testFromDto() { source.setTreatmentNotApplicable(true); source.setTreatmentStartedDate(new Date()); source.setDiagnosticDate(new Date()); + source.setPersonCitizenship(new CountryReferenceDto(country.getUuid(), country.getIsoCode())); + source.setPersonBirthCountry(new CountryReferenceDto(country.getUuid(), country.getIsoCode())); when(countryService.getByReferenceDto(source.getPersonCountry())).thenReturn(country); when(facilityService.getByReferenceDto(source.getPersonFacility())).thenReturn(facility); + when(countryService.getByReferenceDto(source.getPersonBirthCountry())).thenReturn(country); + when(countryService.getByReferenceDto(source.getPersonCitizenship())).thenReturn(country); + final SymptomsDto symptomsDto = new SymptomsDto(); source.setCaseSymptoms(symptomsDto); when(symptomsFacadeEjb.fillOrBuildEntity(symptomsDto, null, true)).thenReturn(new Symptoms());