---
title: HKVerifiableClinicalRecordQueryDescriptor
framework: healthkit
role: symbol
role_heading: Structure
path: healthkit/hkverifiableclinicalrecordquerydescriptor
---

# HKVerifiableClinicalRecordQueryDescriptor

A query interface that provides one-time access to a SMART Health Card or EU Digital COVID Certificate using Swift concurrency.

## Declaration

```swift
struct HKVerifiableClinicalRecordQueryDescriptor
```

## Overview

Overview Use HKVerifiableClinicalRecordQueryDescriptor to read verifiable clinical records. // Calculate the start and end dates. var sixMonthsAgo = DateComponents() sixMonthsAgo.month = -6

let end = Date() guard let start = Calendar.current.date(byAdding: sixMonthsAgo, to: end) else {     fatalError("*** Unable to calculate a date using \(end) and \(sixMonthsAgo) ***") }

// Create the predicate. let lastSixMonthsPredicate = HKQuery.predicateForVerifiableClinicalRecords(withRelevantDateWithin: DateInterval(start: start, end: end))

// Create the descriptor. let healthRecordDescriptor = HKVerifiableClinicalRecordQueryDescriptor(     recordTypes: [.covid19, .immunization],     sourceTypes: [.smartHealthCard, .euDigitalCOVIDCertificate],     predicate: lastSixMonthsPredicate)

// Asynchronously read the records. let records = try await healthRecordDescriptor.result(for: store)

// Use the records here. for record in records {     print(record.recordTypes)     print(record.itemNames)     print(record.issuedDate)     print(record.expirationDate ?? "No expiration date.") } When you call the descriptor’s result(for:) method, it creates and executes an HKVerifiableClinicalRecordQuery in the background, passing the results as an array of HKVerifiableClinicalRecord instances. Unlike other HealthKit queries, you don’t need to request permission to read verifiable health records before using this descriptor. HealthKit prompts the user for permission to read the records each time your app runs the underlying query. note: Running an HKVerifiableClinicalRecordQuery requires a special entitlement from Apple, or the query fails with an HKError.Code.errorAuthorizationDenied error. To request the entitlement, see Request Access to the Verifiable Health Records Entitlement.

## Topics

### Creating Query Descriptors

- [init(recordTypes:sourceTypes:predicate:)](healthkit/hkverifiableclinicalrecordquerydescriptor/init(recordtypes:sourcetypes:predicate:).md)

### Running Queries

- [result(for:)](healthkit/hkverifiableclinicalrecordquerydescriptor/result(for:).md)

### Accessing Query Properties

- [recordTypes](healthkit/hkverifiableclinicalrecordquerydescriptor/recordtypes.md)
- [sourceTypes](healthkit/hkverifiableclinicalrecordquerydescriptor/sourcetypes.md)
- [predicate](healthkit/hkverifiableclinicalrecordquerydescriptor/predicate.md)

### Default Implementations

- [HKAsyncQuery Implementations](healthkit/hkverifiableclinicalrecordquerydescriptor/hkasyncquery-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [HKAsyncQuery](healthkit/hkasyncquery.md)

## See Also

### Clinical record queries

- [HKVerifiableClinicalRecordQuery](healthkit/hkverifiableclinicalrecordquery.md)
- [HKVerifiableClinicalRecordSourceType](healthkit/hkverifiableclinicalrecordsourcetype.md)
- [HKVerifiableClinicalRecordCredentialType](healthkit/hkverifiableclinicalrecordcredentialtype.md)
- [HKDocumentQuery](healthkit/hkdocumentquery.md)
