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.

Queries

Comments

TJT.HCT

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,
IFE=%Z.rw.fragment("LAB.L.SPEC.zcus.tjt.lab.frag.for.oe.R","LAB.MEM"),
IFE=P(R,S,/R.FRAG.VAL["HCT"]^/[ANS%0,"TJT.HCT"]|0)^#,"";""}

TJT.HCT.D

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)^# "";""}

TJT.HGB

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

TJT.HGB.D

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

TJT.WBC

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

TJT.WBC.D

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

TJT.RBC

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

TJT.RBC.D

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

LAB.L.SPEC.zcus.tjt.lab.frag.for.oe

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



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


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