# Configuring System Suitability Testing

System Suitability Testing allows Lab Analysts to perform tests on Quality Control Samples alongside normal *Lab Samples* in order to confirm that the lab's systems are functioning as expected and providing accurate results. Configuring this feature for use requires setup by a Vault Admin.

## Configuration Steps

In order to enable System Suitability Testing, a Vault Admin must complete the following steps:

1. Navigate to **Admin > Configuration > Object Lifecycles > Lab Test Set Lifecycle** and add a new workflow <a href="/en/gr/59885/#user-actions">user action</a> called *Invalidate Workflow* to the following states:
    1. **In Progress**
    2. **In Verification**
2. Navigate to **Admin > Configuration > Objects** and make changes to the following objects:
    3. **Lab Sample**: Activate the **Quality Control Sample** object type.
    4. **Lab Test Set**:
        1. Enable the **Enable Signatures** option.
        2. On the **Actions** tab, ensure that the *Begin Test* and *Resume Test* actions are set to the **Active** status.
        3. On the <a href="/en/gr/26387/">**Page Layout**</a> tab:
            1. Add the following fields to the *Details* section: **Test Definition**, **Conforms**, **Non Conforming Sample Type**
            2. Add the following additional fields: **Invalid**, **New Test Set**, **Previous Test Set**, **Invalid Reason**, **Invalid Reason Category**. Optionally, you can create a new section called *Invalid Test Set* or something similar to house these fields.
            3. Remove the **Test Instructions** field.
            4. Add a new **Spec Execution** related object section.
            5. Inactivate the layout rule that hides the *Workflow Timeline* section.
            6. Add a new **Lab Test Set Result** related object section.
3. Return to **Admin > Configuration > Object Lifecycles > Lab Test Set Lifecycle** and complete the following steps:
    1. In the *Roles* section, add the **Contributed to Test Execution** role. Without this, users who update *Inputs* or *Lab Test Results*, or *Lab Test Set Results* are not added to the role.
    2. On the **Active** state, add the **Begin Test** <a href="/en/gr/59885/#user-actions">user action</a>.
    3. On the **In Progress** state, add the **Resume Test** <a href="/en/gr/59885/#user-actions">user action</a>.
    4. On the **In Review State**, add the **Review Lab Test** <a href="/en/gr/59885/#user-actions">user action</a>. This allows the reviewer to perform the workflow from this state.
    5. On the **Rejected** state, add an <a href="/en/gr/59885/#entry-actions">entry action</a> that performs the following operations:
       1. Change state to **Rejected** for records that are related by *Lab Tests.*
       2. Set the **Invalid** field to **true** using a formula. This also updates the *Invalid* field for *Test Set Results* and *Test Set Results Criteria*.
       3. Change the *Spec Execution Related Object* Lifecycle state to **Rejected** if the Lifecycle state is not *Logged*. This changes the *Spec Execution* for the QC Sample to *Rejected*. The *Logged* state ensures that *Operational Criteria Spec Execution* is not erroneously moved to the *Rejected* state.
4. Navigate to **Admin > Configuration > Object Lifecycles > Spec Execution Lifecycle** and complete the following steps:
    1.  On the **Rejected** state, add an <a href="/en/gr/59885/#entry-actions">entry action</a> that performs the following operations:
        1. If *Spec Execution Type* equals *Quality Control Sample*, change the *Lab Sample's* state to **Rejected**.
