rm pi id refs

This commit is contained in:
alicia pritchett 2022-03-18 12:04:20 -04:00
parent f4cade1b44
commit b9b8210f8a
10 changed files with 4 additions and 22 deletions

View File

@ -1822,10 +1822,6 @@ components:
type: string
format: date_time
example: "2019-12-25T09:12:33.001Z"
primary_investigator_id:
type: string
x-nullable: true
example: dhf8r
user_uid:
type: string
example: dhf8r

View File

@ -42,7 +42,7 @@ class UserView(AdminModelView):
class StudyView(AdminModelView):
column_filters = ['id', 'primary_investigator_id']
column_filters = ['id']
column_searchable_list = ['title']

View File

@ -20,15 +20,12 @@ import io
def add_study(body):
"""Or any study like object. Body should include a title, and primary_investigator_id """
if 'primary_investigator_id' not in body:
raise ApiError("missing_pi", "Can't create a new study without a Primary Investigator.")
"""Or any study like object. Body should include a title """
if 'title' not in body:
raise ApiError("missing_title", "Can't create a new study without a title.")
study_model = StudyModel(user_uid=UserService.current_user().uid,
title=body['title'],
primary_investigator_id=body['primary_investigator_id'],
last_updated=datetime.utcnow(),
status=StudyStatus.in_progress)
session.add(study_model)

View File

@ -24,7 +24,6 @@ class StudyInfo(Script):
"info": {
"id": 12,
"title": "test",
"primary_investigator_id": 21,
"user_uid": "dif84",
"sponsor": "sponsor",
"ind_number": "1234",

View File

@ -10,7 +10,6 @@ from crc.scripts.script import Script
class mock_study:
def __init__(self):
self.title = ""
self.principle_investigator_id = ""
class UpdateStudy(Script):
@ -47,7 +46,5 @@ update_study(title=PIComputingID.label, short_title="Really Short Name")
study.short_name = kwargs[arg]
elif arg.lower() == "proposal_name":
study.proposal_name = kwargs[arg]
elif arg.lower() == "pi":
study.primary_investigator_id = kwargs[arg]
else:
raise WorkflowTaskExecException(task, f"update_study() failed. {self.argument_error_message}")

View File

@ -65,7 +65,6 @@ class BaseTest(unittest.TestCase):
'last_updated': datetime.datetime.utcnow(),
'status': StudyStatus.in_progress,
'progress_status': ProgressStatus.in_progress,
'primary_investigator_id': 'dhf8r',
'sponsor': 'Sartography Pharmaceuticals',
'ind_number': '1234',
'user_uid': 'dhf8r'
@ -76,7 +75,6 @@ class BaseTest(unittest.TestCase):
'last_updated': datetime.datetime.utcnow(),
'status': StudyStatus.in_progress,
'progress_status': ProgressStatus.in_progress,
'primary_investigator_id': 'dhf8r',
'sponsor': 'Makerspace & Co.',
'ind_number': '5678',
'user_uid': 'dhf8r'
@ -261,13 +259,12 @@ class BaseTest(unittest.TestCase):
session.commit()
return user
def create_study(self, uid="dhf8r", title="Beer consumption in the bipedal software engineer",
primary_investigator_id="lb3dp"):
def create_study(self, uid="dhf8r", title="Beer consumption in the bipedal software engineer"):
study = session.query(StudyModel).filter_by(user_uid=uid).filter_by(title=title).first()
if study is None:
user = self.create_user(uid=uid)
study = StudyModel(title=title, status=StudyStatus.in_progress,
user_uid=user.uid, primary_investigator_id=primary_investigator_id)
user_uid=user.uid)
session.add(study)
session.commit()
return study

View File

@ -24,7 +24,6 @@ class TestStudyApi(BaseTest):
"title": "Phase III Trial of Genuine People Personalities (GPP) Autonomous Intelligent Emotional Agents "
"for Interstellar Spacecraft",
"last_updated": datetime.utcnow(),
"primary_investigator_id": "tmm2x",
"user_uid": "dhf8r",
}

View File

@ -36,6 +36,5 @@ class TestUpdateStudyScript(BaseTest):
proposal_name=details.proposal_name)
self.assertEqual(details.title, workflow.study.title)
self.assertEqual(details.short_title, workflow.study.short_title)
self.assertEqual(details.pi, workflow.study.primary_investigator_id)
self.assertEqual(details.short_name, workflow.study.short_name)
self.assertEqual(details.proposal_name, workflow.study.proposal_name)

View File

@ -272,7 +272,6 @@ class TestAuthentication(BaseTest):
"title": "blah",
"last_updated": datetime.utcnow(),
"status": StudyStatus.in_progress,
"primary_investigator_id": uid,
"user_uid": uid,
}

View File

@ -34,7 +34,6 @@ class TestStudyInfoScript(BaseTest):
study_info, second_task = self.do_work(info_type='info')
self.assertEqual(study_info['title'], second_task.data['info']['title'])
self.assertEqual(study_info['primary_investigator_id'], second_task.data['info']['primary_investigator_id'])
self.assertIn(study_info['title'], second_task.documentation)
def test_info_script_updated_study_info(self):