# About the RIM-Clinical Operations Connection

Organizations using both a RIM Vault and a Clinical Operations Vault on the same domain can use a standard Vault to Vault connection. When <a href="/en/gr/60444/">configured</a>, the RIM-Clinical Operations connection transfers _Product Family_, _Clinical Study_, and Clinical _Site_ records, as well as regulatory data, across Vaults. The connection also and automates the creation, versioning, and updating of CrossLink documents and fields. Streamlining object record and document creation reduces duplicate data and allows Vault documents to have a single source of truth within an organization.

<a href="https://platform.veevavault.help/assets/images/clinops-rim-connection.png" data-lightbox="clinops-rim-connection.png" data-title="" data-alt="Clinical Operations - RIM Connection Map">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/clinops-rim-connection.png" alt="Clinical Operations - RIM Connection Map" style=""  />
</a>

## How the RIM-Clinical Operations Connection Works

The RIM-Clinical Operations Connection creates new records, updates existing records, and creates CrossLink documents across Vaults in the below situations.

### Object Records

* When a user creates or edits a _Product Family_ record in the RIM Vault, Vault creates or updates the _Product_ record in the Clinical Operations Vault.
* When a user creates or edits a _Study_ record in the Clinical Operations Vault, Vault creates or updates the _Clinical Study_ record in the RIM Vault.
    * If the _Study Type_, _Study Subtype_, or _Type of Control_ fields are populated on the Study record, Vault updates the Clinical Study record with the appropriate mapped fields in RIM.
* When a user creates or edits a _Study Product_ record in the Clinical Operations Vault, Vault creates or updates the _Product Family Clinical Study_ record in RIM.
* When a user creates or edits a _Site_ record in the Clinical Operations Vault, Vault creates or updates a _Clinical Site_ record under the same _Clinical Study_ record in RIM and populates the _Site Country_ field based on _Study Country_ in the Clinical Operations Vault.
* When a user creates or edits a _Regulatory Objective_ or _Country Decision Detail_ record related to a clinical trial approval Application in RIM, Vault updates a corresponding milestone record in Clinical Operations. 

### CrossLink Documents & Fields

* When a document enters its _Steady_ state in the source Vault, Vault creates or versions a CrossLink document in the target Vault and populates fields. Admins can also configure Vault to transfer document versions to the connected Vault when they reach the source Vault's _Superseded_ state. An Admin defines CrossLink document behavior in the connection's configuration. See details about [document creation][2] below.
* _Study_ field behavior for CrossLinks created in Clinical Operations from RIM:
    * When a RIM source document has a valid _Clinical Study_ field value (according to the Clinical Operations _Study_), the connection populates it accordingly. If the _Study_ does not exist in Clinical Operations, the connection generates a User Exception Message.
    * When a RIM source document has a blank _Clinical Study_ field value, Vault populates the Clinical Operations _Study_ field based on the _Active Lead Agent Product_ associated with the _Product Families_ on the RIM document. In order to leverage this defaulting behavior, _Study_ records in Clinical Operations must use the Lead Agent _Study Product Role_ record.
* When a RIM document to be CrossLinked has a valid _Site_ value (according to the Clinical Operations _Site_), the connection populates it accordingly. If the _Site_ does not exist in Clinical Operations, the connection generates a <a href="/en/gr/60444/#user-exception-objects">User Exception Message</a>.
* By default, when the Clinical source document does not include a _Product_ value, Vault defaults _Products_ on the RIM CrossLink based on the _Product Family Clinical Study_ relationship for every _Study_ referenced by the source document. 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 enable an optional setting by which Vault instead defaults _Products_ on the RIM CrossLink based on the _Primary Product Family_ assigned to the _Study_ referenced by the source document.
* When the RIM document to be CrossLinked has a "European Union" value in the _Country_ field, Vault populates all relevant study countries (where the _Country_ belongs to the "European Union" _Jurisdiction_) on the Clinical CrossLink. 
  * The _Jurisdiction Country_ object must be configured in order to utilize this mapping logic. 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> for the recommended mappings.
  * In order for Vault to populate a Clinical CrossLink's _Study Country_ field via the jurisdiction and country mapping logic, a RIM country value which is considered a Clinical _Jurisdiction_ cannot be included in Clinical's _Country_ object. In the European Union example, this means the RIM Vault's European Union country cannot be both a _Country_ and a _Jurisdiction_ in Clinical.
