Skip to content

Commit

Permalink
Update Logging for Dropdown Conditions (#2330)
Browse files Browse the repository at this point in the history
* function to build dropdown values list

* removed static dropdown options

* added tests for build_logging_table

* removed unneeded comment

---------

Co-authored-by: Tyler Spangler <[email protected]>
  • Loading branch information
tyler-spangler6 and Tyler Spangler authored Dec 14, 2023
1 parent 6fb3ae2 commit 59059d3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 671 deletions.
4 changes: 2 additions & 2 deletions domain-cc/cc-app/src/python_src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

from .pydantic_models import Claim, PredictedClassification
from .util.brd_classification_codes import get_classification_name
from .util.data.reduced_dropdown_list import DROPDOWN_OPTIONS
from .util.logging_dropdown_selections import build_logging_table
from .util.lookup_table import ConditionDropdownLookupTable, DiagnosticCodeLookupTable

dc_lookup_table = DiagnosticCodeLookupTable()
dropdown_lookup_table = ConditionDropdownLookupTable()
dropdown_values = build_logging_table()


app = FastAPI(
Expand Down Expand Up @@ -58,7 +59,6 @@ def get_classification(claim: Claim) -> Optional[PredictedClassification]:

if claim.contention_text and not classification_code:
classification_code = dropdown_lookup_table.get(claim.contention_text, None)
dropdown_values = [term.strip().lower() for term in DROPDOWN_OPTIONS.values()]
is_in_dropdown = claim.contention_text.strip().lower() in dropdown_values
log_contention_text = (
claim.contention_text if is_in_dropdown else "Not in dropdown"
Expand Down
Loading

0 comments on commit 59059d3

Please sign in to comment.