From b0b39b89bc62b37e294925614fe1e3ca1cba0c93 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Wed, 22 May 2024 09:24:17 -0700 Subject: [PATCH 1/5] MAT-6393: Massage data if oid no url provided --- .../webclient/FhirTerminologyServiceWebClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/gov/cms/madie/terminology/webclient/FhirTerminologyServiceWebClient.java b/src/main/java/gov/cms/madie/terminology/webclient/FhirTerminologyServiceWebClient.java index 8d6d29b..4edf244 100644 --- a/src/main/java/gov/cms/madie/terminology/webclient/FhirTerminologyServiceWebClient.java +++ b/src/main/java/gov/cms/madie/terminology/webclient/FhirTerminologyServiceWebClient.java @@ -67,6 +67,10 @@ public String getCodeSystemsPage(Integer offset, Integer count, String apiKey) { public String searchValueSets(String apiKey, Map queryParams) { if (queryParams.containsKey("url")) { String urlValue = queryParams.get("url"); + // if the value does not contain the vsac url we add it + if (!urlValue.startsWith("http://cts.nlm.nih.gov/fhir/ValueSet/")) { + urlValue = "http://cts.nlm.nih.gov/fhir/ValueSet/" + urlValue; + } // if user didnt add htpp:// we do if (!urlValue.startsWith("http://")) { urlValue = "http://" + urlValue; From 99ecec10fdf7f74bf3a7707a05801695e1840236 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Wed, 22 May 2024 10:04:41 -0700 Subject: [PATCH 2/5] MAT-6393: get some debug logs --- src/main/resources/application.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 6767adb..4742ec3 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -46,3 +46,9 @@ spring: mapping: data: code-system-entry-url: ${CODE_SYSTEM_ENTRY_URL:https://madie-dev-static.s3.amazonaws.com/mappings/code-system-entry.json} + +logging: + level: + root: INFO + gov.cms.madie.terminology: DEBUG + org.springframework.web: ERROR \ No newline at end of file From 2f79e810eb503696d1c9bdde04d64988761f16d6 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Wed, 22 May 2024 11:07:13 -0700 Subject: [PATCH 3/5] Add info level logs --- .../gov/cms/madie/terminology/service/VsacService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/gov/cms/madie/terminology/service/VsacService.java b/src/main/java/gov/cms/madie/terminology/service/VsacService.java index a214d54..26b654d 100644 --- a/src/main/java/gov/cms/madie/terminology/service/VsacService.java +++ b/src/main/java/gov/cms/madie/terminology/service/VsacService.java @@ -121,6 +121,7 @@ public List validateCodes(List cqlCodes, UmlsUser umlsUser, St String codeSystemVersion = buildCodeSystemVersion(cqlCode, codeSystemEntry.get()); String codeId = cqlCode.getCodeId(); if (codeId == null || TerminologyServiceUtil.sanitizeInput(codeId).isBlank()) { + log.info("Code id is not available for code {}", cqlCode.getName()); log.debug("Code id is not available for code {}", cqlCode.getName()); cqlCode.setValid(false); cqlCode.setErrorMessage("Code Id is required"); @@ -146,12 +147,16 @@ public List validateCodes(List cqlCodes, UmlsUser umlsUser, St log.debug( "No associated Code system found in code system entry json for {}", cqlCode.getCodeSystem().getOid()); + log.info( + "No associated Code system found in code system entry json for {}", + cqlCode.getCodeSystem().getOid()); cqlCode.getCodeSystem().setValid(false); cqlCode.getCodeSystem().setErrorMessage("Invalid Code system"); } } else { // if oid/url is not provided in cql, then the code system is considered invalid. log.debug("CodeSystem {} does not contain any URL", cqlCode.getCodeSystem().getName()); + log.info("CodeSystem {} does not contain any URL", cqlCode.getCodeSystem().getName()); cqlCode.getCodeSystem().setValid(false); cqlCode.getCodeSystem().setErrorMessage("Code system URL is required"); } @@ -280,11 +285,13 @@ 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)); 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)); cqlCode.setValid(false); cqlCode.setErrorMessage(vsacCode.getErrors().getResultSet().get(0).getErrDesc()); } @@ -296,6 +303,7 @@ 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()); } } From 6692e51ba2e8b6271797bf6e76771f3a2f680725 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Wed, 22 May 2024 11:07:44 -0700 Subject: [PATCH 4/5] MAT-6393: Remove yml log levels. --- src/main/resources/application.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4742ec3..6767adb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -46,9 +46,3 @@ spring: mapping: data: code-system-entry-url: ${CODE_SYSTEM_ENTRY_URL:https://madie-dev-static.s3.amazonaws.com/mappings/code-system-entry.json} - -logging: - level: - root: INFO - gov.cms.madie.terminology: DEBUG - org.springframework.web: ERROR \ No newline at end of file From b288b8f8b6b1fa72890ca4662c3e425582c5ee88 Mon Sep 17 00:00:00 2001 From: mcmcphillips Date: Wed, 22 May 2024 11:15:30 -0700 Subject: [PATCH 5/5] MAT-6393: Remove duplicate logs --- .../java/gov/cms/madie/terminology/service/VsacService.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/gov/cms/madie/terminology/service/VsacService.java b/src/main/java/gov/cms/madie/terminology/service/VsacService.java index 26b654d..3d14b6d 100644 --- a/src/main/java/gov/cms/madie/terminology/service/VsacService.java +++ b/src/main/java/gov/cms/madie/terminology/service/VsacService.java @@ -122,7 +122,6 @@ public List validateCodes(List cqlCodes, UmlsUser umlsUser, St String codeId = cqlCode.getCodeId(); if (codeId == null || TerminologyServiceUtil.sanitizeInput(codeId).isBlank()) { log.info("Code id is not available for code {}", cqlCode.getName()); - log.debug("Code id is not available for code {}", cqlCode.getName()); cqlCode.setValid(false); cqlCode.setErrorMessage("Code Id is required"); } else if (!StringUtils.isBlank(codeSystemVersion)) { @@ -144,9 +143,6 @@ public List validateCodes(List cqlCodes, UmlsUser umlsUser, St } } else { // unidentified code system. - log.debug( - "No associated Code system found in code system entry json for {}", - cqlCode.getCodeSystem().getOid()); log.info( "No associated Code system found in code system entry json for {}", cqlCode.getCodeSystem().getOid()); @@ -155,7 +151,6 @@ public List validateCodes(List cqlCodes, UmlsUser umlsUser, St } } else { // if oid/url is not provided in cql, then the code system is considered invalid. - log.debug("CodeSystem {} does not contain any URL", cqlCode.getCodeSystem().getName()); log.info("CodeSystem {} does not contain any URL", cqlCode.getCodeSystem().getName()); cqlCode.getCodeSystem().setValid(false); cqlCode.getCodeSystem().setErrorMessage("Code system URL is required");