# Configuring the Medical-Quality Connection

Using the Medical-Quality Connection, organizations with both MedInquiry and a Quality QMS Vault can exchange data. The Medical-Quality Connection transfers _Product Quality Complaint_ data from MedInquiry to Quality, which includes the relevant product, event, and reporter information required for the _Complaint Intake_ process.

## Medical-Quality Connection Components

The components below support the standard Medical-Quality Connection.

### Connections

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

  * _Medical-Quality Connection_ (`medical_quality__v`) is available in your Medical Vault
  * _Medical-Quality Connection_ (`medical_quality__v`) is available in your Quality Vault

You must <a href="/en/gr/53358/#Establish_Vault_to_Vault">establish a Vault to Vault Connection</a>
 before using the _Connection_ records.

### Integration & Integration Points

The _Integration_ and _Integration Point_ objects enable Vault to manage the message queues and define what documents and data the connection maps from one Vault to another. These records are read-only and are used by Vault to manage the connection and track any connection errors.

In your Medical Vault, the _Medical-Quality Connection_ record includes the default _Product Quality Complaint Integration_ record with following standard _Integration Point_ records:

  * _Product Quality Complaint Outbound Integration Point_
  * _Product Quality Complaint Inbound Integration Point_

In your Quality Vault, the _Medical-Quality Connection_ record includes the default _Medical-Quality: PQC Integration_ record with following standard _Integration Point_ records:

  * _Medical-Quality: PQC Outbound Integration Point_
  * _Medical-Quality: PQC Inbound Integration Point_

### Integration Rules

To support the Medical-Quality 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 and document fields between two Vaults.

### Third Party Agreements

The connection supports different third party agreements with regards to managing _Reporter_ data in Quality. While configuring the connection, please contact <a class="external-link " href="https://support.veeva.com/hc/en-us" target="_blank" rel="noopener">Veeva Support<i class="fa fa-external-link" aria-hidden="true"></i></a> to configure the connection for your relevant third party agreement.

### Queues

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

In your Medical Vault, you have:

  * _Medical to Quality Product Quality Complaint Outbound Queue_ (`medical_to_quality_pqc_outbound_queue__v`)
  * _Quality to Medical Product Quality Complaint Inbound Queue_ (`quality_to_medical_pqc_inbound_queue__v`)

In your Quality Vault, you have:

  * _Quality to Medical Product Quality Complaint Outbound Queue_ (`quality_to_medical_pqc_outbound_queue__v`)
  * _Medical to Quality Product Quality Complaint Inbound Queue_ (`medical_to_quality_pqc_inbound_queue__v`)

### Query Object Rules

The connection supports <a href="/en/gr/62154/#about-query-object-rules">query object rules</a>
. <a href="/en/gr/62154/#create-query-rule">Query object rules</a>
 provide an additional layer of specificity to your field rules. Learn more about creating query object rules.

### 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 Medical-Quality Connection. If either end of your integration can't process an incoming message, Vault creates a _User Exception Message_ record to capture the failure.

Vault also creates individual _User Exception Item_ records for each item that failed on the related _Integration Point_ record in one of your Vaults. Vault typically creates _User Exception Messages_ in the source Vault when there are issues with the configuration or connection itself. _User Exception Messages_ in the target Vault often contain _User Exception Items_, as the target Vault can encounter document-specific errors as well as configuration errors.

You can view and manage these messages from **Admin > Connections > User Exception Messages**. If you want specific users or groups to receive notifications when Vault creates _User Exception Message_ records, you may configure a flash report for new _User Exception Messages_, or create a custom lifecycle for the _User Exception Message_ object and configure a notification <a href="/en/gr/59885/#entry-actions">entry action</a>
.

A _User Exception Message_ may mean you need to update your data or 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 on the _User Exception Message_ record to run the connection and resolve errors.

### Last Successful Run Time Field 

On each _Integration_ record, the _Last Successful Run Time_ field captures the date and time that the integration last ran with no errors. Vault uses this date to query changes since the integration's last successful run.

When an integration becomes active, Vault automatically sets its _Last Successful Run Time_ to the current datetime. If you inactivate and reactivate an _Integration_ record, Vault also sets the _Last Successful Run Time_ to the current datetime.

You can also manually set the _Last Successful Run Time_ field to a prior datetime. Setting the field to a prior datetime automatically triggers the integration.

## Configuring Your Vaults for the Connection

### Enabling the Integration in MedInquiry

The _Product Quality Complaint Integration_ is inactive by default. To activate this integration:

  1. In your MedInquiry Vault, navigate to **Admin > Connections > Medical-Quality Connection**.
  2. Expand the **Integrations** section.
  3. Click **Product Quality Complaint Integration**.
  4. Select **Active** in the _Status_ field.
  5. Click **Save**.

### Enabling the Integration in Quality

The _Medical-Quality:PQC Integration_ is inactive by default. To activate this integration:

  1. In your Quality Vault, navigate to **Admin > Connections > Medical-Quality Connection**.
  2. Expand the **Integrations** section.
  3. Click **Medical-Quality: PQC Integration**.
  4. Select **Active** in the _Status_ field.
  5. Click **Save**.

### Configuring Reference Lookups

<a href="/en/gr/58198/">Reference lookups</a>
 are a configuration component referenced by integration rules that allow you to map the value of a field on a target object or document indirectly from a value in the source Vault. When you configure the Medical-Quality Connection, you need to add reference lookups for controlled fields within the integration scope. We recommend creating CSV mapping files and loading these to your Vault to create reference lookups.

### Reviewing Field Rules {#field-rules}

We recommend reviewing the field rules for each integration rule for the Medical-Quality Connection. To do so, navigate to **Admin > Connections > Integration Rules**, select an integration rule, and click **Field Rules**.

## Related Permissions

You need a _System Admin_ security profile as well as the following permissions to set up the standard Medical-Quality connection:

| Type | Permission Label | Controls |
| --- | --- | --- |
| Security Profile | Admin: Application: Manage Connections |  Ability to set up the standard Medical-Quality 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 |
