# Configuring Duplicate Check (QMS)

The QMS Duplicate Check feature is an intelligent and streamlined interface for users to determine whether an event, such as a _Quality Event_ or _Complaint_, is a duplicate or follow-up of another event. With this feature configured, Vault can simplify a complex manual process with a simple user action where text search terms are automatically suggested by Vault. After performing the user action, the user is shown a set of potential records along with their similarity score in a side-by-side comparison user interface. When the analysis is complete, Vault stores the results and automatically transitions duplicate or follow-up _Quality Events_ or _Complaints_ to the appropriate lifecycle states, as determined by your configuration.

## Supported Objects

The Duplicate Check feature supports the following objects and object types: 

- _Complaint_
- _Complaint Intake_
- _Supplier Change Notification_
- _Quality Incident_
- _Quality Event_ (_Complaint_ and _Medtech Complaint_ object types)

## Configuration Overview

Complete the following steps to enable the Duplicate Check feature:

  * Optional: Configure <a href="/en/gr/981284/#record-checks-suggestions">Quality Automated Language Translations</a> on <a href="/en/gr/981284/#supported-objects">supported objects</a> to allow users to search and match with translated field data.
  * Configure <a href="/en/gr/70474/">Quality Relationship Automation</a> for the relevant supported object or object type.
  * Add the _Record Check Result_, _Record Check Result State_ fields to the relevant <a href="/en/gr/26387/">object type page layout</a>.
  * Optional: [Enable an application setting][6] to give users the ability to specify terms that all matching records must contain.
  * Add the _Run Quality Record Check_ action to the [supported object lifecycle][1] for the relevant object type.
  * Create [record checks][2] as needed for your business processes.

## Creating Quality Record Checks for Duplicates {#creating-record-checks}

You can create _Quality Record Checks: Duplicate Check_ configurations for each scenario in which users will need to check for duplicates, each available to users as a separate user action.

To create _Quality Record Checks: Duplicate Check_ configurations for recurrence:

  1. Navigate to **Admin > Configuration > Quality Record Checks: Duplicate Check**.
  2. Click **Create**.
  3. Enter a **Label** and select a **Status**.
  4. Select an **Object** from the drop-down:
     1. **Quality Event**: Used for the _Complaint_, _Medtech Complaint_, and _Complaint Intake_ object types.
     2. **Complaint**: Used for the _Pharma Complaint_ object type. This option only appears in Vaults configured to use the standalone _Complaint_ object.
     3. **Supplier Change Notification**: Used for the _Supplier Change Notification_ object.
     4. **Quality Incident**: Used for the _Quality Incident_ object. The _Object Type_ field is not displayed when you select this object.
  5. Select an **Object Type**.
  6. In the **Date Comparison Field** drop-down, select a date field from the supported object from which to base your timeframe.
  7. In the **Date Comparison Timeframe** drop-downs, select a number and time period unit. For example, to include records up to one year previous to the value in the date field selected above, select **1** and **Years**.
  8. Optional: If you want to limit the check to evaluate object records with a certain lifecycle state, select those states in the **Lifecycle States To Include** drop-down.
  9. Optional: If you want Vault to exclude alphanumeric values from system-generated match terms, select the **Exclude numeric suggested terms** checkbox.
  10. Define at least one [duplicate check rule][3].
  11. In the _Comparison Settings_ section, define three (3) tiers of match similarity to assist users in analyzing potential duplicates:
      1. From the **Tier 1**, **Tier 2**, and **Tier 3** drop-downs, select the labels appropriate for each similarity category.
      2. Optional: If you do not want to display percentages for the similarity scores, you can select the **Hide similarity scores from users** checkbox to display the default labels of _Likely Matches_, _Possible Matches_, and _Unlikely Matches_ instead, or you can define and select your own labels from the single value _Recurrence Check Tier Label_ picklists. Ensure that the _Picklist Value Name_ value matches for each tier in both picklists.
      3. Enter a **Minimum Similarity Score (%)** for each tier.
      4. Optional: If you select the **Display** checkbox for **Tier 2** or **Tier 3**, Vault hides the tier column and displays the tier as a category at the top of the page when a user performs the duplicate check user action. Selecting **Display** for a higher tier enables the checkbox on the next lower tier.
  12. In the _Fields to Display_ section, choose one (1) or more fields from the record to display in the record check interface to assist the user in their analysis. These fields are not included in the match calculation. You can select up to 25 fields to display.
  13. In the **Relationship Configuration** drop-down, select the <a href="/en/gr/70474/">relationship configuration</a> applicable to your duplicate check.
  14. Select a **Picklist Value** from the drop-down. Choose from among the values available on the relationship configuration, for example, _is a Duplicate of_ or _is a Follow-up of_.
  15. Optional: Select a **Destination Lifecycle State** that Vault should change the record to if the user determines it to be a duplicate during the check, for example, the _Duplicate_ or _Follow-Up_ states. If a destination lifecycle state is defined, you can also select states from the **Do not transition complaints in the following lifecycle states** drop-down if you want to limit which complaints are automatically transitioned.
  16. To define more verdicts, click **Add Verdict** and repeat steps 13 and 14 as needed.
  17. <a id="editable-fields"></a>Optional: In the _Summary Page_ section, choose **Editable Fields**. Users are able to edit these fields on the record check interface if they have the appropriate Atomic Security setting with _Edit_ permission for all lifecycle states that could appear in the duplicate check results. Fields selected in this section appear in addition to fields selected in the _Fields to Display_ section.
  18. Optional: Select the **Copy Attachments** checkbox to copy any attachments on records identified as duplicates to the record identified as the original.
  19. Click **Save**.

### Defining Duplicate Check Rules {#rules}

