---
title: "predicateForMedicationDoseEvent(scheduledStart:end:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateformedicationdoseevent(scheduledstart:end:)"
---

# predicateForMedicationDoseEvent(scheduledStart:end:)

## Declaration

```swift
class func predicateForMedicationDoseEvent(scheduledStart startDate: Date?, end endDate: Date?) -> NSPredicate
```

## Parameters

- `startDate`: The beginning of the window for scheduled dates of any medication dose event to match.
- `endDate`: The beginning of the window for scheduled dates of any medication dose event to match.

## Discussion

Discussion Creates a predicate for use with HKQuery subclasses. Creates a query predicate that matches HKMedicationDoseEvent samples that have a scheduled date within a window of scheduled times. If nil is provided to either parameter, the respective side of the window is unbound.
