2 Replies Latest reply: May 15, 2014 10:06 AM by Allen _ RSS

    Monarch Model Problem

    Allen _

      I have a report I cannot parse correctly. Here is a copy of a few records. Each record starts with a five-digit code. Spaces are shown as dots to help preserve the spacing in the report:

       

      90604..BH STATUS-DETOX TO PSYCH...........9802.....Y......9BH

      .......CHANGE PT STATUS FROM DETOX TO PSYCH.

      90605..BH CHARGES-DETOX TO PSYCH...........845.....Y......9BH

      .......REG CHANGED PT STATUS FROM DETOX TO PSYCH. PLEASE CHECK ROOM

      ........CHARGES.    

      00073..INCORRECT BLD AND BLD PRODUCTS......................HIM

      .......WHEN THE HOSPITAL PURCHASES BLOOD, THE MUST SPLIT THE CHARGE

      ........FOR THE BLOOD ITSELF (REVENUE CODE 38X) AND THE STORAGE AND

      .........PROCESSING FEES (REVENUE CODE 39X) ON TWO SEPARATE LINE

      ..........ITEMS. THE SUM OF THE UNITS MUST MATCH FOR BOTH LINE ITEM

      99649..OTHER-9CM9649................................................9CM9649

      99650  OTHER-9CM9650................................................9CM9650

       

      Each record should have six fields. The first five are on the first row. The sixth is on the second to fifth row, depending on how long the text in the field is. The report formats the sixth field as a 60 character row and up to four rows long for a maximum of 240 characters.

       

      So far my most successful attempt to capture it is to define the first row as the detail row to capture the first five fields, and the next row as a footer with a trap that is: "ßßßßßßßØ" to capture the sixth field. I have the "end field on" rules turned off to capture the multiple rows.

       

      This works except when the formatting of the field on the report dictates a space as the first character on row 3, 4, or 5. Then the field is truncated at the end of the row with the starting space, and I do not get the rest of the rows of the field. If I leave off the "non-blank trap" character the field still looks fine on the report, but when I switch to table view I only get the 60 characters of the field that are on the first row.

       

      If I define the detail trap as a two row sample, I do not get records that follow where there is no second row in the record, e.g., I would not capture the last record in the sample shown above.

       

      If I define the second row as the detail, and the first row as an append I do not capture records that do not have a second row.

       

      I hope this is clear enough that someone can give me some ideas.

        • Monarch Model Problem
          Olly Bond

          Hello Allen, again,

           

          Sincere apologies. I didn't check the table window and your comment about the omitted single lines was entirely right. Grant's been kind enough to point out by email that this is a case for the guru trap.

           

          Make a single line detail trap using NNNNN for the five fields. Create an append template on a one line sample using the same trap characters, select the relevant field, and set it to start on "      " (six spaces) as a preceding string, and stop on "none of the above".

           

          I've prepared an example model and report using generic anonymous data and posted it online at:

           

          www.greenbar.info/examples/guru.prf[/url]

           

          Best wishes,

           

          Olly

           

          Hello Allen,

           

          This is fairly common - appends and footers aren't the answer when the additional data belongs to only one relevant detail. You can solve it using Advanced field properties.

           

          If you define a two row sample (say, lines 1 & 2 of your sample data), and specify that the trap line is line 1 of 2, and use NNNNN (five wildcard numeric trap characters) in columns 1-5, this should select all the records, including the last one where there is no line 2.

           

          Then define the first five fields normally, and define the field on line 2, click on the Advanced tab of the field properties dialog for this one, and select "End field on... none of the above".

           

          This should work fine on any version from v4 Standard and up.

           

          Best wishes,

           

          Olly