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

@Macro Makes for Readable Code

 

NPR Report Writer, Ben Dorsey, at Iatric Systems, cleverly used @Macro in a recent MEDITECH CS Report. Not being familiar with @Macro, I've compiled it in a report to share it with you.

MEDITECH NPR Macro

@Macro works by dynamically compiling the local macro named init, into NPR object code.

NPR macros become unweildy, when their length extends beyond a couple hundred lines; at which time, NPR Macro Editor Screen corruption is possible, risking macro integrity.

MEDITECH Open Database

Upside:

  • You don't have to call each macro by its fully qualified name. This saves you trouble later, when the report is copied or renamed.
  • Macros are easier to read & edit, because they are shorter.

NPR Object Code

Downside: Translate your report after any changes - and I'm not sure there is one.


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

@Macro also allows you to use macros from standard reports in custom reports. Comes in handy if the standard report uses code that won't pass the RW translator.
Posted @ Monday, December 21, 2009 11:09 PM by Leslie Mann
That is good to know, thanks Leslie!
Posted @ Tuesday, December 22, 2009 9:24 AM by John Sharpe
I am finding this @Macro only works when called from a Macro; not from Line Attributes, or from custom fields.
Posted @ Wednesday, December 23, 2009 12:50 PM by John Sharpe
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

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