Skip to content

Commit 68afe18

Browse files
committed
Replace get() with variable arguments
1 parent 89417fd commit 68afe18

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

engine/src/main/java/com/google/android/fhir/FhirEngine.kt

-24
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ interface FhirEngine {
7272
*/
7373
suspend fun create(vararg resource: Resource): List<String>
7474

75-
/**
76-
* Loads a FHIR resource given its [ResourceType] and logical ID.
77-
*
78-
* @param type The type of the resource to load.
79-
* @param id The logical ID of the resource.
80-
* @return The requested FHIR resource.
81-
* @throws ResourceNotFoundException if the resource is not found.
82-
*/
83-
@Throws(ResourceNotFoundException::class)
84-
suspend fun get(type: ResourceType, id: String): Resource
85-
8675
/**
8776
* Loads multiple FHIR resources given [ResourceType] and logical IDs.
8877
*
@@ -225,19 +214,6 @@ interface FhirEngine {
225214
suspend fun withTransaction(block: suspend FhirEngine.() -> Unit)
226215
}
227216

228-
/**
229-
* Retrieves a FHIR resource of type [R] with the given [id] from the local storage.
230-
*
231-
* @param R The type of the FHIR resource to retrieve.
232-
* @param id The logical ID of the resource to retrieve.
233-
* @return The requested FHIR resource.
234-
* @throws ResourceNotFoundException if the resource is not found.
235-
*/
236-
@Throws(ResourceNotFoundException::class)
237-
suspend inline fun <reified R : Resource> FhirEngine.get(id: String): R {
238-
return get(getResourceType(R::class.java), id) as R
239-
}
240-
241217
/**
242218
* Retrieves FHIR resources of type [R] with the given [ids] from the local storage.
243219
*

engine/src/main/java/com/google/android/fhir/impl/FhirEngineImpl.kt

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ internal class FhirEngineImpl(private val database: Database, private val contex
4949
override suspend fun create(vararg resource: Resource) =
5050
withContext(Dispatchers.IO) { database.insert(*resource) }
5151

52-
override suspend fun get(type: ResourceType, id: String) =
53-
withContext(Dispatchers.IO) { database.select(type, id) }
54-
5552
override suspend fun get(type: ResourceType, vararg ids: String) =
5653
withContext(Dispatchers.IO) { ids.map { id -> database.select(type, id) } }
5754

engine/src/main/java/com/google/android/fhir/testing/Utilities.kt

-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ internal object TestFhirEngineImpl : FhirEngine {
147147

148148
override suspend fun update(vararg resource: Resource) {}
149149

150-
override suspend fun get(type: ResourceType, id: String): Resource {
151-
return Patient()
152-
}
153-
154150
override suspend fun get(type: ResourceType, vararg ids: String): List<Resource> {
155151
return ids.map { Patient().apply { id = it } }
156152
}

0 commit comments

Comments
 (0)