Pages

Wednesday, August 9, 2017

Order Word Important Not Is

This is a quote from an expression used by my family to say to each other, "You understood what I meant, stop fussing about how I said it".

One of the things we've learned after a decade and more of use of XML is that the names of things and the position of them in a hierarchy are sufficient to provide just about all the semantics we need, not the essential order.  The only place where order is important is in LISTS of things that have the same name, and in that case, the order is the only essential characteristic.  XML inherited its dependence on name requirement because that requirement had already existed in an even older standard: SGML, and one of the stated goals of XML was to ensure backwards compatibility with SGML.

One of the weird things in CDA where the order thing shows up is in the order of telecom and address parts of Entities and Roles. It was recognized originally in the creation of the RIM that entities (things in green) could have telecommunications address without having an address.  Since organization extends from entity, the telecom thing had to come first, and then the address followed.

For roles (things in yellow), both addr and telecom were present, and folks put them into the natural order. And so we have this weirdness of two different things having an order requirement that is present in CDA, where there are inconsistencies in the order.

Fortunately, for those of you working with FHIR, JSON doesn't have this restriction (but the FHIR XML surely does have an order restriction). 

Anyway, if you want to know why order is important, it's because XML and XML Schema says it is, not because it really is.  It just make things easier at the time to say that order was important. Recall back in the days when SGML because a standard (1986), computers had as much at 64Kb of memory at a time.  We couldn't afford to read entire files into memory all at once.  These days, we don't think twice about sucking up a megabyte at a time and complain when it takes longer than about 10 seconds to download it.

   Keith

2 comments:

  1. Now to teach Test-Tools this Postel's Law principle https://healthcaresecprivacy.blogspot.com/2017/08/order-word-understand-not-is.html

    ReplyDelete
  2. I found this blog article on the history of Postel's law to be informative not just about the history, but also WHY it is important. http://ironick.typepad.com/ironick/2005/05/my_history_of_t.html

    ReplyDelete