-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#639): add same metabolization check
- Loading branch information
Showing
3 changed files
with
29 additions
and
4 deletions.
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
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,16 @@ | ||
from analyze_functions.constants import ACTIVATE_TEXT, BREAK_DOWN_TEXT | ||
from analyze_functions.data_helpers import get_guideline_annotations | ||
|
||
def check_same_metabolization_type(args): | ||
data = args['data'] | ||
guidelines = args['drug_guidelines'] | ||
has_activate = False | ||
has_break_down = False | ||
for guideline in guidelines: | ||
if has_activate and has_break_down: break | ||
annotations = get_guideline_annotations(data, guideline) | ||
implication = annotations['implication'] | ||
if implication == None: continue | ||
if ACTIVATE_TEXT in implication: has_activate = True | ||
if BREAK_DOWN_TEXT in implication: has_break_down = True | ||
return not (has_activate and has_break_down) |
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