コード例 #1
0
 def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
     """For validation only, pretend no results come back from pb"""
     self.check_args(args)
     # Assure the reference file exists (a bit hacky, but we want to raise this error early, and cleanly.)
     FileService.get_reference_file_data(FileService.DOCUMENT_LIST)
     FileService.get_reference_file_data(FileService.INVESTIGATOR_LIST)
     data = {
         "study":{
             "info": {
                 "id": 12,
                 "title": "test",
                 "primary_investigator_id":21,
                 "user_uid": "dif84",
                 "sponsor": "sponsor",
                 "ind_number": "1234",
                 "inactive": False
             },
             "investigators":
                 {
                     "INVESTIGATORTYPE": "PI",
                     "INVESTIGATORTYPEFULL": "Primary Investigator",
                     "NETBADGEID": "dhf8r"
                 },
             "roles":
                 {
                     "INVESTIGATORTYPE": "PI",
                     "INVESTIGATORTYPEFULL": "Primary Investigator",
                     "NETBADGEID": "dhf8r"
                 },
             "details":
                 {
                     "IS_IND": 0,
                     "IS_IDE": 0,
                     "IS_MULTI_SITE": 0,
                     "IS_UVA_PI_MULTI": 0
                 },
             "approvals": {
                 "study_id": 12,
                 "workflow_id": 321,
                 "display_name": "IRB API Details",
                 "name": "irb_api_details",
                 "status": WorkflowStatus.not_started.value,
                 "workflow_spec_id": "irb_api_details",
             },
             'protocol': {
                 'id': 0,
             }
         }
     }
     self.add_data_to_task(task=task, data=data["study"])
     self.add_data_to_task(task, {"documents": StudyService().get_documents_status(study_id)})
コード例 #2
0
def get_reference_file(name):
    file_data = FileService.get_reference_file_data(name)
    return send_file(
        io.BytesIO(file_data.data),
        attachment_filename=file_data.file_model.name,
        mimetype=file_data.file_model.content_type,
        cache_timeout=-1  # Don't cache these files on the browser.
    )