OBX to vrl question

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf OBX to vrl question

  • Creator
    Topic
  • #51368
    Mark Perschbacher
    Participant

      I am xlating some ORU’s into a vrl’s, and need to extract some data from the OBX’s.  Here is a sample of the data

      OBX|12|TX|SC09-41401$rpt^^99DHT||SOURCE: Screening

       Vaginal/Cervical/Endocervical Thin Prep Pap with Imaging||||||F

       OBX|13|TX|SC09-41401$rpt^^99DHT||||||||F

      What I am trying to do is split the message into a list of OBX’s, and then split that into a list of OBX 5’s.  My plan is to run a regexp on SOURCE:, and run a lrange to the next blank OBX 5, to isloate the source data.  I have a proc that creates a list of OBX’s, but can’t seem to get it to further split that into OBX 5’s.  Here is the guts of the proc so far

      set msg [msgget $mh]

                set fieldSep [string index $msg 3]

                set segmentList [split $msg r]

       

                  set obx [lrange [lregexp $segmentList {^OBX}] 0 end]

          foreach field $obx {

          set field [lindex [split $obx $fieldSep] 4]}

    Viewing 7 reply threads
    • Author
      Replies
      • #69906
        Troy Morton
        Participant

          You’re on the right track.

        • #69907
          Mark Perschbacher
          Participant

            Troy, thanks for your response.  When I echo out the value for $fields or $obx5list before the second for each, I am getting a blank value.

          • #69908
            Mark Perschbacher
            Participant

              Troy, never mind my last reply.  I changed the OBX field to a 5, and it worked.  Thanks again.

            • #69909
              Mark Perschbacher
              Participant

                The last piece that I am struggling with is how to get the proc to find SOURCE: and then grab all the OBX 5 data until it sees a blank OBX 5.  I have looked over all the regexp listings in Clovertech, but am just not getting the correct syntax that I need.  Any help would be apprecitated.

              • #69910
                Troy Morton
                Participant

                  So, you are wanting to pull out all the OBX.5 from the OBX containing “SOURCE:” to the next found one?

                  You can modify the foreach loop that builds the OBX5 list to do that without a REGEXP.  Granted, a REGEXP would be less code, but you don’t necessarily need one.

                  Charlie Bursell and Max Drown are the REGEXP gurus on Clovertech.

                • #69911
                  Mark Perschbacher
                  Participant

                    Troy, I have the OBX 5’s isolated in a list, and can get the proc to find the index of the one with SOURCE:, I am having difficulty figuring out how to tell it to find the next blank one, and grab the data in between.

                  • #69912
                    Jim Kosloskey
                    Participant

                      Unless I am misunderstanding what you need to do I think this could be done in the Xlate without the need for much if any Tcl.

                      Certainly I don’t think you would need navigating Tcl.

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

                    • #69913
                      Mark Perschbacher
                      Participant

                        Jim, there are about four different words that I will need to be executing the same operation for eventually, but you are probably correct.

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