@ExperimentalPersonalHealthRecordApi
public final 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

static final int

Medical resource type that labels data as allergies or intolerances.

static final int

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

static final int

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

static final int

Medical resource type that labels data as medication related.

static final 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.

static final int

Medical resource type that labels data as related to practitioners.

static final int

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

static final int

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

static final int

Medical resource type that labels data as social history.

static final int

Medical resource type that labels data as vaccines.

static final int

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

static final int

Medical resource type that labels data as vital signs.

Public constructors

MedicalResource(
    int type,
    @NonNull MedicalResourceId id,
    @NonNull String dataSourceId,
    @NonNull FhirVersion fhirVersion,
    @NonNull FhirResource fhirResource
)

Public methods

boolean
equals(Object other)
final @NonNull String

The ID of the MedicalDataSource where this MedicalResource comes from.

final @NonNull FhirResource

The FhirResource that this MedicalResource represents.

final @NonNull FhirVersion

The FHIR version of fhirResource.

final @NonNull MedicalResourceId

The unique ID of this MedicalResource represented by a MedicalResourceId.

final int

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

int
@NonNull String

Constants

MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES

public static final int MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES = 2

Medical resource type that labels data as allergies or intolerances.

MEDICAL_RESOURCE_TYPE_CONDITIONS

public static final int MEDICAL_RESOURCE_TYPE_CONDITIONS = 7

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

MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS

public static final int MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS = 6

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

MEDICAL_RESOURCE_TYPE_MEDICATIONS

public static final int MEDICAL_RESOURCE_TYPE_MEDICATIONS = 9

Medical resource type that labels data as medication related.

MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS

public static final int MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS = 10

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

public static final int MEDICAL_RESOURCE_TYPE_PRACTITIONER_DETAILS = 11

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

public static final int MEDICAL_RESOURCE_TYPE_PREGNANCY = 3

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

MEDICAL_RESOURCE_TYPE_PROCEDURES

public static final int MEDICAL_RESOURCE_TYPE_PROCEDURES = 8

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

MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY

public static final int MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY = 4

Medical resource type that labels data as social history.

MEDICAL_RESOURCE_TYPE_VACCINES

public static final int MEDICAL_RESOURCE_TYPE_VACCINES = 1

Medical resource type that labels data as vaccines.

MEDICAL_RESOURCE_TYPE_VISITS

public static final int MEDICAL_RESOURCE_TYPE_VISITS = 12

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

public static final int MEDICAL_RESOURCE_TYPE_VITAL_SIGNS = 5

Medical resource type that labels data as vital signs.

Public constructors

MedicalResource

Added in 1.1.0-beta02
public MedicalResource(
    int type,
    @NonNull MedicalResourceId id,
    @NonNull String dataSourceId,
    @NonNull FhirVersion fhirVersion,
    @NonNull FhirResource fhirResource
)

Public methods

equals

public boolean equals(Object other)

getDataSourceId

Added in 1.1.0-beta02
public final @NonNull String getDataSourceId()

The ID of the MedicalDataSource where this MedicalResource comes from.

getFhirResource

Added in 1.1.0-beta02
public final @NonNull FhirResource getFhirResource()

The FhirResource that this MedicalResource represents.

getFhirVersion

Added in 1.1.0-beta02
public final @NonNull FhirVersion getFhirVersion()

The FHIR version of fhirResource.

getId

Added in 1.1.0-beta02
public final @NonNull MedicalResourceId getId()

The unique ID of this MedicalResource represented by a MedicalResourceId.

getType

Added in 1.1.0-beta02
public final int getType()

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.

hashCode

public int hashCode()

toString

public @NonNull String toString()