# Enable Rules Based Narrative Generation

Learn how to enable your Vault to generate rules based narratives from outline templates based on _Case_ data.

## About the Feature

With the 25R1 release, you can configure rules for narrative generation based on _Case_ data. Create _Narrative Outline_ templates composed of _Narrative Statements_, each with its own _Narrative Statement Options_, where you can define the conditional rules for when Vault includes the related statement within a generated narrative. _Narrative Statement Options_ incorporate related _Case_ data and new functions for formatting statements. You can specify the order of statements according to their alignment and sequence. For easy reference, any changes to the _Case_ between major versions are summarized at the end of a generated narrative.

After you have enabled this feature, see the following articles for more information:

* <a href="/en/lr/832805/">Configure Rules Based Narratives</a>
* <a href="/en/lr/01167/">Generate a Case Narrative</a>

### 25R3 Update: Manage Blind Protection for Case Narratives {#r25r3}

With the 25R3 release, you can turn off blind protection for generated narratives. See [Blind Protection][7] to configure your Vault for the updated feature.

### 25R2 Updates {#r25r2}
With the 25R2 release, Vault introduces the following new features:
* **Rules Based Narratives Enhancements**: You can copy standard outlines and their related statements and options using the _Copy Narrative Outline_ action. See [Configure Actions on Narrative Outline][2] to configure your Vault for the updated feature.
* **Previous Case Version Narrative on Follow-Up**: You can [define settings][6] to specify which narrative documents Vault generates for follow-up _Cases_.

## Prerequisite

If you're interested in discussing whether getting early access to this feature is appropriate for your business needs, contact your Veeva Representative.

## Overview

Complete the following procedures to enable Rules Based Narrative Generation in your Vault:

1. Optional: [Update object layouts][9]
2. [Configure the _Generate Narrative from Outline_ action][1]
3. [Configure actions on _Narrative Outline_][2]
4. [Update the _Case Compare Page_][3]
5. [Define settings for narrative generation][6]
6. Optional: [Update the _Case Test Result_ layout][4]
7. Optional: [Configure Case Access Group Security][5]

## Update Object Layouts {#layouts}

We recommend deploying a <a href="/en/lr/36919/">configuration migration package</a> to update the relevant object layouts:

1. <a class="download-link " href="https://platform.veevavault.help/assets/downloads/saf-narrative-vpk-package.zip" target="_blank" rel="noopener">Download the VPK file here<i class="fa fa-download" aria-hidden="true"></i></a>.
2. Unzip the file.
3. <a href="/en/lr/36919/#import">Import</a> and <a href="/en/lr/36919/#deploy">deploy</a> the VPK package in your Vault.

## Configure the Generate Narrative from Outline Action on Case {#generate-action}

You can configure the _Generate Narrative from Outline_ action in the following ways:

* <a href="/en/lr/43127/#assign-actions">Assign</a>  the action to the _Case_ object and complete the following according to your business needs:
   * Add the action as a <a href="/en/lr/59885/#define-actions">user action</a> to the object and do one (1) of the following: 
     * Select the **Available in All Lifecycle States** checkbox to apply atomic action security defaults for the applicable lifecycle states.
     * Add the action as a <a href="/en/lr/59885/#user-actions">user action</a> to the applicable states of the object lifecycle.
    * Add the action as an <a href="/en/lr/59885/#entry-actions">entry action</a> on the applicable object lifecycle states.
* Configure the action as a <a href="/en/lr/33550/#how-to-define-an-action-step">workflow action step</a>.

### Inactivate the Re-Render Case Narrative Action {#remove-action}

If you previously configured <a href="/en/lr/01372/">Narrative Templates for Report Types and Studies</a> in your Vault, we recommend inactivating the _Re-Render Case Narrative_ action on the _Case_ object since users can instead rerun the _Generate Narrative from Outline_ action.

## Configure Actions on Narrative Outline {#actions}

We recommend configuring the following actions on the _Narrative Outline_ object: 

