# Configuring the Safety-RIM Connection

Configure the <a href="/en/lr/01272/">Safety-RIM Connection</a> to sync product and registration data between Regulatory and Pharmacovigilance systems. With this feature, you can automatically transfer product and registration data from your Regulatory Submissions Vault to your Safety Vault.

## Prerequisites

To use this connection, you must: 

* <a href="/en/lr/53358/#Establish_Vault_to_Vault">Establish the Vault to Vault Connection</a>
* <a class="external-link " href="https://safety.veevavault.help/en/lr/01300" target="_blank" rel="noopener">Enable the Safety-RIM Connection<i class="fa fa-external-link" aria-hidden="true"></i></a>

## Safety-RIM Connection Components

The components below support the standard Safety-RIM Connection. 

### Connections

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

* _Safety to RIM_ connection (`safety_to_rim__v`) is available in your Safety Vault.
* _Safety RIM_ connection (`safety_rim_connection__v`) is available in your RIM Submissions Vault.

In your Safety Vault, you can update the _Connections_ <a href="/en/lr/26387/">object layout</a> to include the following fields in the <a href="/en/lr/53358/#stats">_Connection Stats_ section</a>:

* _RIM: Product Families Created_
* _RIM: Registrations Created_

### Integration & Integration Points {#integration}

The _Integration_ and _Integration Point_ objects enable Safety to manage the message queues and define what data the connection maps from RIM to Safety. These records are read-only and are used by Safety to manage the connection and track any connection errors. The _Safety to RIM_ connection record in each Vault includes the default _RIM-Safety: Product Integration_ record with the following standard _Integration Point_ records:

* Safety Vaults
  * _RIM-Safety: Organization_
  * _RIM-Safety: Product_
  * _RIM-Safety: Product Alias_
  * _RIM-Safety: Product Constituent_
  * _RIM-Safety: Product Dose Form_
  * _RIM-Safety: Product Family_
  * _RIM-Safety: Product Family Product_
  * _RIM-Safety: Product Family Substance_
  * _RIM-Safety: Product Registration_
  * _RIM-Safety: Product Variant_
  * _RIM-Safety: Substance_
* RIM Vaults
  * _RIM-Safety: Co-Packaged Product Constituents_
  * _RIM-Safety: Organization_
  * _RIM-Safety: Product_
  * _RIM-Safety: Product Alias_
  * _RIM-Safety: Product Constituent_
  * _RIM-Safety: Product Family_
  * _RIM-Safety: Product Family Active Substance_
  * _RIM-Safety: Product Family Product_
  * _RIM-Safety: Product Manufactured Dose Form_
  * _RIM-Safety: Product Registration_
  * _RIM-Safety: Product Substance_
  * _RIM-Safety: Product Variant_

#### Integration Rules {#rules}

To support the Safety-RIM connection, it may be necessary to transform data from the source RIM Vault's data model to fit within the target Safety Vault's data model. You can use <a href="/en/lr/62154/">_Integration Rules_</a> to incorporate configurable rules for mapping object and document fields between two Vaults. The Safety-RIM connection includes the following _Integration Rules_, which transfer, create, and update the following records in your Safety Vault based on updates made to corresponding records in your RIM Vault:

| Integration Rule | Source RIM Object | Target Safety Object |
| --- | --- | --- |
| _1.0 Organization_ | _Organization_ (`organization__rim`) | _Organization_ (`organization__v`) of type _Registration Holder_ (`registration_holder__v`) |
| _2.0 Product Family_ | _Product Family_ (`product__v`) | _Product Family_ (`product_family__v`) |
| _3.0 Product_ | _Product_ (`drug_product__v`) | [_Product_][3] (`product__v`) |
| _3.1 Product - FDA Product Code Update_ | _Product Nomenclature Code_ (`product_classification__v`) | [_Product_][3] (`product__v`) |
| _3.2 Combo Product (Packaging)_ | _Packaging_ (`packaging__rim`) | [_Product_][3] (`product__v`) |
| _4.0 Product Family Product_ | _Product Family Product_ (`product_pharmaceutical_product__rim`) | _Product Family Product_ (`product_family_product__v`) |
| _5.0 Product Variant_ | _Product Variant_ (`product_detail__v`) | _Product Variant_ (`product_variant__v`) |
| _6.0 Product Constituent_ | _Product Component_ (`product_component__rim`) | _Product Constituent_ (`product_constituent__v`) |
| _6.1 Product Constituent (Packaging)_ | _Product Packaging Variant_ (`packaging_product_detail__rim`) | _Product Constituent_ (`product_constituent__v`) |
| _7.0 Substance_ | _Active Substance_ (`drug_substance__v`) | _Substance_ (`substance__v`) |
| _8.0 Product Family Substance_ | _Product Family Active Substance_ (`product_active_substance__rim`) | _Product Family Substance_ (`product_family_substance__v`) |
| _9.0 Product Registration_ | _Registration_ (`registration__rim`) | _Product Registration_ (`product_registration__v`) |
| _9.1 Registration (Packaging)_ | _Registered Packaging_ (`registration_packaging__rim`) | _Product Registration_ (`product_registration__v`) |
| _9.2 Product Reg - Med Product Update_ | _Medicinal Product Registration_ (`medicinal_product_registration__v`) | _Product Registration_ (`product_registration__v`) |
| _10.0 Product Alias_ | _Registered Regulatory Text_ (`registered_regulatory_text__v`) | Product Alias (`product_alias__v`) |
| _11.0 Product Dose Form_ | _Product Manufactured Dosage Form_ (`product_manufactured_dosage_form__v`) | _Manufactured Dosage Form_ (`manufactured_dosage_form__v`) |

