MedicalResourceId
class MedicalResourceId : Parcelable
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 |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
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
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 . |
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.
Return |
Int |
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 |
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.
Properties