# On-Demand Workflows

{% hint style="warning" %}
There is **developer work** in the database required to set up workflows. Developers can see additional details here: <https://elentra.atlassian.net/browse/ME-1554> and <https://elentra.atlassian.net/browse/ME-1935>
{% endhint %}

Setting up on-demand workflows allows you to configure forms so that Elentra users can initiate a form when needed without administrative staff creating a distribution. You can use workflows to:

* allow users to initiate assessment tasks (EPA-based and other), and
* allow **learners** to initiate rotation and faculty evaluations.

If there are forms you do not want users to be able to initiate on-demand, simply set the workflow to None.

You will need to decide as an organization how you want to use workflows and provide the relevant information to your developers for them to appropriately set up the database.

Sample uses include:

* Allow learners or faculty to initiate CBME assessments (e.g. Supervisor form) on demand
* Allow learners or faculty to initiate any generic assessment form on demand
* Allow learners to initiate faculty evaluations on demand
* Allow learners to initiate rotation evaluations on demand

You can watch a recording about Workflows at [collaborate.elentra.org](https://collaborate.elentra.org/community/elentra-learn) (login required).

There are some things to note about using on-demand workflows:

* **Forms will only show on the Start Assessment screen if they have an affiliated workflow.** If a form's workflow is set to None it will not be available on demand and should be used only in distributions.
* **To use on-demand workflows, all forms associated with a workflow must be permissioned to a course.**
* **Only learners should be set up to initiate faculty and rotation evaluations on demand**. This is because Elentra uses learners' schedules to determine which forms they should be able to access. There is no user interface to support faculty completing standard course and faculty evaluation forms.

{% hint style="info" %}
Please note that in addition to the types of workflows that an organisation may enable, additional form **types** can also be added to an organization. These include Standard Faculty Evaluation and Standard Rotation Evaluation forms. These form types are not prerequisites to use workflows, **however**, if an organization wants to use automated rotation evaluations (based on a rotation schedule and configured when building a rotation), they must use a Standard Rotation Evaluation form.
{% endhint %}

## **Workflow Types**

1. **EPA** - This is designed specifically for organizations using CBME. Use for forms tagged to EPAs that you want learners to be able to trigger. Forms using the EPA workflow contribute to CBME dashboards. Please note that forms generated from CBME form templates (e.g., supervisor form) will automatically have an EPA workflow added to them.
2. **Other Assessment Form** - Use for forms that you want learners to be able to trigger and complete on demand without tagging to EPAs, or forms that you don't want to appear in the EPA list when triggering. Can be applied to both forms tagged with EPAs/milestones **and** forms that are not tagged with EPAs/milestones. Only forms with EPAs/milestones tagged will contribute to CBME Learner and Program dashboards.
3. **Faculty Evaluation** - Use for faculty evaluations. **Learners** can initiate on demand. A date range is included when triggered. Optionally use with standard faculty evaluation form types.
4. **Rotation Evaluation** - Use only for rotation evaluations and when scheduling learners in rotations using the Clinical Experience Rotation Scheduler. **Learners** can initiate on demand. Optionally use with standard faculty evaluation form types.
   * Note: Learners can only evaluate rotations that they have completed or are currently in. They cannot initiate an evaluation for a rotation scheduled in the future.
5. **None -** Use for forms that you do not want users to be able to initiate on demand. You can still attach these forms to distributions. You can still tag EPAs or milestones as needed.

### Optional Automatic Expiry Date for On-Demand Tasks

An organization can apply expiry dates to on-demand tasks for specific workflows using a database setting (cbme\_ondemand\_expiry).

Organizations must additionally define which workflows will have the automatic expiry dates applied to them (cbme\_ondemand\_expiry\_workflow\_shortnames) and when tasks will expire. By default, Elentra will apply an expiry date 7 days after the task is generated. Organizations can modify this via a database setting (cbme\_ondemand\_expiry\_offset).

This tool also includes support for administration users to [reset expiry dates manually from the assessments interface](https://docs.elentra.org/learn-elentra-me/assessment-evaluation/program-coordinator-use-of-a-and-e/extend-expiry-dates). Program coordinators and course directors can view expired assessments which have a visual indicator that they have expired. A Reset button can optionally be used to reset the expiry date for the task.

### Assessment Methods

**Email blank form**

* Elentra will send the assessment task to the assessor to be completed at a later time.

{% hint style="info" %}
If a learner has initiated a task to send to an assessor, the timing of its delivery is controlled by a behind the scenes task called a cron job. Typically the default setup is for the cron job (send-queued-notifications) to run every 10 minutes. This means if a learner initiates a task using the complete and confirm via email method at 8:30, the assessor might not receive the task until 8:40. If this timing should be adjusted, you must speak with a developer at your institution.
{% endhint %}

**Complete and confirm via email**

* The learner can begin the assessment (i.e., fill in some of the form information) and then send it via email for the assessor to complete and confirm at a later time.

**Complete and confirm via PIN**

* Assessors must have a [PIN configured in their user profile](https://docs.elentra.org/learn-elentra-me/user-tools/profile-preferences#set-user-pin) for a learner to select this option.

**Complete In-Person with Email Receipt**

* The learner starts an assessment with themselves as the target.
* The assessor fills out the assessment on the learner's device.
  * The assessor can submit the assessment and a receipt will be emailed to the assessor confirming the assessment including a link.
  * The assessor can save the assessment as a draft and a receipt will be emailed to the assessor including a link to the draft.

**Self Assessment, then email blank form**

* The learner completes the assessment and then the assessor gets a blank copy to also complete.
* If a course is using a learner or program dashboard, the learner's self-assessment will not count towards their form completion totals or assessment plan requirements.
* There isn't any existing report or view option that is available in the UI that allows for an easy review of the learner's self-assessment and the assessor's completed form. For organizations that want to complete research on these tasks (e.g., compare a learner self-assessment and a faculty assessment), you'll need a developers help to pull the relevant data from the Elentra database.

## User Experience

Faculty and learners click the green Start Assessment/Evaluation button on their dashboard to access a form using a workflow. Learners may see two tab menus: one for Start Assessment/Evaluation and one for Adhoc Distributions. To use a workflow they should click 'Start Assessment/Evaluation'.

* Select a workflow (options available will depend on how you have configured workflows in your database).
* Remaining steps will depend on the workflow selected.

![](https://1986140690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FayN3HSBiNqeeT0QDZ9TB%2Fuploads%2Fgit-blob-fd3a005a4858027f16409d7c48a092d8501c4b61%2FScreen%20Shot%202020-08-06%20at%201.32.32%20PM%20\(1\).png?alt=media)

{% hint style="info" %}
Note that there is a database setting to control whether learners can add an external assessor when initiating an on demand task (setting = cbme\_ondemand\_start\_assessment\_add\_assessor). If you don't see an option for learners to an external assessor and you'd like to, you'll need help from a developer.
{% endhint %}

## Developer Information for Workflows

{% hint style="warning" %}
Developers can see additional details here: <https://elentra.atlassian.net/browse/ME-1554> and <https://elentra.atlassian.net/browse/ME-1935>
{% endhint %}

To allow the use of form workflows in an organization, some setup is required. You need to associate form types with workflows, and, if necessary, restrict the user groups who can access specific workflows.

You can review the available form types in `cbl_assessments_lu_form_types` If your organization wants to use **standard rotation evaluation or standard faculty evaluation forms**, you will need to **add** those to the database and associate them with the correct audience.

| form\_type\_id | title                             |
| -------------- | --------------------------------- |
| 1              | Generic Form                      |
| 2              | Supervisor Form                   |
| 3              | Field Note Form                   |
| 4              | Procedure Form                    |
| 5              | PPA Form                          |
| 6              | Rubric Form                       |
| 7              | Standard Rotation Evaluation Form |
| 8              | Standard Faculty Evaluation Form  |
| 9              | Housing Form                      |
| 10             | Smart Tag Form                    |

Specific workflows are listed in `cbl_assessments_lu_form_workflows`

| form\_workflow\_id | Workflow type                           |
| ------------------ | --------------------------------------- |
| 1                  | Entrustable Professional Activity (EPA) |
| 2                  | Other Assessment Form                   |
| 3                  | Faculty Evaluation                      |
| 4                  | Rotation Evaluation                     |
| 5                  | None                                    |
| 6                  | Smart Tag                               |

`cbl_assessments_lu_form_type_workflow_link` acts as a junction table to associate form workflows with form types.

The migration that runs will assign a workflow of None to all form types. How you configure things depends on how your organization will use workflows. For example, in a CBME setup you could associate Supervisor Forms with the EPA workflow. You could associate Generic Forms with Other Assessment Form workflow. How you set this up depends on how you want to allow users to initiate forms on demand.

Finally, `cbl_assessments_lu_form_workflow_groups` is responsible for restricting access to a specific workflow to specific user groups.

* The migration that runs will populate this table so that by default, only students can initiate`Faculty Evaluation` or `Rotation Evaluation` workflows on demand.
* Any form and user group combination added to this table creates exclusive rights for those user groups to access a form workflow.
* If no workflow is associated with a user group, then all user groups should be able to initiate that workflow on demand.

{% hint style="info" %}
There are several additional database setting options available when using workflows. These include:

* cbme\_ondemand\_start\_assessment (enabled by default)
* cbme\_ondemand\_start\_assessment\_director\_as\_staff\_workflow (disabled by default, if enabled allows faculty directors to get staff workflow view)
* cbme\_ondemand\_start\_assessment\_replace\_admin\_trigger (disabled by default, if enabled changes the Trigger Assessment button on /admin/assessments to use the workflow view)
  {% endhint %}
