You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
populate initial with initialExpression result collection (#2751)
* populate initial with initialExpression result collection
* handle invariant rules for initialExpression
* convert evaluatedExpressionResult to questionnaireItem.type
* updated answerOptions in test to match initialExpressions' result
* added rule url in check message for initial value on group or display items.
* added test for invariant rule que-8 & codings without system match in initialExpression
* - refactored populateInitialValue
Handles repeats logic for answerOption
* - integrated tests for populateInitialValues
* - (spotless fix) ResourceMapperTest.kt
* - (feedback) added test & refactored code to use variables.
* - (refactor) updated multiline comment
"QuestionnaireItem item is not allowed to have both initial.value and initial expression. See rule at http://build.fhir.org/ig/HL7/sdc/expressions.html#initialExpression."
249
250
}
250
251
252
+
// Initial values can't be specified for groups or display items
"QuestionnaireItem item is not allowed to have initial value or initial expression for groups or display items. See rule at http://build.fhir.org/ig/HL7/sdc/expressions.html#initialExpression."
259
+
}
260
+
251
261
questionnaireItem.initialExpression
252
262
?.let {
253
263
evaluateToBase(
254
-
questionnaireResponse =null,
255
-
questionnaireResponseItem =null,
256
-
expression = it.expression,
257
-
contextMap = launchContexts,
258
-
)
259
-
.firstOrNull()
264
+
questionnaireResponse =null,
265
+
questionnaireResponseItem =null,
266
+
expression = it.expression,
267
+
contextMap = launchContexts,
268
+
)
260
269
}
261
270
?.let {
262
-
// Set initial value for the questionnaire item. Questionnaire items should not have both
263
-
// initial value and initial expression.
264
-
val value = it.asExpectedType(questionnaireItem.type)
0 commit comments