MedicalResourceId


class MedicalResourceId : Parcelable
kotlin.Any
   ↳ android.health.connect.MedicalResourceId

A class to represent a unique identifier of a medical resource.

This class contains a set of properties that together represent a unique identifier of a medical resource.

The medical resource data representation follows the Fast Healthcare Interoperability Resources (FHIR) standard.

Summary

Inherited constants
Public constructors
MedicalResourceId(dataSourceId: String, fhirResourceType: Int, fhirResourceId: String)

Constructs a new MedicalResourceId instance.

Public methods
Int

Boolean
equals(other: Any?)

static MedicalResourceId
fromFhirReference(dataSourceId: String, fhirReference: String)

Creates a MedicalResourceId instance from dataSourceId and fhirReference.

String

Returns the unique MedicalDataSource ID of where the data comes from.

String

Returns the FHIR resource ID.

Int

Returns the FHIR resource type.

Int

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<MedicalResourceId!>

Public constructors

MedicalResourceId

MedicalResourceId(
    dataSourceId: String,
    fhirResourceType: Int,
    fhirResourceId: String)

Constructs a new MedicalResourceId instance.

Parameters
dataSourceId String: The unique identifier of the existing MedicalDataSource, representing where the data comes from. This value cannot be null.
fhirResourceType Int: The FHIR resource type. This is the "resourceType" field from a JSON representation of FHIR resource data. Value is android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_IMMUNIZATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ALLERGY_INTOLERANCE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_OBSERVATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_CONDITION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PROCEDURE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION_REQUEST, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION_STATEMENT, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PATIENT, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PRACTITIONER, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PRACTITIONER_ROLE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ENCOUNTER, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_LOCATION, or android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ORGANIZATION
fhirResourceId String: The FHIR resource ID. This is the "id" field from a JSON representation of FHIR resource data. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided dataSourceId is not a valid ID, or fhirResourceType is not a valid supported type.

Public methods

describeContents

fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

fromFhirReference

static fun fromFhirReference(
    dataSourceId: String,
    fhirReference: String
): MedicalResourceId

Creates a MedicalResourceId instance from dataSourceId and fhirReference.

Parameters
dataSourceId String: The unique identifier of the existing MedicalDataSource, representing where the data comes from. This value cannot be null.
fhirReference String: The FHIR reference string typically extracted from the "reference" field in one FHIR resource (source), pointing to another FHIR resource (target) within the same data source, for example "Patient/034AB16". This value cannot be null.
Return
MedicalResourceId This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided dataSourceId is not a valid ID, the referenced resource type is not a valid FhirResource type supported by Health Connect, or fhirReference does not match with the pattern of $fhir_resource_type/$fhir_resource_id, where the FHIR resource type should align with the resource list in the official FHIR website, and the FHIR resource ID should also follow the pattern described in the official FHIR datatypes.

getDataSourceId

fun getDataSourceId(): String

Returns the unique MedicalDataSource ID of where the data comes from.

Return
String This value cannot be null.

getFhirResourceId

fun getFhirResourceId(): String

Returns the FHIR resource ID.

Return
String This value cannot be null.

hashCode

fun hashCode(): Int
Return
Int a hash code value for this object.

toString

fun toString(): String
Return
String a string representation of the object.

writeToParcel

fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

static val CREATOR: Parcelable.Creator<MedicalResourceId!>