diff --git a/crc/scripts/complete_template.py b/crc/scripts/complete_template.py index 59f63158..32bee509 100644 --- a/crc/scripts/complete_template.py +++ b/crc/scripts/complete_template.py @@ -29,7 +29,8 @@ Takes two arguments: def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): """For validation only, process the template, but do not store it in the database.""" - self.process_template(task, study_id, None, *args, **kwargs) + workflow = session.query(WorkflowModel).filter(WorkflowModel.id == workflow_id).first() + self.process_template(task, study_id, workflow, *args, **kwargs) def do_task(self, task, study_id, workflow_id, *args, **kwargs): workflow = session.query(WorkflowModel).filter(WorkflowModel.id == workflow_id).first() @@ -62,13 +63,13 @@ Takes two arguments: # Get the workflow specification file with the given name. file_data_models = FileService.get_spec_data_files( workflow_spec_id=workflow.workflow_spec_id, - workflow_id=workflow.id) - for file_data in file_data_models: - if file_data.file_model.name == file_name: - file_data_model = file_data - - if workflow is None or file_data_model is None: - file_data_model = FileService.get_workflow_file_data(task.workflow, file_name) + workflow_id=workflow.id, + name=file_name) + if len(file_data_models) > 0: + file_data_model = file_data_models[0] + else: + raise ApiError(code="invalid_argument", + message="Uable to locate a file with the given name.") # Get images from file/files fields if len(args) == 3: diff --git a/crc/static/bpmn/research_rampup/ResearchRampUpPlan.docx b/crc/static/bpmn/research_rampup/ResearchRampUpPlan.docx index 2ff0ed80..2073e9af 100644 Binary files a/crc/static/bpmn/research_rampup/ResearchRampUpPlan.docx and b/crc/static/bpmn/research_rampup/ResearchRampUpPlan.docx differ diff --git a/crc/static/bpmn/research_rampup/exclusive_area_monitors.dmn b/crc/static/bpmn/research_rampup/exclusive_area_monitors.dmn index 7a2251de..236796b3 100644 --- a/crc/static/bpmn/research_rampup/exclusive_area_monitors.dmn +++ b/crc/static/bpmn/research_rampup/exclusive_area_monitors.dmn @@ -1,10 +1,10 @@ - + - 'exclusive' in locals() and len(exclusive) + len(exclusive) @@ -14,7 +14,7 @@ - No exclusive spaces without Area Monitor + No exclusvie spaces without Area Monitor >0 diff --git a/crc/static/bpmn/research_rampup/research_rampup.bpmn b/crc/static/bpmn/research_rampup/research_rampup.bpmn index 3f3b3f92..83a0e360 100644 --- a/crc/static/bpmn/research_rampup/research_rampup.bpmn +++ b/crc/static/bpmn/research_rampup/research_rampup.bpmn @@ -163,13 +163,14 @@ Enter the following information for the PI submitting this request#### Personnel for whom you are requesting access Provide information on all personnel you are requesting approval for reentry into the previously entered lab, workspace and/or office space(s) for conducting research on-Grounds. (If there are personnel already working in the space, include them). -**Note: no undergraduates will be allowed to work on-Grounds during Phase I.** - #### Exclusive Space previously entered {%+ for es in exclusive %}{{ es.ExclusiveSpaceRoomID + " " + es.ExclusiveSpaceBuilding.label }}{% if loop.last %}{% else %}, {% endif %}{% else %}No exclusive space entered{% endfor %} + #### Shared Space previously entered -{%+ for ss in shared %}{{ ss.SharedSpaceRoomID + " " + ss.SharedSpaceBuilding.label }}{% if loop.last %}{% else %}, {% endif %}{% else %}No shared space entered.{% endfor %} +{%+ for ss in shared %}{{ ss.SharedSpaceRoomID + " " + ss.SharedSpaceBuilding.label }}{% if loop.last %}{% else %}, {% endif %}{% else %}No shared space entered.{% endfor %} + +**Note: no undergraduates will be allowed to work on-Grounds during Phase I.** @@ -181,13 +182,14 @@ Provide information on all personnel you are requesting approval for reentry int - + + @@ -195,8 +197,11 @@ Provide information on all personnel you are requesting approval for reentry int - + + + + @@ -204,10 +209,10 @@ Provide information on all personnel you are requesting approval for reentry int - + - - + + @@ -218,7 +223,7 @@ Provide information on all personnel you are requesting approval for reentry int - + @@ -275,8 +280,9 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a - + + @@ -284,7 +290,7 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a - + @@ -296,6 +302,7 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a + @@ -303,19 +310,19 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a - + - + - + @@ -326,7 +333,7 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a - + @@ -337,7 +344,7 @@ When your Research Ramp-up Plan is complete and ready to submit for review and a - + @@ -361,8 +368,9 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp - + + @@ -371,7 +379,7 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp - + @@ -382,11 +390,12 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp + - + @@ -400,14 +409,14 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp - + - + @@ -416,7 +425,7 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp - + @@ -427,7 +436,7 @@ Submit one entry for each space the PI is the exclusive investigator. If all sp - + @@ -520,7 +529,7 @@ Use the EHS [Lab Safety Plan During COVID 19 template](https://www.google.com/ur - Where and how to obtain PPE including face covering - + Flow_0wgdxa6 @@ -594,14 +603,14 @@ This step is internal to the system and do not require and user interaction #### Approval Process -The Research Ramp-up Plan and associated documents will be reviewed by{{ " " + ApprvlApprvrName1 }}{{ '.' if ApprvlApprvrName2 == 'n/a' else ' and ' + ApprvlApprvrName2 + '.' }} While waiting for approval, be sure that all required training has been completed and supplies secured. When the approval email notification is received, confirming the three questions below will allow you to proceed. - -{%+ set ns = namespace() %}{% set ns.exclusive = 0 %}{% set ns.shared = 0 %}{% for es in exclusive %}{% if es.ExclusiveSpaceAMComputingID is none %}{% set ns.exclusive = ns.exclusive + 1 %}{% endif %}{% endfor %}{% for ss in shared %}{% if ss.SharedSpaceAMComputingID is none %}{% set ns.shared = ns.shared + 1 %}{% endif %}{% endfor %} +The Research Ramp-up Plan and associated documents will be reviewed by{{ " " + ApprvlApprvrName1 }}{{ '.' if ApprvlApprvrName2 == 'n/a' else ' and ' + ApprvlApprvrName2 + '.' }} -#### Test -Missing Exclusive: {{ ns.exclusive }} -Missing Shared: {{ ns.shared }} +While waiting for approval, be sure that all required training has been completed and supplies secured. Additionally, if any Area Monitors were not known prior to submission, they will need to be discovered before proceeding. + + +When the approval email notification is received, confirming the three questions below and adding any missing Area Monitors will enable the Save button. + If a rejection notification is received, go back to the first step that needs to be addressed and step through each subsequent form from that point. @@ -642,6 +651,7 @@ If a rejection notification is received, go back to the first step that needs to + @@ -677,6 +687,7 @@ If a rejection notification is received, go back to the first step that needs to + @@ -724,14 +735,14 @@ If notification is received that the Research Ramp-up Plan approval process is n Notify the Area Monitor for -#### Exclusive Space previously entered -{%+ for es in exclusive %}{{ es.ExclusiveSpaceRoomID + " " + es.ExclusiveSpaceBuilding.label + " - " }}{% if es.ExclusiveSpaceAMComputingID is none %}No Area Monitor entered{% else %}{{ es.ExclusiveSpaceAMComputingID.label }}{% endif %}{% if loop.last %}{% else %}, {% endif %}{% else %}No exclusive space entered{% endfor %} +#### Exclusive Space +{%+ for es in exclusive %}{{ es.ExclusiveSpaceRoomID + " " + es.ExclusiveSpaceBuilding.label + " - " }}{% if es.ExclusiveSpaceAMComputingID is not defined %}No Area Monitor entered{% else %}{{ es.ExclusiveSpaceAMComputingID.label }}{% endif %}{% if loop.last %}{% else %}, {% endif %}{% else %}No exclusive space entered{% endfor %} -#### Shared Space previously entered -{%+ for ss in shared %}{{ ss.SharedSpaceRoomID + " " + ss.SharedSpaceBuilding.label }}{% if ss.SharedSpaceAMComputingID is none %}No Area Monitor entered{% else %}{{ ss.SharedSpaceAMComputingID.label }}{% endif %}{% if loop.last %}{% else %}, {% endif %}{% else %}No shared space entered.{% endfor %} +#### Shared Space +{%+ for ss in shared %}{{ ss.SharedSpaceRoomID + " " + ss.SharedSpaceBuilding.label + " - " }}{% if ss.SharedSpaceAMComputingID is not defined %}No Area Monitor entered{% else %}{{ ss.SharedSpaceAMComputingID.label }}{% endif %}{% if loop.last %}{% else %}, {% endif %}{% else %}No shared space entered.{% endfor %} SequenceFlow_0qc39tw Flow_0cpmvcw @@ -791,8 +802,6 @@ Provide initial weekly schedule(s) for the PI and all personnel for whom access #### Business Rule Task - - This step is internal to the system and do not require and user interaction Flow_07ge8uf Flow_0peeyne @@ -802,8 +811,6 @@ This step is internal to the system and do not require and user interaction#### Business Rule Task - - This step is internal to the system and do not require and user interaction Flow_0peeyne Flow_0tqna2m @@ -902,7 +909,7 @@ This step is internal to the system and do not require and user interaction - + @@ -910,7 +917,7 @@ This step is internal to the system and do not require and user interaction - + @@ -933,9 +940,6 @@ This step is internal to the system and do not require and user interaction - - - @@ -984,6 +988,9 @@ This step is internal to the system and do not require and user interaction + + + diff --git a/crc/static/bpmn/research_rampup/shared_area_monitors.dmn b/crc/static/bpmn/research_rampup/shared_area_monitors.dmn index f0746f42..c8e696d4 100644 --- a/crc/static/bpmn/research_rampup/shared_area_monitors.dmn +++ b/crc/static/bpmn/research_rampup/shared_area_monitors.dmn @@ -1,15 +1,15 @@ - + - 'shared' in locals() and len(shared) + len(shared) - sum([1 for x in exclusive if x.get('SharedSpaceAMComputingID',None) == None]) + sum([1 for x in shared if x.get('SharedSpaceAMComputingID',None) == None])