Class

HKCDADocument

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

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.

Subclassing Notes

Like many HealthKit classes, the HKCDADocument class should not be subclassed.

Topics

Accessing the Document’s Data

var authorName: String

The document’s author.

var custodianName: String

The name of the organization responsible for the document.

var documentData: Data?

The CDA document stored as XML data.

var patientName: String

The patient’s name.

var title: String

The document’s title.

Relationships

Inherits From

Conforms To

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software