Merge remote-tracking branch 'origin/chore/update_specs' into feature/previous_task

# Conflicts:
#	Pipfile.lock

Assuring that all documents from the xls spreadsheet are loaded when doing validations.
This commit is contained in:
Dan Funk 2020-05-06 11:25:50 -04:00
commit 07e58e923d
15 changed files with 107 additions and 52 deletions

View File

@ -61,32 +61,13 @@ class StudyInfo(Script):
"status": WorkflowStatus.not_started.value,
"workflow_spec_id": "irb_api_details",
},
"documents": {
"AD_CoCApp":
{
'category1': 'Ancillary Document',
'category2': 'CoC Application',
'category3': '',
'Who Uploads?': 'CRC',
'Id': '12',
'Name': 'Certificate of Confidentiality Application',
'count': 0,
'required': True,
'code': 'AD_CoCApp',
'display_name': 'Certificate of Confidentiality Application',
'file_id': 123,
'task_id': 'abcdef14236890',
'workflow_id': 456,
'workflow_spec_id': 'irb_api_details',
'status': 'complete',
}
},
'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)})
def do_task(self, task, study_id, *args, **kwargs):
self.check_args(args)

View File

@ -104,7 +104,7 @@ class StudyService(object):
@staticmethod
def get_documents_status(study_id):
"""Returns a list of documents related to the study, if they are required, and any file information
"""Returns a list of documents related to the study, and any file information
that is available.."""
# Get PB required docs

View File

@ -70,6 +70,9 @@
<camunda:property id="placeholder" value="Limit Length: 11" />
<camunda:property id="hide_expression" value="model.CTG_NA &#38;&#38; model.CTG_NA.enumNoRegister" />
</camunda:properties>
<camunda:validation>
<camunda:constraint name="max_length" config="11" />
</camunda:validation>
</camunda:formField>
<camunda:formField id="CTG_StudyType" label="ClinicalTrials.gov Study Type" type="enum">
<camunda:properties>
@ -307,6 +310,18 @@
<bpmndi:BPMNShape id="StartEvent_1mhzkcr_di" bpmnElement="StartEvent_1mhzkcr">
<dc:Bounds x="-218" y="307" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_1y1qon7_di" bpmnElement="UserTask_1y1qon7">
<dc:Bounds x="620" y="340" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_01zzzg9_di" bpmnElement="UserTask_01zzzg9">
<dc:Bounds x="620" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0gtuk1e_di" bpmnElement="UserTask_EnterMultiSiteInfo">
<dc:Bounds x="620" y="210" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0ebxkp7_di" bpmnElement="UserTask_0ebxkp7">
<dc:Bounds x="620" y="90" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0vthni9_di" bpmnElement="Activity_10nxpt2">
<dc:Bounds x="-120" y="285" width="100" height="80" />
</bpmndi:BPMNShape>
@ -319,18 +334,6 @@
<bpmndi:BPMNShape id="Activity_0x7b58m_di" bpmnElement="Activity_PBMultiSiteCheckQ28">
<dc:Bounds x="350" y="285" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_01zzzg9_di" bpmnElement="UserTask_01zzzg9">
<dc:Bounds x="620" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_1y1qon7_di" bpmnElement="UserTask_1y1qon7">
<dc:Bounds x="620" y="340" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0gtuk1e_di" bpmnElement="UserTask_EnterMultiSiteInfo">
<dc:Bounds x="620" y="210" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0ebxkp7_di" bpmnElement="UserTask_0ebxkp7">
<dc:Bounds x="620" y="90" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -119,14 +119,14 @@ If you have any questions about the process, contact contract negotiator or Offi
<di:waypoint x="682" y="337" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0afrh4e_di" bpmnElement="SequenceFlow_0afrh4e">
<di:waypoint x="460" y="160" />
<di:waypoint x="570" y="160" />
<di:waypoint x="460" y="190" />
<di:waypoint x="570" y="190" />
<di:waypoint x="570" y="312" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0bvhrqu_di" bpmnElement="SequenceFlow_0bvhrqu">
<di:waypoint x="250" y="312" />
<di:waypoint x="250" y="160" />
<di:waypoint x="360" y="160" />
<di:waypoint x="250" y="190" />
<di:waypoint x="360" y="190" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1uxqr6o_di" bpmnElement="SequenceFlow_1uxqr6o">
<di:waypoint x="158" y="337" />
@ -144,14 +144,14 @@ If you have any questions about the process, contact contract negotiator or Offi
<bpmndi:BPMNShape id="ParallelGateway_0f68xmc_di" bpmnElement="ExclusiveGateway_0tqopul">
<dc:Bounds x="545" y="312" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_1fv8l08_di" bpmnElement="Task_0xn3d6z">
<dc:Bounds x="360" y="430" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0tz5ojx_di" bpmnElement="Task_0dj66yz">
<dc:Bounds x="360" y="297" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_1fv8l08_di" bpmnElement="Task_0xn3d6z">
<dc:Bounds x="360" y="430" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_03iirsg_di" bpmnElement="UserTask_03iirsg">
<dc:Bounds x="360" y="120" width="100" height="80" />
<dc:Bounds x="360" y="150" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>

View File

@ -17,6 +17,8 @@
<camunda:formField id="HoldNotes" label="Why was this study moved to Hold Status?" type="textarea">
<camunda:properties>
<camunda:property id="rows" value="5" />
<camunda:property id="group" value="Reason for Hold Notes" />
<camunda:property id="repeat" value="Reason for Hold Notes" />
</camunda:properties>
</camunda:formField>
</camunda:formData>

View File

@ -11,7 +11,7 @@
</inputExpression>
</input>
<output id="output_1" label="Investigator&#39;s Brochure(s) Uploaded?" name="isInvestigatorsBrochure" typeRef="boolean" />
<output id="OutputClause_1f3mlfn" label="Investigator&#39;s Broshure Form Banner" name="ElementDoc_InvestigatorsBrochure" typeRef="string" />
<output id="OutputClause_1f3mlfn" label="Investigator&#39;s Brochure Form Banner" name="ElementDoc_InvestigatorsBrochure" typeRef="string" />
<rule id="DecisionRule_0zvgaym">
<inputEntry id="UnaryTests_0mwq0my">
<text>0</text>

View File

@ -7,7 +7,7 @@
<decisionTable id="decisionTable_1">
<input id="input_1" label="Pharmacy Manual Upload Count">
<inputExpression id="inputExpression_1" typeRef="integer">
<text>StudyInfo.documents.DrugDevDoc_PharmManual.count</text>
<text>StudyInfo.documents["DrugDevDoc_PharmManual"]["count"]</text>
</inputExpression>
</input>
<output id="output_1" label="Pharmacy Manual(s) Uploaded?" name="isPharmacyManual" typeRef="boolean" />

View File

@ -6,8 +6,8 @@
</extensionElements>
<decisionTable id="DecisionTable_1mjqwlv">
<input id="InputClause_18pwfqu" label="Required Doc Keys">
<inputExpression id="LiteralExpression_1y84stb" typeRef="boolean" expressionLanguage="feel">
<text>StudyInfo.documents.Study_DataSecurityPlan.required</text>
<inputExpression id="LiteralExpression_1y84stb" typeRef="boolean" expressionLanguage="python">
<text>StudyInfo.documents['Study_DataSecurityPlan']['required']</text>
</inputExpression>
</input>
<output id="OutputClause_05y0j7c" label="data_security_plan" name="data_security_plan" typeRef="string" />

View File

@ -7,7 +7,7 @@
<decisionTable id="decisionTable_1">
<input id="InputClause_1ki80j6" label="required doc ids">
<inputExpression id="LiteralExpression_10mfcy7" typeRef="boolean" expressionLanguage="Python">
<text>StudyInfo.documents.UVACompl_PRCAppr.required</text>
<text>StudyInfo.documents['UVACompl_PRCAppr']['required']</text>
</inputExpression>
</input>
<output id="output_1" label="enter_core_info" name="enter_core_info" typeRef="string" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1kudwnk" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.4.1">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1kudwnk" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0">
<bpmn:process id="Process_0jhpidf" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1ees8ka</bpmn:outgoing>
@ -26,7 +26,12 @@
<bpmn:outgoing>Flow_0pwtiqm</bpmn:outgoing>
</bpmn:parallelGateway>
<bpmn:sequenceFlow id="Flow_0pwtiqm" sourceRef="Gateway_12tpgcy" targetRef="Activity_0f295la" />
<bpmn:parallelGateway id="Gateway_1nta7st">
<bpmn:parallelGateway id="Gateway_1nta7st" name="Some Name">
<bpmn:extensionElements>
<camunda:properties>
<camunda:property name="display_name" value="Some Name" />
</camunda:properties>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_17ct47v</bpmn:incoming>
<bpmn:outgoing>Flow_1m8285h</bpmn:outgoing>
<bpmn:outgoing>Flow_18pl92p</bpmn:outgoing>
@ -211,6 +216,9 @@
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1m22g4p_di" bpmnElement="Gateway_1nta7st">
<dc:Bounds x="468" y="414" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="462" y="471" width="62" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_16cm213_di" bpmnElement="Activity_16cm213">
<dc:Bounds x="550" y="650" width="100" height="80" />

View File

@ -221,6 +221,7 @@ class ExampleDataLoader:
is_status = filename.lower() == 'status.bpmn'
is_primary = filename.lower() == id + '.bpmn'
file = None
try:
file = open(file_path, 'rb')
data = file.read()

View File

@ -0,0 +1,60 @@
"""empty message
Revision ID: 89073ca446a3
Revises: 1685be1cc232
Create Date: 2020-05-05 11:09:00.307363
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '89073ca446a3'
down_revision = '1685be1cc232'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('workflow_stats')
op.add_column('task_event', sa.Column('action', sa.String(), nullable=True))
op.add_column('task_event', sa.Column('mi_count', sa.Integer(), nullable=True))
op.add_column('task_event', sa.Column('mi_index', sa.Integer(), nullable=True))
op.add_column('task_event', sa.Column('mi_type', sa.String(), nullable=True))
op.add_column('task_event', sa.Column('process_name', sa.String(), nullable=True))
op.add_column('task_event', sa.Column('task_name', sa.String(), nullable=True))
op.add_column('task_event', sa.Column('task_title', sa.String(), nullable=True))
op.add_column('task_event', sa.Column('task_type', sa.String(), nullable=True))
op.add_column('workflow', sa.Column('last_updated', sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('workflow', 'last_updated')
op.drop_column('task_event', 'task_type')
op.drop_column('task_event', 'task_title')
op.drop_column('task_event', 'task_name')
op.drop_column('task_event', 'process_name')
op.drop_column('task_event', 'mi_type')
op.drop_column('task_event', 'mi_index')
op.drop_column('task_event', 'mi_count')
op.drop_column('task_event', 'action')
op.create_table('workflow_stats',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('study_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('workflow_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('workflow_spec_id', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('spec_version', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('num_tasks_total', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('num_tasks_complete', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('num_tasks_incomplete', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('last_updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['study_id'], ['study.id'], name='workflow_stats_study_id_fkey'),
sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], name='workflow_stats_workflow_id_fkey'),
sa.ForeignKeyConstraint(['workflow_spec_id'], ['workflow_spec.id'], name='workflow_stats_workflow_spec_id_fkey'),
sa.PrimaryKeyConstraint('id', name='workflow_stats_pkey')
)
# ### end Alembic commands ###

View File

@ -392,9 +392,9 @@ class TestWorkflowProcessor(BaseTest):
self.assertTrue("enter_core_info" in data)
self.assertEqual("required", data["enter_core_info"])
# It should mark the Data Security Plan as required, because InfoSec Approval (24) is included in required docs.
# self.assertTrue("data_security_plan" in data)
# self.assertEqual("required", data["data_security_plan"])
# It should mark Personnel as required, because StudyInfo.investigators is not empty.
self.assertTrue("personnel" in data)
self.assertEqual("required", data["personnel"])
# It should mark the sponsor funding source as disabled since the funding required (12) is not included in the required docs.
self.assertTrue("sponsor_funding_source" in data)