Skip to content

Commit

Permalink
[GITFLOW]merging 'release-0.4.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ciSymeda committed Sep 5, 2017
2 parents 18380fb + c20c3b1 commit d6df4d7
Show file tree
Hide file tree
Showing 244 changed files with 5,074 additions and 1,716 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ For information on what libs are used see pom.xml in sormas-base project: https:
* ``cd /root/deploy/sormas/backup``
* ``sudo -u postgres pg_dump -Fc -b sormas_db > "sormas_db_"`date +"%Y-%m-%d_%H-%M-%S"`".dump"``
* ``cd /root/deploy/sormas/$(date +%F)``
* Find out current schema version of database:
* ``sudo -u postgres psql sormas_db``
* ``SELECT * from schema_version ORDER BY version_number DESC LIMIT 1;``
* ``\q``
* **Edit sql/sormas_schema.sql**
* ``Remove everything until after the INSERT with the read schema version``
* ``Surround the remaining with BEGIN; and COMMIT;``
* Update the Database schema: ``sudo -u postgres psql sormas_db < sql/sormas_schema.sql``
* Update the database schema
* make the schema update script executable: ``chmod +x sql/database-update.sh``
* execute the update script: ``sql/database-update.sh``
* confirm schema update by pressing enter when asked
* Alternative: Manual database update
* Find out current schema version of database:
* ``sudo -u postgres psql sormas_db``
* ``SELECT * from schema_version ORDER BY version_number DESC LIMIT 1;``
* ``\q``
* Edit sql/sormas_schema.sql
* ``Remove everything until after the INSERT with the read schema version``
* ``Surround the remaining with BEGIN; and COMMIT;``
* Update the Database schema: ``sudo -u postgres psql sormas_db < sql/sormas_schema.sql``
* If something goes wrong, restorte the database using ``sudo -u postgres pg_restore -Fc -d sormas_db < sormas_db_....``

