Stream: questionnaire
Topic: links to images in questionnaire
Diane (Nov 05 2021 at 02:35):
In one of our questionnaires, the users will have to refer to 3 diagrams in order to complete a section of the questionnaire. The diagrams are large (full screen) diagrams not like the pain level faces in the example at https://build.fhir.org/ig/HL7/sdc/examples.html#using-answeroption-and-rendering-xhtml
I know that I can either use an item or the support link https://build.fhir.org/ig/HL7/sdc/examples.html#using-supportlink to direct the users to the images.
But, where is the ideal place to "host" the images? Is there a 'best practice'?
Do I place them into our IG, so that the links lead to build.fhir.org/ig/HL7/ourIGhere.html/images/image1.jpg etc.?
Do I place them into the website that hosts our software, such as www.oursite.edu/images/image1.jpg?
Or, is it best to actually include them with the questionnaire as contained resources like the example at https://build.fhir.org/ig/HL7/sdc/examples.html#using-answeroption-and-rendering-xhtml has the images contained? If I do this,
then when I use the rendering-xhtml extension how do I refer to the files? Is it as easy as # with the ID of the contained image resource?
{
"valueString": "OK",
"_valueString": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/rendering-xhtml",
"valueString": "<a href = '#diagram1'>Click here for diagram 1 </a>"
}
]
Lloyd McKenzie (Nov 05 2021 at 02:55):
In answer to the last question, yes it's just "#[id]". As to what's best, what will the tools that are using the Questionnaire going to have access to most easily? In general I'd say that hosting them at the HL7 site is not ideal, as it's not intended to be available for production runtime use. It's not down often, but we can't promise it won't be and there's no service agreement around it. Also, if you need to make any changes to them, you'd be looking at going through the ballot or other extended publication process, which might not be ideal.
Elliot Silver (Nov 05 2021 at 16:35):
Alternative approach 4: store each as a FHIR Binary distributed with the questionnaire. That puts them on the user's server, rather than one you or HL7 manage; and provides opportunity to avoid the overhead of communicating the images every time the questionnaire is opened.
(It does raise an interesting question of what accept headers the request would have -- you definitely wouldn't want fhir+json or fhir+xml.)
Elliot Silver (Nov 05 2021 at 16:38):
Also, if you include the image as a contained resource, it is going to have to be as a FHIR Binary. I don't think you can do contained non-resources. I'm not sure how you interpret the instance as an image though rather than as a Binary when you follow that link. @Lloyd McKenzie
Lloyd McKenzie (Nov 05 2021 at 18:54):
Binary has a contentType that defines the mime type. If the references is from an <img/> tag or an extension with the same meaning, that should be enough to know how to render it.
Paul Lynch (Nov 09 2021 at 14:38):
@Lloyd McKenzie I would not have expected <a href = '#diagram1'> inside rendering-xhtml to work. Is there someplace in the specification that says it should? I thought it was just img tags that would do that. I don't object to the idea, and can see the usefulness of it.
Lloyd McKenzie (Nov 10 2021 at 02:45):
I agree it should be an <img/> tag, not an <a/> tag.
Paul Lynch (Nov 12 2021 at 16:41):
Okay, but I think @Diane wanted to link to the images, not embed them inside the item text. The images are very large, she said.
Diane (Nov 13 2021 at 00:55):
Yes. I want a link to the images because they are large. I was wondering if I can store the images in the questionnaire (contained resource or as suggested by Elliot Silver, a FHIR binary) and then link to them.
Lloyd McKenzie (Nov 13 2021 at 02:57):
You can only link to something that's a page maintained elsewhere. You can't expect a form filler to generate separate pages for images for you.
Diane (Nov 13 2021 at 21:53):
Good to know. This is a good discussion about the potential options and what is not possible.
Last updated: Apr 12 2022 at 19:14 UTC