# Automated Case Promotion

Vault sometimes receives _Inbox Items_ that require little to no triage, and can automatically promote certain _Inbox Items_ to an initial or follow-up _Case_. _Inbox Items_ received through the following sources can be promoted to a _Case_ automatically:

* An AS2 gateway transmission
* An Intake Vault API endpoint
* The <a href="/en/lr/679350/">Safety-EDC Connection</a>
* <a href="/en/lr/01135/">Imported from any structured source</a>

Vault then determines whether an automatically promoted _Case_ should be an initial or follow-up version or should be marked as follow-up.

<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>: <a href="/en/lr/01320/">Automated Case Promotion</a> and <a href="/en/lr/01333/#24r3-duplicate-e2b-xml-file-detection">Duplicate E2B XML File Detection</a> are not compatible. You can enable both features in your Vault but you can use only one for an inbound source.</p>
    </div>
  </div>
</div>



## Prerequisites

Your Admin may enable the following features:

* <a href="/en/lr/01320/">Automated Case Promotion</a> on _Transmission Profiles_. This includes enabling automatic promotion and configuring merge methods on the <a href="/en/lr/01202/">_Transmission Profile_</a> used to receive cases.
* <a href="/en/lr/01135/#manage-automated-case-promotion-for-e2b-imported-inbox-items">Automated Case Promotion for E2B Imported Inbox Items</a>
* <a href="/en/lr/01200/">Email to Vault Safety Inbox Item</a> to support automatic promotion of _Inbox Items_ generated from email attachments.
* <a href="/en/lr/01319/">Automated Case Promotion for non-Cases</a>
* <a href="/en/lr/01310/">MedDRA Suggestions</a> to provide MedDRA coding suggestions during promotion (when your Vault has an <a href="/en/lr/01187/">active MedDRA dictionary</a>). For example, when automatic case promotion would be prevented by an incorrect or missing MedDRA code on the source document, Vault populates high-confidence terms, when available, during import or _Inbox Item_ creation. 

## Automatic Case Promotion Process

When Vault generates an _Inbox Item_, it determines whether automatic case promotion is possible:

1. Vault generates _Inbox Items_ using the following methods:
  * A source organization, such as a trading partner or health authority, sends a transmission through an AS2 gateway (E2B file) or Intake API (JSON or E2B file) to be imported as an _Inbox Item_.
  * A study site creates an SAE in EDC and the Safety-EDC Connection transfers the data to your Safety Vault, generating an _Inbox Item_.
  * An _Inbox Item_ is created from an E2B (single E2B, multi-E2B, or ZIP file from your _Library_ or email attachment).
2.  Vault determines if _Inbox Items_ can be automatically promoted using the following criteria:
  * Is the <a href="/en/lr/01320/">auto promote</a> option enabled in the applicable _Transmission Profile_ or for the <a href="/en/lr/01135/#manage-automated-case-promotion-for-e2b-imported-inbox-items">document fields</a>?
  *  Is the _Inbox Item_ valid for promotion or is it missing information?
3. Vault determines how to promote _Inbox Items_.

<a href="https://platform.veevavault.help/assets/images/saf-automated-case-promotion-7.png" data-lightbox="saf-automated-case-promotion-7.png" data-title="" data-alt="automated-case-promotion process (1)">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-automated-case-promotion-7.png" alt="automated-case-promotion process (1)" style=""  />
</a>

After confirming automatic promotion is possible, the _Inbox Item_ state changes to _Processing_ and Vault determines whether the _Inbox Item_ can be promoted to an initial _Case_, marked as a follow-up for merge into an in-flight _Case_, or promoted to a follow-up _Case_.

1. Vault performs <a href="/en/lr/01141/#overview-of-duplicate-detection">duplicate detection</a> and checks whether there is a _Case_ with a matching _Case Identifier_. If there is no matching _Case Identifier_, Vault promotes the _Inbox Item_ to an initial _Case_.
2. If there is a _Case_ with a matching _Case Identifier_, Vault determines whether the _Inbox Item_ can be marked as follow-up. The matching _Case_ cannot be in a prohibited state based on the <a href="/en/lr/740208/#mark-follow-up">_Allow Mark Follow-up_ application settings</a>. If the _Inbox Item_ <a href="/en/lr/01138/">can merge to the matching in-flight _Case_</a>, Vault indicates this by setting the _Inbox Item_ state to _Marked as Follow-Up_ and linking it to the _Case_.
3. If the _Inbox Item_ cannot be marked as a follow-up, Vault determines if it can be promoted to a follow-up _Case_. First, it determines whether to treat the _Case_ as serious or non-serious using the following criteria:
   * **Serious**: If the _Inbox Item_ has a primary _Adverse Event_ with a _Seriousness_ value. The primary _Adverse Event_ for E2B files is the first entry in the Reaction(s)/Event(s) section, which is E.I in E2B(R3) files and B.2 in E2B(R2) files.
   * **Non-serious**: If the _Inbox Item_ does not have a primary _Adverse Event_ or the _Seriousness_ of the primary _Adverse Event_ is blank.
