Sidebar

How do I compare a message date against a channel cached date?

0 votes
374 views
asked Feb 29, 2016 by wendy-l-4419 (230 points)

I want to only send messages with MSH-7 that is before a date/time set by a channel cache value. This is my comparison logic but it doesn't seem to work. What am I doing wrong?

var value = qie.deduceDate(source.getNode('MSH-7'));

return value < qie.deduceDate(channelCache.getValue('batchEnd'));

 

batchEnd is essentially used to delay messages from being processed until the date/time defined by it. Its value is updated by scheduled scripts. I would love to hear of a better way of doing the delaying as well.

 

Thanks!

1 Answer

0 votes
I actually just figured it out right after posting this. I need to use .getTime() to get the time elapsed (ms) from a standard date. I'd still love to hear of other ideas on how to delay messages from being processed!
answered Feb 29, 2016 by wendy-l-4419 (230 points)
...