Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the Hours 1

Status
Not open for further replies.

mtownbound

Technical User
Jan 28, 2002
293
US

Running CR9 on 2000, Remedy on Oracle9i db.


Have a form that tracks the number of hours a customer spends in the hospital. However, this is a running clock, no timestamp. However, I do have a check in and check out date.

What I need to do is determine the average hours patients spent in the hospital for a specific month. For example I need to figure out how many hours customers spent in the hospital in July 2003. I can tell you how long a patient was in the hospital(in hours or days) with no problem, by using the patient name or record number. Just having an issue with when those days were.

Any ideas??


Thanks!!!!!!!![noevil]
 
I'm not clear...what exactly is it you are looking for?

If the patient check-in is on 2003/07/10 and check-out on 2003/07/13 and was timestamped as 70 hours - do you want them to show as an average of 17.5 hours per day posted to each of the following

2003/07/10
2003/07/11
2003/07/12
2003/07/13

Please post a sample of your table data with headers and a sample of your required results.
 
Not exactly......

Scenario:

- If a person checks in on April 1, 2003 and doesn't check out until August 1, 2003, then that spent the whole month of July in the hospital.

- Different patient checks in on July 5, 2003 and checks out July 23, 2003.

- Third patient checks in july 10, 2003 and hasn't checked out yet.

I need a formula to determine what were the average hours patients were in the hospital in July. My problem is I have a beginning and ending date and admission duration time, but I need a means to grab a particular "point in time".

Did I just confuse the hell outta ya??[thumbsup]


Thanks!!!!![noevil]
 

mtownbound : " Did I just confuse the hell outta ya??"


Sort of...please post a sample of your table data with headers for the 3 examples stated above, and your required results for that example.
 
Patient Number Check-In Release Date
SP2548856 4/10/2003 7/28/2003
SP2548864 5/15/2003 9/15/2003
SP2548874 7/16/2003 7/22/2003
SP2548942 7/20/2003 N/A


Of course these are fictitious numbers, but this is the format. Now what I need is to determine is how many patients were in the hospital in the month of July. It's pretty easy with the ones that checked in or out in July because I can just use DISTINCT{admission_records.checkinin_date} or {admission_records.release_date} is in the period 07/01/2003 to 07/31/2003, but what about the patients that didn't check in or out in July. How can I count those days for the month of July.

This sounds extremely easy, but i guess i'm having a brain fart!!!!


Thanks!!!!!
 
Whay you need is to make your own admission duration time to reflect only those hours of interest.

This means using 24*number of days the patient was in the hospital in July.

4 formulas might accomplish this:

record selection formula (Report->Edit Selection Formula-Record):
month({table.checkin}) <= 7
and
month({table.checkout}) >= 7

@min_date
if month({table.checkin}) <> 7 then
cdate(2003,7,1)
else
{table.checkin}

@max_date
if month({table.checkout}) <> 7 then
cdate(2003,7,31)
else
{table.checkout}

Now the number of days can be found with:
@Total_Hours
(@max_date-@min_date)*24

Now you can perform averaging against that formula (right click and select insert-Summary->Average).

-k

 

Let me try this and I'll let you know. Thanks for the formulas!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top