Builder


class Builder
kotlin.Any
   ↳ android.health.connect.datatypes.FhirResource.Builder

Builder class for FhirResource.

Summary

Public constructors

Constructs a clone of the other FhirResource instance.

Constructs a clone of the other FhirResource.Builder.

Builder(type: Int, id: String, data: String)

Constructs a new FhirResource.Builder instance.

Public methods
FhirResource

Returns a new instance of FhirResource with the specified parameters.

FhirResource.Builder
setData(data: String)

Sets the FHIR resource data in JSON representation.

FhirResource.Builder

Sets the FHIR resource ID.

FhirResource.Builder
setType(type: Int)

Sets the FHIR resource type.

Public constructors

Builder

Builder(other: FhirResource)

Constructs a clone of the other FhirResource instance.

Parameters
other FhirResource: This value cannot be null.

Builder

Builder(other: FhirResource.Builder)

Constructs a clone of the other FhirResource.Builder.

Parameters
other FhirResource.Builder: This value cannot be null.

Builder

Builder(
    type: Int,
    id: String,
    data: String)

Constructs a new FhirResource.Builder instance.

Parameters
type Int: The FHIR resource type extracted from the "resourceType" field in data. Value is android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_IMMUNIZATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ALLERGY_INTOLERANCE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_OBSERVATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_CONDITION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PROCEDURE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION_REQUEST, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_MEDICATION_STATEMENT, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PATIENT, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PRACTITIONER, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_PRACTITIONER_ROLE, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ENCOUNTER, android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_LOCATION, or android.health.connect.datatypes.FhirResource#FHIR_RESOURCE_TYPE_ORGANIZATION
id String: The FHIR resource ID extracted from the "id" field in data. This value cannot be null.
data String: The FHIR resource data in JSON representation. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided FHIR resource type is not a valid supported type.

Public methods

build

fun build(): FhirResource

Returns a new instance of FhirResource with the specified parameters.

Return
FhirResource This value cannot be null.

setData

fun setData(data: String): FhirResource.Builder

Sets the FHIR resource data in JSON representation.

Parameters
data String: This value cannot be null.
Return
FhirResource.Builder This value cannot be null.

setId

fun setId(id: String): FhirResource.Builder

Sets the FHIR resource ID. This is extracted from the "id" field in data. This is NOT a unique identifier among all FhirResources.

Parameters
id String: This value cannot be null.
Return
FhirResource.Builder This value cannot be null.