# 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
class CreateMedicalDataSourceRequest
```

<br />

*** ** * ** ***

A create request for `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#CreateMedicalDataSourceRequest(android.net.Uri,kotlin.String,androidx.health.connect.client.records.FhirVersion)( fhirBaseUri: https://developer.android.com/reference/android/net/Uri.html, displayName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, fhirVersion: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/FhirVersion )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#displayName()` The display name that describes the data source. |
| `https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#fhirBaseUri()` The FHIR base URI of the data source. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/FhirVersion` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#fhirVersion()` The FHIR version of the medical data that will be linked to this data source. |

## Public constructors

### CreateMedicalDataSourceRequest

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

```
CreateMedicalDataSourceRequest(
    fhirBaseUri: Uri,
    displayName: String,
    fhirVersion: FhirVersion
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### displayName

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

```
val 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.

### fhirBaseUri

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

```
val fhirBaseUri: Uri
```

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/kotlin/androidx/health/connect/client/request/CreateMedicalDataSourceRequest#fhirBaseUri()`. The maximum length for the URI is 2000 characters.

### fhirVersion

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

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