# Configuring the Quality-Clinical Operations Connection

Organizations using both a Clinical Operations Vault and a Quality Vault can utilize a connection between the two Vaults to automatically transfer _Study_ data from Clinical Operations to Quality. This connection transfers _Study_, _Study Country_, and _Study Site_ information across Vaults.

In addition, you can configure the connection to allow users to send an _Issue_ to the QMS application in a customer's Quality Vault. Upon receipt, QMS creates a _GCP Deviation_ record, automatically populated with _Study_ information, which the appropriate personnel can begin to process.

<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>: The Quality-Clinical Operations Vault Connection is only available for organizations with both a Clinical Operations Vault and Quality Vault. Issue management functionality is only available for organizations with the Vault QMS application.</p>
    </div>
  </div>
</div>



## Configuration Overview

Perform the following steps to configure your Vaults to use the Quality-Clinical Operations Connection:

  * Review [connection components][1] and adjust as needed
  * Update the [configuration in your Clinical Operations Vault][2]
  * Update the [configuration in your Quality Vault][3]
  * [Activate the connection][4]

## Quality-Clinical Operations Connection Components {#components}

The following components support the standard Quality-Clinical Operations Connection.

### Connections

The following _Connection_ records are available from **Admin > Connections**:

* _Quality to ClinOps Connection_ (`quality_to_clinops_connection__v`) is available in your Quality Vault
* _Quality to ClinOps Connection_ (`quality_to_clinops_connection__v`) is available in your Clinical Operations Vault

The connection is not active by default. Once set up, you will still need to <a href="/en/gr/53358/">establish the Vault to Vault connection</a> before you can use it.


### Integration & Integration Points {#integration-integration-points}

The _Integration_ and _Integration Point_ objects enable Vault to define what data the connection maps from one Vault to another.

The _Quality to ClinOps Connection_ record includes the following default _Integration_ records with standard _Integration Point_ records in your Clinical Operations Vault:

  * _Quality Study Data Integration_
    * _Study Outbound Integration Point_
    * _Study Country Outbound Integration Point_
    * _Study Site Outbound Integration Point_
  * _Issue Management Integration_
    * _Issue Management Outbound Integration Point_

The _Quality to ClinOps Connection_ record includes the following default _Integration_ records with standard _Integration Point_ records in your Quality Vault:

  * _Study Data Integration_
    * _Study Inbound Integration Point_
    * _Study Country Inbound Integration Point_
    * _Study Site Inbound Integration Point_
  * _Issue Management Integration_
    * _Issue Management Inbound Integration Point_

### Integration & Query Object Rules

To support the Quality-Clinical Operations Connection, it may be necessary to transform data from the source Vault's data model to fit within the target Vault's data model. You can use <a href="/en/gr/62154/">Integration Rules</a> to incorporate configurable rules for mapping object fields between two Vaults.

The connection also supports <a href="/en/gr/62154/#how-to-create-query-object-rules">Query Object Rules</a> within each [integration rule][5], allowing you to configure criteria using Criteria VQL to determine which records in your Clinical Operations Vault are to be created in the Quality Vault. For example, you could configure a rule in the Quality Vault so that the integration checks for a _Phase III_ value in a _Study Phase_ field on the _Study_ object before creating that _Study_ in the Quality Vault.

The following table contains Query Object Rules that Veeva provides by default for the Quality-Clinical Operations Connection in your Quality Vault:

| **Records to be Transferred** | **Integration Rule**           | **Query Object Rule**  | **Filter Clause**                                               |
| ----------------------------- | ------------------------------ | ---------------------- | --------------------------------------------------------------- |
| Studies                       | Quality ClinOps: Study         | Active Studies         | `status__v = 'active__v'`                                       |
| Study Countries               | Quality ClinOps: Study Country | Active Study Countries | `status__v = 'active__v' AND study__vr.status__v = 'active__v'` |
| Sites                         | Quality ClinOps: Study Site    | Active Study Sites     | `status__v = 'active__v' AND study__vr.status__v = 'active__v'` |

### Queues

This feature includes two (2) standard <a href="/en/gr/53147/">message processing queues</a>. You can access and manage these queues from **Admin > Connections > Spark Queues**.

