---
title: HKDocumentType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkdocumenttype
---

# HKDocumentType

A sample type used to create queries for documents.

## Declaration

```swift
class HKDocumentType
```

## Overview

Overview To create a document type instance, use the HKObjectType class’s documentType(forIdentifier:) convenience method. Subclassing Notes As with many HealthKit classes, don’t subclass document types. Additionally, this class reuses the same instance whenever possible. Letting multiple queries share the same document type helps reduce the overall memory usage.

## Topics

### Creating Document Types

- [init(_:)](healthkit/hkdocumenttype/init(_:).md)

## Relationships

### Inherits From

- [HKSampleType](healthkit/hksampletype.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)
- [NSCopying](foundation/nscopying.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)
- [HKDocumentSample](healthkit/hkdocumentsample.md)
- [CDA](healthkit/hkdocumenttypeidentifier/cda.md)
