7 Replies Latest reply on Jan 5, 2017 6:09 AM by Jeffrey Kritzman

# Help with counting emergency visits please

Hi,

Due to the privacy considerations I have made up an excel table.

I would really appreciate if someone can give me a solution to

- count emergency visits for each patient that was discharged yesterday (i.e. 21/12/2016) for the last 6 months

each patient has a unique chart number, and each chart number has multiple visits (account numbers)

- if the patient has 0 to 3 visits prior to admission within the last 6 months than give me the count

- if the patient has more than 3 visits than 4

- if the last emergency visit triggered the admission do not count

please check the excel table attached

• ###### 1. Re: Help with counting emergency visits please

Mihaela,

I see three steps to your solution, but let me know if you can't do any of them.

1. Create a calculation for a count of ER visits for people discharged yesterday and remove those where the last ER visit triggered the admission. It will look like this:

If ATTR([Date Of Discharge]) = (TODAY()-1)

AND ATTR([Admission Date]) != ATTR([ER Date Time])

THEN ([Er_Visits])

END

2. Add a date filter (Date of Discharge?) and select Relative Date. Set this to 6 months.

3. Create a case statement to bucket your results on the first calculation. It would look something like this:

If [ER_Visits Discharged Yesterday] < 4 THEN [ER_Visits Discharged Yesterday]

ELSEIF [ER_Visits Discharged Yesterday] > 3 THEN 4

END

Let me know if any of this doesn't work for you or if I missed something.

-Wesley

• ###### 2. Re: Help with counting emergency visits please

Hi Wesley,

I apologize for the delay, I was a few days off for Christmas!

even if I try just to count er_visits is not working properly

IF

COUNT([Account Number])<=3

THEN

COUNT([Account Number])

ELSE 4

END

I tried this

{ INCLUDE [Unit Number]:SUM(INT([Account Number]))}

any other ideas please and thank you very much!

• ###### 3. Re: Help with counting emergency visits please

Mihaela,

Based on the sample data you provided, there is only one instance of each Account Number so calculating the er_visits will just return 1 each time. It looks like you're calculating it correctly, but the data won't give you a dynamic response. Let me know if you're still having problems

-Wesley

• ###### 4. Re: Help with counting emergency visits please

Hi Mihaela,

Are there multiple lines of data per Account Number in your actual data set?  If so, if you add some of these to the example data and re-post it, we might be able to help more.

Best,

Jeff

• ###### 5. Re: Help with counting emergency visits please

Hi Wesley,

Thank you very much,

I think the problem is that I have to count the er account number only for people discharged yesterday therefore I have to filter the discharge date, then I have to count the er visits for the last 6 months, but the date is already filtered.

Thank you very much for your time and support.

• ###### 6. Re: Help with counting emergency visits please

Hi Jeffrey,

the account number is unique for each visit (it doesn't matter if it's an admission or er visits or radiology) and all of these visits are rolled up into the chart number.

Then for each chart number that was discharged yesterday I have to count the er visits which are Exxx alphanumeric.  But the er visits must be counted for the last 6 months, and I already filtered the data by the discharged date time.

Thank you very much, any help is appreciated!

• ###### 7. Re: Help with counting emergency visits please

Hi Mihaela,

There isn't a chart number column in your example data - if you included this, we should be able to help.

Jeff