Skip to content

Commit

Permalink
[GITFLOW]merging 'release-0.10.0' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ciSymeda committed Nov 27, 2017
2 parents 98ada74 + 9725ae2 commit 84575a1
Show file tree
Hide file tree
Showing 127 changed files with 3,034 additions and 1,815 deletions.
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.9.1</version>
<version>0.10.0</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
18 changes: 13 additions & 5 deletions sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
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.region.DistrictDto;
import de.symeda.sormas.api.region.DistrictReferenceDto;
import de.symeda.sormas.api.region.RegionReferenceDto;
import de.symeda.sormas.api.region.RegionDto;
import de.symeda.sormas.api.user.UserReferenceDto;

@Remote
Expand Down Expand Up @@ -47,12 +48,19 @@ public interface CaseFacade {
List<MapCase> getCasesForMap(DistrictReferenceDto districtRef, Disease disease, Date from, Date to, String userUuid);

/**
* @param onsetFromDate optional
* @param onsetToDate optional
* @param fromDate optional
* @param toDate optional
* @param disease optional
*/
Map<RegionReferenceDto, Long> getCaseCountPerRegion(Date fromDate, Date toDate, Disease disease);

Map<RegionDto, Long> getCaseCountPerRegion(Date fromDate, Date toDate, Disease disease);

/**
* @param fromDate optional
* @param toDate optional
* @param disease optional
*/
Map<DistrictDto, Long> getCaseCountPerDistrict(Date onsetFromDate, Date onsetToDate, Disease disease);

void deleteCase(CaseReferenceDto caseRef, String userUuid);

}
13 changes: 13 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseLogic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package de.symeda.sormas.api.caze;

import de.symeda.sormas.api.utils.ValidationException;

public class CaseLogic {

public static void validateInvestigationDoneAllowed(CaseDataDto caze) throws ValidationException {
if (caze.getCaseClassification() == CaseClassification.NOT_CLASSIFIED) {
throw new ValidationException("Not allowed to set investigation status to done for an unclassified case.");
}
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package de.symeda.sormas.api.event;

import java.io.Serializable;
import java.util.Date;

import de.symeda.sormas.api.Disease;
import de.symeda.sormas.api.region.DistrictReferenceDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DateHelper;

public class DashboardEvent implements Serializable {

Expand All @@ -14,14 +18,35 @@ public class DashboardEvent implements Serializable {
public static final String EVENT_STATUS = "eventStatus";
public static final String DISEASE = "disease";

private String uuid;
private EventType eventType;
private EventStatus eventStatus;
private Disease disease;
private String diseaseDetails;
private Date eventDate;
private Double reportLat;
private Double reportLon;
private String districtUuid;
private DistrictReferenceDto district;

public DashboardEvent(EventType eventType, EventStatus eventStatus, Disease disease) {
public DashboardEvent(String uuid, EventType eventType, EventStatus eventStatus, Disease disease, String diseaseDetails, Date eventDate, Double reportLat, Double reportLon, String districtUuid) {
this.uuid = uuid;
this.eventType = eventType;
this.eventStatus = eventStatus;
this.disease = disease;
this.diseaseDetails = diseaseDetails;
this.eventDate = eventDate;
this.reportLat = reportLat;
this.reportLon = reportLon;
this.districtUuid = districtUuid;
}

public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}

public EventType getEventType() {
Expand All @@ -47,5 +72,62 @@ public Disease getDisease() {
public void setDisease(Disease disease) {
this.disease = disease;
}

public String getDiseaseDetails() {
return diseaseDetails;
}

public void setDiseaseDetails(String diseaseDetails) {
this.diseaseDetails = diseaseDetails;
}

public Date getEventDate() {
return eventDate;
}

public void setEventDate(Date eventDate) {
this.eventDate = eventDate;
}

public Double getReportLat() {
return reportLat;
}

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

public Double getReportLon() {
return reportLon;
}

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

public String getDistrictUuid() {
return districtUuid;
}

public void setDistrictUuid(String districtUuid) {
this.districtUuid = districtUuid;
}

public DistrictReferenceDto getDistrict() {
return district;
}

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

@Override
public String toString() {
String diseaseString = getDisease() != Disease.OTHER
? DataHelper.toStringNullable(getDisease())
: DataHelper.toStringNullable(getDiseaseDetails());
String eventTypeString = diseaseString.isEmpty() ? eventType.toString() : eventType.toString().toLowerCase();
return diseaseString + " " + eventTypeString + " on " + DateHelper.formatDate(eventDate);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ public interface FacilityFacade {
List<FacilityDto> getAllByRegionAfter(String regionUuid, Date date);
List<FacilityDto> getAllWithoutRegionAfter(Date date);

FacilityReferenceDto getFacilityReferenceByUuid(String uuid);

FacilityDto getByUuid(String uuid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class DistrictDto extends DistrictReferenceDto {

private String name;
private String epidCode;
private Integer population;
private Float growthRate;
private RegionReferenceDto region;

public String getName() {
Expand Down Expand Up @@ -35,4 +37,18 @@ public void setRegion(RegionReferenceDto region) {
public String toString() {
return getName();
}

public Integer getPopulation() {
return population;
}
public void setPopulation(Integer population) {
this.population = population;
}

public Float getGrowthRate() {
return growthRate;
}
public void setGrowthRate(Float growthRate) {
this.growthRate = growthRate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public interface GeoShapeProvider {
GeoLatLon getCenterOfRegion(RegionReferenceDto region);

GeoLatLon[][] getDistrictShape(DistrictReferenceDto district);

DistrictReferenceDto getDistrictByCoord(GeoLatLon latLon);

GeoLatLon getCenterOfDistrict(DistrictReferenceDto district);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class RegionDto extends RegionReferenceDto {

private String name;
private String epidCode;
private Integer population;
private Float growthRate;

public String getName() {
return name;
Expand All @@ -27,4 +29,18 @@ public void setEpidCode(String epidCode) {
public String toString() {
return getName();
}

public Integer getPopulation() {
return population;
}
public void setPopulation(Integer population) {
this.population = population;
}

public Float getGrowthRate() {
return growthRate;
}
public void setGrowthRate(Float growthRate) {
this.growthRate = growthRate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ public interface RegionFacade {
RegionDto getRegionByUuid(String uuid);

RegionReferenceDto getRegionReferenceByUuid(String uuid);

List<RegionDataDto> getAllData();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public interface SampleFacade {

List<SampleDto> getAllByCase(CaseReferenceDto caseRef);

List<SampleIndexDto> getIndexList(String userUuid);

List<SampleIndexDto> getIndexListByCase(CaseReferenceDto caseRef);
List<SampleIndexDto> getIndexList(String userUuid, CaseReferenceDto caseRef);

SampleDto getSampleByUuid(String uuid);

Expand Down
Loading

0 comments on commit 84575a1

Please sign in to comment.