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

Meditech Frequently Used & Recent Menu Items (CS 5.6)

 

Mistakes break us out of our usual workflow and given a little curiosity, help us discover things we might not take time to learn on our own.  When you're new to something, everything you see, looks like an option.  What's this do?  How's this work? 

Frequent 0

As we become proficient at our work, our brains develop routines  that we execute without consciously thinking about each step.  Without mistakes and deliberate practice, it is easy to develop tunnel vision. 

Today I found the Recent and Frequent buttons on the right of my MEDITECH NPR Desktop. The buttons were there all along, but until I accidentally clicked the wrong button, I never saw them.  Some days I seek out deliberate practice, on other days my mistakes create unexpected learning opportunities.

Frequent 1

Sidebar: if you've used Windows XP, these features remind me of the personalized Start Menu. Frequently accessed application menu items float to the top of the Frequently Used list.  Recently accessed menu items, appear in the Most Recent list.  Recommend this time saving feature to your MEDITECH physicians and clinicians, you know the ones, who email you about how many mouse clicks it takes to do something.

Frequent 2

It has been said, "whoever makes the most mistakes wins".  While I can't recommend making mistakes as a strategy, I can say that learning from our mistakes is underrated.  Learn more here in Eric's amazing post, titled: Career Calculus.

MEDITECH - Change Business Rules Fast

 

Healthcare Changes Fast 2

MEDITECH reports often contain business rules for your organization.  When changes are requested, they are usually needed right away. To implement changes, report writers have to understand what a report does. 

Business rules are typically expressed in code, known as NPR macros.  Macros are used to break up code into logical groups.  Common practice has been to implement code as inline macros often using the @Macro syntax or a footnote.

Business rules while often straightforward to implement, can be challenging to understand once converted to code.  Understanding existing business logic is required before you can make changes; it follows that organized, de-duplicated code is faster to read, understand and therefore to change. 

When you implement an inline macro, your ability to reuse code is limited.  Macros implemented as programs differ from inline macros in 3 ways, they: 1) accept parameters (a,b,c), 2) end in a semi-colon <;>, and 3) code is not compiled into the report. 

Parameters facilitate fewer lines of code by making it easy to organize and reuse groups of subroutines, also referred to as blocks of code.  Code reuse equals less code.  Less code means fewer lines of code to understand, before adding or changing report functionality.

@Macro provides a way to separate code in a report without an update to macro calls when the report's name changes.  One downside to this approach is that you have to Translate the report, each time a change is made to a macro.  If the macro or report is a lengthy one, report translation can take a long time.

Instead of for example, @Macro(detail), you can implement your detail macro as a program and call it dynamically.  To implement an inline macro as a program:

1) identify and define your parameters in the macro A^urn for example

2) terminate the macro with a semi-colon <;>

3) call the macro as a program, only dynamically like this:
%(ADM)["PAT.."_(c.procedure.name)_".M..detail"](urn)

Use the dynamic macro technique and your reports will be better organized, clear and adaptable to changing business rules.

NOTE: for those using CS 5.6 and greater, the c.procedure.name variable may not be available.  Please try this approach instead. 

@REPORT.NAME^/REPORT.NAME,
%(NUR)[/REPORT.NAME_".M..init"](0)

REPORT.NAME
/R.NEW.PAGE.PGM^/REPORT.NAME,
/REPORT.NAME%L(/REPORT.NAME,".zcus")^/REPORT.NAME,
"PC.WORK.."_/REPORT.NAME^/REPORT.NAME,
/REPORT.NAME$(L(/REPORT.NAME)-3)^/REPORT.NAME

MEDITECH Data Definitions Found

 

MEDITECH Data Definitions often truncated on the MEDITECH web site can be difficult to decipher.  That is until David showed me this workaround.

Meditech Data Defs 000 resized 600

Build an NPR using that segment.  Complete the section shown below, you don't need to fill out anything else in the report.  File.

Meditech Data Defs 0000 resized 600

List the source code.

Meditech Data Defs 001 resized 600

Download to a text file.

Meditech Data Defs 002 resized 600

Open the text file in a text editor.  Look for your sort fields; this list of fields contains all the subscripts for the truncated segment on the MEDITECH web site.

Meditech Data Defs 03 resized 600

MEDITECH.Data.Definitions.WildCard()

 

MEDITECH Report Utilities >> MEDITECH.Data.Definitions.WildCard()

