sbbrown9924
Technical User
Please help me get organized around a query I need to write. I need to measure waiting room times by every hour in the day in an ER. Currently there is an archive database of all patient encounters and within the record of a patient encounter there is the TriageTime and InRoomTime. The interval between these two timestamps is the time a patient spends waiting in the waiting room (right out of the department of redundancy department!).
I know how to determine that basic interval ( datediff('n',TriageTime, InRoomTime) ) but for the rest I'm clueless.
What I'd like to be able to do is take the entire database and for every hour, take a snapshot of how many people are waiting and what the average and max waiting times are for that hour.
So the output would be:
...
Time # of Patients Average Wait Longest Wait
6am 10,545 45min 2:30
7am 12,444 47min 2:45
8am 15,376 1:05 3:07
...
...
Thanks.
I know how to determine that basic interval ( datediff('n',TriageTime, InRoomTime) ) but for the rest I'm clueless.
What I'd like to be able to do is take the entire database and for every hour, take a snapshot of how many people are waiting and what the average and max waiting times are for that hour.
So the output would be:
...
Time # of Patients Average Wait Longest Wait
6am 10,545 45min 2:30
7am 12,444 47min 2:45
8am 15,376 1:05 3:07
...
...
Thanks.