Merge pull request #67 from sartography/irb-events-and-status-427

Irb events and status #427
This commit is contained in:
Dan Funk 2021-08-17 10:32:41 -04:00 committed by GitHub
commit c2438d4b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -93,7 +93,9 @@ class IRBInfoEvent(db.Model):
def all():
event = [IRBInfoEvent(EVENT_ID='', EVENT=''),
IRBInfoEvent(EVENT_ID='299', EVENT='PreReview Returned to PI New Protocol'),
IRBInfoEvent(EVENT_ID='2', EVENT='Pending Full Committee Review'),
IRBInfoEvent(EVENT_ID='57', EVENT='Approval New Protocol'),
IRBInfoEvent(EVENT_ID='300', EVENT='Approvable with Conditions-New Protocol'),
IRBInfoEvent(EVENT_ID='312', EVENT='Condition Response Accepted-New Protocol'),
IRBInfoEvent(EVENT_ID='316', EVENT='Deferred New Protocol'),
IRBInfoEvent(EVENT_ID='62', EVENT='Closed by PI')]
@ -113,6 +115,7 @@ class IRBInfoStatus(db.Model):
@staticmethod
def all():
status = [IRBInfoStatus(STATUS_ID='', STATUS=''),
IRBInfoStatus(STATUS_ID='30', STATUS='In PreReview New Protocol'),
IRBInfoStatus(STATUS_ID='31', STATUS='PreReview Complete New Protocol'),
IRBInfoStatus(STATUS_ID='2', STATUS='Open to enrollment'),
IRBInfoStatus(STATUS_ID='39', STATUS='Withdrawn'),
@ -145,20 +148,30 @@ class IRBInfoSchema(ma.Schema):
include_relationships = True
load_instance = True
fields = ("UVA_STUDY_TRACKING", "DATE_MODIFIED", "IRB_ADMINISTRATIVE_REVIEWER",
"AGENDA_DATE", "IRB_REVIEW_TYPE", "IRB_OF_RECORD", "IRBEVENT", "IRB_STATUS",
"AGENDA_DATE", "IRB_REVIEW_TYPE", "IRB_OF_RECORD", "IRBEVENT", "IRBEVENT_ID", "IRB_STATUS", "IRB_STATUS_ID",
"UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES", "STUDYIRBREVIEWERADMIN")
IRBEVENT = fields.Method("get_event")
IRBEVENT_ID = fields.Method("get_event_id")
IRB_STATUS = fields.Method("get_status")
IRB_STATUS_ID = fields.Method("get_status_id")
@staticmethod
def get_event(obj):
return obj.IRBEVENT[0].EVENT
@staticmethod
def get_event_id(obj):
return obj.IRBEVENT[0].EVENT_ID
@staticmethod
def get_status(obj):
return obj.IRB_STATUS[0].STATUS
@staticmethod
def get_status_id(obj):
return obj.IRB_STATUS[0].STATUS_ID
class Investigator(db.Model):
id = db.Column(db.Integer, primary_key=True)

View File

@ -141,7 +141,9 @@ class Sanity_Check_Test(unittest.TestCase):
irb_info = IRBInfo.query.filter(IRBInfo.SS_STUDY_ID == study.STUDYID).first()
self.assertEqual(irb_info.UVA_STUDY_TRACKING, tracking_string)
self.assertEqual(irb_info.IRBEVENT[0].EVENT, event)
self.assertEqual(irb_info.IRBEVENT[0].EVENT_ID, event_id)
self.assertEqual(irb_info.IRB_STATUS[0].STATUS, status)
self.assertEqual(irb_info.IRB_STATUS[0].STATUS_ID, status_id)
# Delete the study