MEDITECH Reports, MEDITECH NPR Reports, NPR Report Writing, NPR Report Writer, NPR Report, MEDITECH Reporting, MEDITECH Report MEDITECH Reports, NPR Reports, NPR Report Writing, NPR Report Writer, MEDITECH NPR

Friday, October 12, 2007

NPR Macro with ANS as Parameter

There was a question on the MEDITECH-L the other day regarding the LOCAL ANS variable. I thought I'd elaborate more today:

ANS = 7RESP 166 20071012 0540 1

The value of ANS will vary from MEDITECH module & screen where it is being used.

In the NUR module, the MEDITECH screen filer uses /RESP for filing responses to NUR.PC.WORK which falls under the physical file :NPCW. Astute readers will notice that I've translated 7RESP to /RESP. The other values in ANS are used as subscripts when filing the data into the database.

If you have a CDS attribute that is too long, greater than 249 - 254 characters in length, you will not be able to compile the attribute into your screen. That's when I resort to an NPR macro. The macro will be called as a progam like this:
%MIS.zcus.nur.attributes.M.calculate.average.temperature(ANS).

We put our macro under MIS because all modules open to MIS by default. If another application were to call your NUR screen, the NPR report macro could crash the screen because the NPR code is not on that segment. Using MIS as our DPM eliminates this problem.

When you get to the macro, you can work with data under the / prefix using /ANS OR /[ANS,"YOUR.QUERY"]|0. The one caveat to this can occur if the / prefix were stacked when your macro was called; I believe this only happens in ADM query screens. In that case, you'll need to unstack / at the beginning and unstack / at the end of your macro.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home