E-mail
Sunday, 01 January 2012 00:00

Tricks of the Trade: Unpredictable Result when MEDITECH BAR Index Used by Default

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

Meditech NPR uses the BAR.PAT.account.x index by default for your BAR PAT reports, even when you have not specified an index in your report. The BAR.PAT.account.x index is subscripted by account. Since the BAR.PAT.top segment is subscripted by account as well, I’m assuming this index provides better performance than accessing the BAR.PAT.top segment directly.

bar-pat-accounts-0

Here in the object code, you can see BAR.PAT.account.x in the main DO LOOP as ?(B)BZBZX[bz].

bar-pat-accounts-1

There is one scenario where you might not want NPR to use this index: and that is where BAR.PAT.account.x doesn’t contain all your BAR.PAT.top accounts. In that case I’ve found it necessary to write a workaround to access all records in the BAR.PAT.top segment. For your future reference: the physical address for BAR.PAT.top can be found in the screen shot above or on the MEDITECH Data Definitions Page. The physical address is: $(B1)BZ[bz].

One way to get all accounts, including those not in the BAR.PAT.account.x index, is to implement ECB & ECE line attributes to print the detail from the report picture. To do that, go to the General tab of the report, and remove the Detail DPM & Detail Segment. Then use ECB & ECE attributes to loop through the data and print the detail lines on the report picture.

bar-pat-accounts-2

bar-pat-accounts-3

When you look at the resulting object code; it looks surprisingly similar. Except that now, all accounts are accessible from the BAR.PAT.top segment.

bar-pat-accounts-4

The astute reader will notice: selection criteria have not been implemented in these examples. These examples are intended for use in your TEST databases. When writing production reports, take care to limit the number of records using selection criteria or your report may run a very long time.

***

As you have questions about your ARRA and 5.6 reports, email John at jsharpe@comstock-software.com.

john-sharpe

 

John Sharpe is President & MEDITECH Solutions Developer at Comstock Software, Inc. Learn more about NPR Report Writing at the MEDITECH NPR Report Writing Blog.

 
Copyright © 2012 Systems Personnel - "Your Partner in Healthcare Search & Consulting"
399-meditechbulletin.com and MeditechCareers.com are not affiliated with MEDITECH, Inc.