I am currently trying to pull data for a specific patient population:
Patients under the age of 65
Are Diabetic
Not had a HGBA1C between a certain date range
I have ran this and still getting "0" returns. I did get a listing of patients that fit the first two criteria, but once I put in the date ranges it pulls null. Even though with spot checking the patient list on the first 2 variables I find patients that would fit into it. I am not sure what could be missing. Currently Using the CPS Inquiry feature.
Any help would be greatly appreciated!
This SQL script should help, you might need to add additional OBS terms depending on the practice and what they use. And just change the dates.
SELECT *
FROM PatientProfile AS PP
WHERE dbo.PatientAgeInYears(Birthdate) < 65 AND pstatus = 'A' AND
(SELECT COUNT(*) FROM PROBLEM WHERE CHANGE IN (2,6) AND PID = PP.PID AND CODE LIKE '%250.%') > 0 AND
(SELECT COUNT(*) FROM OBS WHERE PID = PP.PID AND HDID IN (28) AND OBSDATE BETWEEN '1/1/2015' AND '12/31/2015') = 0
Would I be able to use this under the Inquiry section? Or do I need to use this in another place? I normally only work within the Inquiry section.
You can use this with SQL Server Management, Excel, Crystal or anything else you can query your CPS database with.
Ok thank you very much.
So I do not have access to run this script. I need to be able to pull this via the Inquiry Section of the Chart Reports. Do you have any insight from within the Inquiry section?
Yes, do the following steps:
- In Chart Reports Inquiry, change Find to Patients.
- Where to Date of Last Observation
- From the search screen, click on your OBS Term, ie. HGBA1C
- change to is before
- input the date
- Click on Add
- Check Mark Active Patients Only
- Now change Where to Problem Code ICD-9, Active
- change to contains
- input 250. <- Don't forget the dot
- Click on Add
- Change Where to Birthdate
- change to on or after
- input the date of birth that would make a person tomorrow 65, so if you were doing this today, you would input 5/20/1950
- Click on Add
Now you can run the search or count. This should work for you.
Should look like this in the table of Find Patients where:
Date of Last HGBA1C is before 'DATE'
AND Problem Code ICD-9, Active contains '250.'
AND Birthdate is on or after '05/20/1950'
Inquiries just will not do an accurate job of this. It (Inquiries) is a very simple tool. Why does it have to be with Inquiries, since Crystal or SQL would better handle the logic?
To prove my point, find patients
Problem Code contains 250. (as previously stated) and birthdate on/after 5/20/1950. This just gave me 2785 patients.
Now, add logic for last obs (HGBA1C) is blank. My inquiry said 350 patients.
So, while 'acantu' solution will be close, you will need to find the patients without any HGBA1C also. Thus, you will need two inquiries to be run.
You are correct joeg1962, the best solution would be sql script that I posted originally.
We will have the ability to run the script within Crystal soon. We were able to run the Inquiry and found the population we needed. So while it is a simple tool, it did work for this purpose (I did need to change my problem variable, was running for a specific code and needed to run Diabetes for example from 250.00 to just 250.) this helped a lot to capture more patients. I am hoping that when we can run Crystal, I will not need to use the Inquiry section any longer. Thank you both for your input!