One message into Two messages with different segment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf One message into Two messages with different segment

  • Creator
    Topic
  • #50201
    Gary Atkinson
    Participant

      Hi-

      Is is possible to take one message and create into two messages, but the format of the messages are different?  I would like to do this in the xlate.  For example I have a inbound ORU message like so (no segments repeat):

      MSH

      PID

      PV1

      ORC

      OBR

      OBX

      and I want to create two messages, one like this:

      MSH

      PID

      PV1

      OBR

      OBX

      and one like this:

      MSH

      PID

      PV1

      ORC

      OBR

      OBX

      The first message will not need an ORC segment and the second message will need an ORC segment.  Also, in the OBR segment of the second message I will need to change field4.1 to something else.  

      Thanks in advance,

      Gary

    Viewing 6 reply threads
    • Author
      Replies
      • #65194

        I think this can be done by making the segments optional in the variant and then using SEND and/or CONTINUE in the xlate.

        -- Max Drown (Infor)

      • #65195
        Vince Angulo
        Participant

          I agree, start by making sure the ORC in the outbound ORU variant is optional:

          1) COPY or PATHCOPY each segment except ORC to your outbound message;

          2) use CONTINUE or SEND to push the first message out;

          3) COPY or PATHCOPY the ORC into the outbound message;

          4) correct the OBR-4.1.

          If you’re using BULKCOPY to create the outbound message, you might want to send the second message first:

          1) correct the OBR-4.1;

          2) use CONTINUE or SEND to push the message out with the ORC;

          3) change the OBR-4.1 back to original value;

          4) PATHCOPY @null to the ORC to remove it from the outbound message.

          You won’t have to do another CONTINUE or SEND, the xlate process will push the second message out.

        • #65196
          Gary Atkinson
          Participant

            Vince-

            I tried out your method and it works but…

            If the inbound message does not have an ORC, the engine returns two messages.

            here is an example:

            Code:


            MESSAGE 1
            0(0).MSH(0)  :  >|^~&|FUJI|BWMC|||||ORU^R03|20080721134224|P|2.3|||AL< 1(0).0(0).0(0).PID(0)  :  >|||1096737||Control^Beth^R< 1(0).0(0).1(0).PV1(0)  :  >||I|||||||||||||||||810100003< 1(0).1(0).0(0).OBR(0)  :  >||XR-08-0000476|20800237|7022^XR Chest 2 Views w/ Apical Lordotic|||20080717172700||||||||||||||||||F< 1(0).1(0).1(0).OBX(0)  :  >||RP|RADREPORT||http://bwmc-fujitest/synapseimage.asp?AccessionNumber=XR-08-0000476^URL^URL||||||F|||20080717172700< 0(0).MSH(0)  :  >|^~&|FUJI|BWMC|||||ORU^R03|20080721134224|P|2.3|||AL< 1(0).0(0).0(0).PID(0)  :  >|||1096737||Control^Beth^R< 1(0).0(0).1(0).PV1(0)  :  >||I|||||||||||||||||810100003< 1(0).1(0).0(0).OBR(0)  :  >||XR-08-0000476|20800237|X7022^XR Chest 2 Views w/ Apical Lordotic|||20080717172700||||||||||||||||||F< 1(0).1(0).1(0).OBX(0)  :  >||RP|RADREPORT||http://bwmc-fujitest/synapseimage.asp?AccessionNumber=XR-08-0000476^URL^URL||||||F|||20080717172700<

            If there is an ORC segment inbound it works:

            Code:


            MESSAGE 1
            0(0).MSH(0)  :  >|^~&|FUJI|BWMC|||||ORU^R03|20080501094934|P|2.3|||AL< 1(0).0(0).0(0).PID(0)  :  >|||0950086||Fenton^Harlee^M< 1(0).0(0).1(0).PV1(0)  :  >||U|||||||||||||||||301226361< 1(0).1(0).0(0).OBR(0)  :  >||CT0800786||2906923^CT Neck Soft Tissue w/ Contrast|||20080501090000||||||||||||||||||F< 1(0).1(0).1(0).OBX(0)  :  >||RP|RADREPORT||http://cmhbld14/synapseimage.asp?AccessionNumber=CT0800786^URL^URL||||||F|||20080501092240< 0(0).MSH(0)  :  >|^~&|FUJI|BWMC|||||ORU^R03|20080501094934|P|2.3|||AL< 1(0).0(0).0(0).PID(0)  :  >|||0950086||Fenton^Harlee^M< 1(0).0(0).1(0).PV1(0)  :  >||U|||||||||||||||||301226361< 1(0).1(0).0(0).ORC(0)  :  >|SC|17970810< 1(0).1(0).0(0).OBR(0)  :  >||CT0800786||X2906923^CT Neck Soft Tissue w/ Contrast|||20080501090000||||||||||||||||||F< 1(0).1(0).1(0).OBX(0)  :  >||RP|RADREPORT||http://cmhbld14/synapseimage.asp?AccessionNumber=CT0800786^URL^URL||||||F|||20080501092240<

            So, does this mean I need a suppress somewhere or will the sending system always have to send an ORC?

          • #65197
            Jim Kosloskey
            Participant

              Gary,

              If the issuance of the CONTINUE (I prefer CONTINUE not SEND) is not conditional, then you can just put a SUPPRESS at the beginning of your Xlate (unconditional of course).

              If the CONTINUE is conditional, then the SUPPRESS has to follow the condition.

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

            • #65198
              Gary Atkinson
              Participant

                If the inbound message does not have an ORC segment, then the xlate still returns a second message, but I don’t want that.  How do say in the xlate “if X segment is present then do Y”?

              • #65199
                Jim Kosloskey
                Participant

                  Gary,

                  I would try putting an unconditional SUPPRESS in at the beginning of your Xlate and fully retesting all scenarios.

                  That may take care of your issue and obviate the need to test for presence of the ORC.

                  However, if that fails and you do need to test for the presence of the ORC:

                  Hopefully there is a field in the ORC that will be there in every message for which there is an ORC. If that is true do an IF Action in your Xlate that checks to see if that field is equal to @null. If it is null, you do not have an ORC (that is why it is important to assure a field that is always present when an ORC is present) and you can take your ‘no ORC’ actions, other wise you can take your “has an ORC’ actions.

                  I am not aware of any mechanism in the Xlate (other than that described above) to check to see if a segment (or any repetition of a segment) exists.

                  I have used the above technique with success for other segments.

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

                • #65200
                  Gary Atkinson
                  Participant

                    I added an IF ORC:2 is null then Supress (after the Continue) else, copy the ORC and Change OBR4.1.  Thanks again for everyone’s help!!  8)

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