Well, that's no ordinary rabbit!

I've been asked several times how to run an NPR report from an attribute so here it is. The basic premise is to have an NPR report run if a query is answered a specific way, in these examples "Y".

NOTE: Although these attributes have worked for me, others have not had the same success.

Update: 11/4/06 - I've been pointed to Meditech KB Article 13984 that has helped fix the screen corruption for some users. The article says to add this footnote to the report.

AL CLOSE.UP 1^/R.FRAGMENT,%Z.printer(""),%Z.printer.close.px("")

Changing Applications

The first 2 examples would be used in a situation where the report is in a different application than the CDS (such as an ADM.PAT report called from an OE, NUR, or SCH screen). The first example would use 2 queries. Query 1 would be the yes/no query and Query 2 would have an IFE attribute that runs the report if the first query is answered "Y". The second example uses an FCLx attribute on a single query. The Z.switch.appl program maintains whatever values are in / so you can use <space><enter> to pull in the current patient to a report selection prompt or use an account number index and select on the acct number field EQ /..LAST.ACCT.NUM. The unit number is also stored (in /..LAST.UNIT.NUM) in case you need to use a unit number index.

The Attribute

IFE=IF{[ANS,"my-query"]|0="Y" 1,
IFE="ADM.PAT.zcus.my.report."^RPT,RPT_"S"^RPTS,RPT_"R"^RPT,
IFE=IF{%Z.switch.appl("ADM") ("** ADM Unavailable **")^/.WO,%Z.w.macro(1,1);
IFE=%[RPTS](RPT,0)X,%Z.switch.appl("")}},1

FCL1=IF{@.response="Y" 1,
FCL1="ADM.PAT.zcus.my.report."^RPT,RPT_"S"^RPTS,RPT_"R"^RPT,
FCL1=IF{%Z.switch.appl("ADM") ("** ADM Unavailable **")^/.WO,%Z.w.macro(1,1);
FCL1=%[RPTS](RPT,0)X,%Z.switch.appl("")}}

Within the Same Application

These 2 examples would be used in a situation where the report is in the same application as the CDS (such as an OE.PAT report called from an OE procedure screen). The first example would use 2 queries. Query 1 would be the yes/no query and Query 2 would have an IFE attribute that runs the report if the first query is answered "Y". The second example uses an FCLx attribute on a single query.

IFE=IF{[ANS,"my-query"]|0="Y" 1,
IFE="ADM.PAT.zcus.my.report."^RPT,RPT_"S"^RPTS,RPT_"R"^RPT,
IFE=%[RPTS](RPT,0)X},1

FCL1=IF{@.response="Y" 1,
FCL1="ADM.PAT.zcus.my.report."^RPT,RPT_"S"^RPTS,RPT_"R"^RPT,
FCL1=%[RPTS](RPT,0)X}

Other Magic Pages

CDS Attributes Emailing Messages Emailing Scheduled Reports
@W. prompts String Manipulation NPR Viewer
Text Edit/View Attribute Meds in an NUR CDS NUI Desktop Icons
Field Attributes Lab results in a CDS Ultimate Message Box
Display Message Attributes Run NPR Report Attribute Multiple Query Checklist
NUR Canned Text in Query Mousetributes LAB TEST VIEW GROUP
OA Msg from PHA Rule FTP Standard Report HTML Pt Master Logs
PCI NPR Report


Don't see what you need?  Visit one of these other sites

Iatric Systems web site
Attributes
NPR tips
NPR reports
Magic and C/S Products
ITNurse.net
Hosted by Daniel Davis
Resources for the IT Nurse
Articles and Discussion Forum
Debbie Kelly web site
Attributes
Meditech tips
Nursing Informatics
Debbie Bate-Travis web site
Attributes
Links to other attribute sites
Links to Nursing Informatics sites
Magic NPR Report Writing
Blogged by John Sharpe
NPR Report Writing Tips

or email me your request (tomt at thomast357.com).