Re: [MEDITECH-L] NPR:Need help with elapsed time of computed fields

76 views
Skip to first unread message

Poirier, Robin

unread,
Aug 1, 2008, 4:10:07 PM8/1/08
to ISD...@stjosephs.org, medit...@mtusers.com
I've been wrestling with this EXACT issue for almost 2 months! I'm
having problems getting the right fields to work. If one is blank,
forget about the elapsed time working.

I was going to add the same question today before we spec'd it out to a
vendor. You beat me to it!

If there's a solution within the list group, we'd be GREATLY
appreciative as well.
Thanks.

Robin A. Poirier
Sr. Applications Analyst
Howard County General Hospital
rpoi...@hcgh.org
PH: 410-720-8736
FX: 410-740-7565


-----Original Message-----
From: meditech-...@mtusers.com
[mailto:meditech-...@mtusers.com] On Behalf Of
ISD...@stjosephs.org
Sent: Friday, August 01, 2008 9:49 AM
To: medit...@mtusers.com
Subject: [MEDITECH-L] NPR:Need help with elapsed time of computed fields

Good Morning,
We are Magic 5.62, I have a report written in ADM.PAT adm.pat.events.
The
report shows the time the patient was registered in the ER to the time
the
patient was transferred to the Inpatient floor. I'm trying to create an
elapsed time field but it's not working. This is what I've done. I
have 4
computed fields on a detail line as follows:

xx.regd
DAT=FREE
LEN=8
VAL=IF{@event.code="ENREGER" @event.date}

xx.regt
DAT=FREE
LEN=4
VAL=IF{@event.code="ENREGER" @event.time}

xx.trand
DATE=FREE
LEN=8
VAL=IF{@event.code="TFRADMIN" @event.date}

xx.trant
DAT=FREE
LEN=4
VAL=IF{@event.code="TFRADMIN" @event.time}

All the above returns the proper date and time. I then created the
following time elapsed field:

