AnsweredAssumed Answered

ExecuteSQL Calculation Question

Question asked by mikeo'neil on Nov 13, 2017
Latest reply on Nov 13, 2017 by mikeo'neil

Hi Folks,

 

I am using ExecuteSQL to obtain data for a Chart Series.

 

FMA 16.03 OSX 10.11.6

Constant is Number field

Alert_Type = Text field

Shift = Text field

Discharge_Code is Number field

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Outcome WHERE Alert_Type = 'C Arrest' AND Discharge_Code  =  1  GROUP BY Shift" ; "" ; "" ) This works with one single Discharge_Code

 

What I am trying to do is in this Series is to pull accumulated data/counts. I have up to 10 Discharge Codes and in the above calculation; it is only pulling data totals from one Discharge Code, even though I tried;

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Outcome WHERE Alert_Type = 'C Arrest' AND Discharge_Code  =  1 and Discharge_Code  =  3    GROUP BY Shift" ; "" ; "" ) This failed.

.

Example: 

What I want to do is to pull data from a combination of Discharge Codes.

I want to show a chart that displays by Fire Department work shift, the total number of Cardiac Arrest patients that were discharged to their home, a Rehabilitation Center, or transferred to another facility.

 

Or I want to show a chart that displays by Fire Department work shift, the total number of Cardiac Arrest patients that were discharged to Hospice, Expired or sent to a Skilled Nursing Facility.

 

Thanks-Mike

Outcomes