4. Vault determines if the _Inbox Item_ can be created as a follow-up _Case_. The matching _Case_ cannot be in a prohibited state based on the <a href="/en/lr/740208/#follow-up-options">_Follow-Up Options_ application settings</a>. If the matching _Case_ is in a prohibited state, Vault moves the _Inbox Item_ to the _Promotion Failed_ state and links it to the _Case_.
5. Vault proceeds with the [merge method][5] specified on the applicable _Transmission Profile_ (if sent from a source organization or Veeva EDC) or on the source document. Your Admin can configure the merge method to use for <a href="/en/lr/01320/#configure-system-gateway-transmission-profiles">each _Transmission Profile_</a> and you can configure the merge method to use for <a href="/en/lr/01135/#manage-automated-case-promotion-for-e2b-imported-inbox-items">each uploaded source document</a>, depending on whether the _Case_ is serious or non-serious.

<a href="https://platform.veevavault.help/assets/images/saf-automated-case-promotion-2.png" data-lightbox="saf-automated-case-promotion-2.png" data-title="" data-alt="automated-case-promotion process (2)">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-automated-case-promotion-2.png" alt="automated-case-promotion process (2)" style=""  />
</a>

## Merge Methods {#merge-methods}

Vault includes the following merge methods for automatically promoting _Inbox Items_ to follow-up _Cases_:

* [**Manual**][2]: After _Inbox Item_ import, you must manually merge the _Inbox Item_ into a follow-up _Case_.
* [**Smart**][3]: Vault creates a follow-up _Case_ from both the _Inbox Item_ and initial _Case_ data using default merging behavior.
* [**Override**][4]: Vault creates a follow-up _Case_ from only the _Inbox Item_ data.

### Manual Merge {#manual-merge}

The following steps describe the manual merge method:

1. Vault sets the _Inbox Item_ state to _Marked as Follow-Up_ and links it to the initial _Case_ to indicate they are related.
2. Once the _Inbox Item_ has been imported into your Vault, you must go to the _Inbox Item_ and select **Promote to Follow-up**. Since the _Inbox Item_ is in the _Marked as Follow-Up_ state and is linked to the initial _Case_, Vault directs you to the _Inbox Item to Case Compare_ page.
3. Prior to creating a follow-up _Case_, you can <a href="/en/lr/826980/#complete-the-inbox-item-to-case-compare-page">compare the two _Cases_</a> and select any changes you want to make. Your Admin can <a href="/en/lr/01347/#no-auto-calc">turn off auto-calculation</a> during _Inbox Item_ promotion.
4. Vault moves the _Inbox Item_ to the _Promoted_ state and links to this follow-up _Case_.

<a href="https://platform.veevavault.help/assets/images/saf-acp-manual-merge.png" data-lightbox="saf-acp-manual-merge.png" data-title="" data-alt="manual merge process">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-acp-manual-merge.png" alt="manual merge process" style=""  />
</a>

### Smart Merge {#smart-merge}

The following steps describe the smart merge method:

1. Vault creates a follow-up _Case_ from the _Inbox Item_ information and the initial _Case_ using the <a href="/en/lr/826980/#promote-merge">default merge behavior</a>.
2. Vault moves the _Inbox Item_ to the _Promoted_ state and links to this follow-up _Case_.

<a href="https://platform.veevavault.help/assets/images/saf-smart-merge.png" data-lightbox="saf-smart-merge.png" data-title="" data-alt="smart-merge">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-smart-merge.png" alt="smart-merge" style="max-width: 70%;"  />
</a>

### Override Merge {#override-merge}

The following steps describe the override merge method:

1. Vault creates a follow-up _Case_ using only the _Inbox Item_ information, meaning the follow-up _Case_ is identical to the _Inbox Item_. If the initial _Case_ has any <a href="/en/lr/01167/">narrative documents</a>, Vault appends them to the generated narratives on the follow-up _Case_. Vault combines document references from the initial _Case_ and _Inbox Item_ on the follow-up _Case_.
2. Vault moves the _Inbox Item_ to the _Promoted_ state and links to this follow-up _Case_.

