-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter register data via configuration (#2780)
* Filter register data via configuration Signed-off-by: Elly Kitoto <[email protected]> * Add missing related resources Signed-off-by: Elly Kitoto <[email protected]> * Implement data filters for related resources Signed-off-by: Elly Kitoto <[email protected]> * Implement data filtered register count badge Signed-off-by: Elly Kitoto <[email protected]> * Fix failing tests Signed-off-by: Elly Kitoto <[email protected]> * Test load paging source data with FhirResourceConfig Signed-off-by: Elly Kitoto <[email protected]> * Test that refreshData is invoked with QuestionnaireResponse param Signed-off-by: Elly Kitoto <[email protected]> * Write test for RegisterViewModel#updateRegisterFilterState Signed-off-by: Elly Kitoto <[email protected]> * Implement clear all UI Signed-off-by: Elly Kitoto <[email protected]> * Apply no filter if no data field answer is provided Also fix rendering of badge count. Filtered data can return 0. Reset default value to -1. Signed-off-by: Elly Kitoto <[email protected]> --------- Signed-off-by: Elly Kitoto <[email protected]>
- Loading branch information
Showing
23 changed files
with
792 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ain/java/org/smartregister/fhircore/engine/configuration/register/RegisterFilterConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2021-2023 Ona Systems, Inc | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.smartregister.fhircore.engine.configuration.register | ||
|
||
import kotlinx.serialization.Serializable | ||
import org.smartregister.fhircore.engine.domain.model.ActionConfig | ||
import org.smartregister.fhircore.engine.domain.model.DataQuery | ||
|
||
@Serializable | ||
data class RegisterFilterConfig( | ||
val dataFilterActions: List<ActionConfig>? = null, | ||
val dataFilterFields: List<RegisterFilterField> = emptyList(), | ||
) : java.io.Serializable | ||
|
||
@Serializable | ||
data class RegisterFilterField( | ||
val dataQueries: List<DataQuery>, | ||
val filterId: String, | ||
) : java.io.Serializable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...d/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterFilterState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2021-2023 Ona Systems, Inc | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.smartregister.fhircore.quest.ui.register | ||
|
||
import org.hl7.fhir.r4.model.QuestionnaireResponse | ||
import org.smartregister.fhircore.engine.domain.model.FhirResourceConfig | ||
|
||
data class RegisterFilterState( | ||
val fhirResourceConfig: FhirResourceConfig? = null, | ||
val questionnaireResponse: QuestionnaireResponse? = null, | ||
) |
Oops, something went wrong.