UpsertMedicalResourceRequest


@ExperimentalPersonalHealthRecordApi
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(
    dataSourceId: String,
    fhirVersion: FhirVersion,
    data: String
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

String

The FHIR resource data in JSON representation.

String

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

FhirVersion

The FHIR version being used for data.

Public constructors

UpsertMedicalResourceRequest

Added in 1.1.0-beta02
UpsertMedicalResourceRequest(
    dataSourceId: String,
    fhirVersion: FhirVersion,
    data: String
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

data

Added in 1.1.0-beta02
val dataString

The FHIR resource data in JSON representation.

dataSourceId

Added in 1.1.0-beta02
val dataSourceIdString

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

fhirVersion

Added in 1.1.0-beta02
val fhirVersionFhirVersion

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