Skip to content

Commit

Permalink
Modifying to test with mulitple variables in the expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
MJ1998 committed Jul 20, 2023
1 parent 84d32f3 commit 2f50763
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,7 @@ internal class QuestionnaireViewModel(application: Application, state: SavedStat
)
}
val options = item.extractAnswerOptions(data)
if (expression.isXFhirQuery) {
answerExpressionMap[xFhirExpressionString] = options
}
if (expression.isXFhirQuery) answerExpressionMap[xFhirExpressionString] = options
return options
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,16 @@ class ExpressionEvaluatorTest {
}
)
}
addExtension().apply {
url = EXTENSION_VARIABLE_URL
setValue(
Expression().apply {
name = "B"
language = "text/fhirpath"
expression = "2"
}
)
}
addItem(
Questionnaire.QuestionnaireItemComponent().apply {
linkId = "an-item"
Expand All @@ -885,7 +895,7 @@ class ExpressionEvaluatorTest {
setValue(
Expression().apply {
language = "application/x-fhir-query"
expression = "Patient?address-city={{%A}}"
expression = "Patient?address-city={{%A}}&gender={{%B}}"
}
)
}
Expand All @@ -905,6 +915,6 @@ class ExpressionEvaluatorTest {
null
)

assertThat(result).isEqualTo("Patient?address-city=1")
assertThat(result).isEqualTo("Patient?address-city=1&gender=2")
}
}

0 comments on commit 2f50763

Please sign in to comment.