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!

Calculate percentage in specific requirements 2

Status
Not open for further replies.

kate8

Programmer
Feb 14, 2001
184
US
Hi,
I need create a report that provides the percentage of patients who had the most recent blood pressure in standard for each Doctor. That means the report will show, for example, Dr. A has 10 patients, pt A has 3 blood pressures in a time period, the report needs check the most current blood pressure and see if it is in the standard, if it is, then count this patient in. Check all 10 patients and see how many pt had their most current blood pressure in the standard measure, and give the % for Dr.A, and so on.
I group the Doctor, then group the patients under Doctor, create formula for the most current blood pressure, then create another formula to check if the BP is in the standard. Since the most current BP is under the patient group too, I can’t get the most current BP and check the Blood Pressure at the same time…I hope someone can understand what I mean…I created a formula which check the if it is the most current BP and if it meets the standard, then patient ID. When counting this formula, I was told this formula can’t be counted. I know what the problem is, but don’t know how to fix it.
Is there a way to get this percentage?
Thank you so much for any suggestions and helps!!!
 
Here is one way.

Create a formula that is 1 if it is in range and 0 if out of range.

Create a Running Total that Sums that formula, counts on change of Group (the group of your patient), and resets of change of Group (group of your doctor).

 
Hi Charliy,

Thank you so much for your respond!
My issue is that when check the BP range, that BP must be the most current one for the patient. So I also need group all the BP measure date and check the most current one. When I did that -- make sure the BP is the most current one and check the BP range, then that formula won't be able to be counted/sum in running total.

I am thinking maybe I need do part of it in command...
Any other suggestions?
Thank you!!
 
I did a little experimenting - instead of evaluating the running total on change of group, do an evaluate on this formula:

ONLASTRECORD
OR {table.patient_id} <> NEXT({table.patient_id})

as long as your BP's are in sequence, only the last one will be counted. I ran it with some test data and got the right results.
 
Charliy,

Thank you!!
That works if I only select the patient records which have BP measure, otherwise if the last patient record has no BP measure, but has BP in other days, then will lose one count. I am checking with my user, I think that should be fine. I use {table.patient_id} <> NEXT({table.patient_id}.
Again,thank you for your helps!!

 
Create a formula like this:

//{@BPdate}:
if {table.test} = "BP" then
{table.date}

Then in the running total, use a distinctcount of {table.patient} and then use a formula in the evaluation section like this:

{@BPdate}=maximum({@BPdate},{table.patient}) and
{table.bp} in <your range formula>

Reset on change of doctor.

-LB
 
lbass,

Thank you so much!! It works perfect!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top