Skip to content

Commit

Permalink
Merge branch 'main' into main-lw-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
dubdabasoduba authored Mar 14, 2024
2 parents 86f7109 + 3083a53 commit 992b993
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 9 deletions.
2 changes: 1 addition & 1 deletion android/engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ dependencies {
api(libs.jjwt)
api(libs.fhir.common.utils) { exclude(group = "org.slf4j", module = "jcl-over-slf4j") }
api(libs.runtime.livedata)
api(libs.material3)
// api(libs.material3)
api(libs.foundation)
api(libs.fhir.common.utils)
api(libs.kotlinx.serialization.json)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
sidebar_label: App Flavors
sidebar_label: App flavors
---

# How to Add/Modify App Flavors

## Product Flavors Configuration

Product flavors are a way to create different versions of the same application with distinct features or characteristics. Each product flavor represents a different version of the application, and you can configure various aspect of the app for each flavor. To set this up, navigate to `fhircore > android > quest > Gradle scripts > build.gradle.kts` in the `quest` module.
Product flavors are a way to create different versions of the same application with distinct features or characteristics. Each product flavor represents a different version of the application, and you can configure various aspect of the app for each flavor. To set this up, navigate to `fhircore > android > quest > Gradle scripts > build.gradle.kts` in the `quest` module.

## Configuration Details

Expand Down Expand Up @@ -105,7 +105,7 @@ android {
}
```

`create("debugNonProxy") { initWith(getByName("debug")) }`
`create("debugNonProxy") { initWith(getByName("debug")) }`

- This line creates a new custom build variant named "debugNonProxy" by inheriting configurations from the existing "debug" variant. Here's a breakdown:

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
label: Config Types
label: Config types
88 changes: 88 additions & 0 deletions docs/engineering/android-app/configuring/data-migration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Data migration


The main functionalities of data migration are:
- Migrating data by updating resources based on a set of data queries and key-value pairs,
- Retrieving the latest migration version from shared preferences,
- Performing the migration only if the new version is greater than the client's latest stored migration version.
The data migration configuration outlines a set of rules and operations for migrating malformed FHIR resources such as `Task` resource migration on the client app sqlite database. With this configuration one is able to filter the target resource eg `Encounter` or `Task` and read its referenced `PlanDefinition` and its careplans then filter for the task or resource being migrated that lies within the careplan period and read the resulting `careplan id` . The migration then uses the resulting id to replace the malformed attribute such as `Task.basedOn` hence cleaning out the malformed resource attributes that a wrong `StructureMap` may have generated. The feature allows one to filter using data queries and write rules that can query using `forward_include` as well as `rev_include` targeting base resources and any related resources

## Sample JSON for Task migration
```json
{
"appId": "echis",
"configType": "dataMigration",
"migrations": [
{
"resourceType": "Task",
"updateValues": [
{
"jsonPathExpression": "Task.basedOn[0].reference",
"valueRule": {
"name": "taskBasedOn",
"condition": "true",
"actions": [
"data.put('taskBasedOn', 'CarePlan/' + fhirPath.extractValue(Task, 'Task.basedOn[0].reference') )"
]
}
}
],
"dataQueries": [
{
"paramName": "status",
"operation": "OR",
"filterCriteria": [
{
"dataType": "CODE",
"value": {
"system": "http://hl7.org/fhir/task-status",
"code": "ready"
}
},
{
"dataType": "CODE",
"value": {
"system": "http://hl7.org/fhir/task-status",
"code": "requested"
}
},
{
"dataType": "CODE",
"value": {
"system": "http://hl7.org/fhir/task-status",
"code": "in-progress"
}
}
]
}
],
"purgeAffectedResources": true,
"createLocalChangeEntitiesAfterPurge": true,
"resourceFilterExpression" : {
"conditionalFhirPathExpressions": [
"Task.basedOn[0].reference.startsWith('CarePlan').not() and Task.basedOn[0].reference.startsWith('PlanDefinition').not()"
],
"matchAll": true
},
"version": 1
}
]
}
```

## Config properties
|Property | Description | Required | Default |
|--|--|:--:|:--:|
appId | Provides the ID of the application | Yes | |
configType | Type of configuration | Yes | dataMigration |
migrations | List of migrations | Yes | |
resourceType | The resource to to get/fetch data from e.g Task or Careplan | yes | |
updateValues | Provides the ID of the application | Yes | |
configType | Type of configuration | Yes | dataMigration |
rules | List of rule configurations | Yes | |
version | Version of the migration configuration| Yes | |
purgeAffectedResources | Flag indicating whether affected resources should be purged | Yes | false |
createLocalChangeEntitiesAfterPurge | Flag indicating whether to create local change entities after purging | Yes | true |
resourceFilterExpression | Expression for filtering resources during migration | Yes | |
jsonPathExpression | JSON path expression for locating the value within the resource | Yes | |
computedValueKey | Key for the computed value to be updated | Yes | |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
label: Event Management
label: Event management
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# In-app Reporting
# In-app reporting

The in-app reporting feature empowers the health worker to see how she is performing against her daily task list, and allows for offline peer-to-peer syncing of the data collected on a daily basis. This greatly simplifies reporting requirements by eliminating the need for cumbersome paper registries and tally sheets.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ This rule is used within the rules engine or workflow to be able to determine wh
"condition": "true",
"actions": [
"data.put('isPregnant', service.evaluateToBoolean(data.get('activeConditions'), \"Condition.code.text = 'Pregnant' \", false))"
]
]
},
```
```

### Configuring the properties of the `evaluateToBoolean()`

Expand Down

0 comments on commit 992b993

Please sign in to comment.