Skip to content

Commit fb327b9

Browse files
authored
Merge branch 'upgrade-sdk-libraries' into main-validate-extracted-resources
2 parents d9b017f + 85cd72c commit fb327b9

File tree

17 files changed

+117
-118
lines changed

17 files changed

+117
-118
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111
- Upgrade to latest Android FHIR SDK version includes
12-
- an upgrade to the HAPI FHIR libraries used to process StructureMaps. In the previous libraries `$this.id` returned `[ResourceType]/[ID #]`, the new libraries return `[ID #]`. Therefore, any existing StructureMaps that call `$this.id` will need to replace that with `$this.type().name + $this.id` to have the equivalent output.
13-
- changes to Measure evaluation that requires all Measure JSON files to be rebuilt.
14-
- change to some [MetadataResources](https://hl7.org/fhir/R5/metadataresource.html) that requires they are referenced by URL and not ID. Any existing content that referes to StructureMaps by ID must be updated to refer to it by URL. If we are not storing a URL for it, we will need to add that. E.g. `Library.url`, `Plandefinition.url` because the `FhirOperator` API uses that field to uniquely identify/retrieve the Metadata resource.
15-
- For CQL evaluation, the context is referred to using `%subject` and not `$this`. The latter is reserved for FHIRPath expressions while the former is used for CQL expressions to refer to the primary subject of the expression e.g. patient.
12+
1. an upgrade to the HAPI FHIR libraries used to process StructureMaps. In the previous libraries `$this.id` returned `[ResourceType]/[ID #]`, the new libraries return `[ID #]`. Therefore, any existing StructureMaps that call `$this.id` will need to replace that with `$this.type().name + '/' + $this.id` to have the equivalent output.
13+
2. changes to Measure evaluation that requires all Measure JSON files to be rebuilt.
14+
3. change to some [MetadataResources](https://hl7.org/fhir/R5/metadataresource.html) that requires they are referenced by URL and not ID. Any existing content that referes to StructureMaps by ID must be updated to refer to it by URL. If we are not storing a URL for it, we will need to add that. E.g. `Library.url`, `Plandefinition.url` because the `FhirOperator` API uses that field to uniquely identify/retrieve the Metadata resource.
15+
4. for CQL evaluation, the context is referred to using `%subject` and not `$this`. The latter is reserved for FHIRPath expressions while the former is used for CQL expressions to refer to the primary subject of the expression e.g. patient.
1616

1717
## [0.2.4] - 2023-06-24
1818
### Added

android/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ subprojects {
9494
"org.jacoco" -> useVersion("0.8.11")
9595
}
9696
}
97-
force("com.google.guava:guava:32.1.2-android")
9897
}
9998
}
10099

android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/ConfigurationRegistry.kt