5. Navigate to **Admin > Configuration > Objects** and make changes to the following objects:
    1.  **Spec Execution**
        1. Activate the **Quality Control Sample** object type.
        2. On the <a href="/en/gr/26387/">**Layouts**</a> tab, add the **Test Set** field to the page layouts for the *Operational Criteria* and *Quality Control Sample* object types.
    2.  **Spec Data**
        1. On the <a href="/en/gr/26387/">**Layouts**</a> tab, add a **Lab Test Definition Criteria** section to the layouts for the *Batch Release* and *Stability* object types.
    3.  **Spec Data Sample Action**
        1. On the **Fields** tab, add a **Lab Test Definition Variation** object field with the following VQL criteria: `qc_sample_type__v = null`
    4.  **Lab Test**
        1. On the **Lab Sample** field, add the following VQL criteria: `object_type__vr.name__v != 'quality_control_lab_sample__v'`
    5.  **Lab Test Definition Criteria**
        1.  On the <a href="/en/gr/26387/">**Layouts**</a> tab:
            1.  Add layout rules to hide fields if variation exists. (These should mimic the *Spec Data Criteria* layout rules: hide for variations, hide for no variations.)
            2.  Create new layouts for the *Operational Criteria* and *Quality Control Sample Criteria* object types. Mimic the *Spec Data Criteria* layout and layout rules.
            3.  Add a **Criteria** formula field.
            4.  Add a **Version History** control section.
            5.  Add a **Variation Result to Evaluate** field.
            6.  Add the following layout rules:
                1. **Rounding Rule** `if(not(isBlank(lims_variation_result_to_evaluate__v)),lims_variation_result_to_evaluate__vr.rounding_rule__v,lims_result_to_evaluate__vr.rounding_rule__v)`
                2. **Precision Type** `if(not(isBlank(lims_variation_result_to_evaluate__v)),lims_variation_result_to_evaluate__vr.precision_type__v,lims_result_to_evaluate__vr.precision_type__v)`
                3. **Precision** `if(not(isBlank(lims_variation_result_to_evaluate__v)),lims_variation_result_to_evaluate__vr.precision_number__v,lims_result_to_evaluate__vr.precision_number__v)`
                4. **Notation** `lims_result_to_evaluate__vr.notation__v`
        2.  On the **Fields** tab:
            1.  Configure the following <a href="/en/gr/772652/">picklist dependencies</a>:
                1. **Indication**: Only Alert for the *Test Definition Criteria* object types, *Operational Criteria* and *Quality Control Sample Criteria.*
                2. **Purpose**: *Internal*. *Internal* is also set as the default value.
            2.  On the **Result to Evaluate** field, add the following VQL criteria:
                1. *Quality Control* object type: `result_level__v != 'test_set__v'`
                2. *Operational Criteria* object type: `result_level__v = 'test_set__v'`
                3. Set the **Name** field as <a href="/en/gr/30986/">system managed</a>.
6. <a href="/en/gr/1269/#inactive">Activate</a> the standard picklist values for **Purpose** and delete the custom picklist values.
7. Return to to **Admin > Configuration > Objects** and make the following changes:
    1.  **Lab Test Definition**: On the **Layouts** tab, add **Lab Test Definition Criteria** as a related object section.
    2.  **Lab Test Definition Variation:**
        1.  On the _Layout_ tab:
            1.  Add **Lab Test Definition Criteria** as a related object section.
                1.  Add the following VQL criteria and click **Apply on Create**: `object_type__vr.api_name__v = 'qc_sample_criteria__v'`
            2.  Add the following layout rules:
                1.  **Hide QC sample type**
                    1. **Expression**:` mode_of_entry__v != 'test_execution__v'`
                    2. **Hide**: *Lab Test Definition Criteria* section and QC Sample Type field
                2.  **Hide criteria for non-QC sample type**
                    1. Expression:` isBlank(qc_sample_type__v)`
                    2. Hide: *Lab Test Definition Criteria* section
    3.  **Lab Sample**: 
        1.  On the *Object Types* tab:
            1.  <a href="/en/gr/32857/#assign">Assign</a> custom fields (like `state_c`) to the **Quality Control Lab Sample** object type.
            2.  Set the **Quality Control Lab Sample** object type to **Active**.
            3.   <a href="/en/gr/32857/#how-to-set-up-object-type-picklists">Override</a> the **Quality Control Sample Type** picklist to add all picklist values to the QC Sample object type.
        2.  On the <a href="/en/gr/26387/">*Layouts*</a> tab:
            1.  Add a new **Quality Control Lab Sample** page layout.
                1.  Activate the **Lab Sample Name** field.
8. Configure the following <a href="/en/gr/47850/">Atomic Security</a> for the *Test Set* Lifecycle:
    1.  **Active** state: *Begin Test* action role override: Editor, LIMS Lab Analyst
    2.  **In Progress** state: *Begin Test* action role override: Editor, LIMS Lab Analyst
    3.  **Roles**: READ to LIMS Analyst
9. Update the following <a href="/en/gr/23647/">Permission Sets</a>:
    1.  **LIMS User**
        1.  **READ** and **EDIT**: *Lab Sample* object > *Quality Control Sample* object type
        2.  **READ**: *Lab Test Definition Criteria* object > *Quality Control Sample Criteria* and *Operational Criteria* object types
        3.  **READ**: *Spec Execution* object > *Quality Control Sample* and *Operational Criteria* object types
    2.  **LIMS Results Data Entry** (If needed)
        1.  **EDIT**: *Invalid Reason* and *Invalid Category* fields on the **L***ab Test Set* object
    3.  **Design Data Admin**
        1.  **VIEW**: *Test Definition Version History* control and *Criteria* control on the *Lab Test Definition Criteria* object
        2.  **VIEW**: *Lab Test Definition Criteria* object control on the *Spec Data* object