* **Preview Narrative Outline**: Define the <a href="/en/lr/21270/">web action</a> as a <a href="/en/lr/59885/#define-actions">user action</a> on the _Active_ state of the object's lifecycle.
* **Copy Narrative Outline**: <a href="/en/lr/43127/#assign-actions">Assign</a> the action to the _Narrative Outline_ object and then define the <a href="/en/lr/59885/#define-actions">user action</a> on the applicable states of the object's lifecycle to copy outlines with their related _Narrative Statements_ and _Narrative Statement Options_. 

## Update the Case Compare Page {#case-compare-page}

We recommend adding the following fields to the _Case Compare Followup_ layout for the <a href="/en/lr/01196/">_Case Version Compare_ page</a> so that users can review changes to follow-up statements on the <a href="/en/lr/826980/">_Inbox Item to Case Compare_ page</a>:

* _Patient_ section: 
  * _Date of Birth (normalized)_
* _Adverse Events_ section:
  * _Seriousness_
  * _Onset (normalized)_
  * _Cessation (normalized)_
* _Medical History & Concurrent Conditions_ section:
  * _Start Date Normalized_
  * _End Date Normalized_
* _Drug History_ section:
  * _Start Date Normalized_
  * _End Date Normalized_
* _Products_ section > _Dosage Fields_:
  * _First Administration (normalized)_
  * _Last Administration (normalized)_

## Define Settings for Narrative Generation {#settings}

You can define <a href="/en/lr/740208/#metrics-other">settings</a> to control how Vault generates [follow-up narratives][8] and to [turn off blind protection on narratives][7]. To define settings in your Vault:

1. Navigate to **Admin > Settings > Safety General Settings**.
2. Select **Edit**.
3. In the _Other Options_ section, select the applicable checkbox:
   * [**Default to previous case version narrative on follow-up**][8]
   * [**Turn off Blind Protection on Narratives**][7]
4. Select **Save**.

<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>: The <em>Turn off Blind Protection on Narratives</em> setting also applies to <a href="/en/lr/01372/#blind-protection">Narrative templates</a>.</p>
    </div>
  </div>
</div>



### Follow-Up Narratives {#follow-up}

You can control which minor narrative document versions Vault generates for non-E2B sources when users create a <a href="/en/lr/01148/">follow-up _Case_</a> with the _Default to previous case version narrative on follow-up_ setting. When enabled, Vault generates a single narrative document by copying the previous _Case's_ narrative and does not generate a new narrative from the outline template.

If you do not enable this setting, Vault generates two (2) minor narrative document versions:

* The first copies the previous _Case's_ narrative.
* The second generates a new narrative for the follow-up _Case_ from the applicable <a href="/en/lr/832805/">_Narrative Outline_ template</a>.

### Blind Protection {#blind-protection}

You can control blind protection for narrative documents with the [_Turn off Blind Protection on Narrative_ setting][6]. When you enable this setting, Vault populates the _Blind Protection_ field value of generated narrative documents with _Off_. This document field value determines the following:

* **Off**: Any information in the narrative document may be displayed in the _Narrative Preview_ field.
* **On**: The _Narrative Preview_ field does not display any sensitive information and unauthorized users cannot view the narrative document. 

When Vault generates a narrative for a follow-up _Case_, the new narrative document inherits the _Blind Protection_ value from the narrative of the previous _Case_ version unless the follow-up _Case_ was unblinded during processing. In this scenario, Vault always sets the _Blind Protection_ field to _On_.

## Optional: Update the Case Test Result Layout {#ctr-layout}

Based on your business process, to all applicable _Case Test Result_ object layouts, <a href="/en/lr/15057/#how-to-add-object-fields">add</a> the _Include Result in Narrative?_ field. When users select _No_, Vault excludes that result from the generated narrative, if applicable to your _Narrative Outlines_.

## Optional: Configure Case Access Group Security {#cag}

If applicable, configure <a href="/en/lr/01182/">Case Access Group Security</a> for the _Case Follow-Up Statement_ object. When any user reruns the _Generate Narrative from Outline_ action on a follow-up _Case_, Vault upversions the narrative document. Vault also generates _Case Follow-Up Statements_ to track changes made since the action last ran, and includes those statements in the upversioned narrative.


[1]: #generate-action
[2]: #actions
[3]: #case-compare-page
[4]: #ctr-layout
[5]: #cag
[6]: #settings
[7]: #blind-protection
[8]: #follow-up
[9]: #layouts