Skip to content

Commit

Permalink
Support search by dynamic queries (#3550)
Browse files Browse the repository at this point in the history
* Support search by dynamic queries

Signed-off-by: Elly Kitoto <[email protected]>

* Add custom search param for Patient name and identifier

* Fix failing test

---------

Signed-off-by: Elly Kitoto <[email protected]>
Co-authored-by: Benjamin Mwalimu <[email protected]>
Co-authored-by: Rkareko <[email protected]>
Co-authored-by: Rkareko <[email protected]>
Co-authored-by: Peter Lubell-Doughtie <[email protected]>
  • Loading branch information
5 people authored Oct 19, 2024
1 parent 8f2c558 commit ff5c2b9
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ data class RegisterContentConfig(
val visible: Boolean? = null,
val computedRules: List<String>? = null,
val searchByQrCode: Boolean? = null,
val dataFilterFields: List<RegisterFilterField> = emptyList(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class RegisterScreenTest {
pagesCount = 0,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -173,7 +173,7 @@ class RegisterScreenTest {
pagesCount = 1,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -218,7 +218,7 @@ class RegisterScreenTest {
pagesCount = 1,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -263,7 +263,7 @@ class RegisterScreenTest {
pagesCount = 1,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -309,7 +309,7 @@ class RegisterScreenTest {
pagesCount = 0,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -356,7 +356,7 @@ class RegisterScreenTest {
pagesCount = 0,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -442,7 +442,7 @@ class RegisterScreenTest {
),
),
),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -495,7 +495,7 @@ class RegisterScreenTest {
progressPercentage = flowOf(100),
isSyncUpload = flowOf(false),
currentSyncJobStatus = flowOf(CurrentSyncJobStatus.Succeeded(OffsetDateTime.now())),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down Expand Up @@ -547,7 +547,7 @@ class RegisterScreenTest {
progressPercentage = flowOf(100),
isSyncUpload = flowOf(false),
currentSyncJobStatus = flowOf(CurrentSyncJobStatus.Succeeded(OffsetDateTime.now())),
params = emptyMap(),
params = emptyList(),
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ fun RegisterScreenWithDataPreview() {
pagesCount = 1,
progressPercentage = flowOf(0),
isSyncUpload = flowOf(false),
params = emptyMap(),
params = emptyList(),
)
val searchText = remember { mutableStateOf(SearchQuery.emptyText) }
val currentPage = remember { mutableIntStateOf(0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.google.android.fhir.sync.CurrentSyncJobStatus
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
import org.smartregister.fhircore.engine.configuration.register.RegisterConfiguration
import org.smartregister.fhircore.engine.domain.model.ActionParameter

data class RegisterUiState(
val screenTitle: String = "",
Expand All @@ -32,5 +33,5 @@ data class RegisterUiState(
val progressPercentage: Flow<Int> = flowOf(0),
val isSyncUpload: Flow<Boolean> = flowOf(false),
val currentSyncJobStatus: Flow<CurrentSyncJobStatus?> = flowOf(null),
val params: Map<String, String> = emptyMap(),
val params: List<ActionParameter> = emptyList(),
)
Loading

0 comments on commit ff5c2b9

Please sign in to comment.