Skip to content

Commit

Permalink
Refactor Auto complete widget (#1398)
Browse files Browse the repository at this point in the history
* Refactor Auto complete widget

* Removed FlexBox layout gradle dependency

* Review change, show error message

* Fixed failing test
  • Loading branch information
aditya-07 authored Jun 29, 2022
1 parent e331b97 commit be98cd5
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 180 deletions.
2 changes: 0 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ object Dependencies {
}

const val androidJunitRunner = "androidx.test.runner.AndroidJUnitRunner"
const val flexBox = "com.google.android.flexbox:flexbox:${Versions.flexBox}"
const val junit = "junit:junit:${Versions.junit}"
const val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}"
const val mockitoInline = "org.mockito:mockito-inline:${Versions.mockitoInline}"
Expand Down Expand Up @@ -177,7 +176,6 @@ object Dependencies {
const val androidFhirCommon = "0.1.0-alpha03"
const val desugarJdkLibs = "1.1.5"
const val fhirUcum = "1.0.3"
const val flexBox = "3.0.0"
const val guava = "28.2-android"
const val hapiFhir = "5.4.0"
const val http = "4.9.1"
Expand Down
84 changes: 84 additions & 0 deletions catalog/src/main/assets/auto_complete_questionnaire.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"meta": {
"profile": [
"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire|2.7"
]
},
"status": "draft",
"resourceType": "Questionnaire",
"item": [
{
"type": "choice",
"code": [],
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/questionnaire-item-control",
"code": "autocomplete",
"display": "Auto-complete"
}
],
"text": "Auto-complete"
}
}
],
"required": true,
"repeats": true,
"linkId": "1",
"text": "Do you have any existing conditions",
"answerOption": [
{
"valueCoding": {
"code": "asthma",
"display": "Asthma"
}
},
{
"valueCoding": {
"code": "copd",
"display": "Chronic Lung Disease"
}
},
{
"valueCoding": {
"code": "depression",
"display": "Depression"
}
},
{
"valueCoding": {
"code": "t2dm",
"display": "Diabetes"
}
},
{
"valueCoding": {
"code": "hypertension",
"display": "Hypertension"
}
},
{
"valueCoding": {
"code": "hypertension",
"display": "High Blood Pressure"
}
},
{
"valueCoding": {
"code": "hypercholesterolaemia",
"display": "High Cholesterol"
}
}
],
"initial": {
"valueCoding": {
"code": "asthma",
"display": "Asthma"
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,10 @@ class ComponentListViewModel(application: Application, private val state: SavedS
),
SLIDER(R.drawable.ic_slider, R.string.component_name_slider, "slider_questionnaire.json"),
IMAGE(R.drawable.ic_image, R.string.component_name_image, ""),
AUTO_COMPLETE(
R.drawable.ic_textfield,
R.string.component_name_auto_complete,
"auto_complete_questionnaire.json"
),
}
}
1 change: 1 addition & 0 deletions catalog/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<string name="component_name_slider">Slider</string>
<string name="component_name_dropdown">Dropdown</string>
<string name="component_name_image">Image</string>
<string name="component_name_auto_complete">Auto Complete</string>
<string name="layout_name_default_text">Default</string>
<string name="layout_name_paginated">Paginated</string>
<string name="layout_name_review">Review</string>
Expand Down
1 change: 0 additions & 1 deletion datacapture/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ dependencies {
implementation(Dependencies.Kotlin.stdlib)
implementation(Dependencies.Lifecycle.viewModelKtx)
implementation(Dependencies.material)
implementation(Dependencies.flexBox)
implementation(Dependencies.lifecycleExtensions)
implementation(Dependencies.timber)

Expand Down
Loading

0 comments on commit be98cd5

Please sign in to comment.