DATECOPYOPT UseCustomDate option

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf DATECOPYOPT UseCustomDate option

  • Creator
    Topic
  • #50627
    Anu Jandhyala
    Participant

    Hello,

    What we need:

    Every date field, say MSH 7 should show datetime-timezone in the outgoing field. This does not come in, in the inbound msg. But we don’t want precision ie the extra .000 in the date.

    So I used DATECOPYOPT in my xlate, Precision off and chose “UseCustomDate” radio button and selected -6:30 for timezone. According to the documentation, any missing fields are replaced by the defaults specified in this option. Since inbound msg has no timezone information, I expected this option to append the information. But that was not the case.

    Please clarify on the expected behavior for DATECOPYOPT and also, is there a way for us to accomplish the above task?

    Thanks,

    Anu

Viewing 5 reply threads
  • Author
    Replies
    • #66826
      Jim Kosloskey
      Participant

      Are you using BULKCOPY in your Xlate?

      How about PATHCOPY?

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #66827
      Anu Jandhyala
      Participant

      I am using a PATHCOPY

    • #66828
      Jim Kosloskey
      Participant

      Anu,

      I don’t have experience with PATHCOPY.

      If you are PATHCOPYing the segment that contains the date fields in question try doing a COPY for that specific Date field alone (no PATHCOPY at all) to see if it is PATHCOPY that is causing the DATECOPYOPT to be ignored.

      My theory (and I may be way off) is that at the segment level PATHCOPY works like BULKCOPY at the message level. That is the fields are copied ‘as is’ without the potential that the DATECOPYOPT settings can apply.

      If the single COPY works, you can choose to PATHCOPY the segment and then do an individaul COPY for Date fields, or do individual field COPYs for all fields.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #66829
      Anu Jandhyala
      Participant

      Hi Jim,

      I have tested this more:

      Even with PATHCOPY, I am able to copy/modify individual fields for other types:

      PATHCOPY MSH segment

      COPY =GE –< MSH#3(0) .. etc.,

      I think there may be an issue with DATECOPYOPT or atleast it does not behave as expected.

      Tests run:

      1. PATHCOPY, DATECOPYOPT;Add Precision off; UseCustomTime (with timezone specified)

      Result: Date is copied as is, does not show timezone; In my example: 20081027141230

      Expected Result: 20081027141230+0330  —-> this is what we need for this situation

      2. PATHCOPY, DATECOPYOPT;Add Precision On; UseCustomTime..(same as above)

      Result: 20081027141230.   0+0330

      Expected Result: 20081027141230+0330 (since seconds were specified)

      Also, if DATECOPYOPT was placed before PATHCOPY, I guess the latter overwrote DATECOPY settings, so add precision did not help at all.

    • #66830
      Jim Kosloskey
      Participant

      Anu,

      DATECOPYOPT is supposed to be effective from the time it is encountered in an Xlate.

      So if you have DATECOPYOPT and then other Actions its effect should continue through all of the subsequent Actions until another DATECOPYOPT (probably with different options) is encountered.

      What release of Cloverleaf(R) are you using?

      Try this:

      DATECOPYOPT (with whatever options you want)

      COPY (for the Date/Time Field in question).

      If you get some change to the Date/Time field then DATECOPYOPT is working (maybe not the way you like but working the way it does).

      Then try:

      DATECOPYOPT (with whatever options you want).

      PATHCOPY segment (segment containing Date/Time field).

      If you get the same change as above – fine. If not, then PATHCOPY is copying all of the segment ‘as is’ and you will eithere need to follow the PATHCOPY with individual field COPYs or abandon PATHCOPY for this segment.

      Now if the field is changed but not the way you want, you need to take a look at what an HL/7 Date/Time field with full precision should look like. You may need to add seconds (zeros) to the Date/Time field first.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #66831
      Anu Jandhyala
      Participant

      Thanks, Jim.

      BTW, this is on Cloverleaf 5.5MultiByte.

      I get the best results when DATECOPYOPT is after PATHCOPY.

      My problem is: the timezone gets copied ONLY if precision is on. And with precision ON, I get “20090115120600.   0+0400″ . We do not want the portion in bold. I will try this with a tclproc.

      If you have any other ideas, do throw them my way.

      Thanks,

      Anu

Viewing 5 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10