@ExperimentalPersonalHealthRecordApi
class MedicalResource


A class to hold medical resource data.

Unlike FHIR resource which is represented in Health Connect with FhirResource, MedicalResource is a Health Connect specific concept. A MedicalResource contains more than just a FhirResource, notably, it also contains:

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.FEATURE_PERSONAL_HEALTH_RECORD as an argument. An UnsupportedOperationException would be thrown if the feature is not available.

Summary

Constants

const Int

Medical resource type that labels data as allergies or intolerances.

const Int

Medical resource type that labels data as medical conditions (clinical condition, problem, diagnosis etc).

const Int

Medical resource type that labels data as results (Laboratory or pathology).

const Int

Medical resource type that labels data as medication related.

const Int

Medical resource type that labels data as related to personal details, including demographic information such as name, date of birth, and contact details such as address or telephone numbers.

const Int

Medical resource type that labels data as related to practitioners.

const Int

Medical resource type that labels data as to do with pregnancy.

const Int

Medical resource type that labels data as procedures (actions taken on or for a patient).

const Int

Medical resource type that labels data as social history.

const Int

Medical resource type that labels data as vaccines.

const Int

Medical resource type that labels data as related to an encounter with a practitioner.

const Int

Medical resource type that labels data as vital signs.

Public constructors

MedicalResource(
    type: Int,
    id: MedicalResourceId,
    dataSourceId: String,
    fhirVersion: FhirVersion,
    fhirResource: FhirResource
)

Public functions

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

Public properties

String

The ID of the MedicalDataSource where this MedicalResource comes from.

FhirResource

The FhirResource that this MedicalResource represents.

FhirVersion

The FHIR version of fhirResource.

MedicalResourceId

The unique ID of this MedicalResource represented by a MedicalResourceId.

Int

The MedicalResourceType of this MedicalResource, this is assigned by Health Connect at insertion time.

Constants

MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES

const val MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES = 2: Int

Medical resource type that labels data as allergies or intolerances.

MEDICAL_RESOURCE_TYPE_CONDITIONS

const val MEDICAL_RESOURCE_TYPE_CONDITIONS = 7: Int

Medical resource type that labels data as medical conditions (clinical condition, problem, diagnosis etc).

MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS

const val MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS = 6: Int

Medical resource type that labels data as results (Laboratory or pathology).

MEDICAL_RESOURCE_TYPE_MEDICATIONS

const val MEDICAL_RESOURCE_TYPE_MEDICATIONS = 9: Int

Medical resource type that labels data as medication related.

MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS

const val MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS = 10: Int

Medical resource type that labels data as related to personal details, including demographic information such as name, date of birth, and contact details such as address or telephone numbers.

MEDICAL_RESOURCE_TYPE_PRACTITIONER_DETAILS

const val MEDICAL_RESOURCE_TYPE_PRACTITIONER_DETAILS = 11: Int

Medical resource type that labels data as related to practitioners. This is information about the doctors, nurses, masseurs, physios, etc who have been involved with the user.

MEDICAL_RESOURCE_TYPE_PREGNANCY

const val MEDICAL_RESOURCE_TYPE_PREGNANCY = 3: Int

Medical resource type that labels data as to do with pregnancy.

MEDICAL_RESOURCE_TYPE_PROCEDURES

const val MEDICAL_RESOURCE_TYPE_PROCEDURES = 8: Int

Medical resource type that labels data as procedures (actions taken on or for a patient).

MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY

const val MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY = 4: Int

Medical resource type that labels data as social history.

MEDICAL_RESOURCE_TYPE_VACCINES

const val MEDICAL_RESOURCE_TYPE_VACCINES = 1: Int

Medical resource type that labels data as vaccines.

MEDICAL_RESOURCE_TYPE_VISITS

const val MEDICAL_RESOURCE_TYPE_VISITS = 12: Int

Medical resource type that labels data as related to an encounter with a practitioner. This includes visits to healthcare providers and remote encounters such as telephone and videoconference appointments, and information about the time, location and organization who is being met.

MEDICAL_RESOURCE_TYPE_VITAL_SIGNS

const val MEDICAL_RESOURCE_TYPE_VITAL_SIGNS = 5: Int

Medical resource type that labels data as vital signs.

Public constructors

MedicalResource

Added in 1.1.0-beta02
MedicalResource(
    type: Int,
    id: MedicalResourceId,
    dataSourceId: String,
    fhirVersion: FhirVersion,
    fhirResource: FhirResource
)

Public functions

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

dataSourceId

Added in 1.1.0-beta02
val dataSourceIdString

The ID of the MedicalDataSource where this MedicalResource comes from.

fhirResource

Added in 1.1.0-beta02
val fhirResourceFhirResource

The FhirResource that this MedicalResource represents.

fhirVersion

Added in 1.1.0-beta02
val fhirVersionFhirVersion

The FHIR version of fhirResource.

id

Added in 1.1.0-beta02
val idMedicalResourceId

The unique ID of this MedicalResource represented by a MedicalResourceId.

type

Added in 1.1.0-beta02
val typeInt

The MedicalResourceType of this MedicalResource, this is assigned by Health Connect at insertion time. Clients should be aware that this list is non exhaustive and may increase in future releases when additional types will need to be handled.