FHIR Chat · Should FHIR allow in string? · implementers

Stream: implementers

Topic: Should FHIR allow \u0000 in string?


view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip John Moehrke (Feb 25 2022 at 18:02):

I would hope that a data sanitization would catch these and declare them invalid.

view this post on Zulip 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)

view this post on Zulip David Pyke (Feb 25 2022 at 18:13):

Yeah, I can't see a use case where only whitespace is a valid response

view this post on Zulip John Moehrke (Feb 25 2022 at 18:26):

good test to add to the test tools #testing

view this post on Zulip David Pyke (Feb 25 2022 at 18:28):

No point in testing a SHOULD for non-whitespace content.

view this post on Zulip John Moehrke (Feb 25 2022 at 18:28):

oh yes there is... did you crash?

view this post on Zulip 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

view this post on Zulip Gino Canessa (Feb 25 2022 at 19:32):

Doesn't that note exist because empty values result in invalid XML?

view this post on Zulip 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