# Enable QC Checklist Generation

With the 24R1 release, Vault supports <a href="/en/gr/679956/">quality control (QC) _Checklist_ generation</a> for open _Cases_ and closed _Cases_. These _Checklists_ assist users with performing QC tasks. 

The following list outlines the required configuration in the order it must be performed: 
1. [Configure Checklists][1]
2. [Configure the Case Object Layout][6]
3. [Add the Start Checklist User Action to the Case Lifecycle][2]
4. [Replace the Start Checklist User Action][3]
5. [(Optional) Configure Case Lifecycle Entry Criteria to Consider Only Completed QC Checklists][4]
6. [Configure the Checklist Creation Rule Object Layout][5]
7. [Enable the Post-Closure QC Interval Setting][7]
8. [Update the Case Accepted Workflow][18]
9. [Grant Permissions][19]

After completing the configuration on this page, see <a href="/en/gr/679957/">Configure QC Checklist Creation Rules</a> for instructions on setting up sampling and rule criteria for _Checklist_ generation. 

### 24R3 Update: QC Checklist Updates

With the 24R3 release, you can add the _Execute Checklist Rules_ action as a workflow step or user action. See the following sections to configure your Vault for the updated feature:
* [(24R3) Add the Execute Checklist Rules Workflow Step][15]
* [(24R3) Add the Execute Checklist Rules User Action][16]

## Configure Checklists {#configure-checklists}

To configure _Checklists_ in your Vault: 
1. [Add the QC Checklists Picklist to the Checklist Type][8]
2. [Add User Actions to the Checklist Design Lifecycle ][9]
3. [Create a Checklist Design][10]
4. [Change the Checklist Design State to Approved][12]

### Add the QC Checklists Picklist to the Checklist Type {#add-qc-checklists-picklist}

To add the _QC Checklists_ picklist value to all _Checklist_ types:
1. Navigate to **Business Admin >** **Picklists > Checklist Type (checklist_type__sys)**.
2. Under the _Picklist Values_ section, select **Create**.  
3. In the _Create Picklist Value_ dialog, complete the following information: 
    * **Picklist Value Label**: Enter `QC Checklists`.
    * **Insert Picklist Value to a Specific Position**: Select **No**.
5. Repeat the above steps to create the following picklist values if they don't already exist:
    * _MR Checklist_
    * _FR Checklist_
6. Select **Save**.

For more information, see Vault's <a href="/en/gr/47738/#checklist-type">Configuring Checklists: Checklist Type (Picklist)</a>.

### Add User Actions to the Checklist Design Lifecycle {#add-user-action-checklist-design-lifecycle}

Navigate to **Admin > Configuration > Object Lifecycles > Checklist Design Lifecycle** and add the following <a href="/en/gr/59885/#define-actions">user actions</a> and <a href="/en/gr/59885/#define-entry-action">entry action</a> on the following states of the _Checklist Design Lifecycle_: 

<table>
    <thead>
        <tr>
            <th>State</th>
            <th>Action Type</th>
            <th>Conditions</th>
            <th>Action Label</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="2"><em>Draft</em></td>
            <td>User action</td>
            <td>Always > Change State to Approved</td>
            <td><code>Change State to Approved</code></td>
        </tr>
        <tr>
            <td>User action</td>
            <td>Always > Upload Design Configuration</td>
            <td><code>Upload Design Configuration</code></td>
        </tr>
        <tr>
            <td rowspan="2"><em>Approved</em></td>
            <td>User action</td>
            <td>Always > Create New Version</td>
            <td><code>Create New Version</code></td>
        </tr>
        <tr>
            <td>Entry action</td>
            <td>Always > Make previous checklist design version superseded</td>
            <td>N/A</td>
        </tr>
    </tbody>
</table>

### Create a Checklist Design {#create-checklist-design}

You can create a _Checklist Design_ using the <a href="/en/gr/537448/">Visual Checklist Designer</a> for testing purposes and to ensure the basic _Checklist_ functionality is correctly configured before using _Checklists_ in your QC processes. 

### Change the Checklist Design State to Approved {#change-checklist-design-state-approved}

