Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.web.bind.annotation.RestController;

import gov.healthit.chpl.developer.search.DeveloperSearchResult;
import gov.healthit.chpl.domain.compliance.DirectReview;
import gov.healthit.chpl.manager.StatisticsManager;
import gov.healthit.chpl.report.ReportDataManager;
import gov.healthit.chpl.report.criteriamigrationreport.CriteriaMigrationReportDenormalized;
Expand Down Expand Up @@ -422,6 +423,17 @@ public ReportDataController(ReportDataManager reportDataManager,
return reportDataManager.getDirectReviewCounts();
}

@Operation(summary = "Retrieves the data used to generate the ONC Direct Review report.",
description = "Retrieves the data used to generate the ONC Direct Review report.",
security = {
@SecurityRequirement(name = SwaggerSecurityRequirement.API_KEY)
})
@LogMethodUsage
@RequestMapping(value = "/direct-reviews", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
public @ResponseBody List<DirectReview> getDirectReviews() {
return reportDataManager.getDirectReviews();
}


@Operation(summary = "Get count of Criteria certified to by unique Product.",
description = "Retrieves and returns the Criterion/Product counts.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import gov.healthit.chpl.domain.compliance.DirectReview;
import gov.healthit.chpl.domain.compliance.DirectReviewContainer;
import gov.healthit.chpl.domain.compliance.DirectReviewNonConformity;
import gov.healthit.chpl.exception.EntityRetrievalException;
import gov.healthit.chpl.exception.JiraRequestFailedException;
import gov.healthit.chpl.util.RedisUtil;
import gov.healthit.chpl.validation.compliance.DirectReviewValidator;
Expand Down Expand Up @@ -373,6 +374,16 @@ private List<DirectReview> convertDirectReviewsFromJira(JsonNode rootNode, Logge
if (dr.getStartDate() != null) {
drs.add(dr);
}

Developer dev = null;
try {
dev = developerDao.getById(dr.getDeveloperId());
} catch (EntityRetrievalException ex) {
LOGGER.warn("Direct review exists with developer that cannot be found: " + dr.getDeveloperId(), ex);
}
if (dev != null) {
dr.setDeveloperName(dev.getName());
}
} catch (JacksonException ex) {
logger.error("Cannot map issue JSON to DirectReview class", ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import tools.jackson.databind.annotation.JsonDeserialize;

import lombok.Data;
import lombok.NoArgsConstructor;
import tools.jackson.databind.annotation.JsonDeserialize;

@Data
@NoArgsConstructor
Expand All @@ -28,6 +28,9 @@ public class DirectReview implements Serializable {
@JsonDeserialize(using = DeveloperIdDeserializer.class)
private Long developerId;

private String developerName;


@JsonProperty(value = "startDate", access = Access.WRITE_ONLY)
@JsonAlias("customfield_11016")
@JsonDeserialize(using = TimestampDeserializer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.stereotype.Component;

import gov.healthit.chpl.developer.search.DeveloperSearchResult;
import gov.healthit.chpl.domain.compliance.DirectReview;
import gov.healthit.chpl.report.attestation.AttestationReportService;
import gov.healthit.chpl.report.criteriaattribute.CriteriaAttributeReportService;
import gov.healthit.chpl.report.criteriamigrationreport.CriteriaMigrationReportDenormalized;
Expand Down Expand Up @@ -277,6 +278,11 @@ public DirectReviewCounts getDirectReviewCounts() {
return directReviewReportsService.getDirectReviewCounts();
}

@Synchronized("lock")
public List<DirectReview> getDirectReviews() {
return directReviewReportsService.getDirectReviews();
}

@Synchronized("lock")
public CriteriaAttributeReportService getCriteriaAttributeAttributeService() {
return criteriaAttributeReportService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package gov.healthit.chpl.report.directreview;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import gov.healthit.chpl.compliance.directreview.DirectReviewSearchService;
import gov.healthit.chpl.dao.statistics.SummaryStatisticsDAO;
import gov.healthit.chpl.domain.compliance.DirectReview;
import gov.healthit.chpl.scheduler.job.summarystatistics.data.StatisticsSnapshot;
import gov.healthit.chpl.search.ListingSearchService;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class DirectReviewReportsService {
private SummaryStatisticsDAO summaryStatisticsDAO;
private DirectReviewSearchService drService;

@Autowired
public DirectReviewReportsService(SummaryStatisticsDAO summaryStatisticsDAO, ListingSearchService listingSearchService) {
public DirectReviewReportsService(SummaryStatisticsDAO summaryStatisticsDAO, DirectReviewSearchService drService) {
this.summaryStatisticsDAO = summaryStatisticsDAO;
this.drService = drService;
}

public DirectReviewCounts getDirectReviewCounts() {
Expand All @@ -33,6 +39,12 @@ public DirectReviewCounts getDirectReviewCounts() {
.build();
}

public List<DirectReview> getDirectReviews() {
return drService.getAll().stream()
.flatMap(drContainer -> drContainer.getDirectReviews().stream())
.collect(Collectors.toList());
}

private StatisticsSnapshot getStatistics() {
return summaryStatisticsDAO.getCurrentSummaryStatistics();
}
Expand Down
Loading