diff --git a/chpl/chpl-service/src/main/java/gov/healthit/chpl/report/realworldtesting/RealWorldTestingPlanSummaryReportDao.java b/chpl/chpl-service/src/main/java/gov/healthit/chpl/report/realworldtesting/RealWorldTestingPlanSummaryReportDao.java index cf32ea4253..ad4c1ab6ea 100644 --- a/chpl/chpl-service/src/main/java/gov/healthit/chpl/report/realworldtesting/RealWorldTestingPlanSummaryReportDao.java +++ b/chpl/chpl-service/src/main/java/gov/healthit/chpl/report/realworldtesting/RealWorldTestingPlanSummaryReportDao.java @@ -51,22 +51,6 @@ public List getRealWorldTestingReportsByTestingYe .toList(); } - private RealWorldTestingPlanSummaryReportEntity getEntity(Long id) throws EntityRetrievalException { - Query query = entityManager.createQuery( - "from RealWorldTestingPlanSummaryReportEntity where (NOT deleted = true) and id = :id", RealWorldTestingPlanSummaryReportEntity.class); - query.setParameter("id", id); - List result = query.getResultList(); - - if (result.size() > 1) { - throw new EntityRetrievalException("Data error. Duplicate id in real_world_testing_plan_summary_report table."); - } - - if (result.size() > 0) { - return result.get(0); - } - return null; - } - private RealWorldTestingPlanSummaryReportEntity getEntityByCheckedDateAndAcb(LocalDate checkedDate, Long certificationBodyId) throws EntityRetrievalException { Query query = entityManager.createQuery( "from RealWorldTestingPlanSummaryReportEntity rwtps " diff --git a/chpl/chpl-service/src/main/java/gov/healthit/chpl/scheduler/job/RealWorldTestingSummaryReportCreatorJob.java b/chpl/chpl-service/src/main/java/gov/healthit/chpl/scheduler/job/RealWorldTestingSummaryReportCreatorJob.java index 75e2c6ffac..0f2e4a832d 100644 --- a/chpl/chpl-service/src/main/java/gov/healthit/chpl/scheduler/job/RealWorldTestingSummaryReportCreatorJob.java +++ b/chpl/chpl-service/src/main/java/gov/healthit/chpl/scheduler/job/RealWorldTestingSummaryReportCreatorJob.java @@ -54,13 +54,19 @@ public void execute(JobExecutionContext context) throws JobExecutionException { .map(acb -> acb.getId()) .toList(); - List reportRows = rwtReportService.getRealWorldTestingReports(activeAcbIds, LOGGER); + List rwtPlansReports = rwtReportService.getRealWorldTestingReports(activeAcbIds, LOGGER).stream() + .collect(Collectors.toList()); + + //RWT Results requirement is only enforced for listings with g7, g9, or g10 so we only want to report on those + List rwtResultReports = rwtPlansReports.stream() + .filter(report -> report.getAttestsG7() || report.getAttestsG9() || report.getAttestsG10()) + .collect(Collectors.toList()); TransactionOperations transactionOperations = new TransactionTemplate(transactionManager, new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRES_NEW)); transactionOperations.executeWithoutResult(status -> { - processRwtPlanCounts(reportRows); - processRwtResultsCounts(reportRows); + processRwtPlanCounts(rwtPlansReports); + processRwtResultsCounts(rwtResultReports); }); } catch (Exception e) { LOGGER.catching(e);