Deb, The first one will answer and skip, the second one will answer and stop so the user can adjust the answer if it isn't correct. Of course, you should require those fields that provide input for this calculation and then you won't have to worry about whether there is correct data to perform the calculation. Also, I'd add an REQ attribute to ensure that if staff step through the calculation field and then go back up to change an answer, the calculation ends up accurate when the screen is filed.
IFE=IF{%Z.elapsed.time([ANS,"NURRTEXD"]|0,[ANS,"NURRTEXT"]|0, IFE=[ANS,"NURRTVEND"]|0,[ANS,"NURRTVENT"]|0,"hh.hh")^VAR 1, IFE=VAR^/[ANS%0,"NURRTEHOU"]|0,P(R,S,VAR)^#,""} REQ=IF{%Z.elapsed.time([ANS,"NURRTEXD"]|0,[ANS,"NURRTEXT"]|0, REQ=[ANS,"NURRTVEND"]|0,[ANS,"NURRTVENT"]|0,"hh.hh")^VAR 1, REQ=VAR^/[ANS%0,"NURRTEHOU"]|0} ------------ IFE=IF{%Z.elapsed.time([ANS,"NURRTEXD"]|0,[ANS,"NURRTEXT"]|0, IFE=[ANS,"NURRTVEND"]|0,[ANS,"NURRTVENT"]|0,"hh.hh")^VAR 1, IFE=VAR^/[ANS%0,"NURRTEHOU"]|0,P(R,S,VAR)^#,1} REQ=IF{%Z.elapsed.time([ANS,"NURRTEXD"]|0,[ANS,"NURRTEXT"]|0, REQ=[ANS,"NURRTVEND"]|0,[ANS,"NURRTVENT"]|0,"hh.hh")^VAR 1, REQ=VAR^/[ANS%0,"NURRTEHOU"]|0} Daniel Davis -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenny Whiteside Sent: Monday, August 06, 2007 9:58 PM To: meditech-l@mtusers.com; [EMAIL PROTECTED] Subject: Re: [MEDITECH-L] NUR Attribute for # of Vent Hours Hi Deb, You can do this with the Z.elapsed.time program. Both the Iatric and Meditech websites have some good information regarding the use of Z programs. Try something like this: IFE=IF{%Z.elapsed.time(/[ANS%0,"NURRTEXD"]|0,/[ANS%0,"NURRTEXT"]|0, IFE=/[ANS%0,"NURRTVEND"]|0,/[ANS%0,"NURRTVENT"]|0,"hh.hh")^VAR VAR^ IFE=/[ANS%0,"NURRTEHOU"]|0,P(R,S,VAR)^#,""} (I have not checked this with the syntax checker... so it may not be perfect!) If you want the cursor to stop in the response, you can use just the Z program logic stopping at the ^VAR part. No need for an If Statement. Let me know how it goes, Kenny Whiteside >>> "Deb Carpenter" <[EMAIL PROTECTED]> 08/06/07 4:49 PM >>> Does anyone have an attribute that calculates the number of ventilator hours based on date/time of intubation and date/time of extubation? I have queries for date and time of intubation: NURRTVEND, NURRTVENT I have queries for date and time of extubation: NURRTEXD, NURRTEXT I need to calculate the number of hours between the two dates/times to come up with a result in a query called NURRTEHOU I am scheduled for an attribute class in 3 weeks, but in the meantime I am needing some help! Thanks, Deb Carpenter Solutions Development Analyst AHIS - St. Joseph Regional Medical Center 415 6th Street Lewiston, ID 83501 208.799.5780 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> NOTE: This e-mail message may contain information that may be privileged, confidential, and exempt from disclosure. It is intended for use only by the person to whom it is addressed. If you have received this message in error, please do not forward or use this information in any way. Delete it immediately, and contact the sender as soon as possible by the reply option or by telephone at the telephone number listed (if available). Thank you. -- This message has been scanned for viruses and dangerous content, and is believed to be clean. Catawba Valley Medical Center 810 Fairgrove Church Rd Hickory NC 28602 828-326-3000 "This electronic message may contain information that is confidential and/or legally privileged. It is intended only for the use of the individual(s) and/or entity named as recipients in the message. Please notify the sender immediately and delete the material from your computer if you have received this message in error. Do not deliver, distribute, or copy this message, and do not disclose its contents or take any action as a result of the information it contains. Thank you." -- This message has been scanned for viruses and dangerous content, and is believed to be clean. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= 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 meditech-l@MTUsers.com http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= 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 meditech-l@MTUsers.com http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com