Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code to support single apk approach #1211

Merged
merged 109 commits into from
May 17, 2022
Merged

Conversation

ellykits
Copy link
Collaborator

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #[issue number]

Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the fhircore app to verify my change fixes the issue and/or does not break the app

ellykits and others added 30 commits March 16, 2022 20:46
- Bump up dependency versions
- Update manifest configs
- Remove kotlin-extension plugin; use view binding instead

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
- Refactor navigation
- Use compose navigation for screens
- Refactor main register to use compose views
- Harmonize register data model
- Activate app features via configuration

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
- Harmonized the two operations into a common register

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
- Also ignore case when filtering register data by name

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
- This is done so to allow other operations like save and update on
the DAOs not just data retrieval
- Also renamed DomainMapper to DataMapper

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
* Careplan generation from StrcutureMap

* Scheduler for task updates

* Test and add sample call

* ECBIS SAA config added

* Change invalid log message

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
* Migrate ui package to quest app module

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Use sealed class on RegisterData domain model

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
* Questionnire config from config registry

* Update formConfigurationOf method defaults

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
maimoonak and others added 12 commits May 6, 2022 16:43
* Task plan worker fix | Missing Careplan handiling

* Filter tasks with status-READY only

* Task completion feature

* Task completes for Profile button
* fix family edit questionnaire not populating data

* implement view family overflow menu item

* spotlessApply

* resolve conflicts

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@ellykits ellykits marked this pull request as ready for review May 16, 2022 14:18
@codecov
Copy link

codecov bot commented May 16, 2022

Codecov Report

Merging #1211 (2cb2111) into main (67e2f0f) will decrease coverage by 16.82%.
The diff coverage is 17.96%.

@@              Coverage Diff              @@
##               main    #1211       +/-   ##
=============================================
- Coverage     75.05%   58.22%   -16.83%     
- Complexity      599      635       +36     
=============================================
  Files           100      132       +32     
  Lines          3604     4484      +880     
  Branches        578      714      +136     
