@ExperimentalPersonalHealthRecordApi
public final class FhirVersion implements Comparable


Represents the FHIR version. This is designed according to the official FHIR 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. Use isSupportedFhirVersion to check whether a FHIR version is supported.

This feature is dependent on the version of HealthConnect installed on the device. To check if it's available call HealthConnectFeatures.getFeatureStatus and pass HealthConnectFeatures.FEATURE_PERSONAL_HEALTH_RECORD as an argument. An UnsupportedOperationException would be thrown if the feature is not available.

Summary

Public constructors

FhirVersion(int major, int minor, int patch)

Public methods

int
boolean
equals(Object other)
final int
final int
final int
int
final boolean

Returns true if this FhirVersion is supported, false otherwise.

static final @NonNull FhirVersion
parseFhirVersion(@NonNull String fhirVersionString)

Creates a FhirVersion object with the version of string format.

@NonNull String

Public constructors

FhirVersion

Added in 1.1.0-beta02
public FhirVersion(int major, int minor, int patch)

Public methods

compareTo

Added in 1.1.0-beta02
public int compareTo(@NonNull FhirVersion other)

equals

public boolean equals(Object other)

getMajor

Added in 1.1.0-beta02
public final int getMajor()

getMinor

Added in 1.1.0-beta02
public final int getMinor()

getPatch

Added in 1.1.0-beta02
public final int getPatch()

hashCode

public int hashCode()

isSupportedFhirVersion

Added in 1.1.0-beta02
public final boolean isSupportedFhirVersion()

Returns true if this FhirVersion is supported, false otherwise.

This method is dependent on the version of HealthConnect installed on the device. To check if it's available call HealthConnectFeatures.getFeatureStatus and pass HealthConnectFeatures.FEATURE_PERSONAL_HEALTH_RECORD as an argument.

parseFhirVersion

Added in 1.1.0-beta02
public static final @NonNull FhirVersion parseFhirVersion(@NonNull String fhirVersionString)

Creates a 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. Note that the "label" is not supported for now, which represents a 'working' version.

toString

public @NonNull String toString()