QuestionnaireItemViewItem

data class QuestionnaireItemViewItem(questionnaireItem: <ERROR CLASS>, questionnaireResponseItem: <ERROR CLASS>, resolveAnswerValueSet: suspend (String) -> List<<ERROR CLASS>>, questionnaireResponseItemChangedCallback: () -> Unit)

Item for QuestionnaireItemViewHolder in RecyclerView containing

Parameters

questionnaireItem

the question and the answer.

questionnaireResponseItem

the question and the answer are used to create the right type of view (e.g. a CheckBox for a yes/no question) and populate the view with the right information (e.g text for the CheckBox and initial yes/no answer for the CheckBox).

questionnaireResponseItemChangedCallback

function that should be called whenever the questionnaireResponseItemBuilder is changed to inform the rest of the questionnaire to be updated

Constructors

Link copied to clipboard
fun QuestionnaireItemViewItem(questionnaireItem: <ERROR CLASS>, questionnaireResponseItem: <ERROR CLASS>, resolveAnswerValueSet: suspend (String) -> List<<ERROR CLASS>> = { emptyList() }, questionnaireResponseItemChangedCallback: () -> Unit)

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

QuestionnaireItemViewItem is a transient object for the UI only. Whenever the user makes any change via the UI, a new list of QuestionnaireItemViewItems will be created, each holding references to the underlying QuestionnaireItem and QuestionnaireResponseItem. To avoid refreshing the UI unnecessarily with the same QuestionnaireItems and QuestionnaireResponseItems, we consider two QuestionnaireItemViewItems to be the same if they have the same underlying QuestionnaireItem and QuestionnaireResponseItem. See QuestionnaireItemAdapter.DiffCallback.

Link copied to clipboard
fun equalsDeep(other: QuestionnaireItemViewItem): Boolean

Comparing the contents of two QuestionnaireItemViewItems by traversing the underlying Questionnaire.QuestionnaireItemComponent and QuestionnaireResponse.QuestionnaireResponseItemComponent and comparing values of all the properties. This is done by using the Questionnaire.QuestionnaireItemComponent.equalsDeep and QuestionnaireResponse.QuestionnaireResponseItemComponent.equalsDeep.

Link copied to clipboard
fun isAnswerOptionSelected(answerOption: <ERROR CLASS>): Boolean

Properties

Link copied to clipboard
val questionnaireItem: <ERROR CLASS>
Link copied to clipboard
val questionnaireResponseItem: <ERROR CLASS>
Link copied to clipboard
val questionnaireResponseItemChangedCallback: () -> Unit
Link copied to clipboard
val resolveAnswerValueSet: suspend (String) -> List<<ERROR CLASS>>
Link copied to clipboard
var singleAnswerOrNull: <ERROR CLASS>

The single answer to the QuestionnaireResponse.QuestionnaireResponseItemComponent, or null if there is none or more than one answer.