Each record check configuration for duplicates must contain at least one (1) rule, and can contain up to five (5) rules. To define a rule:

  1. Enter a rule **Label**.
  2. In the **Exact Match Fields** drop-down, select one or more fields on the object that must match exactly between the records to be included in the duplicate check. For example, if your processes require you to check for duplicates only affecting the same facility, select the _Owning Facility_ field to exclude records for other facilities. Fields of the following types are available to select:<a id="supported-fields"></a>
     * _Lookup_
     * _Object Reference_
     * _Picklist_
     * _Text_ (_Long Text_ and _Rich Text_ fields are not supported)
     * _Yes/No_
  3. <a id="similar-match"></a>Optional: In the **Similar Match Fields** drop-down, select one or more text fields of any type on which to run the duplicate check. When a user performs the action on a record, these are the fields for which Vault provides a percentage match score.
  4. Optional: Click **+ Add Related Object Match Criteria** to further [filter results by field data][4] on their related objects.
  5. Optional: Click **Create Rule** to define an additional rule.

Each rule can contain up to ten (10) total _Match Fields_, including both the rule's base match fields and those from its related object match criteria.

#### Defining Related Object Match Criteria {#match-criteria}

You can optionally define up to three (3) related object match criteria for each duplicate check rule.

  1. Select a **Related Object** from the drop-down. Choose from objects related to the primary object selected for this record check.
  2. In the **Exact Match Fields** drop-down, select one or more [supported fields][5] on the object that must match exactly between the records to be included in the duplicate check.
  3. Select the appropriate **Inbound Reference Field** from the related object.
  4. Optional: Click **+ Add Related Object Match Criteria** to define additional criteria.

You can click the minus icon (-) to the right of each line to remove criteria from the rule.

## Enabling Match on All Terms {#all-terms-setting}

You can enable an application setting to give users the option to specify search terms that all matching records must contain when completing a duplicate check. To do this, navigate to **Admin > Settings > Application Settings**, and enable the **Enable Match on All Terms in Record Check and Record Suggestions Actions** checkbox in the _QMS_ section.

<div class="note-border alert-important">
  <div class="alert alert-important" role="alert">
    <div><i class="far fa-exclamation-circle"></i></div>
    <div class="alert-text">
      <p><strong>Important</strong>: Once enabled, you cannot disable the <em>Enable Match on All Terms in Record Check and Record Suggestions Actions</em> setting.</p>
    </div>
  </div>
</div>



## Configuring the Run Quality Record Check Action for Duplicates {#record-check-action}

In order for users to have access to the Duplicate Check functionality at the appropriate stage in the supported object's lifecycle, you must make the _Run Quality Record Check_ action available to users in that lifecycle state:

  1. Navigate to **Admin > Configuration > Object Lifecycles** and click into the supported object lifecycle.
  2. In the _States_ section, click into the lifecycle state in which you want users to run their duplicate check. For example, select the _Closed_ state to allow users to check for recurrence after the _Quality Event_ has been finalized.
  3. In the _User Actions_ section, click **Edit**.
  4. Click **Create Rule**.
  5. If configuring the action for a _Quality Event_ object type, select **Perform with Conditions**, and select **Quality Event Type** > **equals** > **\[object type]**.
  6. Select **Run Quality Record Check** from the _Allow the following actions_ drop-down.
  7. Select one or more _Quality Record Checks_ from the **Available Quality Record Checks** drop-down. Ensure that you include the duplicate record check that you [previously created][2].
  8. Select the **Allow user to override discovered match terms** checkbox to allow modification of search terms in a pop-up dialog after the user performs the action.
  9. Add an _Action Label_ for the action.
  10. Click **Save**.

## Duplicate Check Limitations

By default, Vault can include up to 100 records in the results of duplicate checks that use text search functions, such as [_Similar Match Fields_][7], to find suggested terms and provide a similarity score. For duplicate checks that do not use text search, but instead rely entirely on exact field and record matches, this limit is 1,500 records.

If your organization requires more results per duplicate check, contact your Veeva Representative.

## Related Permissions

You must have the following permissions to configure or use _Quality Record Checks_:

|Type|Permission|Controls|
|--- |--- |--- |
|Security Profile | Admin: Quality Record Check: Read, Create, Edit, Delete | Ability to see, create, and manage _Quality Record Checks: Duplicate Check_ configurations |
|Security Profile | Object: Record Check Rule Detail: Read, Edit | Ability to see and edit duplicate check rules. |
|Security Profile | Admin: Quality Relationship Automation: Read | Ability to select _Quality Relationship Automation_ values within _Quality Record Checks: Duplicate Check Check_ configurations |
|Security Profile | Object: Quality Event: \[object type]: Read | Ability to view records of this object type in the record check interface |
|Security Profile | Object: Complaint: Read | Ability to view records of this object in the record check interface |
|Security Profile | Object: Supplier Change Notification: Read | Ability to view records of this object in the record check interface |
|Security Profile | Object: Quality Incident: Read | Ability to view records of this object in the record check interface |
|Security Profile | Object: Record Check Result: \[object type]: Read, Edit | Ability to view and edit _Record Check Results_ and records of this object type |
|Security Profile | Object: Record Check Match Record: \[object type]: Read, Edit | Ability to view and edit _Record Check Match_ records of this object type |

To perform duplicate checks, the application role that users are assigned to must have sufficient permissions in all lifecycle states included in the duplicate check to establish relationships between the originating record and records returned in duplicate check results. If your configuration uses [_Editable Fields_][8], users must also have a role that grants _Edit_ permission for those fields in all lifecycle states included in the duplicate check results.

  [1]: #record-check-action
  [2]: #creating-record-checks
  [3]: #rules
  [4]: #match-criteria
  [5]: #supported-fields
  [6]: #all-terms-setting
  [7]: #similar-match
  [8]: #editable-fields