Article ID: 29988
Date:
2/4/2008
Published: 2/4/2008
Application: MRI
Source:
Meditech
Platform: MAGIC CS

MRI.PAT: Identifying Expired Patients

The MRI lookup program, when performing a patient lookup, displays a "x" next to the patient idefifying that this patient is expired.  A site inquired whether a field stores this "x".

The MRI.PAT.srch program uses this macro logic to acquire the "x":

A^urn,
@EXP^EXP,
EXP;

EXP
""^visit.subscript,
DO{@Next(visit.subscript)&('DISDATE) .,
IF{"Y"'=@MIS.DIS.expired[@visit.discharge.dispo];
@visit.discharge.date^DISDATE}},
IF{DISDATE!("Y"=@MIS.DIS.expired[@discharge.disposition]) "x"}

The macro searches through the visits segment to determine if the patient expired.  However, the DO loop terminates once the variable DISDATE gets a value.  This is efficient programming since it does not search through all of the patient's visits to determine if the patient expired.

The best approach to take advantage of this programming would be to create a report in the segment MRI.PAT.main.  This way you are not searching through the visits.

You would then build the above macro in your report.  The macro would be called as a program, and MRI.PAT.urn would be sent as the A argument.  For example:

xx.expire
DAT=FREE
LEN=1
VAL=%MRI.PAT.zcus.report.name.M.macro(@urn)

In this example, "MRI.PAT.zcus.report.name.M.macro" would be replaced with the actual macro name created in your report.  This will return a "x" if the patient expired.