Article ID: 22688
Date:
9/8/2005
Published: 9/13/2005
Application: MRI
Source:
Meditech
Platform: MAGIC CS

Selection to check if patient had specific visit.location in MRI.PAT without looping

The following code can be used on an MRI.DRC report to select if a patient had a specific visit.location in MRI.PAT. This example uses the logic next operator and does not require a DO loop:

Add to Selections:
xx.select    EQ
"Y"

Attributes for xx.select
DAT=FREE
LEN=
VAL=IF{+MRI.PAT.visit.locn.x[medical.record,"XXX","LOC1",""] "Y";
VAL=+MRI.PAT.visit.locn.x[medical.record,"XXX","LOC2",""] "Y"}

Above, XXX should be replaced with the actual facility mnemonic. This will then plus on the index file to see if there is a visit.date for the patient for
either of these locations.

Above, LOC1 and LOC2 should be replaced with the actual location mnemonics.

This example shows how to check for two locations, but can be expanded for additional locations if needed.

*The above code can be applied to an ADM.PAT report by editing the medical.record field above to @mri.urn.