-
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(scripts): add any fallback guideline check
- Loading branch information
Showing
13 changed files
with
69 additions
and
31 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
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
...s/analyze/checks/brand_name_whitespace.py → ...functions/checks/brand_name_whitespace.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
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,5 @@ | ||
from analyze_functions.constants import CONSULT_TEXT | ||
|
||
def has_consult(args): | ||
annotations = args['annotations'] | ||
return CONSULT_TEXT in annotations['recommendation'] |
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
6 changes: 4 additions & 2 deletions
6
...analyze/checks/metabolization_severity.py → ...nctions/checks/metabolization_severity.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
23 changes: 23 additions & 0 deletions
23
scripts/analyze_functions/checks/single_any_fallback_guideline.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,23 @@ | ||
from common.get_data import get_guideline_by_id | ||
|
||
def check_single_any_fallback_guideline(args): | ||
drug = args['item'] | ||
data = args['data'] | ||
guidelines = list(map( | ||
lambda guideline_id: get_guideline_by_id(data, guideline_id), | ||
drug['guidelines'], | ||
)) | ||
has_any_fallback = False | ||
for guideline in guidelines: | ||
for gene in guideline['lookupkey'].keys(): | ||
for lookupValue in guideline['lookupkey'][gene]: | ||
is_any_fallback = lookupValue == '*' | ||
if is_any_fallback and len(guideline['lookupkey'][gene]) != 1: | ||
print(gene) | ||
print(guideline['lookupkey']) | ||
print( | ||
'[WARNING] Multiple lookupkeys with present "any ' | ||
'fallback", all other than * are ignored' | ||
) | ||
has_any_fallback = has_any_fallback or is_any_fallback | ||
return not has_any_fallback or len(guidelines) == 1 |
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
scripts/analyze/corrections/consult.py → .../analyze_functions/corrections/consult.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
File renamed without changes.