In the created _QC Checklist_, change the lifecycle state from **Draft** to **Approved**. 

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: To change a <em>Checklist Design’s</em> lifecycle state to <em>Approved</em>, the <em>Checklist Design</em> must have at least one section, one question, and one answer.</p>
    </div>
  </div>
</div>



## Configure the Case Object Layout {#configure-case-layout}

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: If you have reached the maximum number of sections on the <em>Case</em> layout, skip the instructions in this section and instead, <a href="#create-qc-layout">create a <em>QC</em> layout</a>.</p>
    </div>
  </div>
</div>



To update the _Case_ object layout:
1. Navigate to **Admin > Configuration > Objects > Case > Layouts > [Case Layout]**.
2. Insert the _Case Checklist_ <a href="/en/gr/26387/#related-object">related object section</a> with the following information:
    * **Related Object**: Case Checklist
    * **Section Label**: Case Checklists
    * **Section Name**: case_checklists
    * **Creation Option**: Prevent record creation
4. Select **Done**.
5. Select **Save**.

### (Optional) Configure the Case Object Layout for Post-Closure Checklists

If enabling post-closure _Checklists_, follow the steps below to update the _Case_ object layout:
1. Navigate to **Admin > Configuration > Objects > Case > Layouts > [Case Layout]**.
2. Insert the _Case Checklist Rule Assignment_ <a href="/en/gr/26387/#related-object">related object section</a> with the following information:
    * **Related Object**: Case Checklist Rule Assignment
    * **Section Label**: Case Checklist Rule Assignments Checklists
    * **Section Name**: case_checklist_rule_assignments_checklists
    * **Creation Option**: Prevent record creation
4. Select **Done**.
5. Select **Save**.

## (Optional) Create the QC Layout on the Case Object {#create-qc-layout}

If you have reached the maximum number of sections on the _Case_ layout, create a new _QC_ layout on the _Case_ object:
1. Navigate to **Admin > Configuration > Objects > Case > Layouts**. 
2. Select **Create**. 
3. In the _Add Layout_ dialog, complete the following information: 
    * **Object Type**: Case
    * **Layout Label**: QC
    * **Layout Name**: qc_layout 
4. Select **Done**.
5. In the _QC_ layout, <a href="/en/gr/26387/#how-to-add-pages">create the following pages</a>:
    * _QC_
    * _Activities_
6. On the _QC_ page in the _Details_ section, ensure the following fields appear: 
    * _Report Type_
    * _Reporter Country_
    * _Organization_
    * _Event Country_
    * _Intake Format_
    * _Intake Method_
7. Remove and add fields as needed. 
8. Use the following table to add fields and <a href="/en/gr/26387/#how-to-add-sections">insert sections</a> to the _QC_ and _Activities_ pages:

<table>
    <thead>
        <tr>
            <th>Page</th>
            <th>Section Type</th>
            <th>Section Label</th>
            <th>Section Name</th>
            <th>Other Information</th>
            <th>Fields/Columns</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="3"><em>QC</em></td>
            <td>Detail Form</td>
            <td>Narrative</td>
            <td>narrative</td>
            <td><strong>Section Layout</strong>: Detail Form - One Column</td>
            <td><ul>
                    <li>Narrative Preview</li>
                </ul>
                Add other fields as needed.
            </td>
        </tr>
        <tr>
            <td><img class="inline" src="https://platform.veevavault.help/assets/images/saf-app-control.png" alt="Slider icon" style="" />Timeline</td>
            <td>Case Timeline</td>
            <td>case_med_review_tl_section_control</td>
            <td>N/A</td>
            <td>Add as needed.</td>
        </tr>
        <tr>
            <td>Related Object > Case Checklist</td>
            <td>Review Checklists</td>
            <td>review_checklists</td>
            <td><strong>Creation Option</strong>: Prevent record creation</td>
            <td>Add as needed.</td>
        </tr>
        <tr>
            <td rowspan="3"><em>Activities</em></td>
            <td><img class="inline" src="https://platform.veevavault.help/assets/images/saf-app-control.png" alt="Slider icon" style="" />Validation Results (Failures & Warnings)</td>
            <td>Validations</td>
            <td>case_validation_results_control</td>
            <td>N/A</td>
            <td>Add as needed.</td>
        </tr>
        <tr>
            <td>Related Object > User Task</td>
            <td>Action Items</td>
            <td>user_tasks</td>
            <td><ul>
                    <li><strong>Creation Option</strong>: Create record in pop-up dialog</li>
                    <li><strong>Criteria VQL</strong>: <code>object_type__vr.api_name__v CONTAINS ('case_task__v')</code></li>
                    <li>Select <strong>Apply on Create</strong></li>
                </ul>
            </td>
            <td>Add as needed.</td>
        </tr>
        <tr>
            <td>Related Documents > Case</td>
            <td>Documents</td>
            <td>documents</td>
            <td>N/A</td>
            <td>Add as needed.</td>
        </tr>
    </tbody>
