Author |
Message
|
jrsetters |
Posted: Wed Aug 21, 2013 6:21 am Post subject: Inserting the current HL7 date and time in the mapping node |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
I need to add the current date time in HL7 format to a field in a message map (MRM:HL7).
The format needs to be: YYYYMMDDHHMMSS
I can do this using fn:concat and a series of substrings.
eg:
Code: |
fn:concat(fn:substring(xs:string(esql:current-date()),7,4),fn:substring(xs:string(esql:current-date()),12,2),fn:substring(xs:string(esql:current-date()),15,2)) |
But this just seems a little bloated.
I am wondering if there is a simpler way to do this just using a type cast similar to an eSQL command:
Code: |
CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'MMMMddyyyyHHmmss'); |
But I can't figure out what that syntax would like in the Mapping Node if it is even possible. Is it possible? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Aug 21, 2013 6:23 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
What version of WMB are you using? Why can't you call into ESQL from your map?
Quote: |
Custom ESQL
The Custom ESQL transform enables you to call your own ESQL code from a graphical data map.
In the Graphical Data Mapping editor, select Custom ESQL from the Custom Transforms list. You can then use the transform properties to select ESQL code stored in your workspace. When you select the ESQL route, the Parameters table Name and Type columns are populated. You must then select an input element or XPath expression in the Value column for each parameter. You can use the content assist in the Value column to help you to assign the required element, literal or XPath expression. |
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
jrsetters |
Posted: Wed Aug 21, 2013 6:41 am Post subject: |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
I do not want to call a custom eSQL if the same result can be achieved using the built in functions in the Mapping Node.
We're on 7. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Aug 21, 2013 6:44 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
jrsetters wrote: |
I do not want to call a custom eSQL if the same result can be achieved using the built in functions in the Mapping Node.
We're on 7. |
Two strikes. What's wrong with calling a one-line ESQL extension to the mapping node? That's why the ESQL interface from the mapping node exists. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
jrsetters |
Posted: Wed Aug 21, 2013 6:47 am Post subject: |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
I am not justifying our operational decisions to you. The question was a simple one. Your answers are as argumentative and as unhelpful as ever. Thanks all the same. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Aug 21, 2013 6:50 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
jrsetters wrote: |
I am not justifying our operational decisions to you. The question was a simple one. Your answers are as argumentative and as unhelpful as ever. Thanks all the same. |
Three strikes, your out.
No one is asking you to justify anything. I just want to understand why someone has ruled out the obvious solution. Surely there is some technical merit to the decision. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 21, 2013 7:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Well, you don't need to use substring, at least.
you can use fn:year-from-dateTime, fn:month-from-dateTime and etc.
But it looks like you still have to concatenate. I don't see any date-time format patterns like you have in ESQL. |
|
Back to top |
|
 |
jrsetters |
Posted: Wed Aug 21, 2013 8:36 am Post subject: |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
Thank you. That is good to know since an HL7 current time stamp is a pretty standard HL7 messaging necessity. Usually it will be in the source message, but when it is not we need to build it.
I think I will still have to use the substrings because the month and day must be two digit values and the X-from-Y function will trim the leading 0. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Aug 21, 2013 9:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There could be more "normal" xpath things that you could use, that aren't necessarily documented in the broker info center but in the xpath docs for the standard at the level supported. |
|
Back to top |
|
 |
|