Daily using/supporting

Get Firefox browser!
Get Thunderbird!
Get Opera browser!
Get The Gimp!
Get Inkscape!
Get LibreOffice!
Get Videolan!
Get Linux!
Get Mandriva!
Get Joomla!
Hacker Emblem

Archives

Which topics would you like us to cover more?

Latest comments

Home Architecture, security and coding How to parse the HL7 DateTime with nHapi
How to parse the HL7 DateTime with nHapi
Written by Division by Zero   
Tuesday, 30 August 2011 08:41

Recently someone asked me how to parse the DateTime form a HL7 message to a .Net DateTime. In may I wrote a post on how to read SIU messages. The last part was some code on how to parse this DateTime. Since it was quite a big post, this bit was quite hidden. So here's how to parse the HL7 DateTime.

I have copied the code from the earlier post (yes.. that's how lazy I am!).

TQ tq = message.SCH.GetAppointmentTimingQuantity().First();
TS startTime = tq.StartDateTime;
DateTime result = new DateTime(startTime.TimeOfAnEvent.Year, startTime.TimeOfAnEvent.Month, startTime.TimeOfAnEvent.Day, startTime.TimeOfAnEvent.Hour, startTime.TimeOfAnEvent.Minute, startTime.TimeOfAnEvent.Second);

In this code I interpret the TS data type within the TQ data type. There are a few data types concerning time.

Data Type Name Description

DR

Date/time range

Scheduling Only:

<range start date/time (TS)> ^ <range end date/time (TS)>

RI

Repeat interval

Scheduling Only:

<repeat pattern (IS)> ^ <explicit time interval (ST)>

SCV

Scheduling class value pair

Scheduling Only:

<parameter class (IS)> ^ <parameter value (IS)>

TQ

Timing/quantity

<quantity (CQ)> ^ <interval (*)> ^ <duration (*)> ^ <start date/time (TS)> ^ <end date/time (TS)> ^ <priority (ID)> ^ <condition (ST)> ^ <text (TX)> ^ <conjunction (ID)> ^ <order sequencing (*)>

 

Add comment


Security code
Refresh

Computers are useless. They can only give you answers. - Pablo Picasso


© 2009 - 2013, Division by Zero

Template based on the empire template by joomlashack 

 Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.