Stream: questionnaire
Topic: Print version of Questionnaire
Kenneth Myhra (May 28 2020 at 18:44):
I have a use case where we need a print version of the Questionnaire (not QuestionnaireResponse) to be sent by ordinary mail.
As far as I see for many of the questionnaires it will not be possible to auto-generate a print version as there is not always a one-to-one between a digital version and a print version.
So I am thinking of using a DocumentReference and Binary where the DocumentReference refers to the Questionnaire. The reference could also go the other way if that somehow makes more sense. The Binary could be a PDF or a HTML page representing the Questionnaire and would need to be maintained separately from the Questionnaire.
So my question is, has anyone had this use case before, and if not is this something that should be brought into the SDC?
(Looked through the SDC beforehand, but could not find anything. Hopefully I did not oversee anything)
Lloyd McKenzie (May 28 2020 at 19:08):
One possible solution would be to have the Questionnaire's narrative be an 'image' which references a contained binary for the PDF. That way you only have to worry about one resource. (If you'd like an example of that included in SDC, feel free to submit a change request...)
Paul Lynch (Jun 02 2020 at 14:33):
Although it could be difficult to make a print version of some Questionnaires, I would think that if there were a print version of a particular form, one could make a Questionnaire version of it that could be printed.
Brian Postlethwaite (Jun 02 2020 at 22:59):
Another option would be to do something special like we do for binary, and support the Accept header?
Kenneth Myhra (Jun 05 2020 at 07:45):
It's difficult to auto-generate, it usually looks pretty bad. For some questionnaires there's already a print version or it makes sense to create one since (in Norway) you are allowed by law to say that I do not use digital services. In those scenarios we would need to use ordinary mail and have a proper print version.
Brian, are you thinking something like this:
Accept: application/octet-stream
GET Questionnaire/12
Stoyan Halkaliev (Jun 05 2020 at 08:52):
or directly something like this:
Accept: application/fhir+pdf
GET Questionnaire/12
Stoyan Halkaliev (Jun 05 2020 at 09:12):
In the tools presentation of the connectaton I've shown shorty our ReportDesigner, which basically takes care of the visual design and binding of the questionnaire items, but right now it is saved in external (custom) XML structure, with only indirect connection to the questionnaire. I would very much like to have it at least in the repository somewhere, to properly reference it and for history management.
We ware looking also at the binary resource, but it is too "light" for my taste, as I'd rather have something that can be referenced with cannonical and also support version property itself. That's why my current thinking is to have another Questionnaire that specifically contains the definition of the print layout (XML or whatever custom format), then use the url property to specify it is a print layout, use the derivedFrom to point which "real" questionnaire it is for (as it is cannonical), any of the other properties that might be handy, like date, contact, publisher, etc. The idea is, that the print version might have different publishing workflow and different people responsible than the questionnaire itself.
How to only question I haven't decided yet is to where actually put the print layout. I see 3 options at the moment:
- extension on the print questionnaire
- one item, that is just a reference to a binary resource, which contains the print layout definition in any applicable format.
- one text item that contains the print layout definition (which is XML in my case)
I will very much appreciate you comments on this. Thanx in advance.
Kenneth Myhra (Jun 05 2020 at 11:11):
The reasoning for using application/octet-stream
was that we do not know what kind of format it is, coulde be PDF, HTML or something completely else. I only know that I want to handle it as Binary.
Lloyd McKenzie (Jun 05 2020 at 14:11):
If we were going to support that, I think we'd want to nail down the format for interoperability purposes
Kenneth Myhra (Jun 08 2020 at 08:07):
Do you want only one format, or could there be more than one? We have been experimenting with both PDF and HTML
Lloyd McKenzie (Jun 08 2020 at 14:14):
My personal preference would be a single format unless we think there are multiple sub-usecases.
Stoyan Halkaliev (Jun 08 2020 at 18:51):
I was thinking for something more generic, that can be rendered to PDF or HTML (or Word file if needed).
Lloyd McKenzie (Jun 08 2020 at 22:25):
For example?
Stoyan Halkaliev (Jun 09 2020 at 09:30):
I was thinking about XSL-FO, but will need to research a little more. Will look into it (and possible alternatives) and will report here. Any pointers are welcome. Will check also CSS3-page (https://www.w3.org/TR/css-page-3/)
Lloyd McKenzie (Jun 09 2020 at 14:12):
Think about what most questionnaire authors would reasonably be able to provide - unless your expectation is that we'd generate the XSL-FO for them?
Kenneth Myhra (Jun 09 2020 at 14:19):
I am kind of going back to my initial request and trying to describe my use cases a little bit clearer.
There are two use cases that do not directly affect formats.
- There is the use case where you want to send a printable form to someone through ordinary mail, they will fill it out and send it back to you, it might be OCR scanned.
- Here I need to be able to find the print version by ideally a reference on the Questionnaire to a DocumentReference or Binary.
- There is the use case where you want a printable version and merge it with the entries that the user filled out
- I think a reference to a DocumentReference or Binary would be perfectly fine here as well. Unless we want to describe how we merge those entries.
For me just a reference to a Binary or DocumentReference would suffice, but using the narrative and an image as suggested pr. Lloyd is not something that I fancy too much.
Back to the "known formats" I could for example probe the DocumentReference/Binary and determine if I support that format or not.
Then there is Stoyan's use case where as I understand want to describe the actual merging of the contents of the Questionnaire using something like XSL-FO. This could also be Adobe's FDF or XFDF
Lloyd McKenzie (Jun 09 2020 at 14:23):
If we don't want to use the narrative, we could have an extension that would let you point to a PDF or website. Only challenge with that is that the narrative is supposed to be the human-readable version of the form.
Kenneth Myhra (Jun 09 2020 at 14:49):
This is not a use case of a system that cannot understand FHIR, or only understands part of it. This is a system that understands FHIR and needs to invoke a process involving sending a printable version of a Questionnaire to a patient by mail. I agree with the purpose of the narrative, but it seems error-prone in a process such as this.
Lloyd McKenzie (Jun 09 2020 at 15:06):
Do you want to submit a change request for us to define an extension?
Kenneth Myhra (Jun 09 2020 at 15:15):
Yes, I can do that. I'll create a draft extension and submit a CR.
Last updated: Apr 12 2022 at 19:14 UTC