In your Clinical Operations Vault, you have:

  * _Quality to ClinOps Outbound Queue_ (`quality_clin_op_outbound_queue__v`)

In your Quality Vault, you have:

  * _Quality to ClinOps Inbound Queue_ (`quality_clin_op_inbound_queue__v`)

### User Exception Objects

Vault includes the _User Exception Message_ object and its child object, _User Exception Item_, to help you track and resolve any errors that occur with your Quality-Clinical Operations Connection. If the Quality side of the integration can't process an incoming message, Vault creates a _User Exception Message_ record to capture the failure.

If the Quality side of the integration can't process an incoming message, Vault creates a _User Exception Message_ record to capture the failure. When the connection job runs, Vault processes all _User Exception Messages_ that are in the Active state, and inactivates previous ones. Any new errors result in new _User Exception Messages_ in the _Active_ state. Vault also creates individual _User Exception Item_ records for each item that failed on the related _Integration Point_ record in the Clinical Operations Vault. The _User Exception Item_'s _Error Message_ field contains the reason for error.

You can view and manage these messages from **Admin > Connections > User Exception Messages**.

A _User Exception Message_ means that you need to update your configuration. After you update the configuration, Vault attempts to resolve any errors the next time the connection runs. You can also select the **Retry Transfer** action to run the connection and resolve errors.

## Setting Up Your Clinical Operations Vault for the Connection {#configuring-clinical-operations}

Before activating the connection, you must complete the following steps in your Clinical Operations Vault to ensure proper functioning of the connection:

1. Ensure that all applicable Country object records exist in the Clinical Operations Vault, and that their Code field is populated with the two-digit country code (ISO 3166-1).
2. Ensure the Vault is not in <a href="/en/gr/36919/#editing-default-settings-for-data-objects">Record Migration Mode</a>.
3. Optional: Configure the [_Send to Quality_ object record action][6] on the _Quality Issue_ object.
4. Optional: [Update][7] the formula expression within the _Issue_ object's (`pdv__ctms`) _Quality Issue Link_ field so that Clinical Operations users can click an _Issue_ record's _Quality Issue Link_ to view the related _GCP Deviation_ in Quality. Then, configure this field on the _GCP Deviation_ object page layout.

### Send to Quality Action {#record-action}

A record action in your Clinical Operations Vault allows users to send _Quality Issue_ data to the Quality Vault. When this action executes, Vault creates a _GCP Deviation_ record in the Quality Vault.


## Setting Up Your Quality Vault for the Connection {#configuring-quality}

You must complete the steps described in the sections below in your Study Training Vault to enable the connection:

  1. Ensure that all applicable Country object records exist in the Quality Vault, and that their Code field is populated with the two-digit country code (ISO 3166-1).
  2. On the _User Exception Message_ object, add the **Retry Transfer** custom action. Add this action to the _Active_ state in the _User Exception Message Lifecycle_.
  3. Optional: Update permission sets to remove _Create_ permission for the following objects and for their related object fields for appropriate security profiles:
     * _Study_
     * _Study Country_
     * _Study Site_
  4. Optional: [Update][7] the formula expression within the _GCP Deviation_ object's _Clinical Issue Link_ field so that Quality users can click a _GCP Deviation_ record's _Clinical Issue Link_ to view the related _Issue_ in Clinical Operations. Then, configure this field on the _GCP Deviation_ object page layout.


### Generating Global IDs

The Quality-Clinical Operations Connection relies on _Global IDs_ to populate the **Link** field in the target Vault. If a record was last updated before the 19R3 release, the _Global ID_ field may not be populated. If a record is missing the _Global ID_, contact Veeva Support and request that they generate this value on the _Study_, _Study Country_, and _Study Site_ objects in your Clinical Operations Vault. If you have _Study_, _Study Country_, and _Study Sites_ in Quality, populate the _Link_ field value with the _Global ID_ from the source record.

### Last Successful Run Field

On every inbound _Integration_ record, the _Last Successful Run_ field captures the date and time the integration last ran. Vault uses this date to query changes since the integration's last successful run.

