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

New Engage Custom PR #2648

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
77e4bca
Engage custom
FikriMilano Aug 4, 2023
81a1646
IPC Task generation tests
f-odhiambo Jul 23, 2023
2e44299
revised plandef
f-odhiambo Jul 25, 2023
586cac0
Generate unique tasks for each ActivityDefinition
Jul 27, 2023
d380fd0
IPC Tasks
Aug 3, 2023
b347890
Remove reason of build error
FikriMilano Aug 7, 2023
9b9fb1c
Update datacapture dependency to 14.4-SNAPSHOT
FikriMilano Aug 8, 2023
40ca57a
Update profile with Session cards and also ability to move back to pr…
Aug 10, 2023
c2a8aaf
Remove overflow menu icons when configs is null or empty
ellykits Aug 14, 2023
fbde03b
Run spotlessApply
ellykits Aug 14, 2023
8be93e2
Merge branch 'main' of github.com:opensrp/fhircore into new-engage-cu…
FikriMilano Aug 15, 2023
0d7b9fb
Fix post merge conflict issue
FikriMilano Aug 15, 2023
640b703
Remove unused comments
FikriMilano Aug 15, 2023
af45af6
Allows LAUNCH_PROFILE to go back to previous screen
FikriMilano Aug 15, 2023
9cef8ed
Merge branch 'main' into new-engage-custom
f-odhiambo Aug 15, 2023
df4e45b
Ensures navOptions is null if backStack is false
FikriMilano Aug 16, 2023
70c0ee3
Merge branch 'new-engage-custom' of github.com:opensrp/fhircore into …
FikriMilano Aug 16, 2023
5f16265
Update data capture version
FikriMilano Aug 17, 2023
f39cfbb
Merge branch 'main' into new-engage-custom
f-odhiambo Aug 17, 2023
3c9ffb6
Modified PlanDef with also removal of task expiry
Aug 17, 2023
ea55ded
Merge branch 'main' into new-engage-custom
f-odhiambo Aug 17, 2023
440f50b
new test resources
Aug 21, 2023
5666241
Add NOTHING workflow
FikriMilano Aug 22, 2023
b54a58c
Merge branch 'new-engage-custom' of github.com:opensrp/fhircore into …
FikriMilano Aug 22, 2023
51eafe1
Move back to SDC 14.4 SNAPSHOT
FikriMilano Aug 22, 2023
e9640d0
Make default behavior for close task to make ready next set of tasks …
Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions android/engine/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2021 Google LLC

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.
-->
<resources>
<dimen name="help_header_margin_top">0dp</dimen>
</resources>
1 change: 1 addition & 0 deletions android/engine/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@
<string name="unsynced_resources">Unsynced Resources</string>
<string name="all_data_synced">All data synced</string>
<string name="invalid_offline_login_state">User set up required. Enable your internet connection </string>
<string name="help"></string>
</resources>
11 changes: 11 additions & 0 deletions android/engine/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
<item name="android:textColorSecondary">@color/white</item>
<item name="questionnaireSubmitButtonStyle">@style/Quest.Questionnaire.SubmitButtonStyle
</item>
<item name="questionnaireGroupTypeQuestionTextStyle">
@style/TextAppearance.Material3.HeadlineMedium
</item>
<item name="questionnaireQuestionTextStyle">
@style/TextAppearance.Material3.BodyLarge
</item>
<item name="questionnaireHelpHeaderStyle">@style/Quest.Questionnaire.HelpHeaderStyle</item>
</style>
<style name="Quest.Questionnaire.SubmitButtonStyle" parent="Questionnaire.SubmitButtonStyle">
<item name="android:text">@string/str_save</item>
Expand All @@ -76,4 +83,8 @@
<item name="android:layout_gravity">bottom|start</item>
</style>

