The HKCDADocumentSample class is a concrete subclass of the HKDocumentSample class.


Each Clinical Document Architecture (CDA) sample stores a single XML document. The sample’s document property contains an HKCDADocument object that represents the XML data.

Document samples are immutable. HealthKit assigns the document’s properties when the sample is created. They cannot change. If you need to update a document in HealthKit, create a new document sample with the updated CDA XML data.


Creating CDA Samples

init(data: Data, start: Date, end: Date, metadata: [String : Any]?)

Returns a CDA document sample containing the provided XML document and metadata.

Accessing the Document


Document Predicate Keys

Key paths for constructing predicates for querying CDA documents. For more information, see Predicate Format String Syntax.

Document Validation Error Key

A key for accessing detailed information about CDA validation errors.


Inherits From

Conforms To