5 Replies Latest reply: May 15, 2014 10:14 AM by Eamon Donoghue RSS

    Help with non-blank trap and using end field on end of left justification

    jcapra _

      Hi guys I am a little confused on this trap.  I am trying to build a trap (based on text below) so all this information appears on one line.  I built the detail trap on the "--" literal and changed the advanced settings so "end field on" is set to "end of left justification" then I  append the name and number in a seperate template and it works great.  All the detail appears combined into one row (one column) and it looks great.

       

      But.... :mad:....I found in the report there is a scenario where the detail line doesn't start with a "--" (second set of data) so I change my trap to use a non-blank trap.  When I did this it change the data and took each line of the text and put it in separate rows rather than all combine in one column!

       

      Is there anything I could do to fix this or is it just a problem using the non-blank trap and end of left justification. 

       

      Any help is really appreciated.

       

          SIMPSON, BART           111222333444  ________     $____.__     ___                                                                               

      --ASPIRIN 10 MG, PO,                                                                               

      THIS PT WAS STABILIZED                                                                               

      ON THIS MED PRIOR TO                                                                               

      ADMISSION FOR A SOME-                                                                               

      CONDITION, DAILY,                                                                               

      (08/24/12 10AM-..), GIV                                                                               

      STAMPER, HARRY          222333444555  ________     $____.__     ___                                                                               

      BAD TEXT: --WATER FOR                                                                               

      SOMETHING 250 ML,                                                                               

      SOMETHING --THROUGH NG,                                                                               

      Q6H, (08/21/12 06PM-..),                                                                               

      (02 OF 02), GIV         

       

            

       

          SIMPSON, BART           111222333555  ________     $____.__     ___                                                                               

      --ASPIRIN 10 MG, PO,                                                                               

      THIS PT WAS STABILIZED                                                                               

      ON THIS MED PRIOR TO                                                                               

      ADMISSION FOR A SOME-                                                                               

      CONDITION, DAILY,                                                                               

      (08/24/12 10AM-..), GIV                                                                               

      /CODE

        • Help with non-blank trap and using end field on end of left justification
          Eamon Donoghue

          Hi and welcome to the forum.

          I hope I understand your report etc.  but based on the sample you give and the requirements you describe, I would approach this problem slightly differently:

           

          I would select a three line sample for the detail template:

           

              SIMPSON, BART           111222333444  ________     $____.__     ___                                                                               

          --ASPIRIN 10 MG, PO,                                                                               

          I would then trap on the first line - maybe the $ sign or the numeric data or a combination of elements - it looks fairly uniform so you shouldn't have a problem there.

           

          To capture the data starting with --ASPIRIN as a field, I would define this data as a multi-line field Ending on Left Justification - as you've already done.

           

          The only difference in my approach is that I would forget about the Append template and capture everything in the Detail template.  This shouldn't make any difference to the final result. 

           

          If the field is delimited by the '--' combination, you can probably add a calculated field in the table window to clean up the data.

           

          This approach will certainly capture the data.  However I'm not sure if it is the optimum result for your situation.

           

          An alternative is the use a Floating Trap to capture the '--' characters but tbh, I would regard that as a last resort.  Of course, if the report could contain multiple Detail items for any given patient, then you'll need an Append Template and you may have to go the Floating Trap route.  If this is the situation, please let us know adn we can take it from there.

           

          hth,

          Best regards,

          Eamon

          • Help with non-blank trap and using end field on end of left justification
            Olly Bond

            Hello jcapra,

             

            The trap of the Detail template tells Monarch the conditions to create a new record in the table, so a nonblank trap in column 1 will trigger a new record for each line. You could try an alternative, trapping on -- with the Floating trap option, but the third line of Harry Stamper's record would be treated as a new record as well.

             

            I'd try trapping on the "invisible data" of the blank line above the good data. Select a two line sample, then just enter enough ßßßßßßßß characters on line 1 to make sure you don't trap appends and footers that you might want, and on line 2 paint the field you need. In Advanced Field Properties, select "start on line 2" and "end on none of the above" and you should be OK.

             

            Best wishes,

             

            Olly