Creating an ODS segment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Creating an ODS segment

  • Creator
    Topic
  • #53482
    Corey Lewis
    Participant

      I have an order that comes in like this now:

      2(0).1(0).1(0).0(0).OBX(0)  :  >|1|IS|Diet Type^Diet Type||Dysph1~NoCarbonatedBev~NoHotBev< I need it to go out like this in an ODS segment: O D S | D | | ^ N o C a r b o n a t e d B e v |   O D S | D | | ^ D y s p h 1 |   O D S | D | | ^ N o H o t B e v |   Here is what I am getting from Cloverleaf: .ODS(0)  :  >|D~D~D||^Dysph1~^NoCarbonatedBev~^NoHotBev< I have an Iterate over the OBX segment, since I have multiple OBX segments. For the Diet Type OBX segment, I have an Iterate over the OBX:5 field.

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

          Corey,

          Do your ODS segments repeat?

          If so then you need to use a counter in the pathing to the destinations fields, etc.

          I would think you would use the %f counter defined for the repeating OBX-5 at the segment level (or perhaps group level depending on the outbound variant) in the pathing for your COPYs or PATHCOPYs.

          Maybe give us some screen shots showing what you are doing.

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

        • #77831
          Corey Lewis
          Participant

            Jim,

            The ODS segent does repeat.  I have attached 2 screen shots.  The first is the iterate and following copy statements that I am checking the OBX:5 field and the second is the iterate for the OBX segment.My issue is I have to create an ODS segment for each value I get in the OBX:5.  [/img]

          • #77832
            Levy Lazarre
            Participant

              Corey,

              As Jim has stated, you are trying to place each OBX.5 repetition in its own ODS segment. Therefore, you should use the OBX.5 repetition counter  (%f1) as the segment counter in the ODS iterate.

              The ODS iterate should look more like this:

              Code:



              … ODS(%f1).#3(0).[1]

              We can’t give exact paths since we don’t have your outbound variant, but this should bring you closer to the goal.

            • #77833
              Corey Lewis
              Participant

                Levy,

                I made some changes and I am getting better results.  However, I am now getting my ODS segments like this:

                2(0).0(0).ODS(0)  :  >|D||^Dysph1< 2(0).0(0).ODS(1)  :  >|D||^2000mL< 2(0).0(0).ODS(2)  :  >|D||^NoHotBev< However, I have 3 values in my first OBX:5 – Dysph1~NoCarbonatedBev~NoHotBev.  Also I am not sure why my Dietary Fluid value (2000ml) is sliding in between my types. I appreciate everybodies help.  Still learning how Cloverleaf works.

              • #77834
                Levy Lazarre
                Participant

                  Corey,

                  1. I am not sure why you removed the %s1 variable from OBX on the input side since you are iterating over the OBX segments. I would think you still need OBX(%s1) on the input side.

                  2. You must have a Copy statement somewhere that is copying the Fluid Value  to ODS.3. You need to track that statement. Also review the Tcl script running inside your Copy statement.

                  I hope this helps.

                • #77835
                  Corey Lewis
                  Participant

                    I have everything back to where it creates my 3 ODS segments based on the number of values that are attached to my OBX:5.

                    I know what my dilema is but I can’t think through it.  I have 2 OBX input  segments, for the first OBX input, I have created 3 ODS segments.  

                    2(0).0(0).ODS(0)  :  >|D||^Dysph1|testing<

                    2(0).0(0).ODS(1)  :  >|D||^NoCarbonatedBev|testing<

                    2(0).0(0).ODS(2)  :  >|D||^NoHotBev|testing<

                    So my itereate goes back around and reads the 2nd OBX input statement.  This contains my Dietary Fluid Restriction value of 2000mL.  So my OBX segment variable is sitting at 2, so the copies for that particular value are going in my 2nd ODS segment resulting in the below.

                    2(0).0(0).ODS(0)  :  >|D||^Dysph1|testing<

                    2(0).0(0).ODS(1)  :  >|D||^2000mL|testing<

                    2(0).0(0).ODS(2)  :  >|D||^NoHotBev|testing<

                    So how do I get my segment variable to read the right OBX but then create the next ODS segment?  Could I use a counter and use that as a variable on the ODS output?

                    Not sure if I am making any sense.

                  • #77836
                    Levy Lazarre
                    Participant

                      It all depends on how you built your outbound variant.

                      But, yes, you can create and maintain your own outbound counter for the ODS segments. You will have to manually increment the counter after each iteration. There are several posts on this forum that explain how to do this, usually in reference to creating multiple OBX segments but the same principle applies.

                    • #77837
                      Corey Lewis
                      Participant

                        Thanks for the help Jim and Levy, I got the results I was hoping for.  I had to create a variable and add to it for each OBX segment after the segment with the multiple OBX:5’s.  So if I had 3 values in the OBX:5, my variable starts at 4 and that gets moved into a %f variable and that is used on my outbound ODS segment.

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