diff --git a/crc/api/workflow.py b/crc/api/workflow.py index ab7fafe2..79885185 100644 --- a/crc/api/workflow.py +++ b/crc/api/workflow.py @@ -6,7 +6,7 @@ from crc.api.common import ApiError, ApiErrorSchema from crc.api.file import delete_file from crc.models.api_models import Task, WorkflowApi, WorkflowApiSchema from crc.models.file import FileModel -from crc.models.stats import WorkflowStatsModel +from crc.models.stats import WorkflowStatsModel, TaskEventModel from crc.models.workflow import WorkflowModel, WorkflowSpecModelSchema, WorkflowSpecModel, WorkflowSpecCategoryModel, \ WorkflowSpecCategoryModelSchema from crc.services.workflow_processor import WorkflowProcessor @@ -116,6 +116,8 @@ def get_workflow(workflow_id, soft_reset=False, hard_reset=False): def delete(workflow_id): + session.query(TaskEventModel).filter_by(workflow_id=workflow_id).delete() + session.query(WorkflowStatsModel).filter_by(workflow_id=workflow_id).delete() session.query(WorkflowModel).filter_by(id=workflow_id).delete() session.commit() diff --git a/crc/models/api_models.py b/crc/models/api_models.py index 4aa9664e..09982be3 100644 --- a/crc/models/api_models.py +++ b/crc/models/api_models.py @@ -48,6 +48,7 @@ class Task(object): except jinja2.exceptions.UndefinedError as ue: raise ApiError(code="template_error", message="Error processing template for task %s: %s" % (self.name, str(ue)), status_code=500) + # TODO: Catch additional errors and report back. class OptionSchema(ma.Schema): class Meta: diff --git a/crc/static/bpmn/ids/ids.bpmn b/crc/static/bpmn/ids/ids.bpmn index b424be77..3d350f70 100644 --- a/crc/static/bpmn/ids/ids.bpmn +++ b/crc/static/bpmn/ids/ids.bpmn @@ -4,7 +4,7 @@ SequenceFlow_0hr4ghe - + #### Instructions According to selected Study Type: Treatment (TRE), IDS applicable for this type of study: Yes @@ -39,7 +39,7 @@ According to selected Study Type: Treatment (TRE), IDS applicable for this type SequenceFlow_1guaev4 SequenceFlow_1iiazgn - + #### How to IDS service fees are based on the Protocol Owner identified in Common Study section of the workflow. @@ -89,14 +89,15 @@ Protocol Owner: **(need to insert value here)** - + {% if IRB_UplCnt.DrugDeviceDocument.PharmacyManual > 0 %} - {% if IRB_UplCnt.DrugDeviceDocument.PharmacyManual = 1 %} - {{IRB_UplCnt.DrugDeviceDocument.PharmacyManual ~ "Pharmacy Manual Uploaded"}} + {% if IRB_UplCnt.DrugDeviceDocument.PharmacyManual == 1 %} + {{IRB_UplCnt.DrugDeviceDocument.PharmacyManual}} Pharmacy Manual Uploaded "This manual will be sent as part of your IDS Submission" {% else %} - {{IRB_UplCnt.DrugDeviceDocument.PharmacyManual ~ "Pharmacy Manuals Uploaded"}} + {{IRB_UplCnt.DrugDeviceDocument.PharmacyManual}} Pharmacy Manuals Uploaded "These manuals will be sent as part of your IDS Submission +{% endif %} {% else %} "The Pharmacy Manual has not been uploaded. If you do not intend to upload a manual before you IDS submission, please complete the questions below. If you do intend to upload a manual, you do not need to complete them" {% endif %} @@ -125,15 +126,10 @@ Protocol Owner: **(need to insert value here)** - - - - + - - @@ -146,12 +142,12 @@ Protocol Owner: **(need to insert value here)** SequenceFlow_1w7dlq7 - isWaiver = False + isWaiver == False isWaiver == True - + @@ -161,19 +157,26 @@ Protocol Owner: **(need to insert value here)** SequenceFlow_0yzkn64 - + + + + + + + SequenceFlow_0yzkn64 SequenceFlow_0jqi0ps - + {% if IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure > 0 %} {% if IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure == 1 %} - {{IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure ~ "Pharmacy Manual Uploaded"}} + {{IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure}} Pharmacy Manual Uploaded "This brochure will be sent as part of your IDS Submission" {% else %} - {{IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure ~ "Pharmacy Manuals Uploaded"}} + {{IRB_UplCnt.DrugDeviceDocument.InvestigatorBrochure}} Pharmacy Manuals Uploaded "These brochures will be sent as part of your IDS Submission +{% endif %} {% else %} "The Investigator's Brochure has not been uploaded. If you do not intend to upload a manual before you IDS submission, please complete the questions below. If you do intend to upload a manual, you do not need to complete them" {% endif %} @@ -199,16 +202,17 @@ Protocol Owner: **(need to insert value here)** - + {% if IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual > 0 %} - {% if IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual = 1 %} - {{IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual ~ "Pharmacy Manual Uploaded"}} + {% if IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual == 1 %} +{{IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual}} Pharmacy Manual Uploaded "This manual will be sent as part of your IDS Submission" {% else %} - {{IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual ~ "Pharmacy Manuals Uploaded"}} +{{IRB_UplCnt.DrugDeviceDocument.IVRSIWRSIXRSManual}} Pharmacy Manuals Uploaded "These manuals will be sent as part of your IDS Submission + {% endif %} {% else %} - "The IVRS/IWRS/IXRS Manual has not been uploaded. If you do not intend to upload a manual before you IDS submission, please complete the questions below. If you do intend to upload a manual, you do not need to complete them" +"The IVRS/IWRS/IXRS Manual has not been uploaded. If you do not intend to upload a manual before you IDS submission, please complete the questions below. If you do intend to upload a manual, you do not need to complete them" {% endif %} @@ -252,7 +256,7 @@ Protocol Owner: **(need to insert value here)** - +