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("")
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.
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("")}}
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}
Don't see what you
need? Visit one of these other sites
or email me your request (tomt at thomast357.com).