5 Replies Latest reply: May 15, 2014 10:03 AM by Grant Perkins RSS

    Inconsistent multiple line trap trouble

    Warddm _

      First time poster here.  In the report sample below, the SUBSC fields for most PT NO only have 1 subscriber, some have 2 subscribers, a few have 3 or even 4 subscribers.  I have not been able to come up with any way to trap this data.  Can anyone help me with this? :confused:



      1DATE 01/08/09 TIME 01:01 P.M. PAGE   11 REPORT *$PXARXM     XYZ ABCDEFG HOSPITAL           K5 K050


                   PT NO      PT SSN ACCT BAL    STS1 UMD  SUBSC AREA CD                       SUBSC DOB

                                     TOT CHGS    LSTACTPBD SUBSC PHNE                          SUBSC LA1

                                                 LSTPTPYDT SUBSC SSN                           SUSBC LA2

                                                           SUBSC LN                            SUSBC LA3

                                                           SUBCR FN


               9999999999  123451234 53.90       11/12/07  123                                 08/16/62

                                     770.00      11/07/07  1111111                             4615 STONE MILL DR

                                                           012341234                           ANYWHERE C             ST 99999



                                                           123                                 03/11/49

                                                           1111111                             4615 STONE MILL DR

                                                           5034530463                          ANYWHERE C             ST 99999



               9999999999  123451234 558.73      10/12/07  123                                 07/01/45

                                     558.73      10/11/07  5555555                             6921 W 200 S

                                                           012341234                           ANYWHERE CIT           ST 99999



                                                           123                                 11/29/47

                                                           5555555                             6921 W 200 S

                                                           503453046                           ANYWHERE CIT           ST 99999



                                                           123                                 11/29/47

                                                           5555555                             6921 W 200 S

                                                           503453046                           ANYWHERE CIT           ST 99999




                                                                                      6921 W 200 S

                                                           503453046                           ANYWHERE CIT           ST 99999



               9999999999  123451234 1171.90     03/18/08  123                                 11/29/66

                                     1576.00     03/03/08  9999999                             9695 VANGUARD DR

                                                           123456789                           PLACES                 ST 99999




        • Inconsistent multiple line trap trouble
          Grant Perkins

          Hi Warddm and welcome to the forum.


          How you deal with the posted report sample may depend on what you need to see at the end of the process.


          For the report structure the LOGICAL hierarchy is probably for the subscriber to be the detail record and everything above that as an append.


          However if you just want the subscribers in a block of information for reference rather than analysis you might be able to deal with that as a multi-line field. (though it looks 'uncomfortable' for that concept.)


          How you trap the information for the templates is a little dependent on you ultimate goal so understanding that accurately would seem to be our first requirement here.


          Also, is the posted sample a direct extract from the report with 'anonymizing' or have a few editing glitches crept in? I think knowing the precise format could be especially important for solving this problem.



            • Inconsistent multiple line trap trouble
              Warddm _

              Thank you for responding, I am at my wits end on this one.  As for the report sample this is a direct extract with info modified to "protect the innocent" :).  Ultimately I am trying to have one line of data for each account number, the account can have a minimum of 1 subscriber and a maximum of 4.  With fields for:


              Sub1 area code

              sub1 phone

              Sub1 SSN

              Sub1 Last name

              Sub 1 First Name


              Sub2 area code

              sub2 phone

              Sub2 SSN

              Sub2 Last name

              Sub2 First Name


              Sub3 area code

              sub3 phone

              Sub3 SSN

              Sub3 Last name

              Sub 3 First Name


              Sub4 area code


              Sub4 SSN

              Sub4 Last name

              Sub 4 First Name


              This is a placement file for a medical billing company, the subscriber information is critical for the insurers listed on the accounts. 


              I hope this makes sense.



                • Inconsistent multiple line trap trouble
                  Grant Perkins

                  Hi Dianne,


                  Yep, your description makes sense and if a single line per account is what you need that is what you shall have! It seems that this report is more structured and more consistent than most so I have worked on that basis.


                  Here's my suggestion.


                  You should be able to get the fields you list from a single detail template.


                  Use the first line of an account record for the trap sample. (Using you sample a single numeric trap at the right of the Account Number worked but this may not be sufficient using the real report. However the sample does not suggest a need for a complex trap.)


                  Paint a field for the Account number.


                  Paint another field for the area code but you need to make this a block of text lines in a minute so make it as wide as possible (looks like 32 characters from the sample) for both Data and Display Width. Monarch will make it a numeric field but change that to Character or possibly MEMO.


                  This field will become a text block that will grab all the lines from the first to the last line of the record that appear in that 'column'.


                  (I think Character type will be OK but it has a limit of 254 characters. You may have up to 20 lines per account with each line being defined as 32 characters so cramming all that text into a single field would not work. However at least 3 of the lines will be much shorter than 32 characters so it should all fit in a standard field but use MEMO if in doubt.)


                  Move to the Table screen and start to define the 20 calculated fields you will need to convert the Block of text to individual entries (I assume you will need individual entries.)


                  The easiest way to to this from your report is to use the TEXTLINE() function.


                  You subscriber records are always in blocks of 5 entries (not always filled) so you know that lines 1-5 are for subscriber 1, 6 to 10 for Sub 2, etc.


                  Also you know that Subscriber 1 Area code is line 1, Subscriber 2 area code is line 6, Sub 3 is line 11 and Sub 4 is line 16. This makes the creation of the fields a relatively easy and quick task.


                  Create a new calculated field Called (for example) "Subscriber 1 Area Code"


                  Here is the formula. (My extracted text block is called "Subscriber Block" in this formula.)




                  So Subscriber 2 Area Code formula would be:[/SIZE]




                  and so on for Sub 3 and Sub 4 (11 and 16)[/SIZE]


                  Once you have one formula in the model you can use the Duplicate facility to create the other fields. Just provide the name for the field when prompted and change the line number in the formula. You could now set the sizes of the individual fields to be something reasonable - 3 for the Area Code for example.[/SIZE]


                  Then repeat the process for the other fields to be extracted - 20 fields in total.The order of creation does not matter since you can always re-order the column positions in the table to give you what you want.[/SIZE]


                  Add any other fields you need from the Account record and you should be done! If you need some of the additional detail from the Subscriber side you can use the same Block Text concept to get that as well.[/SIZE]


                  Hide the "Subscriber Block" field and you have your result.[/SIZE]


                  I can see a couple of other approaches that might be interesting but this looks like the most direct method based on your description. The known limit of 4 subscriber records maximum helps here. If there could be an unlimited number this approach, though it could work, might not be acceptably reliable. /SIZE


                  It also has the benefit of being quite easy to document for future reference![/SIZE]