iterating OBX problem

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf iterating OBX problem

  • Creator
    Topic
  • #53233
    Nora Katz
    Participant

      This is my original message:

      0(0).MSH(0)  :  >|^~&|ECW|1100|||20120805123340||ORM^O01|1398881|T|2.3|< 1(0).0(0).PID(0)  :  >|1|137816||137816|TEST^CHUMLEY MALE^||19580101|male|||^^^^||9999999999|||||||< 1(0).0(0).PV1(0)  :  >|1||||||15649^Chumley^Keith^T|^^^|||||||||||1398881|< 1(0).2(0).GT1(0)  :  >|1||Test^Chumley Male^||^^^^|9999999999||19580101|male||1|< 2(0).ORC(0)  :  >|NW|1398881|||||||20120805123340|||15649^Chumley^Keith^T|< 3(0).0(0).0(0).OBR(0)  :  >|1|1398881||FRPSA^Free PSA and Total PSA – 1896|||20120805123340|||||||||15649^Chumley^Keith|||||||||||0< 3(0).0(0).0(0).DG1(0)  :  >|1||788.43|Nocturia|< 3(1).0(0).0(0).OBR(0)  :  >|2|1398881||OBICT^Occult Blood ICT – 3545|||20120805123340|||||||||15649^Chumley^Keith|||||||||||0< 3(1).0(0).0(0).DG1(0)  :  >|1||V76.41|Screening for malignant neoplasm of the rectum|< 3(1).0(0).1(0).OBX(0)  :  >|1|ST|OBID1^Specimen 1 Collect Date/Time or HIDE||8/5/12|< 3(1).0(0).1(1).OBX(0)  :  >|2|ST|OBID2^Specimen 2 Collect Date/Time or HIDE||8/5/12|< 3(1).0(0).1(2).OBX(0)  :  >|3|ST|OBID3^Specimen 3 Collect Date/Time or HIDE||8/5/12|< 3(2).0(0).0(0).OBR(0)  :  >|3|1398881||O028^Arthritis Profile – 0028|||20120805123340|||||||||15649^Chumley^Keith|||||||||||0< 3(2).0(0).0(0).DG1(0)  :  >|1||524.62|Arthralgia of temporomandibular joint|< I want to create 3 separate messages containing 1 OBR per message.  But, the OBX segments are appearing in the second and third messages. The OBX segments should only be appearing in the second message.  Why does this happen? 0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6< 2(0).ORC(0)  :  >|NW< 3(0).0(0).OBR(0)  :  >|1|||FRPSA^Free PSA and Total PSA – 1896< 3(0).0(0).DG1(0)  :  >|1< 0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6< 2(0).ORC(0)  :  >|NW< 3(0).0(0).OBR(0)  :  >|2|||OBICT^Occult Blood ICT – 3545< 3(0).0(0).DG1(0)  :  >|1< 3(0).1(0).OBX(0)  :  >|1||OBID1< 3(0).1(1).OBX(0)  :  >|2||OBID2< 3(0).1(2).OBX(0)  :  >|3||OBID3< 0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6< 2(0).ORC(0)  :  >|NW< 3(0).0(0).OBR(0)  :  >|3|||O028^Arthritis Profile – 0028< 3(0).0(0).DG1(0)  :  >|1< 3(0).1(0).OBX(0)  :  >|1||OBID1< 3(0).1(1).OBX(0)  :  >|2||OBID2< 3(0).1(2).OBX(0)  :  >|3||OBID3< Xlate is attached. Iterates look like this: OBR iterate:  group    3   %g1 DG1 iterate:  segment  3(%g1).0(0).0(0).DG1     %s1 OBX iterate:  group   3(%g1).0(0).1       %g2

    Viewing 7 reply threads
    • Author
      Replies
      • #76993
        Jim Kosloskey
        Participant

          Nora,

          The OBX segments from the second message are still there when you build the third message (remember you are taking control as to what constitutes a message).

          What I do is after the initial ITERATE I have another ITERATE that is defined the same as the initial ITERATE except it does a PATHCOPY of @null to the OBX group (don’t forget the group counter in the address path).

          That way right afer I CONTINUE the message I clear out the stuff that might linger for the next message. This can be used for anything else you do not want to propagate from message to message.

          Long time no see.

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

        • #76994
          Nora Katz
          Participant

            Yes, it has been a while.  Hope all is well with you.

            I think I understand what you are saying, but have not been able to configure the Xlate correctly.  This is what the Xlate looks like now.  I copied the initial iterate and pasted it after the CONTINUE and set the OBX to null, but the test tool still displays the OBXs in the third message.

          • #76995
            Jim Kosloskey
            Participant

              Nora,

              You only need the OBX ITERATE after the CONTINUE.

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

            • #76996
              Nora Katz
              Participant

                Refusing to work!

              • #76997
                Robert Milfajt
                Participant

                  I’m thinking your PATHCOPY in the iterate to clear out OBX segments is not nulling out the correct thing.

                  I believe the Iterate needs to be within the first iterate, to set %g1.  Currently it’s at the top level with the OBR segment iterate.

                  Hope this helps,

                  Robert Milfajt
                  Northwestern Medicine
                  Chicago, IL

                • #76998
                  Nora Katz
                  Participant

                    Thanks to Jim’s help, the Xlate is finally working the way I want it to.

                    This is what I get in the testing tool:  3 separate messages, one OBR in each message, and the OBX segments only appear in the second message.

                    The working Xlate is posted below, just in case anyone else was interested in the solution.

                    0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6<

                    2(0).ORC(0)  :  >|NW<

                    3(0).0(0).0(0).OBR(0)  :  >|1|||FRPSA^Free PSA and Total PSA – 1896<

                    3(0).0(0).0(0).DG1(0)  :  >|1||788.43|||Nocturia<

                    0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6<

                    2(0).ORC(0)  :  >|NW<

                    3(0).0(0).0(0).OBR(0)  :  >|2|||OBICT^Occult Blood ICT – 3545<

                    3(0).0(0).0(0).DG1(0)  :  >|1||V76.41|||Screening for malignant neoplasm of the rectum<

                    3(0).0(0).1(0).OBX(0)  :  >|1|OBI<

                    3(0).0(0).1(1).OBX(0)  :  >|2|OBI<

                    3(0).0(0).1(2).OBX(0)  :  >|3|OBI<

                    0(0).MSH(0)  :  >|^~&|||||||ORM^O01||P|2.6<

                    2(0).ORC(0)  :  >|NW<

                    3(0).0(0).0(0).OBR(0)  :  >|3|||O028^Arthritis Profile – 0028<

                    3(0).0(0).0(0).DG1(0)  :  >|1||524.62|||Arthralgia of temporomandibular joint<

                    Thanks again, Jim!!

                    Thanks, Robert, for looking into my problem, also.

                  • #76999
                    David Barr
                    Participant

                      I would have done this in TCL:

                      Code:

                             run {
                                 keylget args MSGID mh
                                 set segs [split [msgget $mh] r]
                                 set obrs [lsearch -all -regex $segs {^OBR}]
                                 lappend obrs [expr [llength $segs]-1]
                                 set part1 [lrange $segs 0 [expr [lindex $obrs 0]-1]]
                                 for { set i 0 } { $i < [llength $obrs]-1 } { incr i } {
                                     set part2 [lrange $segs [lindex $obrs $i]
                                                    [expr [lindex $obrs [expr $i+1]]-1]]
                                     set mh2 [msgcopy $mh]
                                     msgset $mh2 "[join [concat $part1 $part2] r]r"
                                     lappend dispList "CONTINUE $mh2"
                                 }
                                 lappend dispList "KILL $mh"
                             }

                    • #77000
                      Nora Katz
                      Participant

                        Thanks, I’ll keep this code for future reference.

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