Wildcarding the subscripts in a long data definition in the past; you manually replaced the lower case subscripts from this:

$(N1)NPCW[aa]I[nib]O[niu]TD[nod,not,noc]Q[ggv]

until you had:

$(N1)NPCW[:]I[:]O[:]TD[:,:,:]Q[:].
 
Meditech Data Defintions Wildcard 1 resized 600

Your days of tedious data definition editing are gone. Try MEDITECH.Data.Definitions.WildCard().

Meditech Data Defintions Wildcard resized 600 

MEDITECH - Reverse Engineering Standard Reports (CS 5.6)

 

Initializing a MEDITECH standard report never works when you really need it to. That's not a knock on NPR; NPR does what it was intended to do very well, maybe even better than it was designed to ... its that converting code is a very tough thing to do.

MEDITECH Npr List Reports 5 resized 600

When Initializing Report from Standard fails ... print off the report's source & object code. 

MEDITECH Npr List Reports 0 resized 600

MEDITECH Npr List Reports 1 resized 600

MEDITECH Npr List Reports 2 resized 600

MEDITECH Npr List Reports 3 resized 600

MEDITECH Npr List Reports 4 resized 600

Reviewing MEDITECH's standard report code usually yields enough ideas for you to write a new custom report that meets your needs.

MEDITECH NPR Download Factory - Update

 

If you've tried the MEDITECH NPR Download Factory, you have 2 new options: delimiter & qualifier.  Specifying the delimiter and qualifier here, saves you editing time in your NPR macro.

Npr Download Factory Delimiter Qualifier resized 600

MEDITECH NPR Download Factory

 

Think of this as SELECT * FROM tblName when you're querying the MEDITECH Data Repository; only this is for MEDITECH NPR.

If you've ever wanted to build a quick and dirty NPR Download, to dump a dictionary, or a segment; and you don't enjoy creating xx.custom.fields for each data element header, you might be interested in the NPR Download Factory.

Try to create a DOWNLOAD macro for MIS.FIN.CLASS.main in Client Server; then implement as a start macro in a new blank report. 

- data segment:

main[mnemonic]

- fields:

mnemonic
active
ask.sign
comment.if.reject
file.if.not.signed
form
form.phys
hospital.code.to
name
print.if.unk
resp.for.pay.code

You'll only need an NPR Report title, a footnote to call your start macro and a start macro, the NPR Download Factory does the rest.

MEDITECH DOWNLOAD

For future reference, bookmark: MEDITECH Report Utilities.


Lessons Learned: Improving MEDITECH Report Development

 

In Making Software I found this first bullet point ringing particularly true for me.  Most of my reporting mistakes are based in using the wrong data structure OR my knowledge of how the documentation is used.  Learning opportunities surface more often for me in the workflow, instead of the report writing language.

Improving Meditech Reports resized 600

As MEDITECH Report Writers mature and grow, there is less and less to learn about the reporting tools, in comparison to how much there is to learn about how hospitals and their people use MEDITECH.

I'm learning to:

  • Watch an experienced user document the data being used in the report.
  • Ask the people who use my reports more questions. 
  • Double check the MEDITECH Data Definitions across multiple MEDITECH applications and DPMs, even when I'm sure I know the best source for the data.

Whether you use SQL for the Data Repository, NPR for Client Server and Magic, or the Report Designer for 6.x Advanced Technology.  The best way to prevent reporting errors is to be knowledgeable about the business domain for your reports.

MEDITECH NPR Change Checklist for CS & MAGIC 5.6

 

When getting the job done right, is absolutely essential; checklists can be a boon to task accuracy and productivity. 

Key point: your team is more likely to use a checklist, when the people who have to live with the checklist, are encouraged to make changes that suit their skills, environment and desired outcomes.

Meditech Checklist

Read more here in the MEDITECH Community Bulletin article titled: MEDITECH NPR Change Checklist for CS & MAGIC 5.6 (A Pragmatic Approach).

MEDITECH CS - Selection for Reports Called in Screens

 

Reports that are called from MEDITECH screens instead of a menu, usually have a select like the one below.

Meditech Urn Select 1 resized 600

When the report is called from a MEDITECH screen, the /urn value is provided by MEDITECH.  As the report developer, you can look up the /urn and populate it like this. 

Meditech Urn Selection

When you're ready to move the report into production use, remove the AL START Footnote; and MEDITECH will take it from there.

All Posts