</table>

After creating the _QC_ layout, <a href="/en/gr/582159/#how-to-create-layout-profiles">create an applicable layout profile</a> and <a href="/en/gr/582159/#how-to-add-users">assign users</a> to the profile as needed.

## Add the Start Checklist User Action to the Case Lifecycle {#add-start-checklist-user-action}

To test the functionality of the [default QC _Checklist_][10], add the _Start checklist_ <a href="/en/gr/59885/#define-actions">user action</a> to the _QC_ state of the _Case_ object lifecycle using the following information:
* Always > Start checklist 
    * **Checklist Type**: _QC Checklists_
    * **Action Label**: `Start checklist`

### Test the Start Checklist User Action {#test-start-checklist-action}

After configuring the _Start checklist_ action, create a QC _Checklist_ using the _Start checklist_ <a href="/en/gr/59885/#define-actions">user action</a> on a _Case_ in _QC_ state to ensure a _Checklist_ can be generated. You should see a generated _Checklist_ in the _Checklists_ section of the _Case_. 

## Replace the Start Checklist User Action {#replace-user-action}

After [testing the _Start checklist_ user action][13] to ensure a _Checklist Design_ was successfully selected and a _Checklist_ was successfully generated for the _Case_, you can [remove][20] the _Start checklist_ user action and add the _Execute Checklist Rules_ action as one of the following: 
* A [workflow step][21]: Recommended when the _Case_ workflow is initiated using the workflow user action and if <a href="/en/gr/01170/">_Case_ locking</a> is being used.
* A [user action][22]: Recommended if _Case_ locking is not being used.
* An [entry action][23]: Recommended if the _Case_ will be locked to a user before it enters the _QC_ lifecycle state.

This action uses configured <a href="/en/gr/679957/">_Checklist Creation Rules_</a> to generate a _Checklist_.

### Remove the Start Checklist User Action {#remove-start-checklist-user-action}

To remove the _Start checklist_ user action from the _Case_ object lifecycle, navigate to **Admin > Configuration > Object Lifecycles > Case Lifecycle > QC** state and select **Edit** next to the _User Actions_ section.

### (24R3) Add the Execute Checklist Rules Workflow Step {#execute-checklist-rules-wf-step}

To configure the _Execute Checklist Rules_ workflow step for the desired _Case_ workflow:
1. Navigate to **Admin > Configuration > Workflows > [Workflow]**.
2. In the _Workflow Steps_ section, select **Create**.
3. On the _Create Step_ page _Details_ section, enter the following:
    * **Label**: Enter a label for this workflow step.
    * **Type**: Select **System Action**.
    * **Next Steps**: Select a workflow step to follow the newly created step.
4. Under the _System Action Options_ section, select **Execute Checklist Rules**.
5. Select **Save**.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: For this workflow step to run successfully, the <em>Case</em> must be <a href="/en/gr/01170/">assigned and locked</a> to a user.</p>
    </div>
  </div>
</div>



### (24R3) Add the Execute Checklist Rules User Action {#execute-checklist-rules-user-action}

To configure the _Execute Checklist Rules_ user action, <a href="/en/gr/43127/#assign-actions">assign</a> the action to the _Case_ object and add the action as a <a href="/en/gr/59885/#define-actions">user action</a> to the _QC_ state.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: If the <em>Case</em> from which this action was run is <a href="/en/gr/01170/">locked</a> to another user, Vault assigns the generated <em>Checklists</em> to this user instead of the user who ran the action.</p>
    </div>
  </div>
