Class

HKDocumentSample

The HKDocumentSample class is an abstract class that represents a health document in the HealthKit store.

Declaration

class HKDocumentSample : HKSample

Overview

You should never instantiate an HKDocumentSample object directly. Instead, you always work with a concrete subclass. In iOS 10 and watchOS 3, the only concrete class is the HKCDADocumentSample class.

Document samples are immutable: You set the sample’s properties when you create it, and they cannot change.

Subclassing Notes

Like many HealthKit classes, you should not create any custom subclasses of the HKDocumentSample class. You can extend the HKDocumentSample class and its subclasses by adding custom metadata keys and values to the metadata dictionary when the object is instantiated.

Topics

Accessing the Document Sample Properties

var documentType: HKDocumentType

The type of document represented by the sample.

Relationships

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.

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.

static let CDA: HKDocumentTypeIdentifier

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

class HKDocumentType

The HKDocumentType class is a concrete subclass of the HKSampleType class, used when creating queries for documents.