<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKFHIRVersion",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKFHIRVersion"
  },
  "title" : "HKFHIRVersion"
}
-->

# HKFHIRVersion

The FHIR version.

```
class HKFHIRVersion
```

## Overview

Use an [`HKFHIRVersion`](/documentation/HealthKit/HKFHIRVersion) instance to represent the version of the Fast Healthcare Interoperability Resources (FHIR) standard used to create a [`HKFHIRResource`](/documentation/HealthKit/HKFHIRResource) sample.

## Topics

### Creating Version Objects

[`convenience init(fromVersionString: String) throws`](/documentation/HealthKit/HKFHIRVersion/init(fromVersionString:))

Creates an FHIR version object from a string representation of the version.

[`class func primaryDSTU2() -> Self`](/documentation/HealthKit/HKFHIRVersion/primaryDSTU2())

Returns the primary Second Draft Standard for Trial Use (DSTU2) version.

[`class func primaryR4() -> Self`](/documentation/HealthKit/HKFHIRVersion/primaryR4())

Returns the primary Release 4 (R4) version.

### Accessing Version Data

[`var majorVersion: Int`](/documentation/HealthKit/HKFHIRVersion/majorVersion)

The standard’s major version number.

[`var minorVersion: Int`](/documentation/HealthKit/HKFHIRVersion/minorVersion)

The standard’s minor version number.

[`var patchVersion: Int`](/documentation/HealthKit/HKFHIRVersion/patchVersion)

The standard’s patch version number.

[`var stringRepresentation: String`](/documentation/HealthKit/HKFHIRVersion/stringRepresentation)

A string representation of the version.

### Accessing the Release

[`var fhirRelease: HKFHIRRelease`](/documentation/HealthKit/HKFHIRVersion/fhirRelease)

An official release of the FHIR specification.

[`struct HKFHIRRelease`](/documentation/HealthKit/HKFHIRRelease)

Official releases of the FHIR specification.

### Initializers

[`init?(coder: NSCoder)`](/documentation/HealthKit/HKFHIRVersion/init(coder:))

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)