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 |
Public methods | |
---|---|
Int | |
Boolean | |
static MedicalResourceId |
fromFhirReference(dataSourceId: String, fhirReference: String) Creates a |
String |
Returns the unique |
String |
Returns the FHIR resource ID. |
Int |
Returns the FHIR resource type. |
Int |
hashCode() |
String |
toString() |
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.
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
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 . |
getFhirResourceType
fun getFhirResourceType(): Int
Returns the FHIR resource type.
hashCode
fun hashCode(): Int
toString
fun toString(): String
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 |