2 Replies Latest reply: May 15, 2014 10:02 AM by DLONGWORTH _ RSS

    Append problem

    DLONGWORTH _

      Hello

      I have a report where I want to create an Append, but the data is not available on all records. I want the append to not look past the preceding detail line. My current setup has the template adding the append to all records below until it reaches another append instead of leaving the blanks. I am trying to get the "Epi#" and "Hold RsnType" on each record only when it exists.

       

      How can I get the append template to stop when it hits the preceding detail line?

       

      Here is the report - Note the "2 REFERRAL" on Bob Johnson when this data is not present in the report and "1 HOSPCHRG" on Mary Smith in my Current Table:

       

       

       

      Account Num   Patient Name                        

            Epi#  Hold RsnType                          

                Procedure   Mod     Ser Dt      Perf Prov

       

      G00000027     GREEN,MARK                    

                36415               05/30/08    MeCLED  

      G00000029     ADAMS,SALLY                    

            2                 REFERRAL                 

                99212               07/11/08    JRAN  

                36247               07/15/08    JRAN  

                75630,26            07/15/08    JRAN  

                75716,26            07/15/08    JRAN  

      G00000032     JOHNSON,BOB                     

                99213               05/01/08    MDAV  

                36415               05/01/08    MDAV  

                84439               05/01/08    MDAV  

                84443               05/01/08    MDAV  

      G00000033     JONES,TOM                      

            1                 HOSPCHRGS                 

                94010       26      05/08/08    MAND  

                94240       26      05/08/08    MAND  

                94360       26      05/08/08    MAND  

                94720       26      05/08/08    MAND  

      G00000034     SMITH,MARY                    

                36415               07/30/08    BGRA  

                99213               08/04/08    BGRA  

       

      DESIRED table:

       

      G00000027 GREEN,MARK               36415 05/30/08 MeCLED 

      G00000029 ADAMS,SALLY   2 REFERRAL 99212 07/11/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 36247 07/15/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 75630 07/15/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 75716 07/15/08 JRAN  

      G00000032 JOHNSON,BOB              99213 05/01/08 MDAV  

      G00000032 JOHNSON,BOB              36415 05/01/08 MDAV  

      G00000032 JOHNSON,BOB              84439 05/01/08 MDAV  

      G00000032 JOHNSON,BOB              84443 05/01/08 MDAV  

      G00000033 JONES,TOM     1 HOSPCHRG 94010 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94240 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94360 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94720 05/08/08 MAND  

      G00000034 SMITH,MARY               36415 07/30/08 BGRA  

      G00000034 SMITH,MARY               99213 08/04/08 BGRA  

       

      Current table:

       

      G00000027 GREEN,MARK               36415 05/30/08 MeCLED 

      G00000029 ADAMS,SALLY   2 REFERRAL 99212 07/11/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 36247 07/15/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 75630 07/15/08 JRAN  

      G00000029 ADAMS,SALLY   2 REFERRAL 75716 07/15/08 JRAN  

      G00000032 JOHNSON,BOB   2 REFERRAL 99213 05/01/08 MDAV  

      G00000032 JOHNSON,BOB   2 REFERRAL 36415 05/01/08 MDAV  

      G00000032 JOHNSON,BOB   2 REFERRAL 84439 05/01/08 MDAV  

      G00000032 JOHNSON,BOB   2 REFERRAL 84443 05/01/08 MDAV  

      G00000033 JONES,TOM     1 HOSPCHRG 94010 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94240 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94360 05/08/08 MAND  

      G00000033 JONES,TOM     1 HOSPCHRG 94720 05/08/08 MAND  

      G00000034 SMITH,MARY    1 HOSPCHRG 36415 07/30/08 BGRA  

      G00000034 SMITH,MARY    1 HOSPCHRG 99213 08/04/08 BGRA  

      /code

       

      Thank you

        • Append problem
          Data Kruncher

          Hi Damon,

           

          The solution to this challenge lies in using what we around here call the "guru trap" along with a little calculated field trick.

           

          To begin, trap your detail lines (the lines with dates) normally. Now build an append template for your account number lines. I used an alpha trap, followed by a numeric trap, starting in position 1.

           

          Now for the HoldRsnType lines make a two line sample for the sample, with the account number being on the first line. Make the trap for the sample exactly the same as that in the account number template - alpha in position 1, an numeric in position 2. OK the template.

           

          Now in the Table, you'll see that it's pretty close, but you've got some occurrences of 05/ (after a few blank spaces) where they should be entirely blank. No problem. Create a "Hold Reason Type" calculated field to handle this:

          if(left(,1)=" ","",[HoldRsnType])[/code]Finally, hide the HoldRsnType field.

           

          You're all set.

           

          HTH,

          Kruncher

            • Append problem
              DLONGWORTH _

              Hello Kruncher

               

              Thank you. I am using your strategy, although cannot use it exactly as you describe. I found that me example did not represent the complete variability of my report. The EPI# line can appear above any line with a date (detail line). So I am using your strategy, but have to go above the detail line instead of below the account number line as you suggested.

               

              Thanks again

              Damon