@ExperimentalPersonalHealthRecordApi
public final class FhirResource


A class to capture the FHIR resource data. This is the class used for all supported FHIR resource types, which is a subset of the resource list on the official FHIR website and might expand in the future.

FHIR stands for the Fast Healthcare Interoperability Resources.

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

FHIR resource type for AllergyIntolerance.

static final int

FHIR resource type for a FHIR Condition.

static final int

FHIR resource type for a FHIR Encounter.

static final int

FHIR resource type for Immunization.

static final int

FHIR resource type for a FHIR Location.

static final int

FHIR resource type for a FHIR Medication.

static final int

FHIR resource type for a FHIR MedicationRequest.

static final int

FHIR resource type for a FHIR MedicationStatement.

static final int

FHIR resource type for a FHIR Observation.

static final int

FHIR resource type for a FHIR Organization.

static final int

FHIR resource type for a FHIR Patient.

static final int

FHIR resource type for a FHIR Practitioner.

static final int

FHIR resource type for a FHIR PractitionerRole.

static final int

FHIR resource type for a FHIR Procedure.

Public constructors

FhirResource(int type, @NonNull String id, @NonNull String data)

Public methods

boolean
equals(Object other)
final @NonNull String

The FHIR resource data in JSON representation.

final @NonNull String

The FHIR resource ID.

final int

The type of this FHIR resource.

int
@NonNull String

Constants

FHIR_RESOURCE_TYPE_ALLERGY_INTOLERANCE

public static final int FHIR_RESOURCE_TYPE_ALLERGY_INTOLERANCE = 2

FHIR resource type for AllergyIntolerance.

FHIR_RESOURCE_TYPE_CONDITION

public static final int FHIR_RESOURCE_TYPE_CONDITION = 4

FHIR resource type for a FHIR Condition.

FHIR_RESOURCE_TYPE_ENCOUNTER

public static final int FHIR_RESOURCE_TYPE_ENCOUNTER = 12

FHIR resource type for a FHIR Encounter.

FHIR_RESOURCE_TYPE_IMMUNIZATION

public static final int FHIR_RESOURCE_TYPE_IMMUNIZATION = 1

FHIR resource type for Immunization.

FHIR_RESOURCE_TYPE_LOCATION

public static final int FHIR_RESOURCE_TYPE_LOCATION = 13

FHIR resource type for a FHIR Location.

FHIR_RESOURCE_TYPE_MEDICATION

public static final int FHIR_RESOURCE_TYPE_MEDICATION = 6

FHIR resource type for a FHIR Medication.

FHIR_RESOURCE_TYPE_MEDICATION_REQUEST

public static final int FHIR_RESOURCE_TYPE_MEDICATION_REQUEST = 7

FHIR resource type for a FHIR MedicationRequest.

FHIR_RESOURCE_TYPE_MEDICATION_STATEMENT

public static final int FHIR_RESOURCE_TYPE_MEDICATION_STATEMENT = 8

FHIR resource type for a FHIR MedicationStatement.

FHIR_RESOURCE_TYPE_OBSERVATION

public static final int FHIR_RESOURCE_TYPE_OBSERVATION = 3

FHIR resource type for a FHIR Observation.

FHIR_RESOURCE_TYPE_ORGANIZATION

public static final int FHIR_RESOURCE_TYPE_ORGANIZATION = 14

FHIR resource type for a FHIR Organization.

FHIR_RESOURCE_TYPE_PATIENT

public static final int FHIR_RESOURCE_TYPE_PATIENT = 9

FHIR resource type for a FHIR Patient.

FHIR_RESOURCE_TYPE_PRACTITIONER

public static final int FHIR_RESOURCE_TYPE_PRACTITIONER = 10

FHIR resource type for a FHIR Practitioner.

FHIR_RESOURCE_TYPE_PRACTITIONER_ROLE

public static final int FHIR_RESOURCE_TYPE_PRACTITIONER_ROLE = 11

FHIR resource type for a FHIR PractitionerRole.

FHIR_RESOURCE_TYPE_PROCEDURE

public static final int FHIR_RESOURCE_TYPE_PROCEDURE = 5

FHIR resource type for a FHIR Procedure.

Public constructors

FhirResource

Added in 1.1.0-beta02
public FhirResource(int type, @NonNull String id, @NonNull String data)

Public methods

equals

public boolean equals(Object other)

getData

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

The FHIR resource data in JSON representation.

getId

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

The FHIR resource ID. This is extracted from the id field in data. More about FHIR resource ID in https://www.hl7.org/fhir/resource.html#id.

getType

Added in 1.1.0-beta02
public final int getType()

The type of this FHIR resource. This is extracted from the resourceType field in data. The list of supported types is a subset of the resource list on the official FHIR website and might expand in the future.

hashCode

public int hashCode()

toString

public @NonNull String toString()