Printer Friendly

A seamless merge of dBase IV data and WordPerfect.

COMPUTERS PERMEATE the workplace today. They undoubtedly increase the amount of information we are capable of tracking and manipulating, but sometimes seem to require more effort than they're worth.

What follows is a program that truly saves time. It can be modified to work whenever dBase IV (Borland International Inc., Scotts Valley, Calif.) and WordPerfect (WordPerfect Corp., Orem, Utah) applications share data.

* The need. Several years ago we purchased new MS-DOS computers and WordPerfect word processing software for our secretarial staff. Our secretaries use WordPerfect to type surgical biopsy reports.

Several months later we incorporated a database application into the daily routine. Staff members enter each day's surgical specimens into the database using a simple program created with the application generator that comes with dBase IV. From this database, we print logs and specialized reports for various specimen types, and retrieve patient information.

I quickly realized, however, that we were duplicating much effort by entering patient information into the database and typing the same information--the patient's name, age or date of birth, accession number, collection date, ordering physician, and facility--into the header of every surgical report on WordPerfect. If we could export our database file information and retrieve it with a WordPerfect merge, we could eliminate keying this information twice.

* How it's done. We first determined which fields of our database needed to be included in the word processing document. I then wrote a small database program that took the data we selected and created a WordPerfect merge file.

Using ASCII (American Standard Code for Information Interchange) characters 18 and 5, we instructed the dBase program to insert the WordPerfect END FIELD and END RECORD codes directly into our merge file. No intermediate steps or file conversion was necessary. Each field is output sequentially and corresponds to the merge codes in the primary document. That is, the first field is named FIELD 1, the second FIELD 2, and so on until the END RECORD marker is reached. Our merge file, called SURGMERG.TXT, specifies where each field of information will be placed and the overall document format.

We keep all specimens (about 40,000 to date) in a single file for statistical analysis. We create a separate database file each day called LOGSORT.DBF that contains the patients entered that day. It is this file that we use to create our merge.

After entry of a full day's patients, a log sheet is printed from the LOGSORT.DBF database file. Users are then asked if they would like to create a WordPerfect merge file from this data. If they answer yes, a new TABULAR DATA OMITTED file is created that includes the information specified along with merge codes. Users are then asked if they would like that file copied to a floppy disk. We enter patients into the database at one computer and then take the floppy disk with the merge file on it to another computer for the merge. (If you use a single computer for both applications, this step can be eliminated and the data file can be copied directly to the WordPerfect document directory.) The floppy disk is inserted into the second computer and WordPerfect takes over from there.

I have written a WordPerfect macro that opens a new document, retrieves the merge file from the floppy disk, saves the file, and then merges the primary file with the records on the floppy. Within seconds, we have a 40- to 50- page document with appropriate information about each patient on separate pages. Secretaries then complete each report as dictated by the pathologist. If patient headers on reports average 50 keystrokes, and a lab averages 50 patients per day, 2,500 keystrokes are saved daily.

We discovered the hard way that the secondary merge file in ASCII format works properly only if it is retrieved and saved using WordPerfect. That step was added to the macro described in Figure 4.

* Modifications. This program can be modified easily to selectively merge specimens of a specific type, doctor, or any other attribute available in your database. You can also have your database program include fixed information such as today's date and text like "Dr." or "M.D." We frequently get a patient's age rather than date of birth, so we included an "immediate if" (IIF) command that copies the date of birth field if present, or the age field, if not.

Also, this database program can be written in other database languages such as Paradox (Borland) and Foxbase (Fox Software, Perrysburg, Ohio). I have used the program with versions 4.2, 5.0, and 5.1 of WordPerfect and with dBase III Plus. The recently released WordPerfect for Windows has drastically altered its macro language, however, and the described macro will not work with it.

In our laboratory, this marriage of a database application and a word processing program has certainly saved us time and effort. I have found Advanced dBase III Plus Programming and Techniques|1~ of great help as well as WordPerfect: The Magazine.|2~

WordPerfect and dBase IV are popular software packages in many places of business. I am sure that with a little thought, numerous applications can be found for this simple and time-saving program.


1. Liskin M. Advanced dBase III Plus Programming and Techniques. Berkeley, Calif: McGraw Hill; 1987.

2. McHardy SJ. Controlling your basic merge. WordPerfect: The Magazine. 1991; February: 39-42.
COPYRIGHT 1993 Nelson Publishing
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 1993 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Title Annotation:Computer Dialog
Author:York, Donald L.
Publication:Medical Laboratory Observer
Date:Jun 1, 1993
Previous Article:Undercover 'shopping' to evaluate lab services.
Next Article:Clintons float CLIA changes as part of reform strategy.

Related Articles
Tips on buying microcomputer hardware and software.
Can anyone save Ashton-Tate?
Reliable instrument maintenance with a PC.
Technology at work; standard software sets the pace.
A database for abnormal morphology.
An automated system for record keeping, test reporting, and QC in gyn cytology.
How CPAs use software.
Getting the most out of your old LIS.
Double your productivity.

Terms of use | Copyright © 2017 Farlex, Inc. | Feedback | For webmasters