I think you may want to try the larger numbers first, depending on how you
wrote as >=20 may assign that code even though >=121 is the one you want as
>=121 is greater than 20, but the >=20 satisfied the if statements.

if (time >= 121) and (time <= 150) then code = 99291
if time >= 76 then code = 99290
if time >= 20 then code = 99289

If you were using <= then you would put the lower values first.


 Dave Shelby
(916) 734-3004
[EMAIL PROTECTED]


                                                                           
             "Bill Palmer"                                                 
             <[EMAIL PROTECTED]>                                              
             Sent by:                                                   To 
             [EMAIL PROTECTED]         <[email protected]>        
             WORKSTATION.COM                                            cc 
                                                                           
                                                                   Subject 
             02/14/2008 08:10          Re: [Talk] greater and less than    
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             [EMAIL PROTECTED]                                             
                 ATION.COM                                                 
                                                                           
                                                                           




The way it is written you will get only one code.  Plus you could get none
if the time is20, 75, 120 or 150.  If you want only one code then you need
to use "greater than or equal" "less than or equal" like this:

 if (time >= 20) and (time <= 75) then code = 99289
if (time >= 76) and (time =<120) then code = 99290
if (time >= 121) and (time <= 150) then code = 99291

If you want multiple codes for values over 75 then this

if time >= 20 then code = 99289
if time >= 76 then code = 99290
if (time >= 121) and (time <= 150) then code = 99291

--

Bill Palmer
Financial Coordinator, Information Systems
Mid-Columbia Medical Center
The Dalles, OR 97058
541-296-7417

>>> On 2/14/2008 at 7:45 AM, in message <000a01c86f20$a8ee8660
[EMAIL PROTECTED]>,
"Gary Williams" <[EMAIL PROTECTED]> wrote:
> I am working on a script that will take the time spent in our ER and
compare
> it with a chart to determine the CPT code to enter into meditech. Right
now I
> am trying something along these lines,
>
> if time > 20 or < 75 then code = 99289
> if time > 76 or <120 then code = 99290
> if time >121 or < 150 then code = 99291
>
> it seems like the first line will work but not go on to the second. Is
there
> a better way to do this? This is something my VB training hasn't covered
yet.
>
> Thanks,
> Gary Williams



Reply via email to