# Using Batch Results for Stability Timepoint 0

If [configured](/en/lr/919378/) by an Admin, Lab Analysts can reuse *Lab Test Results* from a *Batch Release Test* for the *Initial Timepoint* (T0) *Study Results* of a *Stability Study*. This saves time and effort, preventing the analyst from needing to manually enter *Lab Test Results* that have already been entered elsewhere.

The action is unavailable if any of the following conditions are met:

* The *Lab Test Results* have no associated batch or the batch has no approved *Batch Release Spec Execution*
* The *Lab Study* has more or less than one *Initial Timepoint*
* The *Lab Study* has already been initiated
* The *Stability Spec Data* has no *Test Actions*
* The *Stability Spec Data* has at least one *Out of Specification* criteria

When the analyst performs the *Initiate Lab Study from Batch* action, the system finds valid and completed *Batch Tests*, regardless of version or variation, that are potential matches for the *Lab Study* being initiated and displays them in the *Initiate from Batch* panel. Each potential match is displayed in its own tab on the left of the panel for the analyst to view and assign to each T0 *Spec Data* test action that has an *Out of Specification* criteria.

<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 the <em>Batch Result</em> version is different from the T0 <em>Study Results</em>, the <em>Result Type</em> and <em>Units</em> must match. <em>Precision</em> and other fields can differ.</p>
    </div>
  </div>
</div>



Matches are determined based on the *Spec Data Criteria* on the *Stability Spec Data*. A *Batch Test* is considered a potential match for a *Test Action* on the *Stability Spec Data* if it has a *Lab Test Result* for each *Lab Test Result Definition* referenced by any such relevant *Criteria* for that *Test Action*. Potential matches are categorized into the following types:

* **New Test**: This means that there are no *Tests* in the linked *Batch* that match the *Test Action*'s *Criteria* and thus a new *Test* will be generated in the *Initial Timepoint*'s *Spec Execution*. If all potential matches fall into this category, the action proceeds like the standard *Initiate Lab Study* action.
* **Auto Match**: The *Number of Tests* field and *Select Count* on the *Select* action are both one, meaning that the *Test Action* would have exactly one *Test* generated for it during *Spec Execution*. Additionally, there is exactly one *Test* in the *Batch's* *Spec Execution*(s) that matches the *Criteria* for the *Test Action* and the *Test* cannot match with any other *Test Action*'s *Criteria*. The system automatically matches *Tests* that fall into this category with the *Test Action*.
* **Match Available**: The *Test Action* is neither a *New Test* or an *Auto Match*, necessitating a decision to be made by the analyst. Generally, this occurs in one of the following scenarios:
    * Multiple *Tests* exist in the *Batch's* S*pec Execution*(s) that match the *Criteria* for the *Test Action*.
    * There is exactly one matching *Test* in the *Batch*, but that *Test* is also a potential match with another *Test Action*'s *Criteria*.
    * The *Test Action* would have multiple *Tests* generated for it. In this case, even if the number of potentially-matching *Tests* in the *Batch* is equal to the number of *Tests* to be generated for the *Test Action*, the analyst must match them manually.

<a href="https://platform.veevavault.help/assets/images/lims-t0-25r22-3.png" data-lightbox="lims-t0-25r22-3.png" data-title="" data-alt="batch matching dialog">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/lims-t0-25r22-3.png" alt="batch matching dialog" style=""  />
</a>

## How to Use Batch Results for Stability Timepoint 0

In order to reuse *Batch Results* for a *Stability Study*'s *Timepoint 0*:

1. Navigate to the *Stability Spec Execution* record for the *Lab Study* to be initiated.
2. Select **Actions > Initiate Lab Study from Batch**.
3. In the resulting dialog, review the *Tests* listed along the left side. *Tests* that are matched display a <img class="inline" src="https://platform.veevavault.help/assets/images/lims-t0-25r22-1.png" alt="match icon" style="" /> icon and *Tests* that require decisions to be made display <img class="inline" src="https://platform.veevavault.help/assets/images/lims-t0-25r22-2.png" alt="potential match icon" style="" />.
4. For each *Test* that requires a decision, select the **Batch Result** to be matched, then click **Next**. You can also select **Generate New Test** to use none of the listed *Batch Results*.
    1. The dialog displays *Test Name*, *Lab Sample*, and *Sample Type* columns followed by columns for each result including the Stability *Test's* *Criteria* to evaluate against. You can sort these results by *Test Name*, *Lab Sample*, and *Sample Type* as well as filter them by *Lab Sample* and *Sample Type*.
5. Once you have reviewed each *Test* and made any necessary decisions, review the summary and click **Confirm**.

If two *Tests* have results that are dependent on each other, for example, one test has a result that is used as a cross-test variable in another test, the dependent tests must either all be matched, or none matched.

After matching is complete, if every *Test* is either an *Auto Match* or one for which you manually chose a match, the *Spec Execution* moves to *Testing Complete*. The criteria for any Test Result values used are evaluated. If any new *Tests* were generated, the *Spec Execution* moves to *In Progress* and you can enter the results as normal.

The system creates as few *Lab Samples* as necessary. It only creates those directly related to the T0 Test Action. Any planned parent samples or aliquots, for example, are not created.

The system also creates any dependent Tests of the Tests generated (such as those used in cross-test variables) regardless of whether they have any Out of Specification criteria, as they are needed to complete the dependent tests. When determining dependencies, the system ignores Sample scope variables.

During this process, the system ignores Auto-Generate and Auto-Match flags as well as the Prevent Sample Creation flag.

You cannot approve a *Stability Spec Execution* before approving the *Batch Release Spec Execution* from which it uses results. Additionally, you cannot re-open a *Batch Release Test* that has results being used in a *Stability Spec Execution* without first re-opening the *Stability Spec Execution*.

## Limitations

When performing the *Initiate Lab Study from Batch* action, the following limitations apply:

* The T0 Spec Data cannot exceed 50 Spec Data Test Actions of object type `spec_data_test_sample__v`.
* The T0 Spec Data cannot exceed 100 defined Criteria Evaluations.
* The Batch cannot exceed 300 Tests.
* The Batch cannot exceed 1000 Test Results.


## Related Permissions

In order to use Batch Results for Stability Timepoint Zero, you must have the LIMS User permission set and Execute permission for the *Initiate Lab Study from Batch* action.