<a href="https://platform.veevavault.help/assets/images/saf-override-merge.png" data-lightbox="saf-override-merge.png" data-title="" data-alt="override-merge">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-override-merge.png" alt="override-merge" style="max-width: 70%;"  />
</a>

<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>: When promoting a <em>Global</em> type <em>Inbox Item</em> matching a domestic <em>Case</em> using the override merge method, Vault carries over only the <em>Inbox Item</em>’s data, including the <em>Localization</em>. The override merge method creates a global follow-up <em>Case</em> instead of a domestic <em>Case</em> in this scenario. For more information about promoting a <em>Global</em> type <em>Inbox Item</em> to a domestic <em>Case</em> on the <em>Inbox Item to Case Compare</em> page, see <a href="/en/lr/01136/#localization">Inbox Item Follow-Up</a>.</p>
    </div>
  </div>
</div>



## Automated Case Promotion for Non-Cases

For _Cases_ that do not need to be reported to any health authority, your Admin may configure your Vault to:

* Automatically promote _Inbox Items_ that enter a certain lifecycle state.
* Include the _Auto-Promote to Case_ action on _Inbox Items_ in specified lifecycle states.

To manually promote an _Inbox Item_, from the **All Actions** menu, select **Auto-Promote to Case**.

## Automated Case Promotion Error Troubleshooting {#troubleshooting}

When you import an _Inbox Item_, Vault sends a notification to indicate the results of the import. See <a href="/en/lr/01135/#verify-an-imported-inbox-item">Verify an Imported Inbox Item</a> for more information about confirming the success of the import and how Vault displays validation errors, if any.

### Missing Information

After attempted auto-promotion, _Inbox Items_ enter the _Missing Information_ state and the related _Inbound Transmission_ enters the _Validation Error_ state when any validation error occurs or there is no primary _Company Product_ with a _Rank_ of _1_. Validation errors occur when an _Inbox Item_ includes <a href="/en/lr/760903/#validation">invalid data</a>, such as a future date or missing values.

### Promotion Failed

After attempted auto-promotion, _Inbox Items_ enter the _Promotion Failed_ state when:

* There are multiple open _Case_ versions with a matching _Case Identifier_.
* There is one _Case_ version with a matching _Case Identifier_, but the _Case_ cannot be marked as follow-up or promoted to follow-up based on the configured [prohibited states][7].

<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>: If an <em>Inbox Item</em> in the <em>Promotion Failed</em> state exists and a user imports a new <em>Inbox Item</em> that is eligible for automatic case promotion, Vault does not re-attempt to promote the existing <em>Inbox Item</em> in the <em>Promotion Failed</em> state.</p>
    </div>
  </div>
</div>



### Prohibited States {#prohib-states}

When Vault finds one _Case_ version with a matching _Case Identifier_, Vault may prevent automatic case promotion based on your Admin's configured [merge method][5] and <a href="/en/lr/740208/#mark-follow-up">mark as follow-up intake setting</a>. If your Admin has configured the _Allow Mark Follow-up_ setting:

* If the matching _Case_ is not in a specified prohibited state, for all [merge methods][5], Vault marks the _Inbox Item_ as a follow-up and links the matched _Case_.
* If the matching _Case_ is in a specified prohibited state:
  * For _Manual_ merge, the _Inbox Item_ enters the _Promotion Failed_ state.
  * For _Smart_ or _Override_ merge, Vault promotes the _Inbox Item_ to a follow-up _Case_.

Vault also populates the _Automation Message_ field on the applicable _Inbox Item_ with the reason automated _Case_ promotion couldn't complete.

### Workarounds

After attempting automated _Case_ promotion, if your _Inbox Item_ enters the _Missing Information_ or _Promotion Failed_ state, you can use the following workarounds:

1. Check that the _Inbox Item_ is valid and includes all data required to perform <a href="/en/lr/01141/#overview-of-duplicate-detection">duplicate detection</a>.
2. If your Admin has configured a <a href="/en/lr/59885/">user action</a> to change the state of _Inbox Items_ from _Missing Information_ or _Promotion Failed_ states to _New_, you can manually promote the _Inbox Item_:
   1. From the **All Actions** menu of the _Inbox Item_, select the option to change the state to _New_.
   2. From the **All Actions** menu of the _Inbox Item_, select **Promote to Case**.

[1]: #troubleshooting
[2]: #manual-merge
[3]: #smart-merge
[4]: #override-merge
[5]: #merge-methods
[6]: #troubleshoot-scenario-2
[7]: #prohib-states


