MedicalResourceId
@ExperimentalPersonalHealthRecordApi
public final class MedicalResourceId
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 MedicalResource.
The medical resource 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
Public constructors |
|---|
MedicalResourceId( |
Public methods |
|
|---|---|
boolean |
|
static final @NonNull MedicalResourceId |
fromFhirReference(Creates a |
final @NonNull String |
The ID of the |
final @NonNull String |
The ID of the FHIR resource. |
final int |
The type of the FHIR resource. |
int |
hashCode() |
@NonNull String |
toString() |
Public constructors
Public methods
fromFhirReference
public static final @NonNull MedicalResourceId fromFhirReference(
@NonNull String dataSourceId,
@NonNull String fhirReference
)
Creates a MedicalResourceId instance from dataSourceId and fhirReference.
This method 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.
| Parameters | |
|---|---|
@NonNull String dataSourceId |
Represents ID of a |
@NonNull String fhirReference |
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". |
| Throws | |
|---|---|
IllegalArgumentException |
if the provided |
getDataSourceId
public final @NonNull String getDataSourceId()
The ID of the MedicalDataSource where the data comes from.
getFhirResourceId
public final @NonNull String getFhirResourceId()
The ID of the FHIR resource. This must be unique per MedicalDataSource.
getFhirResourceType
public final int getFhirResourceType()
The type of the FHIR resource. It should be one of the values in FhirResourceType.