Added API endpoint for the new irb_info data

This commit is contained in:
mike cullerton 2021-04-09 12:04:46 -04:00
parent 4ddf47314d
commit d3818debb4
2 changed files with 75 additions and 3 deletions

View File

@ -1,7 +1,8 @@
from pb import session
from pb.models import Investigator, InvestigatorSchema, IRBStatus, IRBStatusSchema, \
RequiredDocument, RequiredDocumentSchema, Study, StudySchema, \
StudyDetails, StudyDetailsSchema, StudySponsor, StudySponsorSchema
from pb.models import Investigator, InvestigatorSchema, IRBInfo, IRBInfoSchema, \
IRBStatus, IRBStatusSchema, RequiredDocument, RequiredDocumentSchema, \
Study, StudySchema, StudyDetails, StudyDetailsSchema, \
StudySponsor, StudySponsorSchema
def get_user_studies(uva_id):
@ -32,3 +33,8 @@ def get_study_details(studyid):
def check_study(studyid):
irb_status = session.query(IRBStatus).filter(IRBStatus.STUDYID == studyid).first()
return IRBStatusSchema().dump(irb_status)
def current_irb_info(studyid):
irb_info = session.query(IRBInfo).filter(IRBInfo.SS_STUDY_ID == studyid).first()
return IRBInfoSchema().dump(irb_info)

View File

@ -154,6 +154,27 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/IRBStatus"
/current_irb_info/{studyid}:
parameters:
- name: studyid
in: path
required: true
description: The id of the study
schema:
type: integer
format: int32
get:
tags:
- CR-Connect
operationId: pb.api.current_irb_info
summary: IRB Info about a particular study
responses:
200:
description: IRB Info about the study
content:
application/json:
schema:
$ref: "#/components/schemas/IRBInfo"
components:
schemas:
Study:
@ -264,6 +285,51 @@ components:
type: string
example: Passed Validation
description: Detail about the study status
IRBInfo:
type: object
properties:
SS_STUDY_ID:
type: number
example: 12345
description: The study id from Protocol Builder
UVA_STUDY_TRACKING:
type: string
example: HSR170023
description: Unknown
DATE_MODIFIED:
type: string
example: 2021-04-20T00:00:00+00:00
description: Unknown
IRB_ADMINISTRATIVE_REVIEWER:
type: string
description: Unknown
AGENDA_DATE:
type: string
example: 2021-04-20T00:00:00+00:00
description: Unknown
IRB_REVIEW_TYPE:
type: string
example: Full Committee
description: Unknown
IRBEVENT:
type: string
example: Receipt of Protocol Continuation
description: Unknown
IRB_STATUS:
type: string
example: Closed to enrollment, follow-up only
description: Unknown
IRB_OF_RECORD:
type: string
example: IRB-HSR
description: Unknown
UVA_IRB_HSR_IS_IRB_OF_RECORD_FOR_ALL_SITES:
type: integer
example: 0
description: Unknown
STUDYIRBREVIEWERADMIN:
type: string
description: Unknown
StudyDetail:
type: object
properties: