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

feat!: Allow changing of ATL using upload-to-update #1764

Merged
merged 4 commits into from
Jan 3, 2025
Merged
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
2 changes: 1 addition & 1 deletion chpl/chpl-resources/src/main/resources/errors.properties
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pendingListing.alreadyProcessing=The listing is already being processed.
upload.emptyFile=You cannot upload an empty file!
upload.notCSV=File must be a CSV document.
listing.upload.badMerge=The CHPL Product Number in the uploaded file, '%s', does not match the expected CHPL Product Number of \
the listing after updates are applied: '%s'. ACB code, ATL code, Product code, Version code, and Certified Date code \
the listing after updates are applied: '%s'. ACB code, Product code, Version code, and Certified Date code \
may not be changed via upload file.
listing.upload.noHeadingFound=No records with allowed heading values were found in the file.
listing.upload.unrecognizedHeading=The heading '%s' was found in the upload file but is not recognized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
RSAKeyProvider keyProvider = new CognitoRsaKeyProvider(region, userPoolId, tokenizeRsaKeyUrl);
Algorithm algorithm = Algorithm.RSA256(keyProvider);
JWTVerifier jwtVerifier = JWT.require(algorithm)
//.withAudience(clientId)
.acceptLeeway(30000) //allows for the CHPL server clock and AWS server clock to be off by 30 seconds

Check warning on line 77 in chpl/chpl-service/src/main/java/gov/healthit/chpl/auth/authentication/CognitoJwtUserConverter.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[reviewdog] reported by reviewdog 🐶 '30000' is a magic number. Raw Output: /github/workspace/./chpl/chpl-service/src/main/java/gov/healthit/chpl/auth/authentication/CognitoJwtUserConverter.java:77:27: warning: '30000' is a magic number. (com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck)
.build();

DecodedJWT decodedJwt = jwtVerifier.verify(jwt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void mergeWithListingFromChpl(CertifiedProductSearchDetails updatedListin
updatedListing.setEdition(currentListing.getEdition());
updatedListing.setCuresUpdate(currentListing.getCuresUpdate());
updatedListing.setSurveillance(currentListing.getSurveillance());
updatedListing.setTestingLabs(currentListing.getTestingLabs());
updatedListing.setCountClosedNonconformities(currentListing.getCountClosedNonconformities());
updatedListing.setCountClosedSurveillance(currentListing.getCountClosedSurveillance());
updatedListing.setCountOpenNonconformities(currentListing.getCountOpenNonconformities());
Expand Down Expand Up @@ -123,6 +122,7 @@ public void mergeWithListingFromChpl(CertifiedProductSearchDetails updatedListin
private String applyUpdatesToChplProductNumber(CertifiedProductSearchDetails updatedListing, CertifiedProductSearchDetails currentListing) {
ChplProductNumberParts currChplProductNumberParts
= chplProductNumberUtil.parseChplProductNumber(currentListing.getChplProductNumber());
currChplProductNumberParts.setAtlCode(chplProductNumberUtil.deriveTestingLabCodeFromListing(updatedListing));
currChplProductNumberParts.setIcsCode(chplProductNumberUtil.deriveIcsCodeFromListing(updatedListing));
currChplProductNumberParts.setAdditionalSoftwareCode(chplProductNumberUtil.deriveAdditionalSoftwareCodeFromListing(updatedListing));
return chplProductNumberUtil.getChplProductNumber(currChplProductNumberParts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ public boolean hasIcsConflict(String uniqueId, Boolean hasIcs) {
return hasIcsConflict;
}

public String deriveTestingLabCodeFromListing(CertifiedProductSearchDetails listing) {
if (listing.getTestingLabs() != null && listing.getTestingLabs().size() > 1) {
return "99";
} else if (listing.getTestingLabs() != null) {
return listing.getTestingLabs().get(0).getTestingLab().getAtlCode();
}
return "";
}

public String deriveIcsCodeFromListing(CertifiedProductSearchDetails listing) {
if (listing.getIcs() == null || !listing.getIcs().getInherits()
|| CollectionUtils.isEmpty(listing.getIcs().getParents())) {
Expand Down
Loading