Subtitle text not behaving as expected
Case 1: The text "Correct!" appears twice, once incorrectly above the question "Cats are better than dogs", and once correctly based on the enableWhen element.
{
"resourceType": "Questionnaire",
"status": "active",
"item": [
{
"linkId": "2",
"text": "Demographic Information",
"type": "group",
"item": [
{
"linkId": "2.1",
"text": "Cats are better than dogs",
"type": "boolean"
},
{
"linkId": "2.1.1",
"text": "Correct!",
"type": "display",
"enableWhen": [
{
"question": "2.1",
"operator": "=",
"answerBoolean": true
}
]
}
]
}
]
}

Case 2: When enableWhen is a child of the item, the "Correct!" text never appears. It still shows up incorrectly above the question, like in Case 1.
{
"resourceType": "Questionnaire",
"status": "active",
"item": [
{
"linkId": "2",
"text": "Demographic Information",
"type": "group",
"item": [
{
"linkId": "2.1",
"text": "Cats are better than dogs",
"type": "boolean",
"item": [
{
"linkId": "2.1.1",
"text": "Correct!",
"type": "display",
"enableWhen": [
{
"question": "2.1",
"operator": "=",
"answerBoolean": true
}
]
}
]
}
]
}
]
}

This is using the published version of com.google.android.fhir:data-capture:0.1.0-beta03.
@PallaviGanorkar can you take a look at this please
https://github.com/google/android-fhir/pull/1222
Case 2: As per issue 1113 and PR 1222, this behavior is as expected. i.e Showing Nested display item text as subtitle text.
Case 1: Reproducible in version com.google.android.fhir:data-capture:0.1.0-beta03, but in latest code base its not reproducible, its working fine.
For Case 2, I did not understand that it was considered subtitle text because the text "Correct!" is rendered the same as the other text on the questionnaire. The intended use would be more clear if the text styling was different.
That said, I think it is difficult to understand when something would be considered a subtitle vs a new text element. Can you describe how the rendering logic works based on the JSON structure for documentation purposes?
As an alternative, maybe we could use the displayCategory extension to make the rendering style decisions more explicit.
In addition, the display of "Correct!" does not appear to respect the enableWhen.
re: formatting based on JSON structure, the top level text "Demographic Information" looks the same as "Cats are better than dogs". I would expect the contents of a "text" field of a "group" type to be a section header and render differently than a question text.
For Case 2, I did not understand that it was considered subtitle text because the text "Correct!" is rendered the same as the other text on the questionnaire. The intended use would be more clear if the text styling was different.
That said, I think it is difficult to understand when something would be considered a subtitle vs a new text element. Can you describe how the rendering logic works based on the JSON structure for documentation purposes?
As an alternative, maybe we could use the displayCategory extension to make the rendering style decisions more explicit.
i agre with this. maybe we should use display category.
maybe we should use "instructions" http://hl7.org/fhir/R4/valueset-questionnaire-display-category.html
https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Hints.20for.20questions
re: formatting based on JSON structure, the top level text "Demographic Information" looks the same as "Cats are better than dogs". I would expect the contents of a "text" field of a "group" type to be a section header and render differently than a question text.
@williamito @jingtang10 @santosh-pingle This is a great call out. I agree they should render differently. From what I'm aware of we don't have a "section header" text style. I have some old mocks where we have this type of text rendering above a question. See below I'd recommend we use the "Title Medium - Roboto 16 Medium" text style. @santosh-pingle any questions/issues with implementing this type of section header text style?
i agre with this. maybe we should use display category. maybe we should use "instructions" http://hl7.org/fhir/R4/valueset-questionnaire-display-category.html
@jingtang10 @williamito
The "subtitle text" usually instructions that accompany the questions. I think changing it to "instructions" might be the most clear.
Looking into it. thanks!
re: formatting based on JSON structure, the top level text "Demographic Information" looks the same as "Cats are better than dogs". I would expect the contents of a "text" field of a "group" type to be a section header and render differently than a question text.
@williamito @jingtang10 @santosh-pingle This is a great call out. I agree they should render differently. From what I'm aware of we don't have a "section header" text style. I have some old mocks where we have this type of text rendering above a question. See below I'd recommend we use the "Title Medium - Roboto 16 Medium" text style. @santosh-pingle any questions/issues with implementing this type of section header text style?
![]()
working on it.
i agre with this. maybe we should use display category. maybe we should use "instructions" http://hl7.org/fhir/R4/valueset-questionnaire-display-category.html
@jingtang10 @williamito
The "subtitle text" usually instructions that accompany the questions. I think changing it to "instructions" might be the most clear.
We can provide implementation. thanks!
i agre with this. maybe we should use display category. maybe we should use "instructions" http://hl7.org/fhir/R4/valueset-questionnaire-display-category.html
@jingtang10 @williamito The "subtitle text" usually instructions that accompany the questions. I think changing it to "instructions" might be the most clear.
We can provide implementation. thanks!
looking into it.