| |
|
|
PostTime:12/16/2008 2:33:36 PM |
Point:0
| #
1
|
Level:
1 
Professional point:
58 
Experience:
4 
Thread:
255 
Post:
956 
Joined date:
4/28/2007 11:29:00 PM
Last Visit:
12/16/2008 11:28:56 PM
|
I only have one table in which all of the data is stored. It was built this way so that data entry would be easier. This is information that was collected to monitor quality of care issues.
|
| |
|
|
|
|
| |
|
|
PostTime:12/16/2008 2:54:01 PM |
Point:0
| #
2
|
Level:
1 
Professional point:
83 
Experience:
2 
Thread:
242 
Post:
980 
Joined date:
4/28/2007 10:38:00 PM
Last Visit:
12/16/2008 11:40:24 PM
|
hotdiamond, can you post the database with a small amount of "dummy data" so that we can look at it and possibly give some more help?
|
| |
|
|
|
|
| |
|
|
PostTime:12/16/2008 3:12:53 PM |
Point:0
| #
3
|
Level:
1 
Professional point:
46 
Experience:
6 
Thread:
265 
Post:
966 
Joined date:
4/29/2007 12:00:00 AM
Last Visit:
12/17/2008 12:21:04 AM
|
Assuming you have a table with the following fields: Provider_ID as Number Patient_ID as Number Visit_Count as Number Lab_Count as Number Eye_Exam_Count as Number Pap_Smear_Count as Number
You could create a union Query as follows: (Note you can only do union queries in SQL - although you can create each part of the union query in a design window and then copy the SQL to a union query)
--- SQL Example Below -----
SELECT tblPatient.ProviderID, tblPatient.Patient_ID, tblPatient.Visit_Count AS [Counter], "Visit" AS Type FROM tblPatient
Union
SELECT tblPatient.ProviderID, tblPatient.Patient_ID, tblPatient.Lab_Count AS [Counter], "Lab" AS Type FROM tblPatient
Union
SELECT tblPatient.ProviderID, tblPatient.Patient_ID, tblPatient.Eye_Exam_Count AS [Counter], "Eye" AS Type FROM tblPatient
Union
SELECT tblPatient.ProviderID, tblPatient.Patient_ID, tblPatient.Pap_Smear_Count AS [Counter], "Pap" AS Type FROM tblPatient;
----- Source Data -------- Patient_ID ProviderID Visit_Count Lab_Count Eye_Exam_Count Pap_Smear_Count 1 1 23 2 1 0 2 1 5 1 0 0 3 2 15 0 1 0 4 2 2 0 0 1
----- Resulting Data ---------- ProviderID Patient_ID Counter Type 1 1 0 Pap 1 1 1 Eye 1 1 2 Lab 1 1 23 Visit 1 2 0 Eye 1 2 0 Pap 1 2 1 Lab 1 2 5 Visit 2 3 0 Lab 2 3 0 Pap 2 3 1 Eye 2 3 15 Visit 2 4 0 Eye 2 4 0 Lab 2 4 1 Pap 2 4 2 Visit
|
| |
|
|
|
|
| |
|
|
PostTime:12/16/2008 4:54:14 PM |
Point:0
| #
4
|
Level:
1 
Professional point:
98 
Experience:
2 
Thread:
272 
Post:
982 
Joined date:
4/28/2007 11:38:00 PM
Last Visit:
12/17/2008 12:23:56 AM
|
Well. You might be able to use a crosstab query of labs per patient grouped by physician if you use some self-joins. I should say, any SQL solution is going to involve self-joins if you want to do it all in one shot. Otherwise you'll just have to build a query for each physician. That's why normalization is so important when you start designing a database. A lot of people say the requirement doesn't necessitate a normalized design, but it's always worth the extra effort up front.
Sorry.
chris.
|
| |
|
|
|
|
| |
|
|
PostTime:12/16/2008 6:54:41 PM |
Point:0
| #
5
|
Level:
1 
Professional point:
96 
Experience:
6 
Thread:
271 
Post:
1040 
Joined date:
4/28/2007 11:55:00 PM
Last Visit:
12/16/2008 11:36:22 PM
|
It all depends on your table structure (like just about anything in a relational database); this will be fairly easy if you've established your relationships correctly. If you have a table for each patient, a table for patients per doctor, a table of visits per patient, and a table of labs per visit, you could build a report that presents patient statistics grouped by physician.
If, on the other hand, your database is not normalized, this will probably be very difficult.
It's hard to say more without specific information.
chris.
|
| |
|
|
|
|
| |
|
|
PostTime:12/16/2008 11:53:40 PM |
Point:0
| #
6
|
Level:
1 
Professional point:
46 
Experience:
6 
Thread:
265 
Post:
966 
Joined date:
4/29/2007 12:00:00 AM
Last Visit:
12/17/2008 12:21:04 AM
|
I usually use an IIF statement in the query. If you look at the previous query, I'll change the lab line
SELECT tblPatient.ProviderID, tblPatient.Patient_ID, IIf([tblPatient].[Lab_YN],1,0) AS [Counter], "Lab" AS Type FROM tblPatient;
This query creates a source for your crosstab query or reports. You can sum, avg, std, or whatever you like to it after you've created the Union Query.
|
| |
|
|
|
|
| |
|
|
PostTime:12/17/2008 12:10:08 AM |
Point:0
| #
7
|
Level:
1 
Professional point:
5 
Experience:
28 
Thread:
261 
Post:
1005 
Joined date:
4/29/2007 2:32:00 AM
Last Visit:
12/17/2008 12:22:50 AM
|
Thanks for the great advice everyone. I actually ran a crosstab query to group the providers, and then I created a report from the crosstab query to show the compliance rates. Thanks again!
|
| |
|
|
|
|
| |
|
|
PostTime:12/17/2008 12:46:22 AM |
Point:0
| #
8
|
Level:
1 
Professional point:
0 
Experience:
11 
Thread:
265 
Post:
940 
Joined date:
4/28/2007 10:35:00 PM
Last Visit:
12/16/2008 11:40:39 PM
|
Thanks for the replies everyone. I'm in a hurry right now and can't really answer any of the questions. I'll reply back later. But just as a quick note, all of the fields I need to calculate are not numbers. 2 of the fields are number fields and 2 are yes/no fields. Will this make it more difficult to calculate? I really need to use the count function first and then find out the percentage. Is this possible? I would think that there would be some way to count all yes's, no's, get a number and then calculate the percentage. Please let me know if this is not possible and I'll try to think of another way.
Thanks again guys.
|
| |
|
|
|
|
| 1 |