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.
#182: Implemented a new feature: Investigation Notes entity with it's…
… fields: investigationNotesData, suspectedDiagnosis, confirmedDiagnosis, investigatedBy, investigatorSignature, investigatorDate
- Loading branch information
Showing
13 changed files
with
484 additions
and
4 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
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
91 changes: 91 additions & 0 deletions
91
...app/src/main/java/de/symeda/sormas/app/backend/investigationnotes/InvestigationNotes.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,91 @@ | ||
package de.symeda.sormas.app.backend.investigationnotes; | ||
|
||
import static de.symeda.sormas.api.utils.FieldConstraints.CHARACTER_LIMIT_DEFAULT; | ||
|
||
import com.j256.ormlite.field.DataType; | ||
import com.j256.ormlite.field.DatabaseField; | ||
import com.j256.ormlite.table.DatabaseTable; | ||
|
||
import javax.persistence.Entity; | ||
import java.util.Date; | ||
import javax.persistence.Column; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
|
||
import de.symeda.sormas.app.backend.common.EmbeddedAdo; | ||
import de.symeda.sormas.app.backend.common.PseudonymizableAdo; | ||
|
||
@Entity(name = InvestigationNotes.TABLE_NAME) | ||
@DatabaseTable(tableName = InvestigationNotes.TABLE_NAME) | ||
@EmbeddedAdo | ||
public class InvestigationNotes extends PseudonymizableAdo { | ||
|
||
private static final long serialVersionUID = -8294812479501735785L; | ||
public static final String TABLE_NAME = "investigationnotes"; | ||
public static final String I18N_PREFIX = "InvestigationNotes"; | ||
|
||
@Column(length = CHARACTER_LIMIT_DEFAULT) | ||
private String investigationNotesData; | ||
@Column(length = CHARACTER_LIMIT_DEFAULT) | ||
private String suspectedDiagnosis; | ||
@Column(length = CHARACTER_LIMIT_DEFAULT) | ||
private String confirmedDiagnosis; | ||
@Column(length = CHARACTER_LIMIT_DEFAULT) | ||
private String investigatedBy; | ||
@Column(length = CHARACTER_LIMIT_DEFAULT) | ||
private String investigatorSignature; | ||
@DatabaseField(dataType = DataType.DATE_LONG) | ||
private Date investigatorDate; | ||
|
||
public String getInvestigationNotesData() { | ||
return investigationNotesData; | ||
} | ||
|
||
public void setInvestigationNotesData(String investigationNotesData) { | ||
this.investigationNotesData = investigationNotesData; | ||
} | ||
|
||
public String getSuspectedDiagnosis() { | ||
return suspectedDiagnosis; | ||
} | ||
|
||
public void setSuspectedDiagnosis(String suspectedDiagnosis) { | ||
this.suspectedDiagnosis = suspectedDiagnosis; | ||
} | ||
|
||
public String getConfirmedDiagnosis() { | ||
return confirmedDiagnosis; | ||
} | ||
|
||
public void setConfirmedDiagnosis(String confirmedDiagnosis) { | ||
this.confirmedDiagnosis = confirmedDiagnosis; | ||
} | ||
|
||
public String getInvestigatedBy() { | ||
return investigatedBy; | ||
} | ||
|
||
public void setInvestigatedBy(String investigatedBy) { | ||
this.investigatedBy = investigatedBy; | ||
} | ||
|
||
public String getInvestigatorSignature() { | ||
return investigatorSignature; | ||
} | ||
|
||
public void setInvestigatorSignature(String investigatorSignature) { | ||
this.investigatorSignature = investigatorSignature; | ||
} | ||
public Date getInvestigatorDate() { | ||
return investigatorDate; | ||
} | ||
|
||
public void setInvestigatorDate(Date investigatorDate) { | ||
this.investigatorDate = investigatorDate; | ||
} | ||
|
||
@Override | ||
public String getI18nPrefix() { | ||
return I18N_PREFIX; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
.../src/main/java/de/symeda/sormas/app/backend/investigationnotes/InvestigationNotesDao.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,71 @@ | ||
package de.symeda.sormas.app.backend.investigationnotes; | ||
|
||
import com.j256.ormlite.dao.Dao; | ||
|
||
import java.util.Date; | ||
|
||
import de.symeda.sormas.app.backend.common.AbstractAdoDao; | ||
import de.symeda.sormas.app.backend.common.DaoException; | ||
|
||
public class InvestigationNotesDao extends AbstractAdoDao<InvestigationNotes> { | ||
|
||
public InvestigationNotesDao(Dao<InvestigationNotes, Long> innerDao) { | ||
super(innerDao); | ||
} | ||
|
||
@Override | ||
protected Class<InvestigationNotes> getAdoClass() { | ||
return InvestigationNotes.class; | ||
} | ||
|
||
@Override | ||
public String getTableName() { | ||
return InvestigationNotes.TABLE_NAME; | ||
} | ||
|
||
@Override | ||
public InvestigationNotes queryUuid(String uuid) { | ||
InvestigationNotes data = super.queryUuid(uuid); | ||
if (data != null) { | ||
initLazyData(data); | ||
} | ||
return data; | ||
} | ||
|
||
@Override | ||
public InvestigationNotes querySnapshotByUuid(String uuid) { | ||
InvestigationNotes data = super.querySnapshotByUuid(uuid); | ||
if (data != null) { | ||
initLazyData(data); | ||
} | ||
return data; | ||
} | ||
|
||
@Override | ||
public InvestigationNotes queryForId(Long id) { | ||
InvestigationNotes data = super.queryForId(id); | ||
if (data != null) { | ||
initLazyData(data); | ||
} | ||
return data; | ||
} | ||
|
||
private InvestigationNotes initLazyData(InvestigationNotes foodHistory) { | ||
return foodHistory; | ||
} | ||
|
||
@Override | ||
public InvestigationNotes saveAndSnapshot(InvestigationNotes ado) throws DaoException { | ||
InvestigationNotes snapshot = super.saveAndSnapshot(ado); | ||
return snapshot; | ||
} | ||
|
||
@Override | ||
public Date getLatestChangeDate() { | ||
Date date = super.getLatestChangeDate(); | ||
if (date == null) { | ||
return null; | ||
} | ||
return date; | ||
} | ||
} |
Oops, something went wrong.