A sample type used to create queries for documents.


class HKDocumentType : HKSampleType


To create a document type instance, use the HKObjectType class’s documentType(forIdentifier:) convenience method.

Subclassing Notes

Like many HealthKit classes, document types are not extensible and should not be subclassed.

Additionally, this class reuses the same instance whenever possible. Letting multiple queries share the same document type helps reduce the overall memory usage.


Inherits From

Conforms To

See Also

Medical Records

Accessing Health Records

Read clinical record data from the HealthKit store.

Accessing Sample Data in the Simulator

Set up sample accounts to build and test your app.

Accessing a User’s Clinical Records

Display a user’s clinical records by requesting authorization and querying HealthKit for the records.

class HKClinicalRecord

A sample that stores a clinical record.

class HKFHIRResource

An object containing Fast Healthcare Interoperability Resources (FHIR) data.

class HKCDADocumentSample

A Clinical Document Architecture (CDA) sample that stores a single document.

class HKDocumentSample

An abstract class that represents a health document in the HealthKit store.

static let CDA: HKDocumentTypeIdentifier

The CDA Document type identifier, used when requesting permission to read or share CDA documents.