Skip to content

Commit e4bdd70

Browse files
Merge pull request #108 from motech-implementations/negative-count
negative values fix in MA Subscriber report.
2 parents cb42194 + bfe8320 commit e4bdd70

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

NMSReportingSuite/src/main/java/com/beehyv/nmsreporting/controller/UserController.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,18 +1160,10 @@ public Object getReport(@RequestBody ReportRequest reportRequest/*,HttpServletRe
11601160
MAPerformanceCountsDto MAperformanceCounts = performanceCounts.get(cumulativesummaryReportEnd.get(i).getLocationId());
11611161
if (MAperformanceCounts != null) {
11621162
summaryDto1.setAshasFailed(MAperformanceCounts.getAshasFailed() != null ? MAperformanceCounts.getAshasFailed() : 0);
1163-
int ashasStartedDifference = a.getAshasStarted() - b.getAshasStarted();
1164-
int ashasCompletedDifference = a.getAshasCompleted() - b.getAshasCompleted();
1165-
long ashaDeactivatedStartedCourseInBetweenCount = MAperformanceCounts.getAshaDeactivatedStartedCourseInBetweenCount() != null ? MAperformanceCounts.getAshaDeactivatedStartedCourseInBetweenCount() : 0L;
1166-
long ashaDeactivatedCompletedCourseInBetweenCount = MAperformanceCounts.getAshaDeactivatedCompletedCourseInBetweenCount() != null ? MAperformanceCounts.getAshaDeactivatedCompletedCourseInBetweenCount() : 0L;
1167-
long totalashasDeactivated = MAperformanceCounts.getAshasDeactivatedInBetween() != null ? MAperformanceCounts.getAshasDeactivatedInBetween() : 0L;
1168-
LOGGER.debug("ashasStartedDifference: {}, ashasCompletedDifference: {}, totalashasDeactivated: {}, ashaDeactivatedStartedCourseInBetweenCount: {},ashaDeactivatedCompletedCourseInBetweenCount: {}",ashasStartedDifference,ashasCompletedDifference,totalashasDeactivated,ashaDeactivatedStartedCourseInBetweenCount,ashaDeactivatedCompletedCourseInBetweenCount);
11691163
summaryDto1.setAshasCompleted((int) (MAperformanceCounts.getAshasCompleted()!=null ? MAperformanceCounts.getAshasCompleted() : 0L));
11701164
summaryDto1.setAshasStarted((int) (MAperformanceCounts.getAshasStarted()!=null ? MAperformanceCounts.getAshasStarted() : 0L));
1171-
summaryDto1.setAshasRegistered((int) (a.getAshasRegistered() - b.getAshasRegistered() + totalashasDeactivated));
1172-
summaryDto1.setRecordsReceived((int) ((a.getAshasRegistered() + a.getAshasRejected()) - (b.getAshasRejected() + b.getAshasRegistered()) + totalashasDeactivated));
1173-
LOGGER.debug("this is recordes received value: {}",(a.getAshasRegistered() + a.getAshasRejected()) - (b.getAshasRejected() + b.getAshasRegistered()));
1174-
1165+
summaryDto1.setAshasRegistered((int)(MAperformanceCounts.getAshasActivatedInBetween()!=null ? MAperformanceCounts.getAshasActivatedInBetween() : 0L) );
1166+
summaryDto1.setRecordsReceived((int) (MAperformanceCounts.getAshasActivatedInBetween()!=null ? MAperformanceCounts.getAshasActivatedInBetween() : 0L) + a.getAshasRejected() - b.getAshasRejected());
11751167
}
11761168
else {
11771169
summaryDto1.setAshasCompleted(a.getAshasCompleted() - b.getAshasCompleted());

0 commit comments

Comments
 (0)