FhirVersion
@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 |
compareTo(@NonNull FhirVersion other) |
boolean |
|
final int |
getMajor() |
final int |
getMinor() |
final int |
getPatch() |
int |
hashCode() |
final boolean |
Returns |
static final @NonNull FhirVersion |
parseFhirVersion(@NonNull String fhirVersionString)Creates a |
@NonNull String |
toString() |
Public constructors
Public methods
isSupportedFhirVersion
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
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.