Skip to content

Commit

Permalink
Itstanany/#2542 erroreneous docs search method documentation (#2543)
Browse files Browse the repository at this point in the history
* fix erroneous docs

* #2542/fix erroneous docs

* add docs

* #2542/ add docs

* spotlessApply

---------

Co-authored-by: Jing Tang <[email protected]>
  • Loading branch information
itstanany and jingtang10 committed Jun 8, 2024
1 parent 735fd0f commit 69e87d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
10 changes: 0 additions & 10 deletions engine/src/main/java/com/google/android/fhir/FhirEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ interface FhirEngine {
/**
* Searches the database and returns a list of resources matching the [Search] specifications.
*
* Example:
* ```
* fhirEngine.search<Patient> {
* 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.
Expand Down
19 changes: 18 additions & 1 deletion engine/src/main/java/com/google/android/fhir/search/Search.kt
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<Patient> {
* 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 <reified R : Resource> FhirEngine.search(
init: Search.() -> Unit,
): List<SearchResult<R>> {
Expand Down

0 comments on commit 69e87d7

Please sign in to comment.