Builder


class Builder
kotlin.Any
   ↳ android.health.connect.CreateMedicalDataSourceRequest.Builder

Builder class for CreateMedicalDataSourceRequest.

Summary

Public constructors

Constructs a clone of the other CreateMedicalDataSourceRequest instance.

Constructs a clone of the other CreateMedicalDataSourceRequest.Builder.

Builder(fhirBaseUri: Uri, displayName: String, fhirVersion: FhirVersion)

Constructs a new CreateMedicalDataSourceRequest.Builder instance.

Public methods
CreateMedicalDataSourceRequest

Returns a new instance of CreateMedicalDataSourceRequest with the specified parameters.

CreateMedicalDataSourceRequest.Builder
setDisplayName(displayName: String)

Sets the display name.

CreateMedicalDataSourceRequest.Builder
setFhirBaseUri(fhirBaseUri: Uri)

Sets the FHIR base URI.

CreateMedicalDataSourceRequest.Builder

Sets the FHIR version of data from this data source.

Public constructors

Builder

Builder(other: CreateMedicalDataSourceRequest)

Constructs a clone of the other CreateMedicalDataSourceRequest instance.

Parameters
other CreateMedicalDataSourceRequest: This value cannot be null.

Builder

Builder(other: CreateMedicalDataSourceRequest.Builder)

Constructs a clone of the other CreateMedicalDataSourceRequest.Builder.

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

Builder

Builder(
    fhirBaseUri: Uri,
    displayName: String,
    fhirVersion: FhirVersion)

Constructs a new CreateMedicalDataSourceRequest.Builder instance.

Parameters
fhirBaseUri Uri: The FHIR base URI of the data source. For data coming from a FHIR server this should be the base URL. The maximum length for the URI is 2000 characters. This value cannot be null.
displayName String: The display name that describes the data source. The maximum length for the display name is 90 characters. This must be unique per app. This value cannot be null.
fhirVersion FhirVersion: The FHIR version of the medical data that will be linked to this data source. This has to be a version supported by Health Connect, as documented on the FhirVersion. This value cannot be null.

Public methods

build

fun build(): CreateMedicalDataSourceRequest

Returns a new instance of CreateMedicalDataSourceRequest with the specified parameters.

Return
CreateMedicalDataSourceRequest This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the mFhirBaseUri or mDisplayName exceed the character limits or if the mFhirVersion is not supported by Health Connect.

setDisplayName

fun setDisplayName(displayName: String): CreateMedicalDataSourceRequest.Builder

Sets the display name. For the request to succeed this must be unique per app.

The display name may not exceed 90 characters.

Parameters
displayName String: This value cannot be null.
Return
CreateMedicalDataSourceRequest.Builder This value cannot be null.

setFhirBaseUri

fun setFhirBaseUri(fhirBaseUri: Uri): CreateMedicalDataSourceRequest.Builder

Sets the FHIR base URI. For data coming from a FHIR server this should be the base URL.

The URI may not exceed 2000 characters.

Parameters
fhirBaseUri Uri: This value cannot be null.
Return
CreateMedicalDataSourceRequest.Builder This value cannot be null.

setFhirVersion

fun setFhirVersion(fhirVersion: FhirVersion): CreateMedicalDataSourceRequest.Builder

Sets the FHIR version of data from this data source.

This has to be a version supported by Health Connect, as documented on the FhirVersion.

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