# ReadMedicalResourcesInitialRequest

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

*** ** * ** ***


```
@ExperimentalPersonalHealthRecordApi
public final class ReadMedicalResourcesInitialRequest extends ReadMedicalResourcesRequest
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.health.connect.client.request.ReadMedicalResourcesRequest](https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesRequest) ||
|   | ↳ | [androidx.health.connect.client.request.ReadMedicalResourcesInitialRequest](https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesInitialRequest) |

*** ** * ** ***

A class to make **initial** requests when reading `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s with `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectClient#readMedicalResources(androidx.health.connect.client.request.ReadMedicalResourcesRequest)`.

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.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectClient#readMedicalResources(androidx.health.connect.client.request.ReadMedicalResourcesRequest)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesInitialRequest#ReadMedicalResourcesInitialRequest(kotlin.Int,kotlin.collections.Set,kotlin.Int)( int medicalResourceType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> medicalDataSourceIds, int pageSize )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesInitialRequest#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/Set.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/ReadMedicalResourcesInitialRequest#getMedicalDataSourceIds()()` Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s belong to one of the `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalDataSource`s represented by these IDs will be returned. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesInitialRequest#getMedicalResourceType()()` Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s with this `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource.Companion.MedicalResourceType` will be returned. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesInitialRequest#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/ReadMedicalResourcesInitialRequest#toString()()` |

| ### Inherited methods |
|---|
| From [androidx.health.connect.client.request.ReadMedicalResourcesRequest](https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesRequest) |---|---| | `final int` | `https://developer.android.com/reference/androidx/health/connect/client/request/ReadMedicalResourcesRequest#getPageSize()()` The maximum number of `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s to be read. | |

## Public constructors

### ReadMedicalResourcesInitialRequest

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

```
public ReadMedicalResourcesInitialRequest(
    int medicalResourceType,
    @NonNull Set<@NonNull String> medicalDataSourceIds,
    int pageSize
)
```

## Public methods

### equals

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

### getMedicalDataSourceIds

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

```
public final @NonNull Set<@NonNull String> getMedicalDataSourceIds()
```

Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s belong to one of the `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalDataSource`s represented by these IDs will be returned. An empty set is permitted, it means `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s from all available apps will be included in the response. An `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` might be thrown if any ID is deemed as invalid.

### getMedicalResourceType

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

```
public final int getMedicalResourceType()
```

Only `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource`s with this `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource.Companion.MedicalResourceType` will be returned. An `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` might be thrown if an invalid type is used, see `https://developer.android.com/reference/androidx/health/connect/client/records/MedicalResource.Companion.MedicalResourceType` for valid values.

### hashCode

```
public int hashCode()
```

### toString

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