Well, that's no ordinary rabbit!

Displaying LAB results on an OE CDS

One method is to call an NPR report fragment in an attribute. One call can be made even if you have several tests that you want to display. The fragment simply needs to store the results in separate /R.FRAG.VAL variables such as /R.FRAG.VAL["HCT"] and /R.FRAG.VAL["HGB"]. The first query attribute calls the fragment and displays the result fo the first test. Each subsequent attribute just displays data that the first one retrieved.

OE Lab cds image 1

This screen has 8 queries, each with an attribute.




This attribute calls the fragment which retrieves the LAB test results and the date/time the specimen was reported. It then displays the result for test HCT. You will only need to change "LAB.MEM" to reference your LAB database.

IFE=IF{/["aa"]^/R.FRAG.ARG1 1,


All subsequent queries have this attribute with changes to reference the correct query and /R.FRAG.VAL variable.

IFE=IF{P(R,S,/R.FRAG.VAL["HCTD"]^/[ANS%0,"TJT.HCT.D"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["HGB"]^/[ANS%0,"TJT.HGB"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["HGBD"]^/[ANS%0,"TJT.HGB.D"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["WBC"]^/[ANS%0,"TJT.WBC"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["WBCD"]^/[ANS%0,"TJT.WBC.D"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["RBC"]^/[ANS%0,"TJT.RBC"]|0)^# "";""}


IFE=IF{P(R,S,/R.FRAG.VAL["RBCD"]^/[ANS%0,"TJT.RCB.D"]|0)^# "";""}


The NPR report is written in lab.l.spec.result.tests and uses the lab.spec.l.patient.index. When the fragment has finished running the most recent results and verified date/time will be stored in /R.FRAG.VAL subscripted to differentiate each test.

oe lab image 1

The patient is passed to the report as /R.FRAG.ARG1 and used as the first select.

oe lab image 2

A start macro loads the 4 tests into /TEST which is used as the second select.

oe lab image start

Nothing is on the report picture. In fact, the only line, a detail line, should have a LC="" attribute since the fragment will not be printing anything. There are 2 macros called by footnotes: the start macro and the detail macro.

oe lab image 3

The detail macro stores the results in /R.FRAG.VAL subscripted by the test and the date and time in /R.FRAG.VAL subscripted by the test plus "D". Only the most recent result is stored since earlier values are overwritten when the report finds a newer test result. It would probably be better to display the collection date and time rather than the verified date and time. To do this just replace @test.verify.date and @test.verify.time with @collection.date and @collection.time.

oe lab image detail

After the fragment is done the data will be stored like this.

HCT result - /R.FRAG.VAL["HCT"]
HCT date/time - /R.FRAG.VAL["HCTD"]
HGB result - /R.FRAG.VAL["HGB"]
HGB date/time - /R.FRAG.VAL["HGBD"]
RBC result - /R.FRAG.VAL["RBC"]
RBC date/time - /R.FRAG.VAL["RBCD"]
WBC result - /R.FRAG.VAL["WBC"]
WBC date/time - /R.FRAG.VAL["WBCD"]

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
NPR tips
NPR reports
Magic and C/S Products
Hosted by Daniel Davis
Resources for the IT Nurse
Articles and Discussion Forum
Debbie Kelly web site
Meditech tips
Nursing Informatics
Debbie Bate-Travis web site
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).