Are both times always for the same date?
%Z.time.sub(A,B) might work.
NPR Report:
VAL=IF{%Z.time.sub([ANS,"query a"]|0,[ANS,"query a"]|0)}
Customer Defined Screen:
IFE=IF{%Z.time.sub([ANS,"query a"]|0,[ANS,"query a"]|0)^ET
IFE= P(R,S,ET^/[ANS%0,"ETQUERY"]|0)^#,1;1}
------------------------------------------------------------------------
---------------------
If you defaulted the begin and end date into 2 queries
[EMAIL PROTECTED]
Or
DFT=%Z.date.in.magic(S(0))
Or
DFT=/.DAT
Then you could use the Z.elapsed.time program
ELASPED TIME IN MINUTES:
The last argument needs to be hh.hh and then you multiply x 60
IFE=IF{%Z.elapsed.time([ANS,"NUR.EENDDT"]|0,
IFE=[ANS,"NUR.EEND"]|0,
IFE=[ANS,"NUR.EBEGDT"]|0,
IFE=[ANS,"NUR.EBEGIN"]|0,"hh.hh")*60^/VAR
IFE=/VAR^/[ANS%0,"NUR.TOT"]|0,P(R,S,/VAR)^#,""}
This takes 4 responses/values to calculate the elapsed time.
END DATE,END TIME,START DATE,START TIME
------------------------------------------------------------------------
----------------------
I think the following should take care of it:
%Z.time.lapse(%Z.elapsed.time(ENDDATE,ENDTIME,STARTDATE,STARTTIME,"hh:mm
"))/60
Z.elapsed.time will return the time in hh:mm format. Z.time.lapse will
return
the number of seconds from that time. Dividing that result by 60 will
return
the number of minutes.
------------------------------------------------------------------------
----------------------
ATTRIBUTES
USER DFT=/.USR
DEVICE DFT=/.DEV
DATE DFT=%Z.date.in.magic(S(0))
TIME/NOW DFT=%Z.time.out(S(0))
WHAT IT LOOKS LIKE ON SCREEN
User: MIS.WAM
Date: 05/19/06 Time: 1048
------------------------------------------------------------------------
---------------------
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joe Cocuzzo
Sent: Thursday, June 28, 2007 6:59 AM
To: Sharon LaDuke; [email protected]
Subject: Re: [MEDITECH-L] time calculation attribute
Z Programs
Z.time.sub
Argument: A = end time HHMM
B.= start time HHMM
Returns: minutes between B and A
Joe Cocuzzo
Vice President
NPR Services
Iatric Systems, Inc.
Phone/Fax: (978) 805-4115
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Web: www.iatric.com <http://www.iatric.com>
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sharon LaDuke
Sent: Wednesday, June 27, 2007 9:05 PM
To: [email protected]
Subject: [MEDITECH-L] time calculation attribute
I'm looking for an attribute that will look at two time fields (both on
the same date) and calculate the minutes between them. Any directions
would be appreciated. Thanks! Sharon
Sharon LaDuke RN BS
Consultant People
(801)397-5679
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
This footnote also confirms that this email message has been swept by Sophos
and MIMEsweeper for the presence of computer viruses.
**********************************************************************
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
To subscribe or unsubscribe to the meditech-l, visit
http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com
To check the status of the meditech-l, visit MTUsers.NET
For help, email [EMAIL PROTECTED]
Please visit and add information to the MTUsers WikiPedia at MTUsers.NET/mwiki
______________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com