Merging Lab Data into Clinic B VISIT Records



Clinic B has its own database containing CLIENT Records with VISIT Records linked to each one. Specimens are sent to Laboratory C with lab slips containing Client name and ID number and the name of the clinic (Clinic B). The laboratory creates a record for each specimen, inserts the results (here just for BUN and Glucose), and send the data back to Clinic B.

Here we demonstrate how to MERGE the laboratory values into the Clinic VISIT records using MERGE with the UPDATE option. The APPEND option is not used, as we do not want to create new VISIT records for non-matching lab values.

The process involves only two commands in Analysis.

  1. READ the VISIT table

  2. Use MERGE UPDATE from the Laboratory table, RESULTS1, specifying key values to assure that the results are inserted into the correct VISIT records. A full specification includes CLIENT ID, Date of Sample, and Clinic, in this case ID :: ID AND VISITDATE::LABDATE AND CLINIC :: CLINIC AND VISITDATE::LABDATE. By coincidence, this specifies Person, Place, and Time, but, if we had included specimen numbers in both databases and these also identified the Clinic, one key might have sufficed.


      1. The picture above shows part of the screen in Analysis, with the MERGE dialog and its BUILD KEY feature open.

        Note: There is an unfortunate BUG in BUILD KEY that does not allow you to put multiple fields on separate lines by pressing the ENTER key. You must use CTRL-ENTER instead to begin a new line after ID, for example. Since putting more than one key on a line in BUILD KEY causes an error in MERGE (and also in RELATE), the CTRL-ENTER trick (or some fancy cutting and pasting) is essential.

After you exit from the browser, you will see Clinic database before MERGING the laboratory data into the BUN and GLUCOSE fields. The MERGE will then occur so that you can see the results. The MERGE command will be displayed in large type above the data.

Now click the X in the upper right corner of the browser to exit.