# CDMS FTP Connection Setup (CTMS)


<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>: While the FTP connection described in this article continues to function, we have introduced a <a href="/en/lr/60661/">standard CDMS and Clinical Operations Vault Connection</a> using Spark messaging as the recommended path to transfer record data.</p>
    </div>
  </div>
</div>




The EDC to CTMS Connection feature provides a cross-domain connection between EDC and CTMS Vaults. Organizations using this feature can leverage EDC data while working in a CTMS Vault by reporting on _Subject_ statuses and status dates captured within EDC. This connection also allows users to navigate to a _Subject_'s casebook in EDC from a _Subject_ or _Monitored Subject_ record in CTMS.


<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>: This feature is only available to organizations with both Clinicial Operations CTMS and CDMS EDC Vaults.</p>
    </div>
  </div>
</div>



## How the FTP Connection Works

Once configured, data syncing happens automatically, with your EDC Vault "pushing" updates to your CTMS Vault on a regular basis via the [FTP server](/en/lr/38653/). The connection schedule is set in your EDC Vault.

When data syncing occurs, Veeva EDC extracts _Subject_ status and status dates in a CSV based on the export configuration for a given _Study_, connects to your CTMS Vault, and places the extracted CSV into a configured folder on the FTP. See [details about the FTP Loader][2] below. Veeva CTMS then ingests the CSV and creates new _Subject_ records or updates records accordingly. We recommend using [Atomic Security](/en/lr/47850/) on _Subject_ object fields in your CTMS Vault to prevent users from inputting incorrect data and causing connection errors.

<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>: Entering <em>Subject</em> data in a CTMS Vault <em>does not</em> update related fields in the linked EDC Vault.</p>
    </div>
  </div>
</div>



## Connection Setup {#integration-setup}

### Configuring the EDC Connection Permission Set & Security Profile

To set up the EDC connection, you must first [create a new Permission Set and Security profile](/en/lr/23647/). Note that these options are automatically available in new CTMS Vaults.

Navigate to **Admin > Users & Groups > Permission Sets** and click **Create**. This permission set must include the following permissions:

<table class="wbord">
  <tr>
    <td>
      <strong>Type</strong>
    </td>
    <td>
      <strong>Permission Label</strong>
    </td>
    <td>
      <strong>Controls</strong>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Application: File Staging: Access
    </td>
    <td>
      <div>
        <div>
          Ability to access Vault's file staging.
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Application: Access API
    </td>
    <td>
      <div>
        <div>
          Ability to make an API call, which is required to create and update records via FTP.
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Application: Vault Owner Actions: Vault Loader
    </td>
    <td>
      <div>
        <div>
          Ability to see and use <strong>Vault Loader</strong> to create and update records via the FTP Loader.
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Application: All Object Records: All Object Record Read
    </td>
    <td>
      <div>
        <div>
          <div>
            Ability to load related data for Subject records; alternatively, you can provide Read access on a per-object basis. The connection requires Read access on at least the <em>Study</em>, <em>Study Country</em>, and <em>Study Site</em> objects.
          </div>
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Objects: Subject: Read, Create, Edit
    </td>
    <td>
      <div>
        <div>
          Ability to create and update Subject records.
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Tabs: Home: View
    </td>
    <td>
      <div>
        <div>
          Ability to see Vault Loader files and file failures in the Notifications view.
        </div>
      </div>
    </td>
  </tr>
</table>

After you create your permission set, navigate to **Users & Groups > Security Profiles** and click **Create** to create an associated security profile. In the _Permission Sets_ section, click **Add > Existing Permission Set** and select your new _CTMS EDC Connection Actions_ permission set.

### User Setup

You'll need to create a connection user who will link your EDC and CTMS applications:

  1. Navigate to **Admin > Users & Groups** and click **Add > New User**.
  2. From the **License Type** drop-down, select the _Full User_.
  3. From the **Security Profile** drop-down, select the newly-created EDC Connection security profile. Note that this user should never have a _Vault Owner_ security profile.
  4. Enter the user's **Name** and **Email**.
  5. Select a **Security Policy**. We recommend [configuring a security policy](/en/lr/1985/) without an expiring password.
  6. Click **Save**.

Once Vault creates the user, your organization will receive a password reset email at the email address you provided. You'll use this password in your EDC Vault to create the FTP connection between Veeva EDC to Veeva CTMS. See details below.

Note that this connection user should not be used for any other purpose.

### FTP Setup {#ftp-loader}

Vault uses the [FTP server](/en/lr/46280/) to connect data in your EDC and CTMS Vaults. In order to connect your Vaults, you must create a new directory on your FTP server named "vaultloader" in the connection user's directory.

