# Harvesting Statements

Using an entry or user action, you can asynchronously create _Scientific Statements_ from qualified link annotations on steady state documents, allowing you to quickly and easily maintain your statement library. Vault harvests the full text, reference links, document metadata, and annotation IDs from text link and area link annotations. The harvested document metadata is based on the document fields that have the same public keys as the fields from the _Scientific Statement_ (`scientific_statement__v`) object type.

To prevent creating duplicate statement records, Vault checks existing records in the _Scientific Statements_ library using the _Match Text_ field on the _Scientific Statement_ (`annotation_keywords__sys`) and _Match Text Variation_ (`match_text_variation__sys`) object.

## Configuring Statement Harvesting

You can add the **Harvest Statements** [entry action](/en/lr/12399/) and [user action](/en/lr/12339/) to any document lifecycle state. We recommend adding the entry action to the steady state. 

To add the entry action:

  1. Navigate to **Admin > Configuration > Document Lifecycles > [Lifecycle] > States > [State]**.
  2. Under _Entry Actions_, click **Edit**.
  3. Click **Create Entry Action**.
  4. Select **Always** and **Harvest Statements**.
  5. Click **Save**.

To add the user action:

  1. Navigate to **Admin > Configuration > Document Lifecycles > [Lifecycle] > States > [State]**.
  2. Under _User Actions_, click **Edit**.
  3. Click **Create User Action**.
  4. Select **Always** and **Harvest Statements**.
  5. Click **Save**.

You must add the following object fields to the active _Scientific Statements_ [object layout](/en/lr/26387/):

  * **Harvested Annotation ID** (`harvested_annotation_id__v`)
  * **Harvested Statement** (`harvested_statement__v`)
  * **Harvested Long Text** (`harvested_long_text__v`)
  * **Harvested Source Document** (`harvested_source_document__v`)

You must also add the **Pending** state to the review and approval workflow for _Scientific Statements_. Then, add the **Send for Approval** user action to the _Pending_ state.

### Qualifying Harvested Annotations

An annotation is qualified for harvest when:

  * The annotation is a document text link annotation or a document area link annotation.
  * The annotation is only linked to a reference document or anchor, as indicated by the document type being [_Suggest Links_ target-enabled](/en/lr/618/#medical).
  * The annotation has more than five text characters.
  * The annotation is not a duplicate of another qualified annotation in the same document (not case sensitive).
  * Text similar to the annotation does not already exist in the _Statement Library,_ based on the volume of similar keywords found between the annotation and _Statement_. For example, if the annotation is "Cholecap is good" and the existing _Statement_ is "Cholecap is very good", it will not be harvested.

### Qualifying Harvested Statements

The **Enable Statements Harvest Auto-Approve Qualified Annotations** setting is enabled by default. When enabled, Vault automatically places qualified harvested _Statements_ in the _Approved_ state.

A harvested _Statement_ is qualified automatically for approval when:

  * The source document is in its steady state, such as _Approved for Distribution_.
  * The linked document is in its steady state, such as _Approved for Use_.
  * The source annotation is a text annotation.
  * The annotation text is less than 1,500 characters.

To disable this functionality, navigate to **Admin > Settings > Application Settings** and, under _Scientific Statement Library Management_, clear the **Enable Statement Harvest Auto-Approve Qualified Annotations** checkbox.


<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 only places qualified harvested <em>Statements</em> in the <em>Approved</em> state if all its configured <a href="/en/lr/59885/#entry-criteria">entry criteria</a> on the <em>Scientfic Statement Lifecycle</em> are met.</p>
    </div>
  </div>
</div>



## Limitations

The following limitations may affect _Scientific Statement_ harvesting:

* Vault does not harvest _Scientific Statements_ if the document is a binder. 
* Vault does not harvest _Scientific Statements_ from video or audio files.
* Vault does not harvest _Scientific Statements_ from ZIP files.
* Vault may fail to harvest _Scientific Statements_ from area annotations if the selected area is small or lacks detectable text. If the text cannot be selected while in [Annotate mode](/en/lr/9777/#Annotate_Mode), it is unlikely that text is detected.

A qualified annotation will not become a harvested _Scientific Statement_ if any of the following items are true:

* The document metadata does not provide a value for _Country_ (`country__v`) and  _Product_ (`product__v`).
* The _Scientific Statement_ (`scientific_statement__v`) object type of the _Scientific Statement_ (`annotation_keywords__sys`) object has required fields designated by the customer for a record to be created, and the document metadata does not provide a value for the required fields.
  * The document type must have document fields with the same public key as the required object record fields, and the data type of the fields is the same.

## Related Permissions

The following permissions control functionality related to harvesting _Statements_:

| Type | Permission Label | Controls |
| --- | --- | --- |
| Security Profile | Objects: Scientific Statement: Create, Edit | Ability to harvest a _Statement_ from a document |
| Security Profile | Objects: Scientific Statement: Object Field Permissions: Primary Country (`country__v`), Primary Product Family (`product__v`): Read | Ability to harvest a _Statement_ from a document |
| Security Profile | Objects: Scientific Statement Country: Create, Edit | Ability to harvest the additional countries from a document as _Scientific Statement Country_ child records of the harvested _Statement_ |
| Security Profile | Objects: Scientific Statement Product: Create, Edit | Ability to harvest the additional products from a document as _Scientific Statement Product_ child records of the harvested _Statement_ |
| Security Profile | Objects: Scientific Statement Indication: Create, Edit | Ability to harvest the additional indications from a document as _Scientific Statement Indication_ child records of the harvested _Statement_ |
