Stream: questionnaire
Topic: Whitespace as an answer
Paul Lynch (Mar 28 2022 at 18:20):
If the user enters a few space characters into a answer field, does that count as an "answer"? I could not find anything about trimming field values.
Elliot Silver (Mar 28 2022 at 18:31):
I don’t believe FHIR allows all whitespace values, so there’d be no way to populate a QR with that answer.
Paul Lynch (Mar 28 2022 at 18:38):
Thanks, I did not think to check the string datatype. From https://build.fhir.org/datatypes.html#string: "strings SHOULD always contain non-whitespace content" and "Leading and Trailing whitespace is allowed, but SHOULD be removed when using the XML format". So it sounds like it is acceptable to trim field values (which was my next question).
Elliot Silver (Mar 28 2022 at 18:39):
That also corrects me— whitespace values are allowed.
Brian Postlethwaite (Mar 28 2022 at 23:44):
Whitespace lead/trail, but not empty. And XML can trim them out - so expect that all could trim them out.
Lloyd McKenzie (Mar 29 2022 at 14:53):
And if they get trimmed, you'll end up with an empty string, which isn't allowed.
Lloyd McKenzie (Mar 29 2022 at 14:53):
Good practice is for your tool to trim all entered data and treat all whitespace as unanswered.
Last updated: Apr 12 2022 at 19:14 UTC