Added comment to _is_valid_study.
Fixed get_required_docs. The data returned for get_required_dcs from UVA PB was *very* different than what we had.
This commit is contained in:
parent
d186b24de3
commit
6f09b0d7dd
|
@ -37,13 +37,15 @@ class StudyService(object):
|
|||
|
||||
@staticmethod
|
||||
def _is_valid_study(study_id):
|
||||
# TODO: Determine if this is always a list now
|
||||
# TODO: If so, just grab the first item, and get rid of this `if` statement
|
||||
study_info = ProtocolBuilderService().get_study_details(study_id)
|
||||
if isinstance(study_info, list) and len(study_info) > 0:
|
||||
study_info = study_info[0]
|
||||
if isinstance(study_info, dict) and 'REVIEW_TYPE' in study_info.keys() and study_info['REVIEW_TYPE'] in [2, 3, 23, 24]:
|
||||
return True
|
||||
study_details = ProtocolBuilderService().get_study_details(study_id)
|
||||
if len(study_details) > 0:
|
||||
study_info = study_details[0]
|
||||
else:
|
||||
study_info = None
|
||||
# The review types 2, 3, 23, 24 correspond to review type names
|
||||
# `Full Committee`, `Expedited`, `Non-UVA IRB Full Board`, and `Non-UVA IRB Expedited`
|
||||
if isinstance(study_info, dict) and 'REVIEW_TYPE' in study_info.keys() and study_info['REVIEW_TYPE'] in [2, 3, 23, 24]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_studies_for_user(self, user, include_invalid=False):
|
||||
|
@ -275,9 +277,8 @@ class StudyService(object):
|
|||
for code, doc in doc_dictionary.items():
|
||||
|
||||
doc['required'] = False
|
||||
# TODO: figure out the correct test here
|
||||
if ProtocolBuilderService.is_enabled() and doc['id'] != '':
|
||||
pb_data = next((item for item in pb_docs if int(item['AUXDOCID']) == int(doc['id'])), None)
|
||||
pb_data = next((item for item in pb_docs['AUXDOCS'] if int(item['SS_AUXILIARY_DOC_TYPE_ID']) == int(doc['id'])), None)
|
||||
if pb_data:
|
||||
doc['required'] = True
|
||||
|
||||
|
|
Loading…
Reference in New Issue