If you need to rerun every _Integration Point_ within the _Integration_ record, you can clear the _Last Successful Run_ field. The next time an action in either Vault triggers the connection, Vault will re-process all object records within the scope of that integration point.

## About Issue Link Fields {#issue-link-fields}

The Issue Management integration includes optional configuration to allow users in one Vault to click a link and quickly access that issue's counterpart in the other Vault. Specifically, this means that:

* Quality users can click a _GCP Deviation_ record's _Clinical Issue Link_ to view the related _Issue_ in Clinical Operations.
* Clinical Operations users can click an _Issue_ record's _Quality Issue Link_ to view the related _GCP Deviation_ in Quality.

These fields can be configured in one or both Vaults.

### Configuring Issue Link Fields

The issue link fields in both Quality and Clinical Operations are provisioned with a default formula expression. This expression includes a placeholder variable which must be updated in each Vault accordingly. To do this, you'll need to gather data in the target Vault to update the source Vault's expression.

For example, the source Quality Vault's _GCP Deviation_ object type's _Clinical Record Link_ field includes the following formula expression:

`Hyperlink(Concat("#t/UPDATE_THIS_ADD_OBJECT_ID/", Right(clinical_record_id__v, 15)), clinical_record_name__v, "new_window", @Connection.quality_to_clinops_connection__v)`


The `UPDATE_THIS_ADD_OBJECT_ID` variable corresponds to the ID used in the list view of _Issue_ records in the Clinical Operations Vault. To locate the ID, navigate to this location in the Clinical Operations Vault, for example under the __Issue Management > Issues__ tab. Then, copy the ID from the page URL as shown and paste it into the Quality Vault as the `UPDATE_THIS_ADD_OBJECT_ID` variable.


<a href="https://platform.veevavault.help/assets/images/issue-link-formula-expression-id.png" data-lightbox="issue-link-formula-expression-id.png" data-title="" data-alt="record list view URL with highlighted ID">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/issue-link-formula-expression-id.png" alt="record list view URL with highlighted ID" style=""  />
</a>


The remaining variables are static and do not necessarily require update to support this feature:

* `Right(clinical_record_id__v, 15` takes the right 15 characters in Quality's `clinical_record_id__v` field to identify the Clinical Operations record via its ID.
* `clinical_record_name__v` populates this field's value (within the _GCP Deviation_ record) as the label for the hyperlink displayed to the Quality user.
* `new_window` specifies that when a user clicks the hyperlink in Quality, the Clinical Operations record opens in a new window.
* `@Connection.quality_to_clinops_connection__v` refers to the Quality Vault's connection record, wherein Vault locates the Clinical Operations Vault's domain details when executing the expression.

## Activating the Connection {#activate}

Once all configuration steps are complete, <a href="/en/gr/53358/#Establish_Vault_to_Vault">activate the connection</a>.

## Connection Limitations

See <a href="/en/gr/53358/#limitations">Standard Connection Limitations</a> for a list of limitations that impact your Quality-Clinical Operations Connection.

## Related Permissions

You need a _System Admin_ security profile as well as the following permissions to set up the standard Quality-Clinical Operations Connection:

| **Type**         | **Permission Label**                                                                     | **Controls**                                                                                             |
| ---------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Security Profile | Admin: Application: Manage Connections                                                   | Ability to set up the Quality-Clinical Operations Connection                                 |
| Security Profile | Object: User Exception Item, User Exception Message: Read                                | Ability to see _User Exception Item_ and _User Exception Message_ records if a connection failure occurs |
| Security Profile | Object: User Exception Message: Object Action Permissions: Retry Transfer: View, Execute | Ability to perform the _Retry Transfer_ action on a _User Exception Message_ record.                     |
| Security Profile | Object: Issue: Object Action Permissions: Send to Quality | Ability to perform the _Send to Quality_ action on an _Issue_ record in the Clinical Operations Vault. |

  [1]: #components
  [2]: #configuring-clinical-operations
  [3]: #configuring-quality
  [4]: #activate
  [5]: #integration-integration-points
  [6]: #record-action
  [7]: #issue-link-fields