* If the RIM source document includes a _Study_ that is archived in Clinical, then the _Study_ is removed from the CrossLink before creation or update. 
* All _Products_ on the Clinical CrossLink document must be a _Study Product_ for at least one _Study_ on the document. If this is not true, then a user exception message is created and the CrossLink fails to create or update.

### Additional Considerations

* When a new _Study Product_ record is created in Clinical Operations, the connection does not automatically reprocess any CrossLinks to add additional _Studies_ to documents.
* When users delete documents or object records in one Vault, Vault does not delete the associated documents or object records in the connected Vault.

## About Record Creation & Update {#about-creation-update}

When creating a record through the connection, Vault also populates the _Link_ (`link__sys`) field on the target record with the source record's _Global ID_ (`global_id__sys`). These fields let Vault know which records to update in the target Vault when data is updated in the source Vault.

## About Document Creation & Update {#document-creation}

Vault creates new CrossLink documents in the steady state defined in the target Vault's document lifecycle of a given document type. If the document's type has multiple lifecycles, Vault applies the first lifecycle available. The connection creates CrossLink documents using the Specific Document Version binding rule. See details about [source binding rules][3] below.

The RIM-Clinical Operations Connection creates, up-versions and syncs metadata for documents in the target Vault that are configured to transfer between Vault applications:

  * When a source document enters its _Steady_ state, the Connection creates a CrossLink in the target Vault in the _Steady_ state of the target's _Document Type_ defined on the Document Lifecycle. Vault also applies any entry actions configured on that lifecycle state, for example, setting the version number to a major version.
  * If a Connection-created CrossLink exists on the target Vault and a new version of the source document is created and moved to a steady state, the Connection up-versions the Target CrossLink and creates a new CrossLink version.
  * When the fields on a _Steady_ state source document are modified in the source Vault, Vault updates those fields on the CrossLink document in the target Vault.
  * If the connection has never run, Vault only transfers the latest _Steady_ state version of the document.
  * Document versions created in the target Vault are set by the target Vault and bound to the versions from which they were created in the source Vault.
  * When enabled by Veeva, Vault transfers any _Superseded_ versions of a document created since the last time the connection ran.
    * If there are both _Steady_ state and _Superseded_ versions of the source document in the source Vault that have not been transferred to the target Vault since the last time the connection ran, Vault transfers all of these document versions.
  * The Documents Integration is triggered when (1) a source document in-scope for transfer enters the Steady State and (2) a source document that has a Connection-created CrossLink has a metadata update. Updates on an Approved source document that does not have a Connection-created CrossLink does not trigger the Connection. 



<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>: Vault does not apply <a class="external-link " href="https://clinical.veevavault.help/en/gr/59930" target="_blank" rel="noopener">document reuse functionality<i class="fa fa-external-link" aria-hidden="true"></i></a> to CrossLink documents in Clinical Operations Vaults that were transferred from RIM Vaults.</p>
    </div>
  </div>
</div>



### About Source Binding Rules {#source-binding-rules}

If a CrossLink document does not already exist in the target Vault, Vault creates the CrossLink document and binds it to the current document version in the source Vault. Vault will then update the CrossLink document only if a user in the source Vault specifically edits the version of the source document that is bound.

All CrossLink documents created via the RIM-Clinical Operations Connection have the _Source Binding Rule_ set to <a href="/en/gr/23145/#crosslinksourcebinding">_Specific Document Version_</a>.

 [2]: #document-creation
 [3]: #source-binding-rules
