FhirResource
@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 |
|
final @NonNull String |
getData()The FHIR resource data in JSON representation. |
final @NonNull String |
getId()The FHIR resource ID. |
final int |
getType()The type of this FHIR resource. |
int |
hashCode() |
@NonNull String |
toString() |
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
Public methods
getData
public final @NonNull String getData()
The FHIR resource data in JSON representation.
getId
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
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.