# How Dose Latency is Calculated

Vault Safety automatically calculates the **First Dose Latency** and **Last Dose Latency** fields on the Case Assessment when the required data points are available. 

The following list summarizes the dates that the system uses to calculate the latency period:

* The **Onset** field on the Case Adverse Event
* The **First Admin Date** field on the Case Product Dosage
* The **Last Admin Date** field on the Case Product Dosage

<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 above fields must specify a minimum precision to the day in order for auto-calculation to occur.</p>
    </div>
  </div>
</div>



## How to Trigger Latency Auto-Calculation 

When you add or update fields on the relevant Case Product Dosage or Case Adverse Event, the system recalculates the latency fields.

## Dose Latency Diagrams

The following diagrams show how the system auto-calculates the **First Dose Latency** and the **Last Dose Latency** fields using the date intervals between the **Onset** date and the **First** and **Last Admin Date**, respectively. 

### Diagram A: First Dose Latency Calculation with Date Precisions to the Day

<a href="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-a.png" data-lightbox="saf-dose-latency-diagram-a.png" data-title="Dose Latency Diagram A" data-alt="dose-latency-diagram-a">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-a.png" alt="dose-latency-diagram-a" style="max-width: 50%;"  />
</a>

1. The **First Admin Date** and **Onset** date are populated with a precision to the day (YYYY/MM/DD).
2. Upon saving the Case Product Dosage and Case Adverse Event records, the system automatically calculates the **First Dose Latency** with a precision to the day.

### Diagram B: Last Dose Latency Calculation with Date Precisions to the Day

<a href="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-b.png" data-lightbox="saf-dose-latency-diagram-b.png" data-title="Dose Latency Diagram B" data-alt="dose-latency-diagram-b">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-b.png" alt="dose-latency-diagram-b" style="max-width: 50%;"  />
</a>

1. The **Last Admin Date** and **Onset** date are populated with a precision to the day (YYYY/MM/DD).
2. Upon saving the Case Product Dosage and Case Adverse Event records, the system automatically calculates the **Last Dose Latency** with a precision to the day.

### Diagram C: Latency Calculation with Precisions to the Time of Day

<a href="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-c.png" data-lightbox="saf-dose-latency-diagram-c.png" data-title="Dose Latency Diagram C" data-alt="dose-latency-diagram-c">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-dose-latency-diagram-c.png" alt="dose-latency-diagram-c" style="max-width: 50%;"  />
</a>

1. The **First Admin Date**, **Last Admin Date**, and **Onset** date are populated with a precision to the time of day (YYYY/MM/DD HH:MM).
2. Upon saving the Case Product Dosage and Case Adverse Event records, the system automatically calculates the **First Dose Latency** and **Last Dose Latency** with even more precision.

<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>: For the system to calculate the Latency fields with this precision, both the Onset date and the Admin Date must be specified with a precision to the time of day.</p>
    </div>
  </div>
</div>