</div>



### Add the Execute Checklist Rules Entry Action {#execute-checklist-rules-entry-action}

To ensure Vault generates a QC _Checklist_ for a _Case_ upon entering the _QC_ lifecycle state, add the _Execute Checklist Rules_ <a href="/en/gr/59885/#define-entry-action">entry action</a> to the _QC_ state of the _Case_ object lifecycle.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: For this entry action to run successfully, the <em>Case</em> must be <a href="/en/gr/01170/">assigned and locked</a> to a user.</p>
    </div>
  </div>
</div>



## (Optional) Configure Case Lifecycle Entry Criteria to Consider Only Completed QC Checklists {#optional-configure-case-lifecycle}

We recommend you configure <a href="/en/gr/59885/#entry_criteria">entry criteria</a> on the _Case_ lifecycle to prevent the _Case_ from moving forward if the QC _Checklist_ is not complete:
1. Navigate to **Admin > Configuration > Object Lifecycles > Case Lifecycle > [State]**.
2. Add the following entry criteria: 
    * Always > State of Related record > Checklists > All records equal > Completed
        * Select the **Conditions On Related Records** checkbox.
            * Object Type > includes > Case Checklist
3. Select **Save**. 

## Configure the Checklist Creation Rule Object Layout {#configure-checklist-creation-rule-layout}

To configure the _Checklist Creation Rule_ object layout: 
1. Navigate to **Admin > Configuration > Objects > Checklist Creation Rule > Layouts > Checklist Creation Rule Detail Page Layout**.
2. Insert the following <a href="/en/gr/26387/#related-object">related object sections</a>:
    * **Checklist Creation Rule Criteria**
        * **Related Object**: Checklist Creation Rule Criteria
        * **Section Label**: Checklist Creation Rule Criteria
        * **Section Name**: checklist_creation_rule_criteria
    * **Case Checklist Rule Assignment**
        * **Related Object**: Case Checklist Rule Assignment
        * **Section Label**: Case Checklists Created with this Rule
        * **Section Name**: case_checklists_created_with_this_rul
3. Select **Save**. 

## Enable the Post-Closure QC Interval Setting {#set-post-closure-qc-interval-setting}

To enable the <a href="/en/gr/740208/#qc">_Post-Closure QC Interval_ setting</a>:

1. Navigate to **Admin > Settings > Safety General Settings**.
2. Select **Edit**.
3. In the _Post-Closure Quality Control_ section, select a _Post-Closure QC Interval_ to define the interval at which Vault should identify closed _Cases_ for post-closure QC _Checklist_ generation:
   * **Daily**: Runs every day for the previous day.
   * **Weekly**: Runs every Monday for the previous week.
   * **Monthly**: Run the first day of every month for the previous month.
4. Select **Save**. 

When Vault generates QC _Checklists_ for <a href="/en/gr/679956/#post-closure-checklists">post-closure _Cases_</a>, Vault generates a CSV log file and adds it as an attachment to the applicable <a href="/en/gr/679957/#rules">_Checklist Creation Rule_</a>.

## Update the Case Accepted Workflow {#case-accepted-wf}

To update the _Case Accepted_ workflow, which will be used to complete QC _Checklists_:
1. Navigate to **Admin > Configuration > Workflows > Case Accepted**.
2. Configure the workflow according to <a href="/en/gr/66930/#accepted_workflow">Configuring Checklist Workflows</a>. 
3. After configuring the workflow, select **Make configuration active**.

## Grant Permissions {#permissions}

To allow users access to use this feature, configure: 
* [Object permissions][24]
* [Sharing rules][25]

### Object Permissions {#object-permissions}

Ensure your <a href="/en/gr/22824/#objectpermissions">permission sets</a> are updated to grant the appropriate level of access for users to objects and object types according to your organization's process. Manage object permissions from **Admin > Users & Groups > Permission Sets > \[Permission Set] > Objects > \[Object]**.

The following table summarizes the objects and object types to use this feature and the recommended level of access for your permission sets:

