mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 08:44:46 +00:00
Adding a sponsors endpoint
This commit is contained in:
parent
a706e0ecab
commit
b2b8e278db
@ -36,6 +36,11 @@ def get_study_details(studyid):
|
||||
return StudyDetailsSchema().dump(details)
|
||||
|
||||
|
||||
def sponsors(studyid):
|
||||
sponsors = db.session.query(StudySponsor).filter(StudySponsor.SS_STUDY == studyid).all()
|
||||
return StudySponsorSchema(many=True).dump(sponsors)
|
||||
|
||||
|
||||
def get_form(id, requirement_code):
|
||||
return
|
||||
|
||||
@ -152,7 +157,7 @@ def site_map():
|
||||
# **************************
|
||||
from pb.forms import StudyForm, StudyTable, InvestigatorForm, StudyDetailsForm, ConfirmDeleteForm, StudySponsorForm
|
||||
from pb.models import Study, RequiredDocument, Investigator, StudySchema, RequiredDocumentSchema, InvestigatorSchema, \
|
||||
StudyDetails, StudyDetailsSchema, StudySponsor, Sponsor
|
||||
StudyDetails, StudyDetailsSchema, StudySponsor, Sponsor, SponsorSchema, StudySponsorSchema
|
||||
|
||||
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
|
49
pb/api.yml
49
pb/api.yml
@ -90,6 +90,29 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Investigator"
|
||||
/sponsors:
|
||||
get:
|
||||
tags:
|
||||
- CR-Connect
|
||||
summary: Sponsors associated with a study.
|
||||
operationId: pb.sponsors
|
||||
description: A list of all the sponsors related to a study
|
||||
parameters:
|
||||
- in: query
|
||||
name: studyid
|
||||
description: A valid studyid, as provided in the call to list all studies.
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: A list of sponsors
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Sponsor"
|
||||
/study:
|
||||
parameters:
|
||||
- in: query
|
||||
@ -155,6 +178,32 @@ components:
|
||||
format: string
|
||||
example: IDS - Investigational Drug Service Approval
|
||||
description: A descriptive name of the required dcoument.
|
||||
Sponsor:
|
||||
properties:
|
||||
SP_NAME:
|
||||
type: string
|
||||
example: "AstraZeneca Pharmaceuticals LP (Wilmington, DE)"
|
||||
description: A descriptive name
|
||||
SP_TYPE:
|
||||
type: string
|
||||
example: "Industry"
|
||||
description: the type of sponsor
|
||||
SP_TYPE_GROUP_NAME:
|
||||
type: string
|
||||
example: "Industry"
|
||||
description: The category of the type of sponsor
|
||||
SS_STUDY:
|
||||
type: number
|
||||
example: 15333
|
||||
description: The unqiue id of the associated study
|
||||
COMMONRULEAGENCY:
|
||||
type: boolean
|
||||
example: true
|
||||
description: Is this a common rule agency
|
||||
SPONSOR_ID:
|
||||
type: number
|
||||
example: 1022
|
||||
description: The unique id of the sponsor
|
||||
Investigator:
|
||||
properties:
|
||||
STUDYID:
|
||||
|
@ -52,6 +52,7 @@ class StudySponsor(db.Model):
|
||||
|
||||
|
||||
class StudySponsorSchema(ma.Schema):
|
||||
|
||||
class Meta:
|
||||
fields = ("SS_STUDY", "SPONSOR_ID", "SP_NAME", "SP_TYPE", "SP_TYPE_GROUP_NAME", "COMMONRULEAGENCY")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user