xx.elapsed.time
DAT=FREE
LEN=15
VAL=%Z.elapsed.time(@xx.trand,@xx.trant,@xx.regd,@xx.regt,"hh Hrs mm
Mins")

Can you not use computed fields in elapsed time fields or can anyone
tell me
what I'm doing wrong.

Thank You,
Laura Wasielewski
St Josephs Hospital
Elmira, Ny


====================================

Keep up to date on recent announcements about MUSE by visiting the
meditech-l web site at MTUsers.net and go to the tab labeled "MUSE -
Dallas 05/08"

If you want to ask a question from the meditech-l users who will be
attending MUSE or share something about MUSE with each other, you can
post messages on the web site on the tab "MUSE - Dallas 05/08"


====================================

Keep up to date on recent announcements about MUSE by visiting the meditech-l web site at MTUsers.net and go to the tab labeled "MUSE - Dallas 05/08"

If you want to ask a question from the meditech-l users who will be attending MUSE or share something about MUSE with each other, you can post messages on the web site on the tab "MUSE - Dallas 05/08"

JohnMar...@rush.edu

unread,
Aug 1, 2008, 4:40:04 PM8/1/08
to Poirier, Robin, medit...@mtusers.com
You can't reference computed view fields (xx.regd) in other computed view
fields. You need to reference the actual field (e.g. @event.time).
However you should also be able to store off your field to a slash
variable.

I haven't tried this, but this should work. . .

xx.regd
DAT=FREE
LEN=8
VAL=""^/REGD,IF{@event.code="ENREGER" @event.date^/REGD}

xx.regt
DAT=FREE
LEN=4
VAL=""^/REGT,IF{@event.code="ENREGER" @event.time^/REGT}

xx.trand
DATE=FREE
LEN=8
VAL=""^/TRAND,IF{@event.code="TFRADMIN" @event.date^/TRAND}

xx.trant
DAT=FREE
LEN=4
VAL=""^/TRANT,IF{@event.code="TFRADMIN" @event.time^/TRANT}


xx.elapsed.time
DAT=FREE
LEN=15
VAL=%Z.elapsed.time(/TRAND,/TRANT,/REGD,/REGT,"hh Hrs mm Mins")

John-Mark Freve
Application Analyst
Rush Oak Park Hospital
Oak Park, IL
708.660.5002


"Poirier, Robin" <rpoi...@hcgh.org>
Sent by: meditech-...@mtusers.com
08/01/2008 03:10 PM

To
<ISD...@stjosephs.org>, <medit...@mtusers.com>
cc

Subject
Re: [MEDITECH-L] NPR:Need help with elapsed time of computed fields

ISD...@stjosephs.org

unread,
Aug 1, 2008, 9:49:12 AM8/1/08
to medit...@mtusers.com

Stewart, Donald

unread,
Aug 4, 2008, 8:49:44 AM8/4/08
to JohnMar...@rush.edu, Poirier, Robin, medit...@mtusers.com
Actually, John-Mark, I have some reports that have computed fields that
successfully reference other computed fields and use their values in
calculations or comparisons. I think the problem here is actually the
Z.elapsed.time function itself.

Donald F. Stewart
Sr. Programmer Analyst
(706)647-8111 x1696
dfst...@urmc.org

Upson Regional Medical Center
801 W. Gordon St.
Thomaston, GA 30286


====================================


====================================


====================================

--
This message has been scanned by the Vigilar Atlas for spam and viruses,
and is believed to be safe and clean.

--
This message has been scanned by the Vigilar Atlas for spam and viruses, and is believed to be safe and clean.

JohnMar...@rush.edu

unread,
Aug 4, 2008, 11:35:19 AM8/4/08
to Stewart, Donald, JohnMar...@rsh.net, meditech-...@mtusers.com, medit...@mtusers.com
I'll have to try that out again I've never had much luck referencing
other computed view fields in a computed view field. Are you sure it
works when you're feeding them as arguments into a program? It might be
worth checking the object code to see how it translates. If the object
code for the field looks like this

%Z.elapsed.time(@xx.trand,@xx.trant,@xx.regd,@xx.regt,"hh Hrs mm Mins")

then there's no way Magic will be able to run Z.elapsed.time.

That being said, Z.elapsed.time is picky about it's arguments. Dates need
to be YYYYMMDD and times need to be HHMM. I ran into a situation before
where whatever I was doing would drop the a leading zero for the hour so
0315 became just 315. Z.elapsed.time returns nil if it gets that kind of
input.

John-Mark Freve
Application Analyst
Rush Oak Park Hospital
Oak Park, IL
708.660.5002


"Stewart, Donald" <dfst...@urmc.org>
Sent by: meditech-...@mtusers.com
08/04/2008 07:49 AM

To
<JohnMar...@rsh.net>, "Poirier, Robin" <rpoi...@hcgh.org>
cc

Bill Mullins

unread,
Aug 5, 2008, 11:30:03 AM8/5/08
to Poirier, Robin, ISD...@stjosephs.org, medit...@mtusers.com
This is what I used in a ADM.PAT event code report.

xx.los1
DAT=FREE
FONT=b
JFY=L
LEN=14
VAL=IF{@status$3="DIS"
%Z.elapsed.time(@discharge.date,@discharge.time,@admit.d
VAL=ate,@admit.time,"hh Hrs mm Mins")}


xx.los2
DAT=FREE
FONT=b
JFY=L
LEN=14
VAL=IF{@status$3'="DIS"
%Z.elapsed.time(@.today,@.now,@event.eff.date,@event.ef
VAL=f.time,"hh Hrs mm Mins")}
----------------------------------------------------------
I have also used the field numbers for the 4 elements for the
elapsed.time calculation, like this:

VAL=%Z.elapsed.time(/V[13],/V[14],/V[3],/V[4],"hh.mm")
----------------------------------------------------------

Good Luck,

Mitch Lawrence

unread,
Aug 4, 2008, 10:38:56 PM8/4/08
to JohnMar...@rush.edu, Stewart, Donald, JohnMar...@rsh.net, meditech-...@mtusers.com, medit...@mtusers.com
Change your computed date field types to DAT=DATE and your time computed
fields to DAT=HHMM.

Your Z.elapsed.time should run then, given that you are correctly
referencing your computed fields.

Another way may be to reference your computed fields via their field
identifiers. In C/S, this would be /R.V[n] where n corresponds to the field
number. I think in MAGIC it is /R[n] (don't quote me on that, it's been a
while).

So your elapsed time ends up being something along the lines of

VAL=%Z.elapsed.time(/R.V[15],/R.V[16],/R.V[13],/R.V[14],"hh.hh")


(or whatever format you end up with)

Mitch

Reply all
Reply to author
Forward
0 new messages