### Query Object Rules

With <a href="/en/lr/62154/#create-query-rule">query object rules</a>, you can use <a href="/en/lr/1037069/">Criteria VQL</a> to determine which records get created, updated, and deleted in your Safety Vault. For example, you can configure a rule in your Safety Vault to prevent Organization records from being sent to Safety if they do not meet certain criteria. 

To ensure the connection transfers only approved _Registrations_ from RIM to Safety, we recommend the following query object rule for the _9.0 Product Registration_ (`rs_product_registration__v`) [rule][2]: 

* **Query Object**: `registration__rim`
* **Label**: Registrations
* **Name**: `registrations__c`
* **Filter Clause**: `state__v = 'approved_state1__c`

If you would like Registrations in all lifecycle states (for example, Inactive, Withdrawn, or Expired) to transfer, you can ignore this query object rule.

### Queues

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

* In your Safety Vault: _RIM to Safety Product Inbound Queue_ (`rim_safety_product_inbound_queue__v`)
* In your RIM Vault: _RIM to Safety Product Outbound Queue_ (`rim_safety_product_outbound_queue__v`)

### User Exception Objects

Safety 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 Safety to RIM connection. If the Safety side of the integration can't process an incoming message, Safety creates a _User Exception Message_ to capture the failure.

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

Safety also creates individual _User Exception Items_  for each item that failed on the related _Integration Point_ in your Safety Vault. The _User Exception Item's Error Message_ field contains the reason for the error. A _User Exception Message_ means you need to update your configuration. After you update the configuration, Safety attempts to resolve any errors the next time the connection runs. You can also select the _Reprocess Request_ action on the _User Exception Message_ to run the connection and resolve errors. When the connection job runs, Safety processes all active _User Exception Messages_. Any new errors result in new active _User Exception Messages_. Once the connections on both the Safety and RIM side run, Vault inactivates any _User Exception Messages_.

## Configuring Co-Packaged Product Constituents {#combo}

For complex products in your RIM Vault, including products with shared packaging, the connection generates <a class="external-link " href="https://safety.veevavault.help/en/lr/01214" target="_blank" rel="noopener">_Combination Product_ types of _Products_<i class="fa fa-external-link" aria-hidden="true"></i></a> in your Safety Vault for the following _Products_ in your RIM Vault:

* All _Complex Product_ types of _Products_
* All co-packaged _Products_ associated with the _Primary Product Family_ specified in a _Packaging_ record

To configure your RIM Vault to transfer co-packaged product constituent details:

1. Add the _Primary Product Family_ field to the _Packaging_ <a href="/en/lr/26387/">object layouts</a> for the _Device Packaging_, _Drug Packaging_, and _Multiform Packaging_ object types.
2. Populate the field of the applicable _Packaging_ records.
3. Activate the _RIM-Safety: Co-Packaged Product Constituents_ [point][1].

## Configuring PSMF Annex H Support {#psmf-annex-h}

You can use the standard _Annex H_ report to generate the PSMF Annex H document in your SafetyDocs Vault using product registration data received from your RIM Vault. To include Annex H data in <a class="external-link " href="https://safety.veevavault.help/en/lr/01240" target="_blank" rel="noopener">PSMF documents generated from Vault reports<i class="fa fa-external-link" aria-hidden="true"></i></a>, follow the steps below to configure your Safety Vault:

1. Add the following fields to the _Product Registration_ object layout:
    * _Additional Monitoring_
    * _Application Lead Market_
    * _Application Number_
    * _Non-Standard Aggregate Periodicity_
    * _Procedure Type_
    * _Procedure Number_
2. Ensure all _Country_ records referenced in _Product Registrations_ follow the standard ISO naming convention. The standard _Annex H_ report excludes any European Union (EU) Countries that do not follow the naming convention.
3. Optional: Go to **Analytics > Reports** and open the **Annex H** report to review the fields included in the report.
4. <a class="external-link " href="https://safety.veevavault.help/en/lr/01342" target="_blank" rel="noopener">Configure your Safety Vault to automatically generate PSMF documents<i class="fa fa-external-link" aria-hidden="true"></i></a> from Vault reports.

You can <a href="/en/lr/3622/#copying-reports">copy</a> the _Annex H_ report to create a new report based on the standard report and then customize the columns and filters on the new report.

[1]: #integration
[2]: #rules
[3]: #combo