diff --git a/engine/src/main/java/com/google/android/fhir/FhirEngine.kt b/engine/src/main/java/com/google/android/fhir/FhirEngine.kt index fa47d2b21a..58f1807e7e 100644 --- a/engine/src/main/java/com/google/android/fhir/FhirEngine.kt +++ b/engine/src/main/java/com/google/android/fhir/FhirEngine.kt @@ -100,16 +100,6 @@ interface FhirEngine { /** * Searches the database and returns a list of resources matching the [Search] specifications. * - * Example: - * ``` - * fhirEngine.search { - * filter(Patient.GIVEN, { - * value = "Kiran" - * modifier = StringFilterModifier.MATCHES_EXACTLY - * }) - * } - * ``` - * * @param search The search criteria to apply. * @return A list of [SearchResult] objects containing the matching resources and any included * references. diff --git a/engine/src/main/java/com/google/android/fhir/search/Search.kt b/engine/src/main/java/com/google/android/fhir/search/Search.kt index 4b1714c9bc..4d9586b275 100644 --- a/engine/src/main/java/com/google/android/fhir/search/Search.kt +++ b/engine/src/main/java/com/google/android/fhir/search/Search.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 Google LLC + * Copyright 2022-2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,23 @@ import com.google.android.fhir.search.query.XFhirQueryTranslator.translate import org.hl7.fhir.r4.model.Resource import org.hl7.fhir.r4.model.ResourceType +/** + * Searches the database and returns a list of resources matching the [Search] specifications. + * + * Example: + * ``` + * fhirEngine.search { + * filter(Patient.GIVEN, { + * value = "Kiran" + * modifier = StringFilterModifier.MATCHES_EXACTLY + * }) + * } + * ``` + * + * @param init The lambda expression used to configure the [Search] object. + * @return A list of [SearchResult] objects containing the matching resources and any included + * references. + */ suspend inline fun FhirEngine.search( init: Search.() -> Unit, ): List> {