Copy entire message or segment to a VRL field

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Copy entire message or segment to a VRL field

  • Creator
    Topic
  • #54655
    Mike Strout
    Participant

    I think I know the answer to this, but I thought I would ask anyway. Is there a way from within an xlate to copy the entire contents of the source message into a field in the target VRL message? Or, is there a way to copy an entire segment like IN1 to a single field in the target VRL?

    I know I can do it with an outbound tcl proc, but I thought I would see if anyone has a xlate’y solution.

    For those interested, here is what I am trying to accomplish. The inbound lab order contains IN1, IN2, and GT1 segments. We send the order to our LIS, but the LIS can’t send out these segments in the outbound charge message, but our downstream system prefer this payer info in the DFT.

    The plan is to grab the order number, MRN, and necessary segments (or the entire message) from the source order message and dump them into an Sqlite DB. When the charge comes out of the LIS, we query the DB for the order record, paste the segments into the right places in the outbound message and send it out.

Viewing 2 reply threads
  • Author
    Replies
    • #82444
      Jim Kosloskey
      Participant

      Mike,

      In my experience there is not currently a way to get the entire message in an Xlate.

      To get the INx etc data, PATHCOPY will not work – but – you can do a CONCAT for the information you want from those segments using whatever separator needed.

      If there are repetitions, then accomodations in the HRL outbound specification would need to be made.

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

    • #82445
      Charlie Bursell
      Participant

      Mike:

      Two ways to access the entire message in Xlate.

      1.  In an IB or Route Pre Proc copy the message to the USERDATA meta field then access in Xlate using xpmmetaget

      2.  Since its all in the same interpreter by default, set a global variable in a Route Pre Proc and assign the whole message to it.  You can then access it in Xlate

      There are some cleanup issues, etc. that should be addressed but I will leave that to you.

      Perhaps you can get Support to write an enhancement request that will allow access to the entire message in Xlate?  It is something we have needed for a long time

    • #82446
      Anwar Husain
      Participant

      Hi Mike,

      I am not sure I completely understood what you are trying to accomplish, but we had a similar requirement where I had to map a target payload message using a regular translate and then send this whole message in an XML message.

      The steps I did :

      1. Define a VRL with just one field called payload

      2. Create the 1st translate M1 -> M2 ( M1 : source msg , M2 : payload message)

      3. Create another translate where source is the VRL created in step 1 and the target is the XML mapping (VRL in your case)

      4. Map the payload from the only field in the source to the target field in a second map

      5. Chain the maps in the route.

      Hope this helps.

      Thanks

      Anwar[/img]

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10