---
title: HKCDADocument
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkcdadocument
---

# HKCDADocument

An object representing a Clinical Document Architecture (CDA) document in HealthKit.

## Declaration

```swift
class HKCDADocument
```

## Overview

Overview CDA documents use XML to encode clinical documents so that they can be easily exchanged. For more information on the CDA document format, see the Clinical Document Architecture, R2 standard. Do not instantiate HKCDADocument objects directly. Instead, create a new HKCDADocumentSample object by calling the  init(data:start:end:metadata:) method, and passing the CDA’s XML data. HealthKit creates a HKCDADocument object for the XML, and assigns it to the sample’s document property. HKCDADocument objects are immutable. When you create a new document sample, HealthKit parses the title, patient name, author name, and custodian name from the XML to populates the document object’s properties. These properties cannot be changed. As with many HealthKit classes, don’t subclass the HKCDADocument class.

## Topics

### Accessing the Document’s Data

- [authorName](healthkit/hkcdadocument/authorname.md)
- [custodianName](healthkit/hkcdadocument/custodianname.md)
- [documentData](healthkit/hkcdadocument/documentdata.md)
- [patientName](healthkit/hkcdadocument/patientname.md)
- [title](healthkit/hkcdadocument/title.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

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

## See Also

### Accessing the Document

- [document](healthkit/hkcdadocumentsample/document.md)
