From 36b1e9c1f3bc55af0246596716fe2f1dd3f177c3 Mon Sep 17 00:00:00 2001 From: tyler-spangler6 <142833783+tyler-spangler6@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:12:51 -0600 Subject: [PATCH 1/2] Remove whitespace from csv lookup table values (#2871) added .strip() to build dropdown lookup Co-authored-by: Tyler Spangler --- .../cc-app/src/python_src/util/lookup_table.py | 4 ++-- .../cc-app/tests/test_condition_dropdown_lookup.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/domain-cc/cc-app/src/python_src/util/lookup_table.py b/domain-cc/cc-app/src/python_src/util/lookup_table.py index 1199d81eac..f6adbe10cd 100644 --- a/domain-cc/cc-app/src/python_src/util/lookup_table.py +++ b/domain-cc/cc-app/src/python_src/util/lookup_table.py @@ -134,7 +134,7 @@ def get_v1_lookup_table(filepath: str, input_key: str, output_key: str) -> dict: try: text_to_convert = int(csv_line[input_key]) except ValueError: - text_to_convert = csv_line[input_key].lower() + text_to_convert = csv_line[input_key].strip().lower() classification_code = int(csv_line[output_key]) classification_code_mappings[text_to_convert] = classification_code except KeyError: @@ -193,7 +193,7 @@ def get_lookup_table( for row in csv_reader: for k in v2_input_key: if row[k] and row[v2_output_key]: - classification_code_mappings[row[k].lower()] = int( + classification_code_mappings[row[k].strip().lower()] = int( row[v2_output_key] ) # raises exception if dropdown_v2_filepath is None (only create DC LUT) diff --git a/domain-cc/cc-app/tests/test_condition_dropdown_lookup.py b/domain-cc/cc-app/tests/test_condition_dropdown_lookup.py index 884779c138..cb6558362a 100644 --- a/domain-cc/cc-app/tests/test_condition_dropdown_lookup.py +++ b/domain-cc/cc-app/tests/test_condition_dropdown_lookup.py @@ -119,3 +119,17 @@ def test_new_dropdown_list(client: TestClient): assert response.status_code == 200 assert response.json()["classification_code"] == 9007 assert response.json()["classification_name"] == "Neurological other System" + + +def test_whitespace_removal(client: TestClient): + json_post_dict = { + "diagnostic_code": 7, + "claim_id": 700, + "form526_submission_id": 777, + "claim_type": "new", + "contention_text": "pharyngeal cancer (throat cancer) ", + } + response = client.post("/classifier", json=json_post_dict) + assert response.status_code == 200 + assert response.json()["classification_code"] == 1230 + assert response.json()["classification_name"] == "Cancer - Respiratory" From f43427947a5be8d1886a721fb42665b3d334b820 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:30:25 -0400 Subject: [PATCH 2/2] Bump org.springframework.cloud:spring-cloud-starter-gateway from 4.1.2 to 4.1.3 (#2872) Bump org.springframework.cloud:spring-cloud-starter-gateway Bumps [org.springframework.cloud:spring-cloud-starter-gateway](https://github.com/spring-cloud/spring-cloud-gateway) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/spring-cloud/spring-cloud-gateway/releases) - [Commits](https://github.com/spring-cloud/spring-cloud-gateway/compare/v4.1.2...v4.1.3) --- updated-dependencies: - dependency-name: org.springframework.cloud:spring-cloud-starter-gateway dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- api-gateway/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-gateway/build.gradle b/api-gateway/build.gradle index 6aa56f5518..89ecb63361 100644 --- a/api-gateway/build.gradle +++ b/api-gateway/build.gradle @@ -11,7 +11,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // Spring Cloud - implementation 'org.springframework.cloud:spring-cloud-starter-gateway:4.1.2' + implementation 'org.springframework.cloud:spring-cloud-starter-gateway:4.1.3' if (osdetector.classifier == "osx-aarch_64") { // Fix MacOS error: Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, // which may result in incorrect DNS resolutions.