#### Web Applications
Expand Down
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CaseDataDto extends CaseReferenceDto {
public static final String COMMUNITY = "community";
public static final String HEALTH_FACILITY = "healthFacility";
public static final String HEALTH_FACILITY_DETAILS = "healthFacilityDetails";
public static final String NONE_HEALTH_FACILITY_DETAILS = "noneHealthFacilityDetails";
public static final String REPORTING_USER = "reportingUser";
public static final String REPORT_DATE = "reportDate";
public static final String INVESTIGATED_DATE = "investigatedDate";
Expand All @@ -45,6 +46,8 @@ public class CaseDataDto extends CaseReferenceDto {
public static final String MEASLES_DOSES = "measlesDoses";
public static final String MEASLES_VACCINATION_INFO_SOURCE = "measlesVaccinationInfoSource";
public static final String EPID_NUMBER = "epidNumber";
public static final String REPORT_LAT = "reportLat";
public static final String REPORT_LON = "reportLon";

private PersonReferenceDto person;
private CaseClassification caseClassification;
Expand Down Expand Up @@ -77,6 +80,9 @@ public class CaseDataDto extends CaseReferenceDto {
private UserReferenceDto surveillanceOfficer;
private UserReferenceDto caseOfficer;

private Float reportLat;
private Float reportLon;

public CaseClassification getCaseClassification() {
return caseClassification;
}
Expand Down Expand Up @@ -253,4 +259,20 @@ public void setEpidNumber(String epidNumber) {
this.epidNumber = epidNumber;
}

public Float getReportLat() {
return reportLat;
}

public void setReportLat(Float reportLat) {
this.reportLat = reportLat;
}

public Float getReportLon() {
return reportLon;
}

public void setReportLon(Float reportLon) {
this.reportLon = reportLon;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
import javax.ejb.Remote;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.facility.FacilityReferenceDto;
import de.symeda.sormas.api.region.CommunityReferenceDto;
import de.symeda.sormas.api.user.UserReferenceDto;

@Remote
public interface CaseFacade {

List<CaseDataDto> getAllCasesAfter(Date date, String userUuid);

List<CaseDataDto> getAllCasesByDiseaseAfter(Date date, Disease disease, String userUuid);
List<CaseDataDto> getAllCasesByDisease(Disease disease, String userUuid);

List<CaseDataDto> getAllCasesBetween(Date fromDate, Date toDate, Disease disease, String userUuid);

Expand All @@ -30,4 +32,8 @@ public interface CaseFacade {
CaseDataDto getByPersonAndDisease(String personUuid, Disease disease, String userUuid);

List<String> getAllUuids(String userUuid);

CaseDataDto moveCase(CaseReferenceDto caze, CommunityReferenceDto community, FacilityReferenceDto facility, String facilityDetails, UserReferenceDto surveillanceOfficer);

List<CaseDataDto> getByUuids(List<String> uuids);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ public class ContactDto extends ContactReferenceDto {
public static final String CONTACT_PROXIMITY = "contactProximity";
public static final String CONTACT_CLASSIFICATION = "contactClassification";
public static final String FOLLOW_UP_STATUS = "followUpStatus";
public static final String FOLLOW_UP_COMMENT = "followUpComment";
public static final String FOLLOW_UP_UNTIL = "followUpUntil";
public static final String CONTACT_OFFICER = "contactOfficer";
public static final String DESCRIPTION = "description";
public static final String RELATION_TO_CASE = "relationToCase";
public static final String REPORT_LAT = "reportLat";
public static final String REPORT_LON = "reportLon";

private PersonReferenceDto person;
private CaseReferenceDto caze;
Expand All @@ -37,10 +40,15 @@ public class ContactDto extends ContactReferenceDto {
@Diseases({Disease.EVD,Disease.LASSA,Disease.CHOLERA})
private FollowUpStatus followUpStatus;
@Diseases({Disease.EVD,Disease.LASSA,Disease.CHOLERA})
private String followUpComment;
@Diseases({Disease.EVD,Disease.LASSA,Disease.CHOLERA})
private Date followUpUntil;
@Diseases({Disease.EVD,Disease.LASSA,Disease.CHOLERA})
private UserReferenceDto contactOfficer;
private String description;
private ContactRelation relationToCase;
private Float reportLat;
private Float reportLon;

public PersonReferenceDto getPerson() {
return person;
Expand Down Expand Up @@ -115,5 +123,23 @@ public ContactRelation getRelationToCase() {
public void setRelationToCase(ContactRelation relationToCase) {
this.relationToCase = relationToCase;
}
public Float getReportLat() {
return reportLat;
}
public void setReportLat(Float reportLat) {
this.reportLat = reportLat;
}
public Float getReportLon() {
return reportLon;
}
public void setReportLon(Float reportLon) {
this.reportLon = reportLon;
}
public String getFollowUpComment() {
return followUpComment;
}
public void setFollowUpComment(String followUpComment) {
this.followUpComment = followUpComment;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ public interface ContactFacade {
List<String> getAllUuids(String userUuid);

void generateContactFollowUpTasks();

List<ContactDto> getByUuids(List<String> uuids);
}
20 changes: 20 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/event/EventDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class EventDto extends EventReferenceDto {
public static final String DISEASE = "disease";
public static final String SURVEILLANCE_OFFICER = "surveillanceOfficer";
public static final String TYPE_OF_PLACE_TEXT = "typeOfPlaceText";
public static final String REPORT_LAT = "reportLat";
public static final String REPORT_LON = "reportLon";

private EventType eventType;
private EventStatus eventStatus;
Expand All @@ -44,6 +46,8 @@ public class EventDto extends EventReferenceDto {
private Disease disease;
private UserReferenceDto surveillanceOfficer;
private String typeOfPlaceText;
private Float reportLat;
private Float reportLon;

public EventType getEventType() {
return eventType;
Expand Down Expand Up @@ -163,4 +167,20 @@ public void setTypeOfPlaceText(String typeOfPlaceText) {
this.typeOfPlaceText = typeOfPlaceText;
}

public Float getReportLat() {
return reportLat;
}

public void setReportLat(Float reportLat) {
this.reportLat = reportLat;
}

public Float getReportLon() {
return reportLon;
}

public void setReportLon(Float reportLon) {
this.reportLon = reportLon;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ public interface EventFacade {

List<String> getAllUuids(String userUuid);

List<EventDto> getByUuids(List<String> uuids);

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ public interface EventParticipantFacade {

List<String> getAllUuids(String userUuid);

List<EventParticipantDto> getByUuids(List<String> uuids);


}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.xml.bind.annotation.XmlTransient;

import de.symeda.sormas.api.I18nProperties;
import de.symeda.sormas.api.region.CommunityReferenceDto;
import de.symeda.sormas.api.region.DistrictReferenceDto;
import de.symeda.sormas.api.region.RegionReferenceDto;
Expand All @@ -12,6 +13,9 @@ public class FacilityDto extends FacilityReferenceDto {

public static final String I18N_PREFIX = "Facility";
public static final String OTHER_FACILITY_UUID = "SORMAS-CONSTID-OTHERS-FACILITY";
public static final String NONE_FACILITY_UUID = "SORMAS-CONSTID-ISNONE-FACILITY";
public static final String OTHER_FACILITY = "OTHER_FACILITY";
public static final String NO_FACILITY = "NO_FACILITY";

private String name;
private RegionReferenceDto region;
Expand Down Expand Up @@ -90,6 +94,13 @@ public void setPublicOwnership(boolean publicOwnership) {

@Override
public String toString() {
if (getUuid().equals(OTHER_FACILITY_UUID)) {
return I18nProperties.getPrefixFieldCaption(I18N_PREFIX, OTHER_FACILITY);
}
if (getUuid().equals(NONE_FACILITY_UUID)) {
return I18nProperties.getPrefixFieldCaption(I18N_PREFIX, NO_FACILITY);
}

StringBuilder caption = new StringBuilder();
caption.append(name);
if (community != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public interface FacilityFacade {

List<FacilityReferenceDto> getAll();

List<FacilityReferenceDto> getHealthFacilitiesByCommunity(CommunityReferenceDto community, boolean includeOthers);
List<FacilityReferenceDto> getHealthFacilitiesByDistrict(DistrictReferenceDto district, boolean includeOthers);
List<FacilityReferenceDto> getHealthFacilitiesByCommunity(CommunityReferenceDto community, boolean includeStaticFacilities);
List<FacilityReferenceDto> getHealthFacilitiesByDistrict(DistrictReferenceDto district, boolean includeStaticFacilities);
List<FacilityReferenceDto> getAllLaboratories();

List<FacilityDto> getAllByRegionAfter(String regionUuid, Date date);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import de.symeda.sormas.api.DataTransferObject;
import de.symeda.sormas.api.facility.FacilityReferenceDto;
import de.symeda.sormas.api.region.CommunityReferenceDto;
import de.symeda.sormas.api.region.DistrictReferenceDto;
import de.symeda.sormas.api.region.RegionReferenceDto;
import de.symeda.sormas.api.utils.YesNoUnknown;

public class PreviousHospitalizationDto extends DataTransferObject {
Expand All @@ -14,12 +17,18 @@ public class PreviousHospitalizationDto extends DataTransferObject {

public static final String ADMISSION_DATE = "admissionDate";
public static final String DISCHARGE_DATE = "dischargeDate";
public static final String REGION = "region";
public static final String DISTRICT = "district";
public static final String COMMUNITY = "community";
public static final String HEALTH_FACILITY = "healthFacility";
public static final String ISOLATED = "isolated";
public static final String DESCRIPTION = "description";

private Date admissionDate;
private Date dischargeDate;
private RegionReferenceDto region;
private DistrictReferenceDto district;
private CommunityReferenceDto community;
private FacilityReferenceDto healthFacility;
private YesNoUnknown isolated;
private String description;
Expand All @@ -38,6 +47,27 @@ public void setDischargeDate(Date dischargeDate) {
this.dischargeDate = dischargeDate;
}

public RegionReferenceDto getRegion() {
return region;
}
public void setRegion(RegionReferenceDto region) {
this.region = region;
}

public DistrictReferenceDto getDistrict() {
return district;
}
public void setDistrict(DistrictReferenceDto district) {
this.district = district;
}

public CommunityReferenceDto getCommunity() {
return community;
}
public void setCommunity(CommunityReferenceDto community) {
this.community = community;
}

public FacilityReferenceDto getHealthFacility() {
return healthFacility;
}
Expand All @@ -58,5 +88,5 @@ public String getDescription() {
public void setDescription(String description) {
this.description = description;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public interface PersonFacade {
PersonDto savePerson(PersonDto dto);

List<String> getAllUuids(String userUuid);

List<PersonDto> getByUuids(List<String> uuids);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface CommunityFacade {
List<CommunityReferenceDto> getAllByDistrict(String districtUuid);

List<CommunityDto> getAllAfter(Date date);

CommunityDto getByUuid(String uuid);
}
Loading

0 comments on commit d6df4d7

Please sign in to comment.