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. 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"