Nested Report Statments in I-4gl
Posted in 1993
In our veterinary medical records database, we need to be able to generate a single case summary which uses data from up to 12 different tables. The report flow goes like this: Demographic data First Animal Data Clinical Signs For this Animal (multiple) Next Animal Data Clinical Signs For this Animal (multiple) ... ... Last Animal Data Clinical Signs for this animal (multiple) Data about the poison and exposure Follow up data Evaluations & Outcome I have been using I-4GL's report capabilities to format the extracted data. Of particular importance is the sorting and BEFORE/AFTER GROUP stuff. The first problem is an old one where the use of "START REPORT x TO outfile" results in each report call overwriting the contents of the previous report. Not what I want, obviously. To overcome this problem I set outfile to be a "cat >> outfile" statement and use "START REPORT x TO PIPE outfile". This worked (ugly, functional) while a kept all the the clinical finding data together. Now that I am trying to show the signs/symptoms that each animal exhibited (as shown above) my patch for the first problem will not work. I have tried the following: Animal cursor stuff start report animal_rpt to pipe outfile loop starts output to animal_rpt sign cursor stuff for this animal start report sign_rpt to pipe outfile loop starts output to sign_rpt loop ends finish report loop ends finish report The result is mostly garbage. The animal data is written to the file but the sign data is not. Options that I see: - send each report to a separate outfile and join them with a Unix call after the report is finished - give up on the grouping and simply call the sign data from within the animal report. Any suggestions will be appreciated. I've tried a lot of different approaches with very limited success. Thanks -- --------------------------------------------------------------------- Harold L. Trammel h-trammel@uiuc.edu | National Animal Poison Control Center | College of Veterinary Medicine | PRACTICE RANDOM KINDNESS Univ. of Illinois Urbana-Champaign | AND SENSELESS ACTS OF BEAUTY =====================================================================