About MEDITECH Reports

 

View John Sharpe's profile on LinkedInI'm your host, John Sharpe, a MEDITECH Consultant living in Spokane, WA. Read more ...

Connect ...

Expand your network by connecting on these social media sites:

Sign up for the MEDITECH Reports Blog; details to attend MEDITECH workshops are sent out 1 week in advance to all MEDITECH Report blog subscribers.

These MEDITECH Workshops are sponsored by Donna Carroll at the MEDITECH Community Bulletin

MEDITECH NPR & RW RESOURCES:

Ascii Table: For NPR Report Writer
Loop Builder: For NPR Macros
Key Codes: For CDS Attributes
List Builder: For NPR Macros
MT Report Names: For NPR Reports
MT Structure Viewer: For Physicals
Strings: Format & Sort

HIT Topics

MEDITECH Reports

Current Articles | RSS Feed RSS Feed

De-Duplicating Detail Using Sort Keys

 

At times you'll find you need your NPR report to use a segment with multiples; but not print the multiples.

Lets say you are using the following index for the BAR.PAT.bar.acct detail segment:

bar.acct.insurance.index ?BZIN[ggm,bzIO,bz]
ggm = insurance, bzIO = insurance.order, bz = account

?BZIN["ABC",1,ACCT1]
?BZIN["DEF",2,ACCT1]
?BZIN["JIK",3,ACCT1]
?BZIN["LMN",4,ACCT1]

You want to only print accounts for a particular list of insurance mnemonics.

1^/INSURANCE.LIST["ABC"],
1^/INSURANCE.LIST["DEF"],
1^/INSURANCE.LIST["JIK"],
1^/INSURANCE.LIST["LMN"],

Your select is insurance LI /INSURANCE.LIST.

Your report's output will have more than one account's detail due to the index having some accounts associated with more than one insurance.

To prevent duplicates, I like to set a sort KEY Header on NPR Page 2 for account or whatever, I'm trying to deduplicate. This puts an HKx line on the report picture. Since I don't actually want a blank line on my report every time the sort changes; I use the following LC line attribute on the HKx:

LC=/DONE[@account]+1^/DONE[@account],""

That "" or nil as it is called keeps the line from printing. While the /DONE[@account]+1^/DONE[@account] part tallies up the times we've processed the account.

Next you'll want a LC attribute on your detail line(s):

LC=IF{/DONE[@account]>1 "";1}

The purpose of a line check is to print report lines based on a condition. Our condition is /DONE[@account] less than 1. In plain english, if we've seen the account once before don't print it.

Want an alert when the next post is published? Click the phone and Subscribe to the MEDITECH Reports Blog!

Subscribe to the Meditech Blog     

                                                                                                                                                                                                          

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics