CreateMedicalDataSourceRequest.Builder


public static final class CreateMedicalDataSourceRequest.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.CreateMedicalDataSourceRequest.Builder


Builder class for CreateMedicalDataSourceRequest.

Summary

Public constructors

Builder(CreateMedicalDataSourceRequest other)

Constructs a clone of the other CreateMedicalDataSourceRequest instance.

Builder(CreateMedicalDataSourceRequest.Builder other)

Constructs a clone of the other CreateMedicalDataSourceRequest.Builder.

Builder(Uri fhirBaseUri, String displayName, FhirVersion fhirVersion)

Constructs a new CreateMedicalDataSourceRequest.Builder instance.

Public methods

CreateMedicalDataSourceRequest build()

Returns a new instance of CreateMedicalDataSourceRequest with the specified parameters.

CreateMedicalDataSourceRequest.Builder setDisplayName(String displayName)

Sets the display name.

CreateMedicalDataSourceRequest.Builder setFhirBaseUri(Uri fhirBaseUri)

Sets the FHIR base URI.

CreateMedicalDataSourceRequest.Builder setFhirVersion(FhirVersion fhirVersion)

Sets the FHIR version of data from this data source.

Inherited methods

Public constructors

Builder

Added in API level 36
Also in U Extensions 16
public Builder (CreateMedicalDataSourceRequest other)

Constructs a clone of the other CreateMedicalDataSourceRequest instance.

Parameters
other CreateMedicalDataSourceRequest: This value cannot be null.

Builder

Added in API level 36
Also in U Extensions 16
public Builder (CreateMedicalDataSourceRequest.Builder other)

Constructs a clone of the other CreateMedicalDataSourceRequest.Builder.

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

Builder

Added in API level 36
Also in U Extensions 16
public Builder (Uri fhirBaseUri, 
                String displayName, 
                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 FHIR base URL (e.g. `https://example.com/fhir`). If the data is generated by an app without a FHIR URL, this can be populated by a unique and understandable URI defined by the app (e.g. `myapp://..`) that points to the source of the data. We recommend not to use a domain name that you don't control. If your app supports app deep linking, this URI would ideally link to the source data. 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

Added in API level 36
Also in U Extensions 16
public CreateMedicalDataSourceRequest build ()

Returns a new instance of CreateMedicalDataSourceRequest with the specified parameters.

Returns
CreateMedicalDataSourceRequest This value cannot be null.

Throws
IllegalArgumentException if the mFhirBaseUri or mDisplayName exceed the character limits or if the mFhirVersion is not supported by Health Connect.

setDisplayName

Added in API level 36
Also in U Extensions 16
public CreateMedicalDataSourceRequest.Builder setDisplayName (String displayName)

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.

Returns
CreateMedicalDataSourceRequest.Builder This value cannot be null.

setFhirBaseUri

Added in API level 36
Also in U Extensions 16
public CreateMedicalDataSourceRequest.Builder setFhirBaseUri (Uri fhirBaseUri)

Sets the FHIR base URI. For data coming from a FHIR server this should be the FHIR base URL (e.g. `https://example.com/fhir`).

If the data is generated by an app without a FHIR base URL, this can be populated by a URI defined by the app (e.g. `myapp://..`) that should:

  • Be a unique and understandable URI.
  • Point to the source of the data. We recommend not to use a domain name that you don't control.
  • Ideally allow linking to the data source if your app supports app deep linking to the data.

The URI may not exceed 2000 characters.

Parameters
fhirBaseUri Uri: This value cannot be null.

Returns
CreateMedicalDataSourceRequest.Builder This value cannot be null.

setFhirVersion

Added in API level 36
Also in U Extensions 16
public CreateMedicalDataSourceRequest.Builder setFhirVersion (FhirVersion fhirVersion)

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.

Returns
CreateMedicalDataSourceRequest.Builder This value cannot be null.