create a OBX segment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf create a OBX segment

  • Creator
    Topic
  • #50905
    Mason Miller
    Participant

      I am trying to create an OBX segment in a result my inbound has repeating OBX segments but I want to add a OBX segment in front of the existing one here is an example of before and after.

      Code:

      before
      OBR|2|||MIC||||||||||||||||||||||^1
      OBX|1|ST|A/S^Amp/Sulbactam|1|S|mcg/mL||S
      OBX|2|ST|Am^Ampicillin|1|S|mcg/mL||S

      After
      OBR|2||E9260000|SENSI|||200905261224|||||||||||||1||||||^1
      [b]OBX|1|TX|SENSI|1|Klebsiella pneumoniae||||||F[/b]
      OBX|1|TX|A/S^Amp/Sulbactam|1|S|mcg/mL||S|||F
      OBX|2|TX|Am^Ampicillin|1|S|mcg/mL||S|||F

    Viewing 7 reply threads
    • Author
      Replies
      • #67973
        Robert Milfajt
        Participant

          So you do not care that you have two OBX segments in a row where OBX.1=1?

          In either case, you need to set up an ITERATE in your Xlate over the OBX segments and COPY each one to the next subscript value, then set the first one to what you want.

          Are you looking for help with the actual syntax of an ITERATE statement?  If so, we need to know the variang definition for your OBX segments, so we can help you set up the correct BASIS for your ITERATE command.

          Hope this helps,

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #67974
          Nate Kruse
          Participant

            If you want to do it in Tcl, try something like this:

            run {

          • #67975
            Mason Miller
            Participant

              here is what I have so far I have my segment built but if I iterate and copy the rest of the OBX segments it overwrites the one that I created I need to copy the inbound 0 to the outbound 1 and so on there could be many of these so I cannot just copy each one.

              Thanks

            • #67976
              Jim Kosloskey
              Participant

                Mason,

                At a minimum you will need to maintain your own counter for your outbound OBX fields.

                That counter should be one more than the inbound counter from the OBX group Iteration  Counter.

                You can use that counter to compute the OBX Set ID if it needs to be valid.

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

              • #67977
                Robert Milfajt
                Participant

                  Reding the Xlate, I see three iterates, and only two control variables.

                  That aside, Jim is right on the money.

                  Robert Milfajt
                  Northwestern Medicine
                  Chicago, IL

                • #67978
                  Robert Milfajt
                  Participant

                    Never mind, I saw it this time…

                    Robert Milfajt
                    Northwestern Medicine
                    Chicago, IL

                  • #67979
                    Mason Miller
                    Participant

                      I looked at the link you give and this is what I have but it is not copying the first OBX segment it is skipping it and copying the second one.  Do you see anything wrong with what I have?

                      Thanks

                    • #67980
                      Mason Miller
                      Participant

                        never mind I figured it out thank you very much

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