Minor cleanup and bug fixes.
This commit is contained in:
parent
473c724fe3
commit
43a9a66d63
|
@ -1,2 +1,3 @@
|
|||
.idea
|
||||
__pycache__/
|
||||
app.db
|
13
app.py
13
app.py
|
@ -48,6 +48,7 @@ db = SQLAlchemy(app)
|
|||
migrate = Migrate(app, db)
|
||||
ma = Marshmallow(app)
|
||||
|
||||
# Loads all the descriptions from the API so we can display them in the editor.
|
||||
description_map = {}
|
||||
with open(r'api.yml') as file:
|
||||
api_config = yaml.load(file, Loader=yaml.FullLoader)
|
||||
|
@ -55,7 +56,6 @@ with open(r'api.yml') as file:
|
|||
for schema in api_config['components']['schemas']:
|
||||
for field, values in api_config['components']['schemas'][schema]['properties'].items():
|
||||
description_map[field] = values['description']
|
||||
print(description_map)
|
||||
|
||||
|
||||
# **************************
|
||||
|
@ -117,7 +117,7 @@ def new_study():
|
|||
title=title,
|
||||
description_map=description_map)
|
||||
|
||||
@app.route('/study/<study_id>}', methods=['GET', 'POST'])
|
||||
@app.route('/study/<study_id>', methods=['GET', 'POST'])
|
||||
def edit_study(study_id):
|
||||
study = db.session.query(Study).filter(Study.STUDYID == study_id).first()
|
||||
form = StudyForm(request.form, obj=study)
|
||||
|
@ -138,7 +138,7 @@ def edit_study(study_id):
|
|||
description_map={})
|
||||
|
||||
|
||||
@app.route('/investigator/<study_id>}', methods=['GET', 'POST'])
|
||||
@app.route('/investigator/<study_id>', methods=['GET', 'POST'])
|
||||
def new_investigator(study_id):
|
||||
form = InvestigatorForm(request.form)
|
||||
action = "/investigator/" + study_id
|
||||
|
@ -158,16 +158,17 @@ def new_investigator(study_id):
|
|||
description_map={})
|
||||
|
||||
|
||||
@app.route('/del_investigator/<inv_id>}', methods=['GET'])
|
||||
@app.route('/del_investigator/<inv_id>', methods=['GET'])
|
||||
def del_investigator(inv_id):
|
||||
db.session.query(Investigator).filter(Investigator.id == inv_id).delete()
|
||||
db.session.commit()
|
||||
return redirect('/')
|
||||
|
||||
|
||||
@app.route('/del_study/<study_id>}', methods=['GET'])
|
||||
@app.route('/del_study/<study_id>', methods=['GET'])
|
||||
def del_study(study_id):
|
||||
db.session.query(Study).filter(Study.STUDYID == study_id).delete()
|
||||
db.session.query(StudyDetails).filter(StudyDetails.STUDYID == study_id).delete()
|
||||
db.session.commit()
|
||||
return redirect('/')
|
||||
|
||||
|
@ -187,7 +188,7 @@ def _update_study(study, form):
|
|||
db.session.add(study)
|
||||
db.session.commit()
|
||||
|
||||
@app.route('/study_details/<study_id>}', methods=['GET', 'POST'])
|
||||
@app.route('/study_details/<study_id>', methods=['GET', 'POST'])
|
||||
def study_details(study_id):
|
||||
study_details = db.session.query(StudyDetails).filter(StudyDetails.STUDYID == study_id).first()
|
||||
if not study_details:
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: dde54f90dde2
|
||||
Revises: d3592c4e8a39
|
||||
Create Date: 2020-02-17 17:29:52.393203
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'dde54f90dde2'
|
||||
down_revision = 'd3592c4e8a39'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('study',
|
||||
sa.Column('STUDYID', sa.Integer(), nullable=False),
|
||||
sa.Column('HSRNUMBER', sa.String(), nullable=True),
|
||||
sa.Column('TITLE', sa.String(length=80), nullable=False),
|
||||
sa.Column('NETBADGEID', sa.String(), nullable=False),
|
||||
sa.Column('Q_COMPLETE', sa.Boolean(), nullable=True),
|
||||
sa.Column('DATE_MODIFIED', sa.DateTime(timezone=True), nullable=True),
|
||||
sa.PrimaryKeyConstraint('STUDYID')
|
||||
)
|
||||
op.create_table('investigator',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('STUDYID', sa.Integer(), nullable=True),
|
||||
sa.Column('NETBADGEID', sa.String(), nullable=False),
|
||||
sa.Column('INVESTIGATORTYPE', sa.String(), nullable=False),
|
||||
sa.Column('INVESTIGATORTYPEFULL', sa.String(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['STUDYID'], ['study.STUDYID'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('required_document',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('AUXDOCID', sa.String(), nullable=False),
|
||||
sa.Column('AUXDOC', sa.String(), nullable=False),
|
||||
sa.Column('STUDYID', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['STUDYID'], ['study.STUDYID'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('study_details',
|
||||
sa.Column('STUDYID', sa.Integer(), nullable=False),
|
||||
sa.Column('IS_IND', sa.Integer(), nullable=True),
|
||||
sa.Column('IND_1', sa.String(), nullable=True),
|
||||
sa.Column('IND_2', sa.String(), nullable=True),
|
||||
sa.Column('IND_3', sa.String(), nullable=True),
|
||||
sa.Column('IS_UVA_IND', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_IDE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_UVA_IDE', sa.Integer(), nullable=True),
|
||||
sa.Column('IDE', sa.String(), nullable=True),
|
||||
sa.Column('IS_CHART_REVIEW', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_RADIATION', sa.Integer(), nullable=True),
|
||||
sa.Column('GCRC_NUMBER', sa.String(), nullable=True),
|
||||
sa.Column('IS_GCRC', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PRC_DSMP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PRC', sa.Integer(), nullable=True),
|
||||
sa.Column('PRC_NUMBER', sa.String(), nullable=True),
|
||||
sa.Column('IS_IBC', sa.Integer(), nullable=True),
|
||||
sa.Column('IBC_NUMBER', sa.String(), nullable=True),
|
||||
sa.Column('SPONSORS_PROTOCOL_REVISION_DATE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_SPONSOR_MONITORING', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_AUX', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_SPONSOR', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_GRANT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_COMMITTEE_CONFLICT', sa.Integer(), nullable=True),
|
||||
sa.Column('DSMB', sa.Integer(), nullable=True),
|
||||
sa.Column('DSMB_FREQUENCY', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_DB', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_UVA_DB', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_CENTRAL_REG_DB', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_CONSENT_WAIVER', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_HGT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_GENE_TRANSFER', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_TISSUE_BANKING', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_SURROGATE_CONSENT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_ADULT_PARTICIPANT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_MINOR_PARTICIPANT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_MINOR', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_BIOMEDICAL', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_QUALITATIVE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PI_SCHOOL', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PRISONERS_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PREGNANT_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_FETUS_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_MENTAL_IMPAIRMENT_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_ELDERLY_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_OTHER_VULNERABLE_POP', sa.Integer(), nullable=True),
|
||||
sa.Column('OTHER_VULNERABLE_DESC', sa.String(), nullable=True),
|
||||
sa.Column('IS_MULTI_SITE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_UVA_LOCATION', sa.Integer(), nullable=True),
|
||||
sa.Column('NON_UVA_LOCATION', sa.String(), nullable=True),
|
||||
sa.Column('MULTI_SITE_LOCATIONS', sa.String(), nullable=True),
|
||||
sa.Column('IS_OUTSIDE_CONTRACT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_UVA_PI_MULTI', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_NOT_PRC_WAIVER', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_CANCER_PATIENT', sa.Integer(), nullable=True),
|
||||
sa.Column('UPLOAD_COMPLETE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_FUNDING_SOURCE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_PI_INITIATED', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_ENGAGED_RESEARCH', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_APPROVED_DEVICE', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_FINANCIAL_CONFLICT', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_NOT_CONSENT_WAIVER', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_FOR_CANCER_CENTER', sa.Integer(), nullable=True),
|
||||
sa.Column('IS_REVIEW_BY_CENTRAL_IRB', sa.Integer(), nullable=True),
|
||||
sa.Column('IRBREVIEWERADMIN', sa.String(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['STUDYID'], ['study.STUDYID'], ),
|
||||
sa.PrimaryKeyConstraint('STUDYID')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('study_details')
|
||||
op.drop_table('required_document')
|
||||
op.drop_table('investigator')
|
||||
op.drop_table('study')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue