# FhirVersion

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)

# FhirVersion

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/health/connect/datatypes/FhirVersion "View this page in Java")  

```
class FhirVersion : Parcelable
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                               ||
| ↳ | [android.health.connect.datatypes.FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#) |

Represents the FHIR version. This is designed according to[the official FHIR versions](https://build.fhir.org/versions.html#versions)of the Fast Healthcare Interoperability Resources (FHIR) standard. "label", which represents a 'working' version, is not supported for now.

The versions R4 (4.0.1) and R4B (4.3.0) are supported in Health Connect.

## Summary

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                                                                      Public methods                                                                                                                                                                                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                        | [describeContents](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#describeContents())`()` <br />                                                                                                                                                                                                                                                                                                                          |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                | [equals](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Indicates whether some other object is "equal to" this one.                                                                                                                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                        | [getMajor](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#getMajor())`()` Returns the major version.                                                                                                                                                                                                                                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                        | [getMinor](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#getMinor())`()` Returns the minor version.                                                                                                                                                                                                                                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                        | [getPatch](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#getPatch())`()` Returns the patch version.                                                                                                                                                                                                                                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                        | [hashCode](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#hashCode())`()` Returns a hash code value for the object.                                                                                                                                                                                                                                                                                                       |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                | [isSupportedFhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#isSupportedFhirVersion())`()` Returns`true`if the[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#)is supported by Health Connect.                                                                                                                                                       |
| static[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#) | [parseFhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#parseFhirVersion(kotlin.String))`(`fhirVersionString:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#)object with the version of string format.                                               |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                  | [toString](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#toString())`()` Returns the string representation of the FHIR version.                                                                                                                                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                      | [writeToParcel](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Populates a[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)with the self information. |

|                                                                                                                                                                                     Properties                                                                                                                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#CREATOR:android.os.Parcelable.Creator) <br /> |

## Public methods

### describeContents

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### equals

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun equals(other: Any?): Boolean
```

Indicates whether some other object is "equal to" this one.

|                     Parameters                     ||
|-------|---------------------------------------------|
| `obj` | the reference object with which to compare. |

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### getMajor

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun getMajor(): Int
```

Returns the major version.  

### getMinor

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun getMinor(): Int
```

Returns the minor version.  

### getPatch

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun getPatch(): Int
```

Returns the patch version.  

### hashCode

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

Returns a hash code value for the object.

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### isSupportedFhirVersion

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun isSupportedFhirVersion(): Boolean
```

Returns`true`if the[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#)is supported by Health Connect.  

### parseFhirVersion

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
static fun parseFhirVersion(fhirVersionString: String): FhirVersion
```

Creates a[FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#)object with the version of string format.

The format should look like "4.0.1" which contains 3 numbers - major, minor and patch, separated by ".". This aligns with[the official FHIR versions](https://build.fhir.org/versions.html#versions). Note that the "label" is not supported for now, which represents a 'working' version.

|                                                            Parameters                                                             ||
|---------------------|--------------------------------------------------------------------------------------------------------------|
| `fhirVersionString` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

|                                                                  Return                                                                  ||
|-------------------------------------------------------------------------------------------------------------|-----------------------------|
| [FhirVersion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/FhirVersion#) | This value cannot be`null`. |

### toString

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

Returns the string representation of the FHIR version.

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

### writeToParcel

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Populates a[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)with the self information.

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#):This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[U Extensions 16](https://developer.android.com/sdkExtensions)  

```
static val CREATOR: Parcelable.Creator<FhirVersion!>
```