WebMeditechBulletin.com
E-mail
Monday, 01 February 2010 07:00

Tricks of the Trade: MEDITECH NPR (Client Server) – Custom F9 Lookups for NPR Reports - Part 1 of 2

By: John Sharpe, President, Comstock Software, Inc.

NOTE: This is an advanced topic, the author assumes the reader has an intermediate level of skill on the NPR Report Writer.

If you’re looking to mimic the functionality in a standard MEDITECH lookup, the MEDITECH Z.id program will get the job done. The information in your lookup can be a simple list or generated from MEDITECH data. Using Z.id, you can create a lookup for a standard field or a custom field, the process is the same.

mcb0210_1

To get started, open your report using NPR and define your Select Fields on the Sorts/Selects tab.

mcb0210_2

Then define the xx.select field in the Picture tab. Key F12 and File the report.

mcb0210_3

Select option 9, the NPR Edit Elements routine.

mcb0210_4

Edit the field attributes by Keying Y, then Enter.

mcb0210_5

Call a local macro from your report as a program. Here, our macro is named select. Key Enter after keying the ID attribute.

mcb0210_6

Key the same ID attribute in the c.age MEDITECH field as well. Key F12 and File the report.

To define the select macro, Enter/Edit using option 7.

mcb0210_7

Type select as the macro name and hit Enter.

mcb0210_8

Take note of the /NUMBERS.DICTIONARY array, the local variable CD, and the Y in {“Y”,”ONE”,”Number One”} the /NUMBERS.DICTIONARY array.

mcb0210_9

You can name your slash / array, which contains your list of items for the Lookup, anything you want. In our example here, the name of the list is /NUMBERS.DICTIONARY. The MEDITECH pointer to, known as the name of, the array, is passed as parameter A like this: %Z.id(^/NUMBERS.DICTIONARY. Placing the carat ^ in front of the array name, tells MEDITECH where this array can be found in MEDITECH memory.

The Y in {"Y","ONE","Number One"} determines whether this item will be included in the Lookup’s list of items.

The local variable CD is the subscript in the /NUMBERS.DICTIONARY[1] array. The value of CD, in this case 1, is the value that is returned to the xx.select field when chosen at run time.

mcb0210_10

In Part 2 of this article, you’ll learn more about other ways custom lookups can be used to help you write better reports.

In the meantime, won't you join your colleagues in asking and answering questions at the MEDITECH Knowledge Exchange?  Thoughts? Email them to John at jsharpe@comstock-software.com.

john-sharpe

 

John Sharpe is President / NPR Consultant at Comstock Software, Inc. Learn more about NPR Report Writing at the MEDITECH NPR Report Writing Blog.

 

 
Copyright © 2010 Systems Personnel - "Your Partner in Healthcare Search & Consulting"
MeditechBulletin.com and MeditechCareers.com are not affiliated with MEDITECH, Inc.
Get Adobe Flash player