Back to main page
Programs by Mike
Technical Writing by Mike
Graphic design by Mike
E-mail Mike

A Logging macro for WP51

Last issue we learned how to have a WP51 macro prompt you for demographic info and store it in variables. Once you have the information in variables you can do anything you want with it. Let's create a log.

Choosing the method

You can have the log created after the report as part of the report macro, or you could create a separate log macro that only does the log.

You start a separate log macro the same way you create any macro (Ctrl-F10) and give it a name. Then record what you can and edit the macro later. We want our log to be created in document 2 and we want each report's demographics on a separate line, so we will need to do a Switch command (Shift-F3) and an Enter. We also want to come back to our current report in Doc 1 so we need another Switch command. After recording these keystrokes your log macro might look like this:

{DISPLAY OFF}
{SWITCH}{ENTER}{SWITCH}

We now have to add the variables to the log. Press Ctrl-F10 and type the name of your log macro then 2 to edit it. Position the cursor between the first Switch command and the Enter command. To get variables into the document we need to use the macro commands menu. We access that by pressing Ctrl-PgUp. Scroll down until {VARIABLE}var~ is highlighted. Press Enter to insert {VARIABLE} into the macro code. Type the name of the variable you want placed in your log followed by a tilde(~). You can also press Ctrl-V followed by the tab key to insert a {Tab} between variables. Repeat this for the remaining variables. (If you are using one of the count macros I demonstrated in the May issue you can add a line count to the log as well by adding {VARIABLE}VAR1~ right before the {Enter} command.)

The completed macro could look like this:

{DISPLAY OFF}{Switch}{VARIABLE}jobno~{Tab}{VARIABLE}ptname~{Tab}{VARIABLE}docname~{Tab}{VARIABLE}VAR1~{Enter}{Switch}

Press F7 to exit and save the log macro.

Creating the log as you create the report

If you don't use my count macro or don't need an individual line count for each report you can have the report macro itself create a log entry for you. This saves you the step of having to run the log macro separately or after you've counted the document.

To do this you need to open the report macro we created in the last issue for editing. Press Ctrl-F10 and type the name of your report macro. Press 2 to edit. Go all the way to the end of the report macro and press Ctrl-V then press Shift-F3 to enter the {Switch} command. Press Ctrl-V again and press the Enter key to enter the {Enter} command. Add another {Switch} command and then follow the instructions above for adding your variables. When you finish the completed report macro should like something like this:

{DISPLAY OFF}

{TEXT}ptname~Type patient name, press Enter: ~
{TEXT}dtofvisit~Type date of visit, press Enter: ~
{TEXT}docname~Type doctor name, press Enter: ~
{TEXT}dtime~Type dictation time, press Enter: ~
{TEXT}ttime~Type transcription time, press Enter: ~
{TEXT}jobno~Type job number, press Enter: ~

{Center}Valley.Urgent.Care{Enter}
{Enter}
Patient.Name:..{VARIABLE}ptname~{Tab}{Tab}{Tab}{Tab}{Tab}Date:..{VARIABLE}dtofvisit~
{Enter}{Enter}
S:{Indent}*{Enter}{Enter}
O:{Indent}*{Enter}{Enter}
A:{Indent}*{Enter}{Enter}
P:{Indent}*{Enter}{Enter}
{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}_________________________
{Enter}
{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{VARIABLE}docname~{Enter}
{Enter}
D:..{VARIABLE}dtime~{Enter}
T:..{VARIABLE}ttime~{Enter}
#{VARIABLE}jobno~

{Switch}{VARIABLE}jobno~{Tab}{VARIABLE}ptname~{Tab}
{VARIABLE}docname~
{Enter}{Switch}

Press F7 to exit and save the report macro.

Copyright 1999 by Mike DeTuri (reprinted from Computer Solutions Vol. 1, Issue 4)