Builder


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

Builder class for MedicalResource.

Summary

Public constructors

Constructs a clone of the other MedicalResource instance.

Constructs a clone of the other MedicalResource.Builder.

Builder(type: Int, dataSourceId: String, fhirVersion: FhirVersion, fhirResource: FhirResource)

Constructs a new MedicalResource.Builder instance.

Public methods
MedicalResource

Returns a new instance of MedicalResource with the specified parameters.

MedicalResource.Builder
setDataSourceId(dataSourceId: String)

Sets the unique MedicalDataSource ID of where the data comes from.

MedicalResource.Builder

Sets the enclosed FhirResource object.

MedicalResource.Builder

Sets the FHIR version being used for fhirResource.

MedicalResource.Builder
setType(type: Int)

Sets the medical resource type.

Public constructors

Builder

Builder(other: MedicalResource)

Constructs a clone of the other MedicalResource instance.

Parameters
other MedicalResource: This value cannot be null.

Builder

Builder(other: MedicalResource.Builder)

Constructs a clone of the other MedicalResource.Builder.

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

Builder

Builder(
    type: Int,
    dataSourceId: String,
    fhirVersion: FhirVersion,
    fhirResource: FhirResource)

Constructs a new MedicalResource.Builder instance.

Parameters
type Int: The medical resource type. Value is android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_CONDITIONS, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_MEDICATIONS, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_PRACTITIONER_DETAILS, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_PREGNANCY, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_PROCEDURES, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_VACCINES, android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_VISITS, or android.health.connect.datatypes.MedicalResource#MEDICAL_RESOURCE_TYPE_VITAL_SIGNS
dataSourceId String: The unique MedicalDataSource ID of where the data comes from. This value cannot be null.
fhirVersion FhirVersion: the FHIR version being used for fhirResource. This value cannot be null.
fhirResource FhirResource: The enclosed FhirResource object. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided medical resource type is not a valid supported type, or dataSourceId is not a valid ID.

Public methods

build

fun build(): MedicalResource

Returns a new instance of MedicalResource with the specified parameters.

Return
MedicalResource This value cannot be null.

setDataSourceId

fun setDataSourceId(dataSourceId: String): MedicalResource.Builder

Sets the unique MedicalDataSource ID of where the data comes from.

Parameters
dataSourceId String: This value cannot be null.
Return
MedicalResource.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided dataSourceId is not a valid ID.

setFhirResource

fun setFhirResource(fhirResource: FhirResource): MedicalResource.Builder

Sets the enclosed FhirResource object.

Parameters
fhirResource FhirResource: This value cannot be null.
Return
MedicalResource.Builder This value cannot be null.

setFhirVersion

fun setFhirVersion(fhirVersion: FhirVersion): MedicalResource.Builder

Sets the FHIR version being used for fhirResource.

Parameters
fhirVersion FhirVersion: This value cannot be null.
Return
MedicalResource.Builder This value cannot be null.