2019-12-20 19:32:04 +00:00
openapi : "3.0.2"
2019-11-19 20:57:46 +00:00
info :
version : 1.0 .0
title : Workflow Microservice
license :
name : MIT
servers :
- url : http://localhost:5000/v1.0
2020-03-24 18:15:21 +00:00
security :
- jwt : [ 'secret' ]
2019-11-19 20:57:46 +00:00
paths :
2020-02-20 20:35:07 +00:00
/sso_backdoor :
2020-02-18 21:38:56 +00:00
get :
operationId : crc.api.user.backdoor
summary : A backdoor that allows someone to log in as a specific user, if they
are in a staging environment.
2020-03-24 18:15:21 +00:00
security : [ ] # Disable security for this endpoint only.
2020-02-20 20:35:07 +00:00
parameters :
- name : uid
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : true
schema :
type : string
- name : email_address
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : display_name
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : affiliation
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : eppn
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : first_name
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : last_name
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
- name : title
2020-02-21 16:24:39 +00:00
in : query
2020-02-20 20:35:07 +00:00
required : false
schema :
type : string
2020-02-24 21:59:16 +00:00
- name : redirect_url
in : query
required : false
schema :
type : string
2020-02-18 21:38:56 +00:00
tags :
- Users
responses :
'304' :
description : Redirection to the hosted frontend with an auth_token header.
/user :
get :
operationId : crc.api.user.get_current_user
summary : Returns the current user.
tags :
- Users
responses :
'200' :
description : The currently authenticated user.
content :
application/json :
schema :
$ref : "#/components/schemas/User"
2019-12-11 21:54:24 +00:00
# /v1.0/study
/study :
2019-11-19 20:57:46 +00:00
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.study.all_studies
2019-12-11 21:54:24 +00:00
summary : Provides a list of studies related to the current user.
2019-11-19 20:57:46 +00:00
tags :
2019-12-18 19:02:17 +00:00
- Studies
2019-12-11 21:54:24 +00:00
responses :
'200' :
description : An array of studies, ordered by the last modified date.
content :
application/json :
schema :
$ref : "#/components/schemas/Study"
2020-01-03 16:44:24 +00:00
post :
2020-01-14 20:39:54 +00:00
operationId : crc.api.study.add_study
2020-01-03 16:44:24 +00:00
summary : Creates a new study with the given parameters.
tags :
- Studies
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/Study'
responses :
'200' :
description : Study created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/Study"
2019-12-18 19:02:17 +00:00
/study/{study_id}:
2020-01-31 16:33:31 +00:00
parameters :
- name : study_id
in : path
required : true
description : The id of the study for which workflows should be returned.
schema :
type : integer
format : int32
2019-12-11 21:54:24 +00:00
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.study.get_study
2019-12-18 19:02:17 +00:00
summary : Provides a single study
2019-12-11 21:54:24 +00:00
tags :
2019-12-18 19:02:17 +00:00
- Studies
2019-12-11 21:54:24 +00:00
responses :
'200' :
2019-12-18 19:02:17 +00:00
description : An Study Object
2019-12-11 21:54:24 +00:00
content :
application/json :
schema :
2019-12-18 19:02:17 +00:00
$ref : "#/components/schemas/Study"
2020-03-09 19:12:40 +00:00
delete :
operationId : crc.api.study.delete_study
summary : Removes the given study completely.
tags :
- Studies
responses :
'204' :
description : The study has been removed.
2020-01-31 16:33:31 +00:00
put :
2020-01-14 20:39:54 +00:00
operationId : crc.api.study.update_study
2020-01-03 16:44:24 +00:00
summary : Updates an existing study with the given parameters.
tags :
- Studies
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/Study'
responses :
'200' :
description : Study updated successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/Study"
2019-12-18 19:02:17 +00:00
/study-update/{study_id}:
2019-12-11 21:54:24 +00:00
post :
2020-01-14 20:39:54 +00:00
operationId : crc.api.study.post_update_study_from_protocol_builder
2019-12-18 19:02:17 +00:00
summary : If the study is up-to-date with Protocol Builder, returns a 304 Not Modified. If out of date, return a 202 Accepted and study state changes to updating.
2019-12-11 21:54:24 +00:00
tags :
2019-12-18 19:02:17 +00:00
- Study Status
2019-11-19 20:57:46 +00:00
parameters :
2019-12-11 21:54:24 +00:00
- name : study_id
in : path
required : true
2019-12-18 19:02:17 +00:00
description : The id of the study that should be checked for updates.
2019-12-11 21:54:24 +00:00
schema :
type : integer
format : int32
2019-12-18 19:02:17 +00:00
responses :
'304' :
description : Study is currently up to date and does not need to be reloaded from Protocol Builder
'202' :
description : Request accepted, will preform an update. Study state set to "updating"
2020-03-30 14:12:10 +00:00
2019-12-18 19:02:17 +00:00
/workflow-specification :
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.workflow.all_specifications
2019-12-18 19:02:17 +00:00
summary : Provides a list of workflows specifications that can be added to a study manually. Please note that Protocol Builder will handle this most of the time.
tags :
2020-01-30 14:11:17 +00:00
- Workflow Specifications
2019-12-18 19:02:17 +00:00
responses :
'200' :
description : An array of workflow specifications
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-14 02:43:09 +00:00
post :
2020-01-14 20:39:54 +00:00
operationId : crc.api.workflow.add_workflow_specification
2020-01-14 02:43:09 +00:00
summary : Creates a new workflow specification with the given parameters.
tags :
2020-01-30 14:11:17 +00:00
- Workflow Specifications
2020-01-14 02:43:09 +00:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpec'
responses :
'200' :
description : Workflow specification created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-14 19:10:53 +00:00
/workflow-specification/{spec_id}:
2020-01-23 21:05:09 +00:00
parameters :
- name : spec_id
in : path
required : false
description : The unique id of an existing workflow specification to modify.
schema :
type : string
2020-01-28 15:14:06 +00:00
get :
operationId : crc.api.workflow.get_workflow_specification
summary : Returns a single workflow specification
tags :
2020-01-30 14:11:17 +00:00
- Workflow Specifications
2020-01-28 15:14:06 +00:00
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-14 19:10:53 +00:00
put :
2020-01-14 20:39:54 +00:00
operationId : crc.api.workflow.update_workflow_specification
2020-01-14 19:10:53 +00:00
summary : Modifies an existing workflow specification with the given parameters.
tags :
2020-01-30 14:11:17 +00:00
- Workflow Specifications
2020-01-14 19:10:53 +00:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpec'
responses :
'200' :
description : Workflow specification created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-23 21:05:09 +00:00
delete :
operationId : crc.api.workflow.delete_workflow_specification
summary : Removes an existing workflow specification
tags :
2020-01-30 14:11:17 +00:00
- Workflow Specifications
2020-01-23 21:05:09 +00:00
responses :
'204' :
description : The workflow specification has been removed.
2020-03-27 12:29:31 +00:00
/workflow-specification/{spec_id}/validate:
parameters :
- name : spec_id
in : path
required : false
description : The unique id of an existing workflow specification to validate.
schema :
type : string
get :
operationId : crc.api.workflow.validate_workflow_specification
summary : Loads and attempts to execute a Workflow Specification, returning a list of errors encountered
tags :
- Workflow Specifications
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Error"
2020-03-16 20:30:56 +00:00
/workflow-specification-category :
get :
operationId : crc.api.workflow.list_workflow_spec_categories
summary : Provides a list of categories that can be added to a workflow spec.
tags :
2020-03-27 12:29:31 +00:00
- Workflow Specification Category
2020-03-16 20:30:56 +00:00
responses :
'200' :
description : An array of workflow specification categories
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpecCategory"
post :
operationId : crc.api.workflow.add_workflow_spec_category
summary : Creates a new workflow spec category with the given parameters.
tags :
2020-03-27 12:29:31 +00:00
- Workflow Specification Category
2020-03-16 20:30:56 +00:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpecCategory'
responses :
'200' :
description : Workflow spec category created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
/workflow-specification-category/{cat_id}:
parameters :
- name : cat_id
in : path
required : false
description : The unique id of an existing workflow spec category to modify.
schema :
type : string
get :
operationId : crc.api.workflow.get_workflow_spec_category
summary : Returns a single workflow spec category
tags :
2020-03-27 12:29:31 +00:00
- Workflow Specification Category
2020-03-16 20:30:56 +00:00
responses :
'200' :
description : Workflow spec category.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
put :
operationId : crc.api.workflow.update_workflow_spec_category
summary : Modifies an existing workflow spec category with the given parameters.
tags :
2020-03-27 12:29:31 +00:00
- Workflow Specification Category
2020-03-16 20:30:56 +00:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpecCategory'
responses :
'200' :
description : Workflow spec category created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
delete :
operationId : crc.api.workflow.delete_workflow_spec_category
summary : Removes an existing workflow spec category
tags :
2020-03-27 12:29:31 +00:00
- Workflow Specification Category
2020-03-16 20:30:56 +00:00
responses :
'204' :
description : The workflow spec category has been removed.
2019-12-27 18:50:03 +00:00
/file :
parameters :
2020-02-04 02:56:18 +00:00
- name : workflow_spec_id
in : query
required : false
description : The unique id of a workflow specification
schema :
type : string
- name : study_id
2019-12-27 18:50:03 +00:00
in : query
required : false
2020-02-04 02:56:18 +00:00
description : The unique id of a study
2019-12-27 18:50:03 +00:00
schema :
2020-02-04 03:29:41 +00:00
type : integer
2020-02-04 19:26:53 +00:00
- name : workflow_id
in : query
required : false
description : The unique id of a workflow instance
schema :
type : integer
2020-02-04 02:56:18 +00:00
- name : task_id
in : query
required : false
description : The unique id of a workflow task
schema :
2020-02-04 03:29:41 +00:00
type : string
2020-02-05 20:06:19 +00:00
- name : form_field_key
in : query
required : false
2020-03-19 21:13:30 +00:00
description : The unique key of a workflow task form field. Make sure this matches a document in the irb_documents.xslx reference sheet.
2020-02-05 20:06:19 +00:00
schema :
type : string
2019-12-27 18:50:03 +00:00
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.file.get_files
2019-12-27 18:50:03 +00:00
summary : Provides a list of files that match the given parameters (such as a spec id) IMPORTANT, only includes metadata, not the file content.
tags :
- Files
responses :
'200' :
description : An array of file descriptions (not the file content)
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/File"
2020-03-09 19:12:40 +00:00
2019-12-27 18:50:03 +00:00
post :
2020-01-14 20:39:54 +00:00
operationId : crc.api.file.add_file
2019-12-27 18:50:03 +00:00
summary : Add a new file
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Metadata about the uploaded file, but not the file content.
content :
application/json :
schema :
$ref : "#/components/schemas/File"
/file/{file_id}:
parameters :
- name : file_id
in : path
required : true
description : The id of the File requested
schema :
type : integer
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.file.get_file_info
2019-12-27 18:50:03 +00:00
summary : Returns metadata about a file.
tags :
- Files
responses :
'200' :
description : Returns the file information requested.
content :
application/json :
schema :
$ref : "#/components/schemas/File"
put :
2020-01-31 15:39:19 +00:00
operationId : crc.api.file.update_file_info
2020-01-31 16:33:31 +00:00
summary : Updates existing file info with the given parameters.
2019-12-27 18:50:03 +00:00
tags :
- Files
requestBody :
content :
2020-01-31 15:39:19 +00:00
application/json :
2019-12-27 18:50:03 +00:00
schema :
2020-01-31 16:33:31 +00:00
$ref : '#/components/schemas/File'
2019-12-27 18:50:03 +00:00
responses :
'200' :
2020-01-31 16:33:31 +00:00
description : File info updated successfully.
2019-12-27 18:50:03 +00:00
content :
application/json :
schema :
$ref : "#/components/schemas/File"
delete :
2020-01-14 20:39:54 +00:00
operationId : crc.api.file.delete_file
2019-12-27 18:50:03 +00:00
summary : Removes an existing file
tags :
- Files
responses :
'204' :
description : The file has been removed.
/file/{file_id}/data:
parameters :
- name : file_id
in : path
required : true
description : The id of the File requested
schema :
type : integer
get :
2020-01-31 15:39:19 +00:00
operationId : crc.api.file.get_file_data
2019-12-27 18:50:03 +00:00
summary : Returns only the file contents
tags :
- Files
responses :
'200' :
description : Returns the actual file
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-01-31 15:39:19 +00:00
put :
operationId : crc.api.file.update_file_data
summary : Update only the file contents for a given file
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
2020-03-16 17:24:15 +00:00
x-body-name : file
2020-01-31 15:39:19 +00:00
type : object
properties :
file :
type : string
format : binary
2020-03-16 17:24:15 +00:00
required :
- file
2020-01-31 15:39:19 +00:00
responses :
'200' :
2020-03-25 12:06:58 +00:00
description : Returns the updated file model with the new version information.
2020-01-31 15:39:19 +00:00
content :
2020-03-25 12:06:58 +00:00
application/json :
2020-01-31 15:39:19 +00:00
schema :
2020-03-25 12:06:58 +00:00
$ref : "#/components/schemas/File"
2019-12-27 18:50:03 +00:00
# /v1.0/workflow/0
2020-03-13 19:03:57 +00:00
/reference_file :
get :
operationId : crc.api.file.get_reference_files
summary : Provides a list of existing reference files that are available in the system.
tags :
- Files
responses :
'200' :
description : An array of file descriptions (not the file content)
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/File"
/reference_file/{name}:
parameters :
- name : name
in : path
required : true
description : The special name of the reference file.
schema :
type : string
get :
operationId : crc.api.file.get_reference_file
summary : Reference files are called by name rather than by id.
tags :
- Files
responses :
'200' :
description : Returns the actual file
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
put :
operationId : crc.api.file.set_reference_file
summary : Update the contents of a named reference file.
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Returns the actual file
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
# /v1.0/workflow/0
2019-12-11 21:54:24 +00:00
/workflow/{workflow_id}:
2019-12-30 18:15:39 +00:00
parameters :
2019-11-19 20:57:46 +00:00
- name : workflow_id
in : path
required : true
2019-12-11 21:54:24 +00:00
description : The id of the workflow
2019-11-19 20:57:46 +00:00
schema :
type : integer
format : int32
2019-12-30 18:15:39 +00:00
get :
2020-01-14 20:39:54 +00:00
operationId : crc.api.workflow.get_workflow
2020-04-19 19:14:10 +00:00
summary : Returns a workflow, can also be used to do a soft or hard reset on the workflow.
2020-03-05 21:45:44 +00:00
parameters :
- name : soft_reset
in : query
required : false
description : Set this to true to use the latest workflow specification to load minor modifications to the spec.
schema :
type : boolean
- name : hard_reset
in : query
required : false
description : Set this to true to reset the workflow
schema :
type : boolean
2019-12-30 18:15:39 +00:00
tags :
- Workflows and Tasks
2019-11-19 20:57:46 +00:00
responses :
'200' :
2019-12-11 21:54:24 +00:00
description : Returns details about the workflows state and current task
2019-11-19 20:57:46 +00:00
content :
application/json :
schema :
2019-12-11 21:54:24 +00:00
$ref : "#/components/schemas/Workflow"
2019-12-30 18:15:39 +00:00
delete :
2020-04-29 20:07:39 +00:00
operationId : crc.api.workflow.delete_workflow
2019-12-30 18:15:39 +00:00
summary : Removes an existing workflow
tags :
2019-12-30 18:34:18 +00:00
- Workflows and Tasks
2019-12-30 18:15:39 +00:00
responses :
'204' :
description : The workflow was removed
2020-03-11 18:28:53 +00:00
/workflow/{workflow_id}/stats:
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
get :
operationId : crc.api.stats.get_workflow_stats
summary : Stats about a given workflow
tags :
- Workflows and Tasks
responses :
'200' :
description : Returns counts of complete, incomplete, and total number of tasks
content :
application/json :
schema :
$ref : "#/components/schemas/Workflow"
2020-04-22 23:40:40 +00:00
/workflow/{workflow_id}/task/{task_id}/data:
2020-01-07 18:23:46 +00:00
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
2020-01-14 16:02:44 +00:00
- name : task_id
2020-01-07 18:23:46 +00:00
in : path
required : true
description : The id of the task
schema :
type : string
2020-01-14 16:02:44 +00:00
format : uuid
2020-04-22 23:40:40 +00:00
put :
operationId : crc.api.workflow.update_task
summary : Exclusively for User Tasks, submits form data as a flat set of key/values.
2019-11-19 20:57:46 +00:00
tags :
2019-12-11 21:54:24 +00:00
- Workflows and Tasks
2020-04-22 23:40:40 +00:00
requestBody :
description : Key / Value pairs in JSON format.
required : true
content :
application/json :
schema :
type : object
example :
favorite_color : blue
capital_assyria : Assur
2019-11-19 20:57:46 +00:00
responses :
2020-04-22 23:40:40 +00:00
'201' :
2020-04-28 21:25:53 +00:00
description : Returns the updated workflow with this task as the current task.
content :
application/json :
schema :
$ref : "#/components/schemas/Workflow"
/workflow/{workflow_id}/task/{task_id}/set_token:
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
- name : task_id
in : path
required : true
description : The id of the task
schema :
type : string
format : uuid
put :
operationId : crc.api.workflow.set_current_task
summary : Attempts to make the given task the Current Active Task
tags :
- Workflows and Tasks
responses :
'201' :
description : Returns the updated workflow with this task as the current task.
2019-11-19 20:57:46 +00:00
content :
application/json :
schema :
2020-04-22 23:40:40 +00:00
$ref : "#/components/schemas/Workflow"
/workflow/{workflow_id}/task/{task_id}/lookup/{field_id}:
2020-01-14 16:02:44 +00:00
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
- name : task_id
in : path
required : true
description : The id of the task
schema :
type : string
format : uuid
2020-04-22 23:40:40 +00:00
- name : field_id
in : path
required : true
description : The id of the field (as set in the bpmn editor) on which to do a lookup.
schema :
type : string
- name : query
in : query
required : false
description : The string to search for in the Value column of the lookup table.
schema :
type : string
- name : limit
in : query
required : false
description : The total number of records to return, defaults to 10.
schema :
type : integer
get :
operationId : crc.api.workflow.lookup
summary : Provides type-ahead search against a lookup table associted with a form field.
2019-11-19 20:57:46 +00:00
tags :
2019-12-11 21:54:24 +00:00
- Workflows and Tasks
2019-11-19 20:57:46 +00:00
responses :
'201' :
2020-04-22 23:40:40 +00:00
description : Returns the a list of values and labels for a lookup form.
2019-11-19 20:57:46 +00:00
content :
application/json :
schema :
2020-04-22 23:40:40 +00:00
$ref : "#/components/schemas/LookupItem"
2020-02-29 22:22:38 +00:00
/render_markdown :
parameters :
- name : data
in : query
required : true
description : The json data to use in populating the template
schema :
type : string
- name : template
in : query
required : true
description : The markdown template to process.
schema :
type : string
get :
operationId : crc.api.tools.render_markdown
2020-03-24 18:15:21 +00:00
security : [ ] # Disable security for this endpoint only.
2020-02-29 22:22:38 +00:00
summary : Processes the markdown template using the data provided.
tags :
- Configurator Tools
responses :
'201' :
description : Returns the updated workflow with the task completed.
content :
text/plain :
schema :
type : string
/render_docx :
parameters :
- name : data
in : query
required : true
description : The json data to use in populating the template
schema :
type : string
put :
operationId : crc.api.tools.render_docx
2020-03-24 18:15:21 +00:00
security : [ ] # Disable security for this endpoint only.
2020-02-29 22:22:38 +00:00
summary : Renders a docx template with embedded jinja2 markup.
tags :
- Configurator Tools
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Returns the generated document.
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-03-03 20:30:42 +00:00
/list_scripts :
get :
operationId : crc.api.tools.list_scripts
2020-03-24 18:15:21 +00:00
security : [ ] # Disable security for this endpoint only.
2020-03-03 20:30:42 +00:00
summary : Returns an list of scripts, along with their descriptions
tags :
- Configurator Tools
responses :
'201' :
description : The list of scripts
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Script"
2019-11-19 20:57:46 +00:00
components :
2020-03-24 18:15:21 +00:00
securitySchemes :
jwt :
type : http
scheme : bearer
bearerFormat : JWT
x-bearerInfoFunc : crc.api.user.verify_token
2019-11-19 20:57:46 +00:00
schemas :
2020-02-18 21:38:56 +00:00
User :
properties :
uid :
type : string
email_address :
type : string
display_name :
type : string
2020-02-20 20:35:07 +00:00
affiliation :
type : string
eppn :
type : string
first_name :
type : string
last_name :
type : string
title :
type : string
2019-12-31 21:32:47 +00:00
DataModel :
properties :
id :
type : string
2019-12-11 21:54:24 +00:00
Study :
properties :
id :
2019-12-19 16:58:51 +00:00
type : integer
example : 1234
2019-12-11 21:54:24 +00:00
title :
type : string
example : The impact of fried pickles on beer consumption in bipedal software developers.
last_updated :
type : string
format : date_time
example : "2019-12-25T09:12:33.001Z"
2020-03-30 14:12:10 +00:00
primary_investigator_id :
2019-12-11 21:54:24 +00:00
type : string
2020-03-30 14:12:10 +00:00
example : dhf8r
2020-02-26 23:06:51 +00:00
user_uid :
type : string
example : dhf8r
2020-03-30 14:12:10 +00:00
protocol_builder_status :
2019-12-11 21:54:24 +00:00
type : string
2020-04-21 21:13:30 +00:00
enum : [ INCOMPLETE, ACTIVE, HOLD, OPEN, ABANDONED]
2020-03-30 14:12:10 +00:00
example : done
2019-12-11 21:54:24 +00:00
sponsor :
type : string
example : "Sartography Pharmaceuticals"
ind_number :
type : string
example : "27b-6-42"
2020-03-30 14:12:10 +00:00
hsr_number :
type : string
2020-03-30 18:01:57 +00:00
x-nullable : true
2020-03-30 14:12:10 +00:00
example : "27b-6-1212"
categories :
type : array
items :
$ref : "#/components/schemas/WorkflowSpecCategory"
2019-12-18 19:02:17 +00:00
WorkflowSpec :
2019-12-11 21:54:24 +00:00
properties :
id :
type : string
2020-03-16 16:10:32 +00:00
name :
type : string
2019-12-18 19:02:17 +00:00
display_name :
2019-12-11 21:54:24 +00:00
type : string
2019-12-18 19:02:17 +00:00
description :
2019-12-11 21:54:24 +00:00
type : string
2020-03-16 16:10:32 +00:00
primary_process_id :
type : string
nullable : true
Created a "StudyService" and moved all complex logic around study manipulation out of the study api, and this service, as things were getting complicated. The Workflow Processor no longer creates the WorkflowModel, the study object handles that, and only passes the model into the workflow processor when it is ready to start the workflow.
Created a Study object (seperate from the StudyModel) that can cronstructed on request, and contains a different data structure than we store in the DB. This allows us to return underlying Categories and Workflows in a clean way.
Added a new status to workflows called "not_started", meaning we have not yet instantiated a processor or created a BPMN, they have no version yet and no stored data, just the possiblity of being started.
The Top Level Workflow or "Master" workflow is now a part of the sample data, and loaded at all times.
Removed the ability to "add a workflow to a study" and "remove a workflow from a study", a study contains all possible workflows by definition.
Example data no longer creates users or studies, it just creates the specs.
2020-03-30 12:00:16 +00:00
category_id :
2020-03-16 16:10:32 +00:00
type : integer
nullable : true
workflow_spec_category :
$ref : "#/components/schemas/WorkflowSpecCategory"
is_status :
type : boolean
nullable : true
WorkflowSpecCategory :
properties :
id :
type : integer
name :
type : string
display_name :
type : string
2020-03-26 19:29:52 +00:00
display_order :
type : integer
2020-03-30 14:12:10 +00:00
workflows :
type : array
items :
$ref : "#/components/schemas/Workflow"
2019-12-27 18:50:03 +00:00
File :
properties :
id :
type : number
name :
type : string
example : "random_fact.bpmn"
version :
2020-01-31 16:33:31 +00:00
type : integer
2019-12-27 18:50:03 +00:00
last_updated :
type : string
format : date_time
example : "2019-12-25T09:12:33.001Z"
type :
2020-01-31 16:33:31 +00:00
type : string
2019-12-27 18:50:03 +00:00
primary :
type : boolean
content_type :
type : string
example : "application/xml"
workflow_spec_id :
type : string
example : "random_fact"
2020-03-20 12:21:21 +00:00
x-nullable : true
2019-12-27 18:50:03 +00:00
file :
type : file
format : binary
2019-12-11 21:54:24 +00:00
Workflow :
2019-11-19 20:57:46 +00:00
properties :
id :
readOnly : true
type : integer
format : int64
2019-12-18 19:02:17 +00:00
status :
2019-12-11 21:54:24 +00:00
type : enum
2020-02-07 16:34:44 +00:00
enum : [ 'new' , 'user_input_required' , 'waiting' , 'complete' ]
user_tasks :
2019-12-18 19:02:17 +00:00
type : array
items :
2020-02-07 16:34:44 +00:00
$ref : "#/components/schemas/Task"
2020-03-05 22:10:00 +00:00
last_task :
$ref : "#/components/schemas/Task"
next_task :
$ref : "#/components/schemas/Task"
2020-02-07 17:36:08 +00:00
workflow_spec_id :
type : string
2020-03-05 22:10:00 +00:00
spec_version :
type : string
is_latest_spec :
type : boolean
2020-03-10 19:46:14 +00:00
num_tasks_total :
type : integer
num_tasks_complete :
type : integer
num_tasks_incomplete :
type : integer
2020-02-07 16:34:44 +00:00
2019-11-19 20:57:46 +00:00
example :
2019-12-11 21:54:24 +00:00
id : 291234
2019-12-18 19:02:17 +00:00
status : 'user_input_required'
2020-03-05 22:10:00 +00:00
workflow_spec_id : 'random_fact'
spec_version : 'v1.1 [22,23]'
is_latest_spec : True
next_task :
id : study_identification
name : Study Identification
title : IRB Review
documentation : "# Heading 1\n\nMarkdown documentation text goes here"
type : form
state : ready
2019-12-11 21:54:24 +00:00
Task :
2019-11-19 20:57:46 +00:00
properties :
id :
readOnly : true
2019-12-20 19:32:04 +00:00
type : string
2019-11-19 20:57:46 +00:00
name :
type : string
2019-12-20 20:39:02 +00:00
title :
type : string
2019-12-11 21:54:24 +00:00
type :
2019-11-19 20:57:46 +00:00
type : string
2019-12-20 19:32:04 +00:00
state :
2019-12-19 16:58:51 +00:00
type : string
2019-12-11 21:54:24 +00:00
form :
2019-12-18 19:02:17 +00:00
$ref : "#/components/schemas/Form"
2019-12-20 20:39:02 +00:00
documentation :
type : string
2019-11-19 20:57:46 +00:00
example :
2019-12-20 19:32:04 +00:00
id : study_identification
name : Study Identification
2019-12-20 20:39:02 +00:00
title : IRB Review
documentation : "# Heading 1\n\nMarkdown documentation text goes here"
2019-12-20 19:32:04 +00:00
type : form
state : ready
form :
"key": "irb_review_form"
"fields" :
- "id": "irb_review_type"
"type": "enum"
"label": "Select IRB Review Type"
"options" :
- id : "emergency_use"
name : "Emergency Use"
- id : "humanitarian_device"
name : "Humanitarian Device"
- id : "non_human"
name : "Non-Human"
- id : "non_uva_agent"
name : "Non-UVA Agent"
- id : "exempt"
name : "Exempt"
- id : "non_engaged"
name : "Non-Engaged"
- id : "expedited"
name : "Expedited"
- id : "full_board"
name : "Full Board"
2020-02-18 15:14:03 +00:00
"default_value": "Full Board"
2019-12-20 19:32:04 +00:00
"validation" :
- name : "required"
config : "true"
"properties" :
- id : "description"
value : "Description text goes here"
- id : "help"
value : "# Heading 1\n\nMarkdown help text goes here"
- id : "required_expression"
value : "model.my_boolean_field_id && model.my_enum_field_value !== 'something'"
- id : "hide_expression"
value : "model.my_enum_field_value === 'something'"
2019-12-18 19:02:17 +00:00
Form :
properties :
2019-12-20 19:32:04 +00:00
key :
type : string
2019-12-18 19:02:17 +00:00
fields :
type : array
items :
$ref : "#/components/schemas/Field"
2019-12-20 19:32:04 +00:00
example :
"key": "irb_review_form"
"fields" :
- "id": "irb_review_type"
"type": "enum"
"label": "Select IRB Review Type"
"options" :
- id : "emergency_use"
name : "Emergency Use"
- id : "humanitarian_device"
name : "Humanitarian Device"
- id : "non_human"
name : "Non-Human"
- id : "non_uva_agent"
name : "Non-UVA Agent"
- id : "exempt"
name : "Exempt"
- id : "non_engaged"
name : "Non-Engaged"
- id : "expedited"
name : "Expedited"
- id : "full_board"
name : "Full Board"
2020-02-18 15:14:03 +00:00
"default_value": "Full Board"
2019-12-20 19:32:04 +00:00
"validation" :
- name : "required"
config : "true"
"properties" :
- id : "description"
value : "Description text goes here"
- id : "help"
value : "# Heading 1\n\nMarkdown help text goes here"
- id : "required_expression"
value : "model.my_boolean_field_id && model.my_enum_field_value !== 'something'"
- id : "hide_expression"
value : "model.my_enum_field_value === 'something'"
2019-12-18 19:02:17 +00:00
Field :
properties :
id :
type : string
readOnly : true
type :
type : enum
2019-12-20 19:32:04 +00:00
enum : [ 'string' , 'long' , 'boolean' , 'date' , 'enum' ]
readOnly : true
label :
type : string
2019-12-18 19:02:17 +00:00
readOnly : true
options :
type : array
items :
2019-12-20 19:32:04 +00:00
$ref : "#/components/schemas/EnumFieldOption"
2019-12-18 19:02:17 +00:00
readOnly : true
2020-02-18 15:14:03 +00:00
default_value :
2019-12-20 19:32:04 +00:00
type : string
2020-02-18 15:14:03 +00:00
readOnly : true
2019-12-20 19:32:04 +00:00
validation :
type : array
items :
$ref : "#/components/schemas/FieldValidation"
2019-12-18 19:02:17 +00:00
readOnly : true
2019-12-20 19:32:04 +00:00
"properties" :
type : array
items :
$ref : "#/components/schemas/FieldProperty"
readOnly : true
EnumFieldOption :
properties :
id :
type : string
name :
type : string
FieldValidation :
properties :
name :
type : string
config :
type : string
FieldProperty :
properties :
id :
type : string
2019-12-18 19:02:17 +00:00
value :
type : string
2019-12-20 19:32:04 +00:00
example :
id : "required_expression"
value : "model.should_require"
2019-11-19 20:57:46 +00:00
Error :
required :
- code
- message
properties :
code :
2019-12-11 21:54:24 +00:00
type : string
format : string
example : "access_denied"
2019-11-19 20:57:46 +00:00
message :
type : string
2019-12-11 21:54:24 +00:00
example : "You do not have permission to view the requested study."
2020-03-03 20:30:42 +00:00
Script :
properties :
name :
type : string
format : string
example : "random_fact"
description :
type : string
example : "Returns a random fact about a topic. Provide an argument of either 'cat', 'norris', or 'buzzword'"
2020-04-22 23:40:40 +00:00
LookupItem :
properties :
value :
type : string
format : string
example : "1000"
label :
type : string
example : "Chuck Norris"
data :
type : any