Skip to content

Commit

Permalink
Merge pull request #12581 from SORMAS-Foundation/feature-11574-enviro…
Browse files Browse the repository at this point in the history
…nment-samples-on-dashboard-map

Feature 11574 environment samples on dashboard map
  • Loading branch information
sergiupacurariu authored Oct 10, 2023
2 parents 3ccfef4 + 2bfab27 commit 520b98e
Show file tree
Hide file tree
Showing 16 changed files with 446 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class MapSampleDto implements Serializable {

private SampleAssociationType associationType;

public MapSampleDto(Double longitude, Double latitude, Double associatedEntityLongitude, Double associatedEntityLatitude) {
if (!setLatLonIfPresent(longitude, latitude, null))
setLatLonIfPresent(associatedEntityLongitude, associatedEntityLatitude, null);
}

public MapSampleDto(
Double casePersonLon,
Double casePersonLat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@ public interface SampleDashboardFacade {

Long countSamplesForMap(SampleDashboardCriteria criteria, Set<SampleAssociationType> associationTypes);

Long countEnvironmentalSamplesForMap(SampleDashboardCriteria criteria);

List<MapSampleDto> getSamplesForMap(SampleDashboardCriteria criteria, Set<SampleAssociationType> associationTypes);

List<MapSampleDto> getEnvironmentalSamplesForMap(SampleDashboardCriteria criteria);
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public void setRegion(RegionReferenceDto region) {
this.region = region;
}

public EnvironmentSampleCriteria region(RegionReferenceDto region) {
this.region = region;
return this;
}

public DistrictReferenceDto getDistrict() {
return district;
}
Expand All @@ -109,6 +114,11 @@ public void setDistrict(DistrictReferenceDto district) {
this.district = district;
}

public EnvironmentSampleCriteria district(DistrictReferenceDto district) {
this.district = district;
return this;
}

public Double getGpsLatFrom() {
return gpsLatFrom;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2018,12 +2018,14 @@ public interface Captions {
String sampleDashboardAllSamples = "sampleDashboardAllSamples";
String sampleDashboardCaseSamples = "sampleDashboardCaseSamples";
String sampleDashboardContactSamples = "sampleDashboardContactSamples";
String sampleDashboardEnvironmentsSamples = "sampleDashboardEnvironmentsSamples";
String sampleDashboardEventParticipantSamples = "sampleDashboardEventParticipantSamples";
String sampleDashboardFinalLabResults = "sampleDashboardFinalLabResults";
String sampleDashboardSamplePurpose = "sampleDashboardSamplePurpose";
String sampleDashboardShipmentStatus = "sampleDashboardShipmentStatus";
String sampleDashboardShowCaseSamples = "sampleDashboardShowCaseSamples";
String sampleDashboardShowContactSamples = "sampleDashboardShowContactSamples";
String sampleDashboardShowEnvironmentSamples = "sampleDashboardShowEnvironmentSamples";
String sampleDashboardShowEventParticipantSamples = "sampleDashboardShowEventParticipantSamples";
String sampleDashboardSpecimenCondition = "sampleDashboardSpecimenCondition";
String sampleDashboardTestResults = "sampleDashboardTestResults";
Expand Down
2 changes: 2 additions & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,11 @@ sampleDashboardTestResults=Test Results
sampleDashboardCaseSamples=Case Samples
sampleDashboardContactSamples=Contact Samples
sampleDashboardEventParticipantSamples=Event Participant Samples
sampleDashboardEnvironmentsSamples=Environment Samples
sampleDashboardShowCaseSamples=Show Case Samples
sampleDashboardShowContactSamples=Show Contact Samples
sampleDashboardShowEventParticipantSamples=Show Event Participant Samples
sampleDashboardShowEnvironmentSamples=Show Environment Samples
captionDefault=Default
defaultRegion=Default Region
defaultDistrict=Default District
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ public Long countSamplesForMap(SampleDashboardCriteria criteria, Set<SampleAssoc
return sampleDashboardService.countSamplesForMap(criteria, associationTypes);
}

@Override
public Long countEnvironmentalSamplesForMap(SampleDashboardCriteria criteria) {
return sampleDashboardService.countEnvironmentSamplesForMap(criteria);
}

@Override
public List<MapSampleDto> getSamplesForMap(SampleDashboardCriteria criteria, Set<SampleAssociationType> associationTypes) {
return sampleDashboardService.getSamplesForMap(criteria, associationTypes);
}

@Override
public List<MapSampleDto> getEnvironmentalSamplesForMap(SampleDashboardCriteria criteria) {
return sampleDashboardService.getEnvironmentalSamplesForMap(criteria);
}

@LocalBean
@Stateless
public static class SampleDashboardFacadeEjbLocal extends SampleDashboardFacadeEjb {
Expand Down
Loading

0 comments on commit 520b98e

Please sign in to comment.