Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Thursday, June 11, 2015

How do you set current timestamp to field of HL7 result in Mirth?

var ctimestamp = DateUtil.getCurrentDate('yyyyMMddhhmmss');

msg['MSH']['MSH.7']['MSH.7.1'] = ctimestamp;
msg['MSH']['MSH.10']['MSH.10.1'] = ctimestamp;

Formatting options :
- yyyy year (four-digit)
- M, MM month, month with leading 0
- d, dd day, day with leading 0
- HH hour, 24-hour-format
- hh hour, 12-hour-format
- mm minutes
- ss seconds
- SSS milliseconds
- ww week in year