Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCD-3928: Move surveillance endpoints under certified-products controller #1776

Merged
merged 21 commits into from
Feb 26, 2025
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b1bca56
feat!: Deprecate surveillance endpoints, certifiedProduct field
kekey1 Jan 14, 2025
9161b5e
fix: A few more 'certifiedProduct' references
kekey1 Jan 14, 2025
c1a2b9b
feat!: Remove collections/certified-products endpoint
kekey1 Jan 15, 2025
ac6129d
fix: Remove certifiedProduct ref from statistics hql
kekey1 Jan 16, 2025
8e52142
Merge branch 'staging' into OCD-3928
kekey1 Jan 17, 2025
c10f1a9
Merge branch 'staging' into OCD-3928
kekey1 Jan 22, 2025
81a0f50
Merge branch 'staging' into OCD-3928
kekey1 Jan 23, 2025
520f901
fix: Merge issue
kekey1 Jan 23, 2025
b02dcd5
Merge branch 'staging' into OCD-3928
kekey1 Jan 23, 2025
bf31563
fix: Require reason when deleting surveillance
kekey1 Jan 28, 2025
25d0734
refactor: Extract requirement type formatted title up for "Other" types
kekey1 Feb 3, 2025
77c62d1
Merge branch 'staging' into OCD-3928
kekey1 Feb 5, 2025
fb3ca91
fix: Validate "Other" surv req without "other" text
kekey1 Feb 10, 2025
6877da6
Merge branch 'staging' into OCD-3928
kekey1 Feb 11, 2025
7a9d2f7
fix: handle missing req type
kekey1 Feb 13, 2025
ddd14ce
refactor: Extract nc type get title up to nc level
kekey1 Feb 18, 2025
8130939
fix: Better handle null nc type in error messages
kekey1 Feb 18, 2025
39246bb
Merge branch 'staging' into OCD-3928
kekey1 Feb 19, 2025
b0c1dbc
fix: Remove ref to surv.certifiedProduct in Quarterly Report HQL
kekey1 Feb 19, 2025
0113300
fix: Ignore removed properties when going to/from JSON
kekey1 Feb 19, 2025
10ffbf4
fix: Put back removed fields that we should leave in place
kekey1 Feb 20, 2025
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
Prev Previous commit
Next Next commit
fix: Require reason when deleting surveillance
[#OCD-3928]
  • Loading branch information
kekey1 committed Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bf31563fd1af379b958ddce4231c55ee5db17502
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.quartz.JobDataMap;
@@ -26,7 +27,6 @@
import gov.healthit.chpl.caching.ListingSearchCacheRefresh;
import gov.healthit.chpl.certifiedproduct.CertifiedProductDetailsManager;
import gov.healthit.chpl.dao.CertifiedProductDAO;
import gov.healthit.chpl.dao.auth.UserDAO;
import gov.healthit.chpl.domain.CertifiedProductSearchDetails;
import gov.healthit.chpl.domain.activity.ActivityConcept;
import gov.healthit.chpl.domain.schedule.ChplJob;
@@ -47,6 +47,7 @@
import gov.healthit.chpl.sharedstore.listing.ListingStoreRemove;
import gov.healthit.chpl.sharedstore.listing.RemoveBy;
import gov.healthit.chpl.util.AuthUtil;
import gov.healthit.chpl.util.ErrorMessageUtil;
import gov.healthit.chpl.util.FileUtils;
import gov.healthit.chpl.validation.surveillance.SurveillanceCreationValidator;
import gov.healthit.chpl.validation.surveillance.SurveillanceReadValidator;
@@ -66,7 +67,7 @@ public class SurveillanceManager extends SecuredManager {
private SurveillanceCreationValidator survCreationValidator;
private FileUtils fileUtils;
private Environment env;
private UserDAO userDAO;
private ErrorMessageUtil msgUtil;
private CertificationCriterionService certificationCriterionService;
private String schemaBasicSurveillanceName;

@@ -82,7 +83,7 @@ public SurveillanceManager(SurveillanceDAO survDao, CertifiedProductDAO cpDao,
SurveillanceCreationValidator survCreationValidator,
SurveillanceUpdateValidator survUpdateValidator,
FileUtils fileUtils, Environment env,
UserDAO userDAO, CertificationCriterionService certificationCriterionService,
ErrorMessageUtil msgUtil, CertificationCriterionService certificationCriterionService,
@Value("${schemaBasicSurveillanceName}") String schemaBasicSurveillanceName) {
this.survDao = survDao;
this.cpDao = cpDao;
@@ -94,7 +95,7 @@ public SurveillanceManager(SurveillanceDAO survDao, CertifiedProductDAO cpDao,
this.survReadValidator = survReadValidator;
this.fileUtils = fileUtils;
this.env = env;
this.userDAO = userDAO;
this.msgUtil = msgUtil;
this.certificationCriterionService = certificationCriterionService;
this.schemaBasicSurveillanceName = schemaBasicSurveillanceName;

@@ -201,6 +202,9 @@ public void deleteSurveillance(Long certifiedProductId, Surveillance survToDelet
if (survToDelete == null) {
throw new InvalidArgumentsException("Surveillance to delete is null.");
}
if (StringUtils.isEmpty(reason)) {
throw new MissingReasonException(msgUtil.getMessage("surveillance.reasonRequired"));
}

CertifiedProductSearchDetails beforeCp = cpDetailsManager.getCertifiedProductDetails(certifiedProductId);