Why XML is all the rage now?

Started by
61 comments, last by TechnoGoth 10 years, 1 month ago

I'd have to pick none of the above. Honestly, that first one just looks like gibberish. Not that XML is any better, but still... Just total gibberish.

It's actually rather simplistic and all your information is viewable in a tight, concise manner.

Each message that comes across a network interface has an MSH segment, a Message Header. The message header displays information like who sent the message, who's supposed to receive it, what type of information are you going to find in the message, when was it sent, etc.

MSH|^~\&|GHH LAB|ELAB-3|GHH OE|BLDG4|200202150930||ORU^R01|CNTRL-3456|P|2.4

Each line of the message consists of a 3 letter identifier that tells you what information is going to be housed in the following line. Such as the MSH(Message Header), PID (Patient Identification), OBR(Oberservation Request), OBX (Oberservation Result), etc. These lines are known as Segments.

Each segment contains a host of fields, sub fields, sub-sub fields, etc.

Each field is separated by a | delimiter, which each field containing a particular set of standardized data.

MSH|^~\&|GHH LAB|ELAB-3|GHH OE|BLDG4|200202150930||ORU^R01|CNTRL-3456|P|2.4

Take for instance the MSH segment - Field number 9. This field states the Message Type (what type of information you can expect to see in the rest of the message). MSH-9 in this example has a field and subfield delimited by the ^ symbol. The caret delimits fields and subfields.

So MSH-9.1 is the Message Type, and MSH 9.2 (Subfield) is the Message Event.

MSH|^~\&|GHH LAB|ELAB-3|GHH OE|BLDG4|200202150930||ORU^R01|CNTRL-3456|P|2.4

The message structure looks like this:

[Message (Type & Event]

[Segment]

[Field]

[Subfield]

[Field]

[Subfield]

[Segment]

[Field]

[Subfield]

[Field]

[Subfield]

[Segment]

[Field]

[Subfield]

[Field]

[Subfield]

...and so on...

Anyways, figured I'd share. It's not often I get to speak about my profession as it's so niche. tongue.png

Advertisement

So you have to memorize a bunch of three-letter acronyms as well as memorizing standard field layouts in order to make sense of it? I can see how that would be somewhat easier for the expert, but not so much for anyone who hasn't spent their career memorizing such things.

So you have to memorize a bunch of three-letter acronyms as well as memorizing standard field layouts in order to make sense of it? I can see how that would be somewhat easier for the expert, but not so much for anyone who hasn't spent their career memorizing such things.

Not quite. There are a load of tools out there that does this for you. Most of the tools you use to build the interfaces have this automatically added to them. Much like trying to figure out where everything is in the BCL in .NET, Intellisense works wonders, as well as the Library Explorer.

That being said. Most people revert back to the standard specifications that are released by HL7.org, as this positional data tends to change slightly depending on the version of the standard you're using. (Again, much like the different .NET Framework versions)

So you have to memorize a bunch of three-letter acronyms as well as memorizing standard field layouts in order to make sense of it? I can see how that would be somewhat easier for the expert, but not so much for anyone who hasn't spent their career memorizing such things.

Not quite. There are a load of tools out there that does this for you. Most of the tools you use to build the interfaces have this automatically added to them. Much like trying to figure out where everything is in the BCL in .NET, Intellisense works wonders, as well as the Library Explorer.

That being said. Most people revert back to the standard specifications that are released by HL7.org, as this positional data tends to change slightly depending on the version of the standard you're using. (Again, much like the different .NET Framework versions)

There.. there are also XML tools that can present the data in a clean hierarchical fashion minus all the tags and group related items together, so I'm not sure there's really any difference tongue.png I'm with JT on this one.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

I've gatta agree with JT and bact, the v2 is complete gibberish without some form of documentation to assist you reading it. At least the xml version has human readable tags that can somewhat assist in figuring out whats's going on.

Also the tool argument is pretty moot since the purpose of a tool is to abstarct away from the underlying serializing format.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

Those records reminded me of my days as an abinitio developer. In AI you have record files that define the fields along with the field type and whether or not it is fixed length or deliminated. You could probably do the same thing in c# with annotations and a parser.

A record description file might look like this:

record monster

{

int id(3)

string name("\0")

int hp (5)

int attack (3)

int defense (3)

}("\n")

then in the data file you get the following:

001Goblin\000250020005\n

002Spider\000150010007\n

003Rat\000050002002\n

004Goblin King\059000350135\n

Generally I find that the data storage structure you use depends on your needs. XML was popular because it was well defined and well structured. Xml readers and writers are common and easy to use and so you can quickly parse the data you want with linq or xpath. You can also use style sheets to define the data and check that its well formed which makes it useful for api's and other B2B applications. Its also useful if you only new need a subset of the data in the file.

But these days JSON is pretty popular and widely used in the web which means there are plenty of tools to read and write it. The files are also much smaller than xml files which is useful when you have to worry about the size of data.

This topic is closed to new replies.

Advertisement