### EDC Setup

After you configure your CTMS Vault and FTP server, you must create an FTP Connection in your EDC Vault. See <a class="external-link " href="https://cdmshelp.veeva.com/lr/resources/integrations/ctms-connection/" target="_blank" rel="noopener">About the Veeva CTMS Connection<i class="fa fa-external-link" aria-hidden="true"></i></a> for details on configuring this connection.

## Default Configurations

CTMS Vaults include the following standard configuration elements to support connection with EDC:

### EDC ID Field

The _EDC ID_ (`edc_id__v`) field in CTMS Vaults is a unique identifier for connection upserts, allowing EDC to connect a _Subject_ with the correct _Site_ and push data over. This field is available on the following objects:

  * _Study_
  * _Study Country_
  * _Study Site_
  * _Subject_
  * _Monitored Subject_ (This is a lookup field to the _EDC ID_ field on the _Subject_ record)
  * _Subject Visit_
  * _Monitored Subject Visit_
  * _Visit Definition_
  * _Study Arm_

Vault populates the _EDC ID_ field by default on the _Study_, _Study Country_, and _Study Site_ objects, but users can update it later to ensure that the field matches and syncs correctly across EDC and CTMS Vaults. Note that if the _Study_, _Study Country_, and _Study Site_ record names are the same in your EDC and CTMS Vaults, you shouldn't need to update the _EDC ID_ field later.

Depending on your CTMS configuration, you may want to remove the _EDC ID_ field from your object page layouts or [configure field-level security](/en/lr/39108/) to prevent users from editing the field and disrupting connection.

### Subject Object Fields

The following fields appear on the _Subject_ (`subject__clin`) object page layout in support of connection with EDC data:

  * _Subject ID_
  * _Subject Status_
  * _Screened Date_
  * _Screen Failed Date_
  * _Enrolled Date_
  * _Randomized Date_
  * _Withdrawn Date_
  * _End of Treatment Date_
  * _Complete Date_
  * _EDC ID_

### Subject Statuses

The following standard picklist values are available in the _Subject Status_ picklist (`subject_status__clin`), which is used to select a status in the _Subject Status_ field on _Subject_ and _Monitored Subject_ records:

  * _Pre Screening_
  * _In Screening_
  * _Screen Failure_
  * _Enrolled_
  * _Randomized_
  * _Withdrawn_
  * _End of Treatment_
  * _Complete_

### Lifecycle

The _Subject_ object lifecycle (`subject_lifecycle__v`) allows Admins to configure the Open Casebook user action on the _Subject_ object.

Note that you must first manually assign this lifecycle to the _Subject_ object. To do this, navigate to the _Subject_ object from **Admin > Configuration > Objects**, click **Edit**, and select the _Subject_ lifecycle from the **Lifecycle** drop-down.

## Configuring the Open Casebook Web & User Actions

You can configure a web action and associated user actions that allow cross-domain users with access to both EDC and CTMS Vaults to open an EDC _Casebook_ record from CTMS. What actions a user can perform after opening a casebook from CTMS depends on their EDC permissions for that _Subject_ casebook.

### Configuring the Web Action

<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>: We recommend working with Veeva Services to create an <strong>Open Casebook</strong> web action.</p>
    </div>
  </div>
</div>



To create the web action yourself:

  1. Navigate to **Admin > Configuration > Web Actions** and click **Create**.
  2. Enter a **Label**. We recommend "Casebook Navigation".
  3. In the **Type** drop-down, select **Object**.
  4. In the **Target** drop-down, select **Open in New Window**.
  5. In the **URL** window, enter the following URL, replacing the bolded text (including carets) with your EDC Vault ID: `https://${Vault.domain}/ui/veevaHome/switchVaultWithTarget/`**`<EDC-vault-ID>`**`?tg=%2F%23t%2F0TB000000000301%3D%26cn%3Dsubject__v%26cf%3 Dexternal_id__v%26cid=${Object.edc_id__v}&src=cl`
  6. Click the **Validate** button to validate your URL.
  7. Click **Save**.

Note that you can find your **EDC Vault ID** by navigating to **Admin > Settings** in your EDC Vault.

### Configuring the User Actions

You can configure user actions on your _Subject_ and _Monitored Subject_ objects to allow users to open a related _Casebook_ record. We recommend adding an **Open Casebook** action on the _In Progress_ and _Complete_ states of the _Monitored Subject_ object lifecycle, and the _Active_ state of the _Subject_ object lifecycle.

Your user action should be a Web Action user action that includes the following condition: If _EDC ID is not blank_. Learn more about creating user actions. Learn more information about [defining user actions](/en/lr/30683/#define-actions).

 [2]: #ftp-loader
