MedicalDataSource


@ExperimentalPersonalHealthRecordApi
public final class MedicalDataSource


A class to hold the data source information of medical data. Each MedicalResource is associated with a MedicalDataSource.

The medical data is represented using the Fast Healthcare Interoperability Resources (FHIR) standard.

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

MedicalDataSource(
    @NonNull String id,
    @NonNull String packageName,
    @NonNull Uri fhirBaseUri,
    @NonNull String displayName,
    @NonNull FhirVersion fhirVersion,
    Instant lastDataUpdateTime
)

Public methods

boolean
equals(Object other)
final @NonNull String

The display name that describes this MedicalDataSource.

final @NonNull Uri

The FHIR base URI of this MedicalDataSource.

final @NonNull FhirVersion

The FHIR version of this MedicalDataSource.

final @NonNull String

The unique identifier of this MedicalDataSource, generated by HealthConnect at creation time.

final Instant

An Instant indicating a point in time when this MedicalDataSource was last used to update or insert any MedicalResource.

final @NonNull String

The package name of the app that created this MedicalDataSource.

int
@NonNull String

Public constructors

MedicalDataSource

Added in 1.1.0-beta02
public MedicalDataSource(
    @NonNull String id,
    @NonNull String packageName,
    @NonNull Uri fhirBaseUri,
    @NonNull String displayName,
    @NonNull FhirVersion fhirVersion,
    Instant lastDataUpdateTime
)

Public methods

equals

public boolean equals(Object other)

getDisplayName

Added in 1.1.0-beta02
public final @NonNull String getDisplayName()

The display name that describes this MedicalDataSource. This must be be unique per app.

getFhirBaseUri

Added in 1.1.0-beta02
public final @NonNull Uri getFhirBaseUri()

The FHIR base URI of this MedicalDataSource.

getFhirVersion

Added in 1.1.0-beta02
public final @NonNull FhirVersion getFhirVersion()

The FHIR version of this MedicalDataSource. All MedicalResources inserted under this MedicalDataSource must have the same FHIR version.

getId

Added in 1.1.0-beta02
public final @NonNull String getId()

The unique identifier of this MedicalDataSource, generated by HealthConnect at creation time.

getLastDataUpdateTime

Added in 1.1.0-beta02
public final Instant getLastDataUpdateTime()

An Instant indicating a point in time when this MedicalDataSource was last used to update or insert any MedicalResource. null if that has never happened or no data is linked to this MedicalDataSource.

getPackageName

Added in 1.1.0-beta02
public final @NonNull String getPackageName()

The package name of the app that created this MedicalDataSource.

hashCode

public int hashCode()

toString

public @NonNull String toString()