=============================================
- Hits           2705     2611       -94     
- Misses          517     1477      +960     
- Partials        382      396       +14     
Flag Coverage Δ
engine 58.22% <17.96%> (-16.83%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tregister/fhircore/engine/appfeature/AppFeature.kt 0.00% <0.00%> (ø)
...er/fhircore/engine/appfeature/AppFeatureManager.kt 0.00% <0.00%> (ø)
...ircore/engine/appfeature/model/AppFeatureConfig.kt 0.00% <0.00%> (ø)
...ster/fhircore/engine/appfeature/model/AppTarget.kt 0.00% <0.00%> (ø)
.../fhircore/engine/appfeature/model/FeatureConfig.kt 0.00% <0.00%> (ø)
...core/engine/configuration/ConfigurationRegistry.kt 72.97% <0.00%> (-3.09%) ⬇️
...ine/configuration/view/DataFiltersConfiguration.kt 0.00% <0.00%> (ø)
...ore/engine/configuration/view/FormConfiguration.kt 0.00% <0.00%> (ø)
...ngine/configuration/view/LoginViewConfiguration.kt 70.00% <0.00%> (ø)
.../engine/configuration/view/PinViewConfiguration.kt 70.83% <0.00%> (ø)
... and 93 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67e2f0f...2cb2111. Read the comment docs.

pld
pld previously approved these changes May 16, 2022
Copy link
Member

@pld pld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! this looks awesome work 💯

the only comment that'd be nice to address now is moving the number to a constant in a constant file

everything else is for new issues in the next face of configurability

@@ -161,8 +156,8 @@ class FamilyDetailsActivity : BaseMultiLanguageActivity() {
}

private fun removeFamilyMenuItemClicked(familyId: String) {
startActivity(
Intent(this, RemoveFamilyQuestionnaireActivity::class.java).apply {
/* startActivity(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this? if this to add back later, can we add a todo note?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class will be deleted. Code already refactored in FamilyProfileScreen

private var _appFeatureConfig: AppFeatureConfig? = null

fun loadAndActivateFeatures() {
// TODO do we want to handle missing this config for any app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if a config doesn't have it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will default to quest application workflow

package org.smartregister.fhircore.engine.appfeature.model

enum class AppTarget {
CHW,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are these used? I'm not sure we want this to be the distinguishing attribute

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't know if we want to hard code this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was introduced in the first iteration of the application feature configs and we are not using them currently. We figured we can filter the data at user level instead. We will remove it in the next iteration.


package org.smartregister.fhircore.engine.appfeature.model

enum class HealthModule {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We certainly do not want to hard code these

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using enum to avoid string constants here, the configuration will be read from app feature configurations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will later be renamed to RegisterType/RegisterFactor or something relevant as we had discussed when scoping mwcore register - the configuration is used to differentiate the various registers supported in the app.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specific modules are not something we want to define in the code but through configurations, we don't want the code to limit the potential modules

syncJob: SyncJob,
configurationRegistry: ConfigurationRegistry,
syncBroadcaster: SyncBroadcaster,
syncInterval: Long = 30,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move 30 to a constant please

val tasks: List<Task> = listOf()
) : ProfileData(logicalId = logicalId, name = name)

data class AncProfileData(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future refactor removes this to dynamic config

val servicesOverdue: Int? = null
) : RegisterData(logicalId = logicalId, name = name)

data class AncRegisterData(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future refactor removes this to dynamic config


package org.smartregister.fhircore.engine.domain.model

enum class TaskStatus {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not defined somehow through the status of the fhir resources, like is there a fhir file we can load that would include this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Forgot to delete this.


open fun getDataTypes(): TreeSet<DataType> =
TreeSet<DataType>(
listOf(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these the only resource that can be synced via p2p?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rkareko or @ekigamba Can comment on this.


protected fun resourceClassType(type: DataType) =
when (ResourceType.valueOf(type.name)) {
ResourceType.Group -> Group::class.java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there might be some metaprogramming we can do to avoid the when

@ellykits ellykits changed the title WIP: Refactor code to support single apk approach Refactor code to support single apk approach May 17, 2022
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
pld
pld previously approved these changes May 17, 2022
@ellykits
Copy link
Collaborator Author

Noted code coverage for quest is not reported (after we introduced app flavors). Will fix this in a separate PR.

@dubdabasoduba
Copy link
Member

Noted code coverage for quest is not reported (after we introduced app flavors). Will fix this in a separate PR.

Please create an issue for this.

…eric-app-register

� Conflicts:
�	android/engine/src/main/assets/configs/default/config_health_config.json
�	android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/ConfigurationRegistry.kt
�	android/engine/src/main/java/org/smartregister/fhircore/engine/ui/appsetting/AppSettingActivity.kt
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@pld
Copy link
Member

pld commented May 17, 2022

it's happening!!!

@pld pld merged commit 219659e into main May 17, 2022
@pld pld deleted the implement-generic-app-register branch May 17, 2022 14:09
AbdulWahabMemon added a commit that referenced this pull request May 18, 2022
* main:
  Refactor code to support single apk approach (#1211)
  Implement debug suffix config loader (#1271)

# Conflicts:
#	android/engine/src/main/assets/configs/default/config_health_config.json
#	android/engine/src/main/java/org/smartregister/fhircore/engine/appfeature/AppFeature.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/appfeature/AppFeatureManager.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/appfeature/model/HealthModule.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/ConfigurationRegistry.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/register/dao/RegisterDaoFactory.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/domain/model/ProfileData.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/domain/model/RegisterData.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/ui/appsetting/AppSettingActivity.kt
#	android/engine/src/main/java/org/smartregister/fhircore/engine/ui/appsetting/AppSettingViewModel.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/navigation/SideMenuOptionFactory.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/ui/patient/register/PatientItemMapper.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/ui/patient/register/PatientRegisterScreen.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/ui/patient/register/PatientRegisterViewModel.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/models/PatientProfileViewData.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/util/mappers/ProfileViewDataMapper.kt
#	android/quest/src/main/java/org/smartregister/fhircore/quest/util/mappers/RegisterViewDataMapper.kt
#	android/quest/src/main/res/values/strings.xml
qiarie pushed a commit that referenced this pull request Jan 15, 2025
* Migrate to targetSDK 31
- Bump up dependency versions
- Update manifest configs
- Remove kotlin-extension plugin; use view binding instead

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement generic register
- Refactor navigation
- Use compose navigation for screens
- Refactor main register to use compose views
- Harmonize register data model
- Activate app features via configuration

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Move navigation screens to NavigationScreen class

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor register pagination and filter
- Harmonized the two operations into a common register

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix outlined text design
- Also ignore case when filtering register data by name

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement FHIRPath data extractor

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Display last sync time on side menu

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add language switcher action

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement FhirTaskGenerator

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor register client action

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement generic app profile

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename data providers to data access objects
- This is done so to allow other operations like save and update on
the DAOs not just data retrieval
- Also renamed DomainMapper to DataMapper

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Careplan and task generation via StructureMap (#1174)

* Careplan generation from StrcutureMap

* Scheduler for task updates

* Test and add sample call

* ECBIS SAA config added

* Change invalid log message

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename UI data models

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Move relevant UI packages to quest app module (#1178)

* Migrate ui package to quest app module

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Use sealed class on RegisterData domain model

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor register client implementation

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Load saved binary resource questionnaire configs (#1177)

* Questionnire config from config registry

* Update formConfigurationOf method defaults

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Open profile on list item click

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading data to member profile

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Show progress dialog when loading configs

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename components package

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename components package

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Start family profile implementation

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Format PersonalData UI

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename PatientProfileData to ProfileData

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement family member view component

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Rename event

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement FamilyDao (#1190)

* Add filters

* Add filters

* Family Register and Profile DAO

* Fix compile issue with Date class

* Refactor Family DAO

* Update family profile

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement AncDao (#1193)

* ANC DAO | structure map condition | auto load config on login

* Remove extra todo

* Implement default profile DAO (#1194)

* ANC DAO | structure map condition | auto load config on login

* Remove extra todo

* Default Register DAO | search subject resource refactor

* Add questionnaire and responses to default dao

* Update family register row UI

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor family and anc models

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update individual profile views

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement add member action

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix ANC register UI

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Populate extra personal data information

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement family profile bottomsheet

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement action for opening family member task form

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Resolve force app crash when wrong sync config provided

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement app flavors (#1217)

* Implement app flavors

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Correct g6pd flavor versionNameSuffix config

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix pin login logo

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor household representation (#1216)

* Refactor family to Group

* Rename patientId to resourceId

The mentioned Id could be a patientId or groupId,
hence it's renamed to resourceId.

* Use official identifier

* Use constant FAMILY_CARE_PLAN

* Fix sync

* Fix filtering

* Use suffix from strings.xml

* Update CHANGELOG.md

* Move family name translation to view mapper

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove redundant filter

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix households display
- Filter only households with names. Implemented a workaround
for counting family groups

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add family member task (#1221)

* Add family member task

* Change to subject

* Refactor generic function for launching questionnaires

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement change family head action (#1228)

* Implement action for change family head

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor overflow menu to use id.xml resources

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Move SideMenuOptionFactory to quest app module

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Activate device to device sync feature (#1229)

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor register data access objects (#1223)

* refactor register data access classes

refactor anc and family register data access classes

* clean up register data access classes

update Official Identifier to use enum, update FamilyRegisterDao to use load and fetch methods provided in defaultRepository

* Resolve missing references

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading register data (#1230)

* Migrate measure report UI implementation to quest

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Clean up measure report UI

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix loading family/anc register data

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove unnecessary null check

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix app crash on API versions below 8

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Make login screen scrollable

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add member and household head to household (#1240)

* ✨ Updated the Questionnaire View Model to add patients and related persons to the group resource

* 🎨 Reformat code

* 📝 Updated the Change log

* ♻️ Rename the method names

* 🎨 Spotless code reformat

* Add member and household head to household (#1241)

* ✨ Updated the Questionnaire View Model to add patients and related persons to the group resource

* 🎨 Reformat code

* 📝 Updated the Change log

* ♻️ Rename the method names

* 🎨 Spotless code reformat

* ✨ Added the family ID as part of the variables on the ad family member profile

* ♻️ update the variable naming

* Migrate measure reporting to quest app (#1242)

* Migrate measure report UI implementation to quest

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Clean up measure report UI

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Migrate measure reporting to quest app module

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* 1082 (P2P) implement sending receiving data (#1226)

* Trigger CI

* Integrate p2p

* Add P2P sender and receiver dao implementations

* Implement fetching of data to be sent via P2P

* Add p2p lib as a project

* Initialize P2P library

* Init P2P lib options with sender and receiver transfer daos

* Update p2p receiver transfer dao with constructor

* Fix filter by lastupdated
Fix getting data types for sender and receiver transfer DAOs

* Sort records by last updated ascending
return resources as json data

* Fix JSON encoding resources for p2p transfer

* Resolve merge conflicts

* Add generically fetching each resource type for p2p transfer

* Save records on receiver device

* Filter records by greater than last updated at

* Add P2P menu icon on bottom navigation

* Fix resources search query for p2p (#1222)

* Add generically fetching each resource type for p2p transfer

* Fix resources search query for p2p

* Update engine to 0.1.0-alpha06-preview-p2p-SNAPSHOT

* Handle array index out of bounds when returned records is empty

* Use generic methoad to load various resources

* Make resource type dynamic

* Make resource type dynamic

* Use correct resorce type when parsing resources

Co-authored-by: Richard Kareko <rkareko@ona.io>

* Move data P2P retrieval and saving logic to base transfer DAO

* Hook up opening of P2P screen

* Set large heapsize setting to true

* Log ids of transferred resources to terminal

* Add group to list of resources for sync

* Update Resource.meta.lastUpdated date for inserts and updates

* Handle retrieval of Group class type

* Update p2p-lib directory

* Use published p2p lib snapshot

* Bump up p2p lib version

Co-authored-by: Ephraim Kigamba <ekigamba@ona.io>
Co-authored-by: Ephraim Kigamba <31766075+ekigamba@users.noreply.github.com>

* Implement family questionnaire (#1232)

* WIP Moving FamilyQuestionnaireActivity along with dependencies

* Restored FamilyQuestionnaireActivity on Anc for all old references

* Restored FamilyQuestionnaireActivity on Anc for all old references

* ran spotless script for code styling

* Fixed save button texts on config file, moved constants to companion object in Family Questionnaire

* Fixed using familyId when opening Add Member Questionnaire

* Implement change family head functionality

* Fix app crash

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Activate in app reporting via config

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Add quick fix for showing register action for specific register

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* ✨ Propagating the family name

* Update count on sync complete

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove deprecated environment variables

* Automation of Product Flavor releases via CI/CD

- Add support for releasing APKs from Flavors via CI/CD
- Add configuration to simulate flavors in build.gradle

* Disable CI configurations for deprecated modules

* Fix build 💚

* Close drawer on click report

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* React to sync state on sync complete (#1248)

* React to sync state on sync complete

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Delete unused class

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix holding composable reference in viewmodel

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement remove family and family member  (#1236)

* remove family by group

* add deactivate family members toggle config

* refactor remove family package

* resolve family provile merge conflict

* update family profile event

* correct parameters for OverflowMenuClick event

* 1205 Remove family member (#1235)

* Add overflow and remove button

* Refactor RemoveFamilyQuestionnaireActivity

* spotlessApply

* Move RemoveProfile to other package

* Create MemberQuestionnaireActivity

* delete family member. ongoing

* Filter only active family members

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: Fikri Milano <fikrimilano1@gmail.com>
Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* 🎨 Update the task genration

* Refactor p2p implementation (#1243)

* Trigger CI

* Integrate p2p

* Add P2P sender and receiver dao implementations

* Implement fetching of data to be sent via P2P

* Add p2p lib as a project

* Initialize P2P library

* Init P2P lib options with sender and receiver transfer daos

* Update p2p receiver transfer dao with constructor

* Fix filter by lastupdated
Fix getting data types for sender and receiver transfer DAOs

* Sort records by last updated ascending
return resources as json data

* Fix JSON encoding resources for p2p transfer

* Resolve merge conflicts

* Add generically fetching each resource type for p2p transfer

* Save records on receiver device

* Filter records by greater than last updated at

* Add P2P menu icon on bottom navigation

* Fix resources search query for p2p (#1222)

* Add generically fetching each resource type for p2p transfer

* Fix resources search query for p2p

* Update engine to 0.1.0-alpha06-preview-p2p-SNAPSHOT

* Handle array index out of bounds when returned records is empty

* Use generic methoad to load various resources

* Make resource type dynamic

* Make resource type dynamic

* Use correct resorce type when parsing resources

Co-authored-by: Richard Kareko <rkareko@ona.io>

* Move data P2P retrieval and saving logic to base transfer DAO

* Hook up opening of P2P screen

* Set large heapsize setting to true

* Log ids of transferred resources to terminal

* Add group to list of resources for sync

* Update Resource.meta.lastUpdated date for inserts and updates

* Handle retrieval of Group class type

* Update p2p-lib directory

* Use published p2p lib snapshot

* Bump up p2p lib version

* Refactor p2p implementation
- Permoved some code cleanups on QuestApplication class

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Run spotlessApply

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Code clean up

* Remove unused import

* Run spotless apply

Co-authored-by: Richard Kareko <rkareko@ona.io>
Co-authored-by: Ephraim Kigamba <ekigamba@ona.io>
Co-authored-by: Ephraim Kigamba <31766075+ekigamba@users.noreply.github.com>

* Fix task color code; refresh data when activity in foreground (#1262)

* Fix tasks color codes

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refresh composable screens when the activity is resumed

Implemented a workaround based on the following recommendation (compose UI by default is not refreshed
when lifecycle is updated)
https://stackoverflow.com/questions/66546962/jetpack-compose-how-do-i-refresh-a-screen-when-app-returns-to-foreground

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* refactor remove family and member (#1263)

add condition to remove managing entity if member is head

move remove functionality to FamilyRegisterDao

* Implement family edit button (#1259)

* implement edit family details

load register family questionnaire with type as edit

* implement view/edit family-member/patient details

load register family member questionnaire with type as edit

* handle family profile null checks

* rename bundleEntry variable

* Fix loading task form

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Task plan worker fix | Missing Careplan handiling

* Enable loading new config by re-opening the app (#1261)

* Enable loading new config by re-opening the app

* Load AppMainActivity if user is not logged out

* Address review comments

* Filter tasks with status-READY only

* Fix careplan not found bug

* Task completion feature

* Fix app crash on login

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement ANC enrollment (#1267)

* Launch anc enrollment questionnaire

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix refreshing register count

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement action for launching task form (#1266)

* Task plan worker fix | Missing Careplan handiling

* Filter tasks with status-READY only

* Task completion feature

* Task completes for Profile button

* Fix app crash

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Implement task form action (#1268)

* Task plan worker fix | Missing Careplan handiling

* Filter tasks with status-READY only

* Task completion feature

* Task completes for Profile button

* Fix task color coding on patient profile(#1270)

* Implement family edit functionality (#1272)

* fix family edit questionnaire not populating data

* implement view family overflow menu item

* spotlessApply

* resolve conflicts

Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refresh profile data

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Configure action icon and color

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Apply background color on patient profile

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Update ecbis version to v0.0.6

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* reference configs for afyayangu app

* Fix failing tests; Ignore failing to be deleted test

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove unnecessary class TaskStatus

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove unnecessary code

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Co-authored-by: maimoonak <4829880+maimoonak@users.noreply.github.com>
Co-authored-by: Fikri Milano <fikrimilano1@gmail.com>
Co-authored-by: roywanyaga <84201465+roywanyaga@users.noreply.github.com>
Co-authored-by: Benjamin Mwalimu <dubdabasoduba@gmail.com>
Co-authored-by: Rkareko <47570855+Rkareko@users.noreply.github.com>
Co-authored-by: Ephraim Kigamba <ekigamba@ona.io>
Co-authored-by: Ephraim Kigamba <31766075+ekigamba@users.noreply.github.com>
Co-authored-by: aurangzaibumer <35099184+aurangzaibumer@users.noreply.github.com>
Co-authored-by: Raazia Tariq <89384079+RaaziaTarique@users.noreply.github.com>
Co-authored-by: Martin Ndegwa <ndegwamartin@gmail.com>
Co-authored-by: Richard Kareko <rkareko@ona.io>
Co-authored-by: maimoonak <maimoonak.mk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants