Skip to content

Commit

Permalink
Replace get() with variable arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
qiarie committed Nov 28, 2024
1 parent 89417fd commit cbfb3a9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
11 changes: 0 additions & 11 deletions engine/src/main/java/com/google/android/fhir/FhirEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ interface FhirEngine {
*/
suspend fun create(vararg resource: Resource): List<String>

/**
* Loads a FHIR resource given its [ResourceType] and logical ID.
*
* @param type The type of the resource to load.
* @param id The logical ID of the resource.
* @return The requested FHIR resource.
* @throws ResourceNotFoundException if the resource is not found.
*/
@Throws(ResourceNotFoundException::class)
suspend fun get(type: ResourceType, id: String): Resource

/**
* Loads multiple FHIR resources given [ResourceType] and logical IDs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ internal class FhirEngineImpl(private val database: Database, private val contex
override suspend fun create(vararg resource: Resource) =
withContext(Dispatchers.IO) { database.insert(*resource) }

override suspend fun get(type: ResourceType, id: String) =
withContext(Dispatchers.IO) { database.select(type, id) }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ internal object TestFhirEngineImpl : FhirEngine {

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

override suspend fun get(type: ResourceType, id: String): Resource {
return Patient()
}

override suspend fun get(type: ResourceType, vararg ids: String): List<Resource> {
return ids.map { Patient().apply { id = it } }
}
Expand Down

0 comments on commit cbfb3a9

Please sign in to comment.