How to get offset for a given timestamp, allowing for DST
Hello All
I'm not sure what the best practice is for this. I have a DTL for returning ORUs back to a hospital in a different time zone. They have requested that various timestamps have the time zone offset added to the HL7 format (%q%k, I think). First, I just wanted to be sure the system was aware it was DST. I was able to determine if DST is in effect like this:
<assign property='tzOffset' action='set' value='"-0500"' /> <code><![CDATA[ SET dst=$SYSTEM.Util.IsDST() IF dst=1 {SET tzOffset = "-0400"} ]]> </code> <assign property='target.{MSH:7}' action='set' value=' source.{MSH:7}_tzOffset' />
This presents the timestamp in MSH:7 as 20200602123015-0400, so I know the system is at least aware that it is DST. Now the part I don't understand is how to convert any given timestamp (%q) to include the correct offset for that time. I tried the following, but only got "-0000" for the offset.
<assign property='target.{MSH:7}' action='set' value='..ConvertDateTime(source.{MSH:7},"%q","%q%z")' />
Any help would be greatly appreciated!