Making new ORU out of multiple ORC,OBRs

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Making new ORU out of multiple ORC,OBRs

  • Creator
    Topic
  • #54564
    Kevin Crist
    Participant

      Been working on this for a while tying different things no luck so i have it more simplified…and wrong. What i need to do we get a result with more than one ORC and OBR is to group those, along with the OBX and send each on it’s separate message.

      Now

      ORC|RE|L65734-1|216^1035O.5.21^2.16.840.1.113

      OBR|1|L657341|216^1035O.5.21^2.16.840.1.1138(AST)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F

      OBX|1|SN|1920-8^^LN^SGOT^SGOT (AST)^

      SPM|1|^C28&1035O.5.242&2.16.840.1.113883.3.1833.2.5.242.1035.1408673021&ISO||56^PLASMA^L^^^^1408673021^^PLASMA|||||||P^Patient^HL70369^P^Patient^L^2.5.1^V1||||||20141204153457^20141204153457|20141204153457

      ORC|RE|L65735-1|217^1035O.5.21^2.16.840.1.113883.3.1833.2.5.21.1035.1408673021^ISO|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758

      OBR|2|L65735-1|217^1035O.5.21^2.16.840.1.113883.3.1833.2.5.21.1035.1408673021^ISO|1744-2^^LN^SGPT^SGPT (ALT)^L^^1408673021^SGPT (ALT)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F

      OBX|1|SN|1744-2^^LN^SGPT^SGPT (ALT)^L^^1408673021^SGPT (ALT)||^50|U/L^^L^^^^1408673021|5-41|H|||F|||20141204153457|||||20141204153556||||GOOD SAMARITAN HOSPITAL

      SPM|1|^C28&1035O.5.242&2.16.840.1.113883.3.1833.2.5.242.1035.1408673021&ISO||56^PLASMA^L^^^^1408673021^^PLASMA|||||||P^Patient^HL70369^P^Patient^L^2.5.1^V1||||||20141204153457^20141204153457|20141204153457

      What i want

      One Message…

      ORC|RE|L65734-1|216^1035O.5.21^2.16.840.1.113883.3.1833

      OBR|1|L65734-1|216^1035O.5.21^2.16.840.1.113883.3.1833.2.5

      OBX|1|SN|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021

      Next Message is the next group and so on.

      ORC|RE|L65735-1|217^1035O.5.21^2.16.840.1.113883.3.1833.2.5

      OBR|2|L65735-1|217^1035O.5.21^2.16.840.1.113883.3.1833.2.5.

      OBX|1|SN|1744-2^^LN^SGPT^SGPT (ALT)^L^^1408673021^

      My iterate is a standard 2.5.1 for in and out. I have not added any OBX segments to it yet. Any help would be awesome.

      Thanks.

    Viewing 10 reply threads
    • Author
      Replies
      • #81996
        James Cobane
        Participant

          Kevin,

          It should be a matter of using a ‘CONTINUE’ statement as the last action within your ORC group iteration to cut a message for the current iteration of the ORC.  Then you’ll need to add a SUPPRESS to prevent a duplicate message from the last ORC processed.

          Hope that makes sense.

          Jim Cobane

          Henry Ford Health

        • #81997
          Kevin Crist
          Participant

            Thanks for the reply Jim. I put in the CONTINUE & SUPPRESS and got 2 messages but what i meant to add yesterday and forgot was my current output of what i had. I’m not sure i have my iterates correct as well… It seems to put the same ORC and OBR in both messages.

            MESSAGE 1

            0(0).MSH(0)  :  >|^~&|CITA-LIS|A|REG|GSH|20141204153612.0000-0500||ORU^R01|B9CE384C46F9FF449E4A|P|2.5.1<

            1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505080500.0000-0500|M||WHIT^White^L||||||||9129004611<

            1(0).1(0).0(0).ORC(0)  :  >|RE|L65734-1|216^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

            1(0).1(0).0(0).OBR(0)  :  >|1|L65734-1|216^1035O.5.21^2.16.84|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F<

            0(0).MSH(0)  :  >|^~&|CITA-LIS|A|REG|GSH|20141204153612.0000-0500||ORU^R01|B9CE384C46F9FF449E4A|P|2.5.1<

            1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505080500.0000-0500|M||WHIT^White^L||||||||9129004611<

            1(0).1(0).0(0).ORC(0)  :  >|RE|L65734-1|216^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

            1(0).1(0).0(0).OBR(0)  :  >|1|L65734-1|216^1035O.5.21^2.16.84|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F<

            1(0).1(1).0(0).OBR(0)  :  ><

          • #81998
            Jim Kosloskey
            Participant

              Kevin,

              You don’t have your %g1 in the right place in your PATHCOPY

              S/B this:

              1(0).1(%g1).0(0).ORC(0)

              Same for OBR

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            • #81999
              Kevin Crist
              Participant

                OK, i made that change and have a couple of quesitons

                1)How do you know where to put the %g1 (or any other variable) at?

                B) I did make the change you suggested and it kind of worked and kind of didnt. Here is my Output: The second message uses both ORC/OBR while the first just has one.

                0(0).MSH(0)  :  >|^~&|CITA-LIS|A|REG|GSH|20141204153612.0000-0500||ORU^R01|B9CE384C46F9FF449E4A|P|2.5.1<

                1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505113200.0000-0500|M||WHIT^White^L||||||||9129004611<

                1(0).1(0).0(0).ORC(0)  :  >|RE|L65734-1|216^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

                1(0).1(0).0(0).OBR(0)  :  >|1|L65734-1|216^1035O.5.21^2.16.84|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F<

                0(0).MSH(0)  :  >|^~&|CITA-LIS|A|REG|GSH|20141204153612.0000-0500||ORU^R01|B9CE384C46F9FF449E4A|P|2.5.1<

                1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505113200.0000-0500|M||WHIT^White^L||||||||9129004611<

                1(0).1(0).0(0).ORC(0)  :  >|RE|L65734-1|216^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

                1(0).1(0).0(0).OBR(0)  :  >|1|L65734-1|216^1035O.5.21^2.16.84|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F<

                1(0).1(1).0(0).ORC(0)  :  >|RE|L65735-1|217^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

                1(0).1(1).0(0).OBR(0)  :  >|2|L65735-1|217^1035O.5.21^2.16.84|1744-2^^LN^SGPT^SGPT (ALT)^L^^1408673021^SGPT (ALT)|||20141204153457|20141204153457||||||||2057^STINE^SCOTT^^^^^^^^^^PRN|^^FX^^^^8852758|CHEM||3058033||20141204153603-0500|||F<

                Here is what i have at moment:

              • #82000
                Jim Kosloskey
                Participant

                  Where your basis ends is where the repetition is. A sanity check is to run the messages through the HL/7 tester and watch where the repetitions occur.

                  For your Destination in the PATHCOPY Action use 0 instead of %g1 – after all each message outbound will only have one occurence. That should take care of the extra occurrences.

                  email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

                • #82001
                  Kevin Crist
                  Participant

                    Thanks for the help. That worked with the ORC/OBR with each new message. But i also need to now add the OBX for each results.

                    I added what i have now which isnt working. Only copies over the first OBX which makes sense but when i try to put in a %g1 in the destination field it copies the OBX from the first message to the second message i am making and then adding that OBX to it as well if that makes sense.

                    The OBX is in a different group of 1.1.3 so i wasnt sure if i added it right to the 1.1.0 group of the OBR/ORC.

                  • #82002
                    Terry Kellum
                    Participant

                      From the message structure above, I would say that you will need an iterate nested inside g1 (call it g2?) at the 1.1.3, and a segment iterate nested inside THAT iterate on the NTE segment.

                      Jim’s suggestion of running the ORIGINAL message thru the HL7 tester is not only good, IMHO it is essential to understanding the structure.

                      I usually also look for the repeating fields in the structure and add dummy segments to test and make sure I have my iterates in the right places.

                      Just taking a wild guess, it looks like you will have:

                      1(0).1(%g1).3(%g2).OBX(0)  and

                      1(0).1(%g1).3(%g2).NTE(%s1) …

                      I think…..

                      Jim, do you concur??

                    • #82003
                      Kevin Crist
                      Participant

                        ok i set my OBX iterate basis and pathcopy  as:

                        Iterate

                        group

                        1(0).1(0).3

                        %g2

                        Pathcopy

                        1(0).1(%g1).3(%g2).OBX(0) -> 1(0).1(%g1).3(%g2).OBX(0)

                        and NTE:

                        group

                        1(0).1(0).3

                        %g2

                        Pathcopy:

                        1(0).1(%g1).3(%g2).NTE(%s1) -> 1(0).1(%g1).3(%g2).NTE(%s1)

                        I’m confused as to why the OBXs keep adding on to the subsequent messages.

                        My output is:

                        Message 1

                        1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505103500.0000-0500|M||WHIT^White^L||||||||9129004611<

                        1(0).1(0).0(0).ORC(0)  :  >|RE|L65734-1|216^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

                        1(0).1(0).0(0).OBR(0)  :  >|1|L65734-1|216^1035O.5.21^2.16.84|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SG

                        1(0).1(0).3(0).OBX(0)  :  >|1|SN|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)||^85|U/L^^L^^^^14

                        Message 2

                        1(0).0(0).0(0).PID(0)  :  >|1||121772||LORD^STAR||19790505103500.0000-0500|M||WHIT^White^L||||||||9129004611<

                        1(0).1(0).0(0).ORC(0)  :  >|RE|L65735-1|217^1035O.5.21^2.16.84|||||||||2057^STINE^SCOTT^^^^^^^^^^PRN||^^FX^^^^8852758<

                        1(0).1(0).0(0).OBR(0)  :  >|2|L65735-1|217^1035O.5.21^2.16.84|1744-2^^LN^SGPT^SGPT (ALT)^L^^1408673021^SGPT

                        1(0).1(0).3(0).OBX(0)  :  >|1|SN|1920-8^^LN^SGOT^SGOT (AST)^L^^1408673021^SGOT (AST)||^85|U/L^^L^^^

                        1(0).1(0).3(1).OBX(0)  :  >|1|SN|1744-2^^LN^SGPT^SGPT (ALT)^L^^1

                        Thanks for all your help. First time i’ve had to do something like this

                      • #82004
                        Jim Kosloskey
                        Participant

                          Terry – sorry for the late reply but you are correct that the groups/segments post OBR need to be properly referenced.

                          Kevin,

                          In your basis for the OBX you need to include the counter you used for the previous group to which the OBX is subordinate –

                          1(0).1(%g1).3

                          And I don’t think the basis for your NTE  following the OBX is correct. That should be segment and the basis shoulld look like this I think:

                          1(0).1(%g1).3(%g2).NTE

                          Get that straightened up and let’s see where you are at.

                          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

                        • #82005
                          Kevin Crist
                          Participant

                            OK, here is what i have. My two iterates and my original message and the result after going through the tester. I took out the NTE part just for my sanity at this point. I somehow got it to add more messages than it has ORC/OBRs.

                          • #82006
                            Jim Kosloskey
                            Participant

                              Replace the %g1 in your Destination of your OBX PATHCOPY with a zero – you want al of your outbound OBX groups to be associated with the first ORC Group.

                              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

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