UpsertMedicalResourceRequest


@ExperimentalPersonalHealthRecordApi
public final class UpsertMedicalResourceRequest


A request class for both inserting and updating MedicalResources.

From dataSourceId, fhir resource type and fhir resource ID extracted from data, a MedicalResourceId will be constructed. If there already exists a MedicalResource with that MedicalResourceId in Health Connect, then that MedicalResource will be updated, otherwise a new MedicalResource will be inserted.

The data representation follows 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.Companion.FEATURE_PERSONAL_HEALTH_RECORD as an argument.

Summary

Public constructors

UpsertMedicalResourceRequest(
    @NonNull String dataSourceId,
    @NonNull FhirVersion fhirVersion,
    @NonNull String data
)

Public methods

boolean
equals(Object other)
final @NonNull String

The FHIR resource data in JSON representation.

final @NonNull String

The ID of an existing MedicalDataSource where the data being inserted comes from.

final @NonNull FhirVersion

The FHIR version being used for data.

int
@NonNull String

Public constructors

UpsertMedicalResourceRequest

Added in 1.1.0-beta02
public UpsertMedicalResourceRequest(
    @NonNull String dataSourceId,
    @NonNull FhirVersion fhirVersion,
    @NonNull String data
)

Public methods

equals

public boolean equals(Object other)

getData

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

The FHIR resource data in JSON representation.

getDataSourceId

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

The ID of an existing MedicalDataSource where the data being inserted comes from.

getFhirVersion

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

The FHIR version being used for data. This must match dataSourceId's MedicalDataSource.fhirVersion.

hashCode

public int hashCode()

toString

public @NonNull String toString()