-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Expanded lookup table endpoint #3674
Merged
tyler-spangler6
merged 3 commits into
develop
from
conditions-626-expanded-classification-endpoint
Oct 31, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 169 additions & 0 deletions
169
domain-cc/cc-app/src/python_src/util/expanded_lookup_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
""" | ||
This file contains constants and configurations for the expanded lookup table. | ||
Parameters | ||
---------- | ||
COMMON_WORDS: list[str] | ||
List of words to remove from incoming text and lookup table values. | ||
MUSCULOSKELETAL_LUT: dict | ||
Lookup table for musculoskeletal conditions. | ||
FILE_READ_HELPER: dict | ||
Helper dictionary that has the filepath and column names for instantiating the lookup table | ||
""" | ||
|
||
import os | ||
|
||
from .table_versions import CONDITION_DROPDOWN_TABLE_VERSION | ||
|
||
FILE_READ_HELPER = { | ||
"filepath": os.path.join( | ||
os.path.dirname(__file__), | ||
"data", | ||
"condition_dropdown_lookup_table", | ||
f"[Release notes] Contention Text to Classification mapping release notes - Contention Text Lookup " | ||
f"{CONDITION_DROPDOWN_TABLE_VERSION}.csv", | ||
), | ||
"contention_text": "CONTENTION TEXT", | ||
"classification_code": "CLASSIFICATION CODE", | ||
"classification_name": "CLASSIFICATION TEXT", | ||
} | ||
|
||
MUSCULOSKELETAL_LUT = { | ||
"knee": { | ||
"classification_code": 8997, | ||
"classification_name": "Musculoskeletal - Knee", | ||
}, | ||
"ankle": { | ||
"classification_code": 8991, | ||
"classification_name": "Musculoskeletal - Ankle", | ||
}, | ||
"hip": { | ||
"classification_code": 8996, | ||
"classification_name": "Musculoskeletal - Hip", | ||
}, | ||
"elbow": { | ||
"classification_code": 8993, | ||
"classification_name": "Musculoskeletal - Elbow", | ||
}, | ||
"shoulder": { | ||
"classification_code": 9002, | ||
"classification_name": "Musculoskeletal - Shoulder", | ||
}, | ||
"wrist": { | ||
"classification_code": 9004, | ||
"classification_name": "Musculoskeletal - Wrist", | ||
}, | ||
"low back": { | ||
"classification_code": 8998, | ||
"classification_name": "Musculoskeletal - Mid/Lower Back (Thoracolumbar Spine)", | ||
}, | ||
"lower back": { | ||
"classification_code": 8998, | ||
"classification_name": "Musculoskeletal - Mid/Lower Back (Thoracolumbar Spine)", | ||
}, | ||
"neck": { | ||
"classification_code": 8999, | ||
"classification_name": "Musculoskeletal - Neck/Upper Back (Cervical Spine)", | ||
}, | ||
"mid back": { | ||
"classification_code": 8998, | ||
"classification_name": "Musculoskeletal - Mid/Lower Back (Thoracolumbar Spine)", | ||
}, | ||
"upper back": { | ||
"classification_code": 8999, | ||
"classification_name": "Musculoskeletal - Neck/Upper Back (Cervical Spine)", | ||
}, | ||
"foot": { | ||
"classification_code": 8994, | ||
"classification_name": "Musculoskeletal - Foot", | ||
}, | ||
"toe": { | ||
"classification_code": 8994, | ||
"classification_name": "Musculoskeletal - Foot", | ||
}, | ||
"toes": { | ||
"classification_code": 8994, | ||
"classification_name": "Musculoskeletal - Foot", | ||
}, | ||
"feet": { | ||
"classification_code": 8994, | ||
"classification_name": "Musculoskeletal - Foot", | ||
}, | ||
} | ||
|
||
COMMON_WORDS = [ | ||
"left", | ||
"right", | ||
"bilateral", | ||
"in", | ||
"of", | ||
"or", | ||
"the", | ||
"my", | ||
"and", | ||
"chronic", | ||
# 'lower', | ||
"to", | ||
"and", | ||
"major", | ||
"than", | ||
"with", | ||
# 'upper', | ||
# 'low', | ||
"a", | ||
"va", | ||
"for", | ||
"as", | ||
"has", | ||
"me", | ||
"one", | ||
"use", | ||
"year", | ||
"within", | ||
"worse", | ||
"at", | ||
"have", | ||
"side", | ||
"by", | ||
"frequent", | ||
"mild", | ||
"loud", | ||
"weak", | ||
"bl", | ||
# 'not', | ||
"exam", | ||
"undiagnosed", | ||
"during", | ||
"is", | ||
"when", | ||
"day", | ||
"was", | ||
"all", | ||
"aircraft", | ||
"total", | ||
"moderate", | ||
"noises", | ||
"complete", | ||
"after", | ||
"up", | ||
"it", | ||
"bi", | ||
"daily", | ||
"no", | ||
"had", | ||
"getting", | ||
"also", | ||
"rt", | ||
"sp", | ||
"be", | ||
"see", | ||
"need", | ||
"an", | ||
"which", | ||
"since", | ||
"this", | ||
"jet", | ||
"can't", | ||
"cant", | ||
"pain", | ||
"condition", | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this have any benefit here (and in the next conditional)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using
dict[]
is preferred if we are certain the key exists which we are since we have the defaults set in thelookup_tables.get()
methods. I think the advantage of usingdict.get()
is that handles the keyerror using the default. I am good to switch it if it helps readability and consistency though.