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 <[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
