ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Inserting the current HL7 date and time in the mapping node

Post new topic  Reply to topic
 Inserting the current HL7 date and time in the mapping node « View previous topic :: View next topic » 
Author Message
jrsetters
PostPosted: Wed Aug 21, 2013 6:21 am    Post subject: Inserting the current HL7 date and time in the mapping node Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Wed Aug 21, 2013 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jrsetters
PostPosted: Wed Aug 21, 2013 6:41 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Wed Aug 21, 2013 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jrsetters
PostPosted: Wed Aug 21, 2013 6:47 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Wed Aug 21, 2013 6:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Aug 21, 2013 7:29 am    Post subject: Reply with quote

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
View user's profile Send private message
jrsetters
PostPosted: Wed Aug 21, 2013 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 21, 2013 9:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Inserting the current HL7 date and time in the mapping node
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.