@@ -83,6 +83,17 @@ interface FhirEngine {
83
83
@Throws(ResourceNotFoundException ::class )
84
84
suspend fun get (type : ResourceType , id : String ): Resource
85
85
86
+ /* *
87
+ * Loads multiple FHIR resources given [ResourceType] and logical IDs.
88
+ *
89
+ * @param type The type of the resource to load.
90
+ * @param ids The logical IDs of the resources.
91
+ * @return The list of requested FHIR resources.
92
+ * @throws ResourceNotFoundException if the resources are not found.
93
+ */
94
+ @Throws(ResourceNotFoundException ::class )
95
+ suspend fun get (type : ResourceType , vararg ids : String ): List <Resource >
96
+
86
97
/* *
87
98
* Updates one or more FHIR [Resource]s in the local storage.
88
99
*
@@ -227,6 +238,19 @@ suspend inline fun <reified R : Resource> FhirEngine.get(id: String): R {
227
238
return get(getResourceType(R ::class .java), id) as R
228
239
}
229
240
241
+ /* *
242
+ * Retrieves FHIR resources of type [R] with the given [ids] from the local storage.
243
+ *
244
+ * @param R The type of the FHIR resource to retrieve.
245
+ * @param ids The logical IDs of the resources to retrieve.
246
+ * @return The list of requested FHIR resources.
247
+ * @throws ResourceNotFoundException if the resource is not found.
248
+ */
249
+ @Throws(ResourceNotFoundException ::class )
250
+ suspend inline fun <reified R : Resource > FhirEngine.get (vararg ids : String ): List <R > {
251
+ return ids.map { id -> get(getResourceType(R ::class .java), id) as R }
252
+ }
253
+
230
254
/* *
231
255
* Deletes a FHIR resource of type [R] with the given [id] from the local storage.
232
256
*
0 commit comments