# GetMedicalDataSourcesRequest

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/GetMedicalDataSourcesRequest.kt+class:androidx.health.connect.client.request.GetMedicalDataSourcesRequest) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
@ExperimentalPersonalHealthRecordApi
public final class GetMedicalDataSourcesRequest
```

<br />

*** ** * ** ***

Request to read medical data sources using HealthConnectManager#getMedicalDataSources

If no package names are set in a request, all data sources from all packages will be returned. Otherwise the response is limited to the requested package names per permission enforced in `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectClient#getMedicalDataSources(androidx.health.connect.client.request.GetMedicalDataSourcesRequest)`

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/GetMedicalDataSourcesRequest#GetMedicalDataSourcesRequest(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> packageNames)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/request/GetMedicalDataSourcesRequest#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/util/List.html<@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/GetMedicalDataSourcesRequest#getPackageNames()()` Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalDataSource`s created by the apps with these package names will be returned. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/request/GetMedicalDataSourcesRequest#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/GetMedicalDataSourcesRequest#toString()()` |

## Public constructors

### GetMedicalDataSourcesRequest

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

```
public GetMedicalDataSourcesRequest(@NonNull List<@NonNull String> packageNames)
```

## Public methods

### equals

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

### getPackageNames

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

```
public final @NonNull List<@NonNull String> getPackageNames()
```

Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalDataSource`s created by the apps with these package names will be returned.

### hashCode

```
public int hashCode()
```

### toString

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