Skip to content

Commit

Permalink
Merge pull request #84 from MeasureAuthoringTool/MAT-6393b
Browse files Browse the repository at this point in the history
MAT-6393: Fix condition for unique valuesets with no author
  • Loading branch information
mcmcphillips authored May 31, 2024
2 parents 1d34798 + d57f099 commit d346b72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ public List<ValueSetForSearch> searchValueSets(String apiKey, Map<String, String
ValueSetForSearch.builder()
.title(vs.getTitle())
.author(
String.valueOf(
vs.getExtensionByUrl(
"http://hl7.org/fhir/StructureDefinition/valueset-author")
.getValue()))
Optional.ofNullable(
vs.getExtensionByUrl(
"http://hl7.org/fhir/StructureDefinition/valueset-author"))
.map(extension -> String.valueOf(extension.getValue()))
.orElse(""))
.name(vs.getName())
.composedOf(
vs.getCompose().getInclude().stream()
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/gov/cms/madie/terminology/service/VsacService.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ public List<CqlCode> validateCodes(List<CqlCode> cqlCodes, UmlsUser umlsUser, St
} else {
// unidentified code system.
log.info(
"No associated Code system found in code system entry json for {}",
cqlCode.getCodeSystem().getOid());
"No associated Code system found in code system entry json for {}",
cqlCode.getCodeSystem().getOid());
cqlCode.getCodeSystem().setValid(false);
cqlCode.getCodeSystem().setErrorMessage("Invalid Code system");
}
Expand Down Expand Up @@ -281,13 +281,16 @@ private void buildVsacErrorMessage(CqlCode cqlCode, VsacCode vsacCode) {
&& StringUtils.isNumeric(vsacCode.getErrors().getResultSet().get(0).getErrCode())) {
int errorCode = Integer.parseInt(vsacCode.getErrors().getResultSet().get(0).getErrCode());
if (errorCode == 800 || errorCode == 801) {
log.info("Error code is 800, or 801 from VSAC. Error: {}", vsacCode.getErrors().getResultSet().get(0));
log.info(
"Error code is 800, or 801 from VSAC. Error: {}",
vsacCode.getErrors().getResultSet().get(0));
cqlCode.getCodeSystem().setValid(false);
cqlCode
.getCodeSystem()
.setErrorMessage(vsacCode.getErrors().getResultSet().get(0).getErrDesc());
} else if (errorCode == 802) {
log.info("Error code is 802 from VSAC. Error: {}", vsacCode.getErrors().getResultSet().get(0));
log.info(
"Error code is 802 from VSAC. Error: {}", vsacCode.getErrors().getResultSet().get(0));
cqlCode.setValid(false);
cqlCode.setErrorMessage(vsacCode.getErrors().getResultSet().get(0).getErrDesc());
}
Expand All @@ -299,7 +302,10 @@ private void buildVsacErrorMessage(CqlCode cqlCode, VsacCode vsacCode) {
+ "If this error persists, please contact the Help Desk.");
} else {
cqlCode.setValid(false);
log.info("Error code is uncaught. General catch, Error: {} status: {}", vsacCode.getErrors().getResultSet().get(0), vsacCode.getStatus());
log.info(
"Error code is uncaught. General catch, Error: {} status: {}",
vsacCode.getErrors().getResultSet().get(0),
vsacCode.getStatus());
}
}

Expand Down

0 comments on commit d346b72

Please sign in to comment.