# CreateMedicalDataSourceRequest

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/request/CreateMedicalDataSourceRequest.kt+class:androidx.health.connect.client.request.CreateMedicalDataSourceRequest) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***

<br />

```
@ExperimentalPersonalHealthRecordApi
public final class CreateMedicalDataSourceRequest
```

<br />

*** ** * ** ***

A create request for `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectClient#createMedicalDataSource(androidx.health.connect.client.request.CreateMedicalDataSourceRequest)`.

The medical data is represented using the Fast Healthcare Interoperability Resources ([FHIR](https://hl7.org/fhir/)) standard.

This feature is dependent on the version of HealthConnect installed on the device. To check if it's available call `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#FEATURE_PERSONAL_HEALTH_RECORD()` as an argument. An `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` would be thrown if the feature is not available.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#CreateMedicalDataSourceRequest(android.net.Uri,kotlin.String,androidx.health.connect.client.records.FhirVersion)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html fhirBaseUri, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html displayName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/FhirVersion fhirVersion )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#getDisplayName()()` The display name that describes the data source. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#getFhirBaseUri()()` The FHIR base URI of the data source. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/FhirVersion` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#getFhirVersion()()` The FHIR version of the medical data that will be linked to this data source. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#toString()()` |

## Public constructors

### CreateMedicalDataSourceRequest

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public CreateMedicalDataSourceRequest(
    @NonNull Uri fhirBaseUri,
    @NonNull String displayName,
    @NonNull FhirVersion fhirVersion
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getDisplayName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final @NonNull String getDisplayName()
```

The display name that describes the data source. The maximum length for the display name is 90 characters. This must be unique per app.

### getFhirBaseUri

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final @NonNull Uri getFhirBaseUri()
```

The FHIR base URI of the data source. For data coming from a FHIR server this should be the [FHIR base URL](https://hl7.org/fhir/R4/http.html#root) (e.g. `https://example.com/fhir/`). If the data is generated by an app without a FHIR URL, `fhirBaseUri` should be a unique and understandable URI defined by the app (e.g. `myapp://..`) that points to the source of the data. As an example, if a client app supports an [app deep linking](https://developer.android.com/training/app-links/deep-linking), this deeplink could be used as `https://developer.android.com/reference/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#fhirBaseUri()`. The maximum length for the URI is 2000 characters.

### getFhirVersion

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final @NonNull FhirVersion getFhirVersion()
```

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 `https://developer.android.com/reference/androidx/health/connect/client/records/FhirVersion`.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```