---
title: "predicateForElectrocardiograms(symptomsStatus:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateforelectrocardiograms(symptomsstatus:)"
---

# predicateForElectrocardiograms(symptomsStatus:)

Returns a predicate that matches electrocardiogram samples with the specified symptom status.

## Declaration

```swift
class func predicateForElectrocardiograms(symptomsStatus: HKElectrocardiogram.SymptomsStatus) -> NSPredicate
```

## Parameters

- `symptomsStatus`: The target symptom status.

## Return Value

Return Value A predicate that matches electrocardiogram samples with the specified symptom status.

## Discussion

Discussion Use this convenience method to create a predicate that matches electrocardiogram samples with the specified symptom status. The following sample uses both the convenience method and a predicate format string to create equivalent predicates. let forSymptomStatus = HKQuery.predicateForElectrocardiograms(symptomsStatus: .present)

let status = HKElectrocardiogram.SymptomsStatus.present.rawValue

let explicitForSymptomStatus = NSPredicate(format: "%K == %d", HKPredicateKeyPathECGSymptomsStatus, status)

## See Also

### Related Documentation

- [HKPredicateKeyPathECGSymptomsStatus](healthkit/hkpredicatekeypathecgsymptomsstatus.md)

### Creating electrocardiogram predicates

- [predicateForElectrocardiograms(classification:)](healthkit/hkquery/predicateforelectrocardiograms(classification:).md)
- [predicateForObjectsAssociated(electrocardiogram:)](healthkit/hkquery/predicateforobjectsassociated(electrocardiogram:).md)