+22-17
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,6 @@ constructor(
405405
configCacheMap.clear()
406406
sharedPreferencesHelper.read(SharedPreferenceKey.APP_ID.name, null)?.let { appId ->
407407
val parsedAppId = appId.substringBefore(TYPE_REFERENCE_DELIMITER).trim()
408-
// if (isInitialLogin) return null
409-
val filterResourceList =
410-
listOf(
411-
ResourceType.Questionnaire.name,
412-
ResourceType.StructureMap.name,
413-
ResourceType.List.name,
414-
ResourceType.PlanDefinition.name,
415-
ResourceType.Library.name,
416-
ResourceType.Measure.name,
417-
ResourceType.Basic.name,
418-
ResourceType.Binary.name,
419-
ResourceType.Parameters,
420-
)
421408
val patientRelatedResourceTypes = mutableListOf<ResourceType>()
422409
val compositionResource = fetchRemoteComposition(parsedAppId)
423410
compositionResource?.let { composition ->
@@ -433,7 +420,7 @@ constructor(
433420
missingDelimiterValue = "",
434421
)
435422
}
436-
.filter { entry -> entry.key in filterResourceList }
423+
.filter { entry -> entry.key in FILTER_RESOURCE_LIST }
437424
.forEach { entry: Map.Entry<String, List<Composition.SectionComponent>> ->
438425
if (entry.key == ResourceType.List.name) {
439426
processCompositionListResources(
@@ -686,7 +673,7 @@ constructor(
686673

687674
fun clearConfigsCache() = configCacheMap.clear()
688675

689-
suspend fun processCompositionListResources(
676+
private suspend fun processCompositionListResources(
690677
resourceGroup:
691678
Map.Entry<
692679
String,
@@ -736,12 +723,12 @@ constructor(
736723
}
737724
}
738725

739-
fun FhirResourceConfig.dependentResourceTypes(target: MutableList<ResourceType>) {
726+
private fun FhirResourceConfig.dependentResourceTypes(target: MutableList<ResourceType>) {
740727
this.baseResource.dependentResourceTypes(target)
741728
this.relatedResources.forEach { it.dependentResourceTypes(target) }
742729
}
743730

744-
fun ResourceConfig.dependentResourceTypes(target: MutableList<ResourceType>) {
731+
private fun ResourceConfig.dependentResourceTypes(target: MutableList<ResourceType>) {
745732
target.add(resource)
746733
relatedResources.forEach { it.dependentResourceTypes(target) }
747734
}
@@ -788,5 +775,23 @@ constructor(
788775
const val ORGANIZATION = "organization"
789776
const val TYPE_REFERENCE_DELIMITER = "/"
790777
const val DEFAULT_COUNT = 200
778+
779+
/**
780+
* The list of resources whose types can be synced down as part of the Composition configs.
781+
* These are hardcoded as they are not meant to be easily configurable to avoid config vs data
782+
* sync issues
783+
*/
784+
val FILTER_RESOURCE_LIST =
785+
listOf(
786+
ResourceType.Questionnaire.name,
787+
ResourceType.StructureMap.name,
788+
ResourceType.List.name,
789+
ResourceType.PlanDefinition.name,
790+
ResourceType.Library.name,
791+
ResourceType.Measure.name,
792+
ResourceType.Basic.name,
793+
ResourceType.Binary.name,
794+
ResourceType.Parameters,
795+
)
791796
}
792797
}

android/engine/src/main/java/org/smartregister/fhircore/engine/task/FhirCarePlanGenerator.kt

-4
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ constructor(
234234

235235
carePlan.contained.clear()
236236

237-
// TODO Confirm why reversion here
238-
// Save CarePlan only if it has activity, otherwise just save contained/dependent resources
239-
// if (output.hasActivity()) defaultRepository.addOrUpdate(true, carePlan)
240-
241237
defaultRepository.addOrUpdate(true, carePlan)
242238

243239
dependents.forEach { defaultRepository.addOrUpdate(true, it) }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M12.167,2.833C10.222,2.833 8.357,3.606 6.981,4.981C5.606,6.357 4.833,8.222 4.833,10.167C4.833,13.007 6.681,15.762 8.707,17.901C9.701,18.951 10.699,19.81 11.449,20.407C11.728,20.629 11.972,20.814 12.167,20.958C12.362,20.814 12.606,20.629 12.885,20.407C13.635,19.81 14.632,18.951 15.626,17.901C17.652,15.762 19.5,13.007 19.5,10.167C19.5,8.222 18.728,6.357 17.352,4.981C15.977,3.606 14.112,2.833 12.167,2.833ZM12.167,22.083C11.658,22.846 11.658,22.846 11.658,22.846L11.655,22.844L11.649,22.84L11.628,22.826C11.61,22.814 11.585,22.796 11.552,22.774C11.487,22.729 11.394,22.663 11.276,22.578C11.04,22.407 10.706,22.159 10.307,21.841C9.51,21.206 8.444,20.289 7.376,19.162C5.277,16.946 3,13.743 3,10.167C3,7.736 3.966,5.404 5.685,3.685C7.404,1.966 9.736,1 12.167,1C14.598,1 16.93,1.966 18.649,3.685C20.368,5.404 21.333,7.736 21.333,10.167C21.333,13.743 19.056,16.946 16.957,19.162C15.889,20.289 14.824,21.206 14.027,21.841C13.628,22.159 13.294,22.407 13.058,22.578C12.94,22.663 12.846,22.729 12.781,22.774C12.749,22.796 12.723,22.814 12.705,22.826L12.684,22.84L12.678,22.844L12.676,22.845C12.676,22.846 12.675,22.846 12.167,22.083ZM12.167,22.083L12.675,22.846C12.367,23.052 11.966,23.051 11.658,22.846L12.167,22.083Z"
8+
android:fillColor="#282828"
9+
android:fillType="evenOdd"/>
10+
<path
11+
android:pathData="M12.167,2.833C10.222,2.833 8.357,3.606 6.981,4.981C5.606,6.357 4.833,8.222 4.833,10.167C4.833,13.007 6.681,15.762 8.707,17.901C9.701,18.951 10.699,19.81 11.449,20.407C11.728,20.629 11.972,20.814 12.167,20.958C12.362,20.814 12.606,20.629 12.885,20.407C13.635,19.81 14.632,18.951 15.626,17.901C17.652,15.762 19.5,13.007 19.5,10.167C19.5,8.222 18.728,6.357 17.352,4.981C15.977,3.606 14.112,2.833 12.167,2.833ZM12.167,22.083C11.658,22.846 11.658,22.846 11.658,22.846L11.655,22.844L11.649,22.84L11.628,22.826C11.61,22.814 11.585,22.796 11.552,22.774C11.487,22.729 11.394,22.663 11.276,22.578C11.04,22.407 10.706,22.159 10.307,21.841C9.51,21.206 8.444,20.289 7.376,19.162C5.277,16.946 3,13.743 3,10.167C3,7.736 3.966,5.404 5.685,3.685C7.404,1.966 9.736,1 12.167,1C14.598,1 16.93,1.966 18.649,3.685C20.368,5.404 21.333,7.736 21.333,10.167C21.333,13.743 19.056,16.946 16.957,19.162C15.889,20.289 14.824,21.206 14.027,21.841C13.628,22.159 13.294,22.407 13.058,22.578C12.94,22.663 12.846,22.729 12.781,22.774C12.749,22.796 12.723,22.814 12.705,22.826L12.684,22.84L12.678,22.844L12.676,22.845C12.676,22.846 12.675,22.846 12.167,22.083ZM12.167,22.083L12.675,22.846C12.367,23.052 11.966,23.051 11.658,22.846L12.167,22.083Z"
12+
android:fillColor="#ffffff"
13+
android:fillAlpha="0.7"
14+
android:fillType="evenOdd"/>
15+
<path
16+
android:pathData="M12.167,8.333C11.154,8.333 10.333,9.154 10.333,10.167C10.333,11.179 11.154,12 12.167,12C13.179,12 14,11.179 14,10.167C14,9.154 13.179,8.333 12.167,8.333ZM8.5,10.167C8.5,8.142 10.142,6.5 12.167,6.5C14.192,6.5 15.833,8.142 15.833,10.167C15.833,12.192 14.192,13.833 12.167,13.833C10.142,13.833 8.5,12.192 8.5,10.167Z"
17+
android:fillColor="#282828"
18+
android:fillType="evenOdd"/>
19+
<path
20+
android:pathData="M12.167,8.333C11.154,8.333 10.333,9.154 10.333,10.167C10.333,11.179 11.154,12 12.167,12C13.179,12 14,11.179 14,10.167C14,9.154 13.179,8.333 12.167,8.333ZM8.5,10.167C8.5,8.142 10.142,6.5 12.167,6.5C14.192,6.5 15.833,8.142 15.833,10.167C15.833,12.192 14.192,13.833 12.167,13.833C10.142,13.833 8.5,12.192 8.5,10.167Z"
21+
android:fillColor="#ffffff"
22+
android:fillAlpha="0.7"
23+
android:fillType="evenOdd"/>
24+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M19,9.5H15V3.5H9V9.5H5L12,16.5L19,9.5ZM11,11.5V5.5H13V11.5H14.17L12,13.67L9.83,11.5H11ZM5,18.5H19V20.5H5V18.5Z"
8+
android:fillColor="#282828"/>
9+
<path
10+
android:pathData="M19,9.5H15V3.5H9V9.5H5L12,16.5L19,9.5ZM11,11.5V5.5H13V11.5H14.17L12,13.67L9.83,11.5H11ZM5,18.5H19V20.5H5V18.5Z"
11+
android:fillColor="#ffffff"
12+
android:fillAlpha="0.7"/>
13+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="20dp"
3+
android:height="15dp"
4+
android:viewportWidth="20"
5+
android:viewportHeight="15">
6+
<path
7+
android:pathData="M14.35,12.175L17.9,8.625C18.1,8.425 18.333,8.329 18.6,8.337C18.867,8.346 19.1,8.45 19.3,8.65C19.483,8.85 19.575,9.083 19.575,9.35C19.575,9.617 19.483,9.85 19.3,10.05L15.075,14.3C14.875,14.5 14.642,14.6 14.375,14.6C14.108,14.6 13.875,14.5 13.675,14.3L11.525,12.15C11.342,11.967 11.25,11.733 11.25,11.45C11.25,11.167 11.342,10.933 11.525,10.75C11.708,10.567 11.942,10.475 12.225,10.475C12.508,10.475 12.742,10.567 12.925,10.75L14.35,12.175ZM14.35,4.175L17.9,0.625C18.1,0.425 18.333,0.329 18.6,0.337C18.867,0.346 19.1,0.45 19.3,0.65C19.483,0.85 19.575,1.083 19.575,1.35C19.575,1.617 19.483,1.85 19.3,2.05L15.075,6.3C14.875,6.5 14.642,6.6 14.375,6.6C14.108,6.6 13.875,6.5 13.675,6.3L11.525,4.15C11.342,3.967 11.25,3.733 11.25,3.45C11.25,3.167 11.342,2.933 11.525,2.75C11.708,2.567 11.942,2.475 12.225,2.475C12.508,2.475 12.742,2.567 12.925,2.75L14.35,4.175ZM1,13C0.717,13 0.479,12.904 0.287,12.712C0.096,12.521 0,12.283 0,12C0,11.717 0.096,11.479 0.287,11.287C0.479,11.096 0.717,11 1,11H8C8.283,11 8.521,11.096 8.712,11.287C8.904,11.479 9,11.717 9,12C9,12.283 8.904,12.521 8.712,12.712C8.521,12.904 8.283,13 8,13H1ZM1,5C0.717,5 0.479,4.904 0.287,4.712C0.096,4.521 0,4.283 0,4C0,3.717 0.096,3.479 0.287,3.287C0.479,3.096 0.717,3 1,3H8C8.283,3 8.521,3.096 8.712,3.287C8.904,3.479 9,3.717 9,4C9,4.283 8.904,4.521 8.712,4.712C8.521,4.904 8.283,5 8,5H1Z"
8+
android:fillColor="#282828"/>
9+
<path
10+
android:pathData="M14.35,12.175L17.9,8.625C18.1,8.425 18.333,8.329 18.6,8.337C18.867,8.346 19.1,8.45 19.3,8.65C19.483,8.85 19.575,9.083 19.575,9.35C19.575,9.617 19.483,9.85 19.3,10.05L15.075,14.3C14.875,14.5 14.642,14.6 14.375,14.6C14.108,14.6 13.875,14.5 13.675,14.3L11.525,12.15C11.342,11.967 11.25,11.733 11.25,11.45C11.25,11.167 11.342,10.933 11.525,10.75C11.708,10.567 11.942,10.475 12.225,10.475C12.508,10.475 12.742,10.567 12.925,10.75L14.35,12.175ZM14.35,4.175L17.9,0.625C18.1,0.425 18.333,0.329 18.6,0.337C18.867,0.346 19.1,0.45 19.3,0.65C19.483,0.85 19.575,1.083 19.575,1.35C19.575,1.617 19.483,1.85 19.3,2.05L15.075,6.3C14.875,6.5 14.642,6.6 14.375,6.6C14.108,6.6 13.875,6.5 13.675,6.3L11.525,4.15C11.342,3.967 11.25,3.733 11.25,3.45C11.25,3.167 11.342,2.933 11.525,2.75C11.708,2.567 11.942,2.475 12.225,2.475C12.508,2.475 12.742,2.567 12.925,2.75L14.35,4.175ZM1,13C0.717,13 0.479,12.904 0.287,12.712C0.096,12.521 0,12.283 0,12C0,11.717 0.096,11.479 0.287,11.287C0.479,11.096 0.717,11 1,11H8C8.283,11 8.521,11.096 8.712,11.287C8.904,11.479 9,11.717 9,12C9,12.283 8.904,12.521 8.712,12.712C8.521,12.904 8.283,13 8,13H1ZM1,5C0.717,5 0.479,4.904 0.287,4.712C0.096,4.521 0,4.283 0,4C0,3.717 0.096,3.479 0.287,3.287C0.479,3.096 0.717,3 1,3H8C8.283,3 8.521,3.096 8.712,3.287C8.904,3.479 9,3.717 9,4C9,4.283 8.904,4.521 8.712,4.712C8.521,4.904 8.283,5 8,5H1Z"
11+
android:fillColor="#ffffff"
12+
android:fillAlpha="0.7"/>
13+
</vector>

android/engine/src/main/res/values/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@
174174
<string name="os_version">OS Version</string>
175175
<string name="device_date">Date</string>
176176
<string name="device">Device</string>
177-
<string name="migrating_data">Migrating data</string>
178177
<string name="ok">OK</string>
179178
<string name="add">ADD</string>
179+
<string name="data_migration_started">Started data migration from version %1$d</string>
180+
<string name="data_migration_completed">Application data migrated to version %1$d</string>
180181
</resources>

android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/login/LoginScreenTest.kt

-7
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class LoginScreenTest {
7777
forgotPassword = { listenerObjectSpy.forgotPassword() },
7878
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
7979
appVersionPair = Pair(1, "1.0.1"),
80-
dataMigrationInProgress = false,
8180
)
8281
}
8382
if (applicationConfiguration.loginConfig.showLogo) {
@@ -109,7 +108,6 @@ class LoginScreenTest {
109108
forgotPassword = { listenerObjectSpy.forgotPassword() },
110109
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
111110
appVersionPair = Pair(1, "1.0.1"),
112-
dataMigrationInProgress = false,
113111
)
114112
}
115113
composeRule
@@ -174,7 +172,6 @@ class LoginScreenTest {
174172
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
175173
loginErrorState = loginErrorState,
176174
appVersionPair = Pair(1, "1.0.1"),
177-
dataMigrationInProgress = false,
178175
)
179176
}
180177
composeRule
@@ -197,7 +194,6 @@ class LoginScreenTest {
197194
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
198195
loginErrorState = loginErrorState,
199196
appVersionPair = Pair(1, "1.0.1"),
200-
dataMigrationInProgress = false,
201197
)
202198
}
203199
composeRule
@@ -220,7 +216,6 @@ class LoginScreenTest {
220216
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
221217
loginErrorState = loginErrorState,
222218
appVersionPair = Pair(1, "1.0.1"),
223-
dataMigrationInProgress = false,
224219
)
225220
}
226221
composeRule
@@ -240,7 +235,6 @@ class LoginScreenTest {
240235
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
241236
loginErrorState = loginErrorState,
242237
appVersionPair = Pair(1, "1.0.1"),
243-
dataMigrationInProgress = false,
244238
)
245239
}
246240
composeRule
@@ -260,7 +254,6 @@ class LoginScreenTest {
260254
onLoginButtonClicked = { listenerObjectSpy.attemptRemoteLogin() },
261255
loginErrorState = loginErrorState,
262256
appVersionPair = Pair(1, "1.0.1"),
263-
dataMigrationInProgress = false,
264257
)
265258
}
266259
composeRule

0 commit comments

Comments
 (0)