FHIR Chat · Static Image · questionnaire

Stream: questionnaire

Topic: Static Image


view this post on Zulip RP (Mar 07 2021 at 02:40):

Curious what is the approach for displaying static images inside of a Questionnaire? I'm thinking could use an attachment item type set an initial value to the image and set the items value to be read-only? Is this the right approach (I didn't see an item-control for images).

view this post on Zulip Lloyd McKenzie (Mar 07 2021 at 03:47):

The approach recommended by SDC is to use the HTML extension for the item.text or option value. That allows you to have images in group labels, display text, questions and/or answers.

view this post on Zulip Lloyd McKenzie (Mar 07 2021 at 03:47):

(And it allows you to mix text and images as needed)

view this post on Zulip Lloyd McKenzie (Mar 07 2021 at 03:48):

You can also provide appropriate content for the sight-impaired, flyovers or whatever else is needed

view this post on Zulip Kashyap Jois (Mar 10 2021 at 10:05):

If you are working in a mobile based environment and not web based you can use the extensions defined in the CPGShareableQuestionnaire i.e. itemImage and responseImage

view this post on Zulip RP (Mar 18 2021 at 22:30):

Got it thanks :+1:

view this post on Zulip Brian Postlethwaite (Apr 06 2021 at 22:59):

@Lloyd McKenzie should we note that CPG extension in SDC somewhere?

view this post on Zulip Lloyd McKenzie (Apr 07 2021 at 01:04):

Not sure - that gives us two ways to do the same thing, which I'm somewhat leery of...

view this post on Zulip Brian Postlethwaite (Apr 07 2021 at 03:56):

The HTML way is more challenging for non Web renderings, and I suspect the CPG extension covers something more explicit too - I'll take another look at it to see if I'd use it, @Paul Lynch can you take a look too?

view this post on Zulip Paul Lynch (Apr 07 2021 at 12:38):

I think the cpq-itemimage and cpg-responseImage would be easier to implement than rendering-xhtml, which is only supposed to support of limited set of tags due to security concerns (which are probably difficult to fully address). Also, rendering-xhtml seems like an obscure way to add an image. (The rendering-xhtml page does not even mention images.)

view this post on Zulip Lloyd McKenzie (Apr 07 2021 at 14:54):

Then I guess we need a change request...

view this post on Zulip Tilo Christ (Apr 07 2021 at 16:45):

Lloyd McKenzie said:

Then I guess we need a change request...

@Paul Lynch

rendering-xhtml seems like an obscure way to add an image. (The rendering-xhtml page does not even mention images.)

The SDC example is using xhtml to render images into answer options: http://build.fhir.org/ig/HL7/sdc/examples.html#using-answeroption-and-rendering-xhtml , does that count as specification by example?

I operate in a non-html, mobile environment and I implemented the render-xhtml with images in 11 lines of code, but if needs be I can write another 11 lines of code for the CPG way.

Can the Attachment datatype as used by the CPG images be placed inside the contained section of the Questionnaire? I operate in poorly networked areas and need the questionnaires to be fully self-contained, similar to what the SDC example is doing.

On the topic of images, is there guidance which mime-types need to be supported as a minimum? PNG? JPG? GIF?? SVG?? # of colours? alpha channel? Should there be specified limits on the size of the images? I threw the questionnaire which I had designed for the Hot Beverage IG at #social on April 1st at the SDC implementations which were listed on Confluence, and they were all either unable to support the display of images or crashed. Maybe some boundaries might help? BTW: Feel free to add this Questionnaire to the examples collection as a stress test:
https://github.com/tiloc/faiadashu/blob/main/example/assets/instruments/beverage_ig.json

Ceterum censeo: I wish I could attach a responseImage to a slider and use that as a VAS scale :-)

view this post on Zulip Paul Lynch (Apr 08 2021 at 15:14):

Lloyd McKenzie said:

Then I guess we need a change request...

The one issue I am having with those two extensions (cpg-itemImage and cpg-responseImage) is that I don't see "context of use" documented, and although I was assuming cpq-responseImage would go on answerOption, now that I look at it again I am not sure that is its intended use.

view this post on Zulip Tilo Christ (Apr 08 2021 at 17:23):

But wouldn't this example do just that? http://build.fhir.org/ig/HL7/cqf-recommendations/Questionnaire-anc-quick-check.json.html

view this post on Zulip Lloyd McKenzie (Apr 08 2021 at 17:32):

The contexts are Questionnaire.item and Questionnaire.item.answerOption respectively

view this post on Zulip Paul Lynch (Apr 08 2021 at 17:34):

@Lloyd McKenzie Is that guess a based on examples, or are you looking at something that says that?

view this post on Zulip Lloyd McKenzie (Apr 08 2021 at 17:35):

What's not clear is what's meant by 'accompany'? Can the text be omitted? Is the text a flyover for the image? Do you have to see both? Also, there's no support for capturing the image in the QuestionnaireResponse.

view this post on Zulip Lloyd McKenzie (Apr 08 2021 at 17:35):

@Bryn Rhodes - do you think these extensions should move into SDC?

view this post on Zulip Paul Lynch (Apr 08 2021 at 17:38):

I assume accompany means "in addition to" the text. I wondered for a bit about placement (to right, left, or below the text) but then I decided if that kind of placement control was important, the Questionnaire designer could use rendering-xhtml.

view this post on Zulip Bryn Rhodes (Apr 08 2021 at 17:46):

@Lloyd McKenzie , yes, I've submitted a tracker to that effect here: https://jira.hl7.org/browse/FHIR-31513

view this post on Zulip Lloyd McKenzie (Apr 08 2021 at 18:01):

That's not quite the same as saying "move them"

view this post on Zulip Tilo Christ (Apr 08 2021 at 18:25):

Paul Lynch said:

I assume accompany means "in addition to" the text. I wondered for a bit about placement (to right, left, or below the text) but then I decided if that kind of placement control was important, the Questionnaire designer could use rendering-xhtml.

I would very much agree with that. With a mobile questionnaire filler you need rather the semantics of the extensions, rather than a precise layout definition. With Android or iOS you might have to serve all different kinds of screen sizes from a phone in portrait or landscape mode up to a large iPad Pro, and any prescription that something needs to go left, right, or above something else is something you can either ignore, or scale down until it becomes unreadable, or do a lot of wrapping... the same goes for the colours in XHMTL or render-style. The SDC examples that try to be fancy with colours become unreadable on a phone in dark mode (dark blue on dark grey, for instance). Other trouble makers on mobile are the table extensions in group items and the horizontal layout in choice item.

view this post on Zulip Paul Lynch (Apr 08 2021 at 18:25):

Would it be better to just refer to them from SDC? Moving things (changing URLs) can be disruptive.

view this post on Zulip Bryn Rhodes (Apr 08 2021 at 19:04):

I'd be happy to update the CPG to use the SDC extensions if they were available.

view this post on Zulip Lloyd McKenzie (Apr 08 2021 at 20:52):

The challenge is that SDC can't use the CPG extensions unless it has a dependency on the CPG IG - and I think the logical direction for dependency would be CPG depending on SDC.


Last updated: Apr 12 2022 at 19:14 UTC