Stream: implementers
Topic: Should FHIR allow \u0000 in string?
Yunwei Wang (Feb 25 2022 at 17:36):
We received a FHIR resource with this JSON segemnt
"type": {
"text": "\u0000"
}
type
is a CodeableConcept
string data type states that "Strings SHOULD not contain Unicode character points below 32, except for u0009 (horizontal tab), u0010 (carriage return) and u0013 (line feed)" so text
is valid and so does type
.
But it feels really strange since this does not convey any meaning.
Lloyd McKenzie (Feb 25 2022 at 17:41):
Yeah, I'd say someone is trying to cheat a mandatory in a more creative way than necessary - explain to them about the dataAbsentReason extension. My preference would be that if normalize-space on a string is empty, then we treat it as an empty string.
John Moehrke (Feb 25 2022 at 18:02):
I would hope that a data sanitization would catch these and declare them invalid.
Gino Canessa (Feb 25 2022 at 18:06):
I have run into issues with that SHOULD before.. I do not like it, Sam I Am.
That string also runs into problems with the other SHOULD present there:
Note: This means that a string that consists only of whitespace could be trimmed to nothing, which would be treated as an invalid element value. Therefore strings SHOULD always contain non-whitespace content.
(which I also believe should be a SHALL)
David Pyke (Feb 25 2022 at 18:13):
Yeah, I can't see a use case where only whitespace is a valid response
John Moehrke (Feb 25 2022 at 18:26):
good test to add to the test tools #testing
David Pyke (Feb 25 2022 at 18:28):
No point in testing a SHOULD for non-whitespace content.
John Moehrke (Feb 25 2022 at 18:28):
oh yes there is... did you crash?
Grahame Grieve (Feb 25 2022 at 19:20):
I wished to make it a SHALL too, but if we do that, then there are legacy records that cannot be communicated
Gino Canessa (Feb 25 2022 at 19:32):
Doesn't that note exist because empty values result in invalid XML?
Lloyd McKenzie (Feb 25 2022 at 19:44):
Can we at least spit out a warning? Does FHIRPath have a trim() or normalize-space() function?
Last updated: Apr 12 2022 at 19:14 UTC