forked from SORMAS-Foundation/SORMAS-Project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gh-release-1.87.0' of https://github.com/ePareto-Inform…
…ation-System/SORMAS-Project into gh-release-1.87.0
- Loading branch information
Showing
25 changed files
with
1,430 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...a/de/symeda/sormas/app/backend/patienttraveldetailsduring/PatientTravelDetailsDuring.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package de.symeda.sormas.app.backend.patienttraveldetailsduring; | ||
|
||
import com.j256.ormlite.field.DataType; | ||
import com.j256.ormlite.field.DatabaseField; | ||
import com.j256.ormlite.table.DatabaseTable; | ||
|
||
import de.symeda.sormas.api.utils.TravelLocation; | ||
import de.symeda.sormas.app.backend.common.EmbeddedAdo; | ||
import de.symeda.sormas.app.backend.common.PseudonymizableAdo; | ||
import de.symeda.sormas.app.backend.riskfactor.RiskFactor; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
import java.util.Date; | ||
|
||
@Entity(name = PatientTravelDetailsDuring.TABLE_NAME) | ||
@DatabaseTable(tableName = PatientTravelDetailsDuring.TABLE_NAME) | ||
@EmbeddedAdo(parentAccessor = PatientTravelDetailsDuring.RISK_FACTOR) | ||
|
||
public class PatientTravelDetailsDuring extends PseudonymizableAdo { | ||
public static final String I18N_PREFIX = "PatientTravelDetailsDuring"; | ||
private static final long serialVersionUID = 6551672739041643942L; | ||
|
||
public static final String TABLE_NAME = "patienttraveldetailsduring"; | ||
public static final String RISK_FACTOR = "riskFactor"; | ||
|
||
@DatabaseField(dataType = DataType.DATE_LONG) | ||
private Date dateOfTravel; | ||
@Enumerated(EnumType.STRING) | ||
private TravelLocation placeOfTravel; | ||
@DatabaseField(foreign = true, foreignAutoRefresh = true) | ||
private RiskFactor riskFactor; | ||
|
||
@Override | ||
public String getI18nPrefix() { | ||
return I18N_PREFIX; | ||
} | ||
|
||
public RiskFactor getRiskFactor() { | ||
return riskFactor; | ||
} | ||
public void setRiskFactor(RiskFactor riskFactor) { | ||
this.riskFactor = riskFactor; | ||
} | ||
|
||
public Date getDateOfTravel() { | ||
return dateOfTravel; | ||
} | ||
|
||
public void setDateOfTravel(Date dateOfTravel) { | ||
this.dateOfTravel = dateOfTravel; | ||
} | ||
|
||
public TravelLocation getPlaceOfTravel() { | ||
return placeOfTravel; | ||
} | ||
|
||
public void setPlaceOfTravel(TravelLocation placeOfTravel) { | ||
this.placeOfTravel = placeOfTravel; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...e/symeda/sormas/app/backend/patienttraveldetailsduring/PatientTravelDetailsDuringDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package de.symeda.sormas.app.backend.patienttraveldetailsduring; | ||
|
||
import com.j256.ormlite.dao.Dao; | ||
|
||
import java.sql.SQLException; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import de.symeda.sormas.app.backend.common.AbstractAdoDao; | ||
import de.symeda.sormas.app.backend.riskfactor.RiskFactor; | ||
|
||
public class PatientTravelDetailsDuringDao extends AbstractAdoDao<PatientTravelDetailsDuring> { | ||
|
||
public PatientTravelDetailsDuringDao(Dao<PatientTravelDetailsDuring, Long> innerDao) { | ||
super(innerDao); | ||
} | ||
|
||
@Override | ||
protected Class<PatientTravelDetailsDuring> getAdoClass() { | ||
return PatientTravelDetailsDuring.class; | ||
} | ||
|
||
@Override | ||
public PatientTravelDetailsDuring build() { | ||
PatientTravelDetailsDuring patientTravelDetailsDuring = super.build(); | ||
return patientTravelDetailsDuring; | ||
} | ||
|
||
@Override | ||
public void deleteCascade(PatientTravelDetailsDuring patientTravelDetailsDuring) throws SQLException { | ||
super.delete(patientTravelDetailsDuring); | ||
} | ||
|
||
public List<PatientTravelDetailsDuring> getByRiskFactor(RiskFactor riskFactor) { | ||
if (riskFactor.isSnapshot()) { | ||
return querySnapshotsForEq(PatientTravelDetailsDuring.RISK_FACTOR + "_id", riskFactor, PatientTravelDetailsDuring.CHANGE_DATE, false); | ||
} | ||
return queryForEq(PatientTravelDetailsDuring.RISK_FACTOR + "_id", riskFactor, PatientTravelDetailsDuring.CHANGE_DATE, false); | ||
} | ||
|
||
@Override | ||
public Date getLatestChangeDate() { | ||
Date date = super.getLatestChangeDate(); | ||
if (date == null) { | ||
return null; | ||
} | ||
return date; | ||
} | ||
|
||
@Override | ||
public String getTableName() { | ||
return PatientTravelDetailsDuring.TABLE_NAME; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...da/sormas/app/backend/patienttraveldetailsduring/PatientTravelDetailsDuringDtoHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package de.symeda.sormas.app.backend.patienttraveldetailsduring; | ||
|
||
import java.util.List; | ||
|
||
import de.symeda.sormas.api.PostResponse; | ||
import de.symeda.sormas.api.riskfactor.PatientTravelDetailsDuringDto; | ||
import de.symeda.sormas.app.backend.common.AdoDtoHelper; | ||
import de.symeda.sormas.app.rest.NoConnectionException; | ||
import retrofit2.Call; | ||
|
||
|
||
public class PatientTravelDetailsDuringDtoHelper extends AdoDtoHelper<PatientTravelDetailsDuring, PatientTravelDetailsDuringDto> { | ||
|
||
public PatientTravelDetailsDuringDtoHelper() { | ||
} | ||
|
||
@Override | ||
protected Class<PatientTravelDetailsDuring> getAdoClass() { | ||
return PatientTravelDetailsDuring.class; | ||
} | ||
|
||
@Override | ||
protected Class<PatientTravelDetailsDuringDto> getDtoClass() { | ||
return PatientTravelDetailsDuringDto.class; | ||
} | ||
|
||
@Override | ||
protected Call<List<PatientTravelDetailsDuringDto>> pullAllSince(long since, | ||
Integer size, | ||
String lastSynchronizedUuid) throws NoConnectionException { | ||
throw new UnsupportedOperationException("Entity is embedded"); | ||
} | ||
|
||
@Override | ||
protected Call<List<PatientTravelDetailsDuringDto>> pullByUuids(List<String> uuids) throws NoConnectionException { | ||
throw new UnsupportedOperationException("Entity is embedded"); | ||
} | ||
|
||
@Override | ||
protected Call<List<PostResponse>> pushAll(List<PatientTravelDetailsDuringDto> exposureDtos) throws NoConnectionException { | ||
throw new UnsupportedOperationException("Entity is embedded"); | ||
} | ||
|
||
@Override | ||
protected void fillInnerFromDto(PatientTravelDetailsDuring target, PatientTravelDetailsDuringDto source) { | ||
target.setDateOfTravel(source.getDateOfTravel()); | ||
target.setPlaceOfTravel(source.getPlaceOfTravel()); | ||
} | ||
|
||
@Override | ||
protected void fillInnerFromAdo(PatientTravelDetailsDuringDto target, PatientTravelDetailsDuring source) { | ||
target.setDateOfTravel(source.getDateOfTravel()); | ||
target.setPlaceOfTravel(source.getPlaceOfTravel()); | ||
} | ||
|
||
@Override | ||
protected long getApproximateJsonSizeInBytes() { | ||
return 0; | ||
} | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
...ava/de/symeda/sormas/app/backend/patienttraveldetailsprior/PatientTravelDetailsPrior.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package de.symeda.sormas.app.backend.patienttraveldetailsprior; | ||
|
||
|
||
import com.j256.ormlite.field.DataType; | ||
import com.j256.ormlite.field.DatabaseField; | ||
import com.j256.ormlite.table.DatabaseTable; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
import java.util.Date; | ||
|
||
import de.symeda.sormas.app.backend.common.EmbeddedAdo; | ||
import de.symeda.sormas.app.backend.common.PseudonymizableAdo; | ||
import de.symeda.sormas.app.backend.riskfactor.RiskFactor; | ||
import de.symeda.sormas.api.utils.TravelLocation; | ||
|
||
@Entity(name = PatientTravelDetailsPrior.TABLE_NAME) | ||
@DatabaseTable(tableName = PatientTravelDetailsPrior.TABLE_NAME) | ||
@EmbeddedAdo(parentAccessor = PatientTravelDetailsPrior.RISK_FACTOR) | ||
|
||
public class PatientTravelDetailsPrior extends PseudonymizableAdo { | ||
|
||
public static final String I18N_PREFIX = "PatientTravelDetailsPrior"; | ||
private static final long serialVersionUID = 6551672739041643942L; | ||
|
||
public static final String TABLE_NAME = "patienttraveldetailsprior"; | ||
public static final String RISK_FACTOR = "riskFactor"; | ||
|
||
@DatabaseField(dataType = DataType.DATE_LONG) | ||
private Date dateOfTravel; | ||
@Enumerated(EnumType.STRING) | ||
private TravelLocation placeOfTravel; | ||
@DatabaseField(foreign = true, foreignAutoRefresh = true) | ||
private RiskFactor riskFactor; | ||
|
||
@Override | ||
public String getI18nPrefix() { | ||
return I18N_PREFIX; | ||
} | ||
|
||
public RiskFactor getRiskFactor() { | ||
return riskFactor; | ||
} | ||
public void setRiskFactor(RiskFactor riskFactor) { | ||
this.riskFactor = riskFactor; | ||
} | ||
|
||
public Date getDateOfTravel() { | ||
return dateOfTravel; | ||
} | ||
|
||
public void setDateOfTravel(Date dateOfTravel) { | ||
this.dateOfTravel = dateOfTravel; | ||
} | ||
|
||
public TravelLocation getPlaceOfTravel() { | ||
return placeOfTravel; | ||
} | ||
|
||
public void setPlaceOfTravel(TravelLocation placeOfTravel) { | ||
this.placeOfTravel = placeOfTravel; | ||
} | ||
} |
Oops, something went wrong.