<style name="Quest.Questionnaire.HelpHeaderStyle" parent="TextAppearance.Material3.TitleSmall">
<item name="android:visibility">invisible</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cql-engine = "2.4.0"
cql-evaluator = "2.4.0"
cql-to-elm = "2.4.0"
dagger-hilt-compiler = "2.42"
data-capture = "1.0.0-preview11-SNAPSHOT"
data-capture = "1.0.0-preview14.3-SNAPSHOT"
desugar-jdk-libs = "1.1.5"
easy-rules-jexl = "4.1.0"
espresso-core = "3.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,80 @@

package org.smartregister.fhircore.quest.data

import android.util.Log
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.datacapture.XFhirQueryResolver
import com.google.android.fhir.search.Search
import com.google.android.fhir.search.search
import org.hl7.fhir.r4.model.QuestionnaireResponse
import javax.inject.Inject
import javax.inject.Singleton
import org.hl7.fhir.r4.model.Resource
import org.hl7.fhir.r4.model.ResourceType

@Singleton
class QuestXFhirQueryResolver @Inject constructor(val fhirEngine: FhirEngine) : XFhirQueryResolver {
override suspend fun resolve(xFhirQuery: String): List<Resource> {
return fhirEngine.search(xFhirQuery)
Log.d("FIKRI XFHIRQUERY", xFhirQuery)
FikriMilano marked this conversation as resolved.
Show resolved Hide resolved


if (xFhirQuery.contains("QuestionnaireResponse")) {
val strParams = xFhirQuery.removePrefix("QuestionnaireResponse?")
val params = strParams.split("&")
val search = Search(ResourceType.QuestionnaireResponse).apply {
// filter(QuestionnaireResponse.SUBJECT, { value = "Patient/970fcf90-0383-45e1-acfa-1e3f0b7d0797" })
// filter(QuestionnaireResponse.QUESTIONNAIRE, { value = "Questionnaire/$questionnaireId" })
params.forEach {
val paramType = it.split("=").first()
val paramValue = it.split("=").last()
Log.d("FIKRI PARAM", "$paramType $paramValue")

if (paramType == QuestionnaireResponse.SP_SUBJECT) {
this.filter(QuestionnaireResponse.SUBJECT, { value = paramValue })
}

// if (paramType == QuestionnaireResponse.SP_PATIENT) {
// Log.d("FIKRI PARAM 2", "$paramType $paramValue")
// this.filter(QuestionnaireResponse.PATIENT, { value = paramValue })
// }

if (paramType == QuestionnaireResponse.SP_QUESTIONNAIRE) {
this.filter(QuestionnaireResponse.QUESTIONNAIRE, { value = paramValue })
}
}
}

// val lists = fhirEngine.search<QuestionnaireResponse> {
// params.forEach {
// val paramType = it.split("=").first()
// val paramValue = it.split("=").last()
// Log.d("FIKRI PARAM", "$paramType $paramValue")
//
// if (paramType == QuestionnaireResponse.SP_SUBJECT) {
// Log.d("FIKRI PARAM 1", "$paramType $paramValue")
// this.filter(QuestionnaireResponse.SUBJECT, { value = paramValue })
// }
//
// if (paramType == QuestionnaireResponse.SP_PATIENT) {
// Log.d("FIKRI PARAM 2", "$paramType $paramValue")
// this.filter(QuestionnaireResponse.PATIENT, { value = paramValue })
// }
//
// if (paramType == QuestionnaireResponse.SP_QUESTIONNAIRE) {
// Log.d("FIKRI PARAM 3", "$paramType $paramValue")
// this.filter(QuestionnaireResponse.QUESTIONNAIRE, { value = paramValue })
// }
// }
// filter(QuestionnaireResponse.SUBJECT, { value = "Patient/970fcf90-0383-45e1-acfa-1e3f0b7d0797" })
// filter(QuestionnaireResponse.QUESTIONNAIRE, { value = "Questionnaire/$questionnaireId" })
// }

val lists = fhirEngine.search<QuestionnaireResponse>(search)
Log.d("FIKRI TOTAL RES", lists.size.toString())

return lists
} else {
return fhirEngine.search(xFhirQuery)
}
}
}