---
title: HKDocumentSample
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkdocumentsample
---

# HKDocumentSample

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

## Declaration

```swift
class HKDocumentSample
```

## Overview

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. Extend Document Samples 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

- [documentType](healthkit/hkdocumentsample/documenttype.md)

## Relationships

### Inherits From

- [HKSample](healthkit/hksample.md)

### Inherited By

- [HKCDADocumentSample](healthkit/hkcdadocumentsample.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Medical records

- [Accessing Health Records](healthkit/accessing-health-records.md)
- [Accessing Sample Data in the Simulator](healthkit/accessing-sample-data-in-the-simulator.md)
- [Accessing a User’s Clinical Records](healthkit/accessing-a-user-s-clinical-records.md)
- [Accessing Data from a SMART Health Card](healthkit/accessing-data-from-a-smart-health-card.md)
- [HKClinicalRecord](healthkit/hkclinicalrecord.md)
- [HKFHIRResource](healthkit/hkfhirresource.md)
- [HKVerifiableClinicalRecord](healthkit/hkverifiableclinicalrecord.md)
- [HKVerifiableClinicalRecordSubject](healthkit/hkverifiableclinicalrecordsubject.md)
- [HKCDADocumentSample](healthkit/hkcdadocumentsample.md)
- [CDA](healthkit/hkdocumenttypeidentifier/cda.md)
- [HKDocumentType](healthkit/hkdocumenttype.md)
