Right-To-Left scripts in #FHIR
Feb 3, 2016Today, I’m at Linux Conference Australia. I watched a hysterically funny and very interesting presentation by Moriel Schottlender on using Right-To-Left scripts, such as Hebrew, Arabic, Farsi, etc:
browsers have problems when deciding what to do when languages are mixed up, and that, my friends, is a recipe for really weird issues when typing and viewing bidirectional text.
Check the full presentation. And yes, Moriel showed us some really confusing stuff. She kept showing images like this:
This, btw, is your mind trying to process RTL issues (and how could I not post that image?). Moriel has a web site demonstrating some of this stuff (including the piece de resistance, an animated bmp).
Anyway, after the presentation, I asked Moriel whether she had any thoughts about RTL use in a RESTful interface (say, maybe, FHIR). She didn’t have any strong experience, but a combination of her presentation, and her comments after, led to the following advice:
- If you’re using RTL script entirely, that should be pretty straight forward. The framework of a resource is all LTR ASCII, but the contents of the string primitives are RTL. That works fine
- The tricky bit is where you mix scripts - e.g. an Arabic word mixed in with an english sentence
Actually, that’s not at all an unusual idea. You can see an example of this here on Wikipedia. And in a clinical environment, it would be a typical thing to happen in somewhere like Saudi Arabia, with a lot of foreigners working in the healthcare system, and mixing English and Arabic. You can watch Moriel’s presentations for fun with left, right, parentheses etc, and see how tricky that could be. Anyway, the basic advice is:
Anywhere you mix LTR and RTL scripts, make sure you useUnicode control charactersto mark the edges of the direction changes.
And one more conclusion I drew:
- There’s little prospect we’ll ever publish an IG that makes sensible use of RTL content
If anyone has experimented with RTL content in FHIR - I’d love to hear about it: we want to support that properly.
p.s. I’m here at LinuxConf to talk about the FHIR community as an open source project.