<table>
    <thead>
        <tr>
            <th>Objects</th>
            <th>Object Types</th>
            <th>Permissions</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="2"><em>Case Checklist</em></td>
            <td><em>Base Case Checklist</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><em>Case Checklist</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                    <li><em>Create</em></li>
                    <li><em>Edit</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td rowspan="5"><em>Case Response</em></td>
            <td><em>Base Case Response</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><em>Date Response</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                    <li><em>Edit</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><em>Multiple Choice Response</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                    <li><em>Edit</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><em>Number Response</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                    <li><em>Edit</em></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><em>Text Response</em></td>
            <td><ul>
                    <li><em>Read</em></li>
                    <li><em>Edit</em></li>
                </ul>
            </td>
        </tr>
    </tbody>
</table>

### (Optional) Sharing Rules {#sharing-rules}

You can configure custom sharing rules to provide certain users or user groups _Read_ access to _Case Checklists_: 
1. Navigate to **Admin > Configuration > Objects > Case Checklist > Sharing Rules**. 
2. Select **Create**. 
3. On the _New Sharing Rule_ page, enter a name for the rule in the _Label_ field, for example, `Viewer Access`.
4. Select **Save**. 
5. In the _Roles_ section, select **Add** and complete the following fields: 
    * **Role**: Select **Viewer**. 
    * **Users and Groups**: Select a user or user group, for example, _Case Processing_. \
    Repeat this step as applicable.
6. Select **Save**.

## Next Steps

After completing the configuration on this page, you must <a href="/en/gr/679957/">configure QC Checklist Creation Rules</a>, which are based on _Checklist Creation Rule Criteria_ and sampling. Vault uses these _Checklist_ rules to generate a _Checklist Design_ specific to each _Case_. 

We recommend testing your configuration by creating a sample _Checklist Creation Rule_ and then running this rule for <a href="/en/gr/679956/#in-process-checklists">in-process</a> then <a href="/en/gr/679956/#post-closure-checklists">post-closure</a> _Cases_. 

You can also [create more _Checklist Designs_][10] for different use cases. For example, in-process clinical _Cases_, in-process spontaneous _Cases_, post-closure clinical _Cases_, post-closure spontaneous _Cases_, and Product-specific _Cases_.  

### Manually Test Post-Closure QC Checklists

Vault generates post-closure QC _Checklists_ at the interval defined by the [_Post-Closure QC Interval_ setting][7]. However, for intervals set to _Weekly_ and _Monthly_, you can manually generate post-closure QC _Checklists_ for testing purposes without the need to wait until the end of the configured interval. For a _Case_ to be eligible, they must first be closed to ensure Vault sets the _Process Completion Date_. Manual interval testing requires the _Process Completion Date_ values to be from the previous day(s) relative to the UTC.

To manually generate post-closure QC _Checklists_ for testing purposes:
1. Navigate to **Admin > Settings > Safety General Settings**.
2. In the _Post-Closure Quality Control_ section, select **Generate Post-Closure QC Checklists**.

Vault displays a message to notify you the job has begun and sends you a notification when the job completes. If you trigger the action multiple times, Vault consecutively runs each job in a queue.

[1]: #configure-checklists
[2]: #add-start-checklist-user-action
[3]: #replace-user-action
[4]: #optional-configure-case-lifecycle
[5]: #configure-checklist-creation-rule-layout
[6]: #configure-case-layout
[7]: #set-post-closure-qc-interval-setting
[8]: #add-qc-checklists-picklist
[9]: #add-user-action-checklist-design-lifecycle
[10]: #create-checklist-design
[11]: #set-up-questions-answers
[12]: #change-checklist-design-state-approved
[13]: #test-start-checklist-action
[14]: #optional-create-the-qc-action-layout-on-the-case-object
[15]: #execute-checklist-rules-wf-step
[16]: #execute-checklist-rules-user-action
[17]: #next-steps
[18]: #case-accepted-wf
[19]: #permissions
[20]: #remove-start-checklist-user-action
[21]: #execute-checklist-rules-wf-step
[22]: #execute-checklist-rules-user-action
[23]: #execute-checklist-rules-entry-action
[24]: #object-permissions
[25]: #sharing-rules