Dialysis Starter Charts

Dialysis starters data (Graph1)

Each percentage bar chart shows the percentage of items in dashboarddata by list_status (no_decision, working_up, active, unsuitable, suspended) at a quarter for the selected unit.

E.g., Preston at Q1 2018 proportion of list_status = "working_up"

select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and list_status = "working_up" and quarter_id=2 / select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and quarter_id=2 * 100 → 7 / 26 * 100 = 26.92%

Patients who are still being “Working up or under discussion” (Graph2)

This graph presents a line graph per unit, where all units belong to the same region. The chart also includes a line graph for the region. Each point of a line graph represents the percentage of items in dashboarddata per unit, per quarter_id and list_status=”working_up'” over all dashboarddata items for all list_status and indicated unit, quarter_id.

E.g., Preston at Q1 2018 proportion of list_status = "working_up"

select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and list_status = "working_up" and quarter_id=2 / select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and quarter_id=2 * 100 → 7 / 26 * 100 = 26.92%

Each point of the region line graph computed as: region_count / region_total_count * 100, is equivalent to the following query:

E.g., North West region at Q1 2020 and list_status = “working_up”

select count(*) from txfirst_dashboarddata left join users_unit on unit_id = users_unit.id where region_id = 3 and list_status = "working_up" and quarter_id=17 / select count(*) from txfirst_dashboarddata left join users_unit on unit_id = users_unit.id where region_id = 3 and quarter_id=17 * 100 → 15 / 54 * 100 = 27.78%

Patients who have “No documented decision status” (Graph3)

Similar computation as Graph2 with list_status = “no_decision”. This graph presents a line graph per unit, where all units belong to the same region. The figure also includes a line graph for the region. Each point of a line graph represents the proportion in percentage of items in dashboarddata per unit, per quarter_id and list_status=”no_decision” over all dashboarddata items for all list_status and indicated unit, quarter_id.

E.g., Preston at Q1 2018 proportion of list_status = "no_decision"

select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and list_status = "no_decision" and quarter_id = 2 / select count(*) as count1 from txfirst_dashboarddata where unit_id = 4 and quarter_id = 2 * 100 → 1 / 26 * 100 = 3.85%

Each point of the region line graph in the code is computed as region_count / region_total_count * 100, which is equivalent to the following query:

E.g., North West region at Q1 2020 and list_status = “no_decision”

select count(*) from txfirst_dashboarddata left join users_unit on unit_id = users_unit.id where region_id = 3 and list_status = "no_decision" and quarter_id=17 / select count(*) from txfirst_dashboarddata left join users_unit on unit_id = users_unit.id where region_id = 3 and quarter_id=17 * 100 → 4 / 54 * 100 = 7.41%

Under Reasons why patients were still in category "working up or under discussion" at time of starting dialysis

Proportions (Graph4)

Proportion of dashboardata items per reason_id, quarter_id over all dashboarddata items of a quarter_id in a unit.

E.g., Preston Q1 2018

select quarter_id, reason_id, count(reason_id) as count1 from txfirst_dashboarddata left join txfirst_quarter on quarter_id = txfirst_quarter.id where unit_id = 4 and txfirst_quarter.quarter = 201801 and list_status = "working_up" group by reason_id order by quarter_id

Result:

quarter_idreason_idcount1

2

1

4

2

2

1

2

4

2

Then the bars of Preston at quarter 201801 and list_status=”working_up” depict the following:

Reason_id = 1 (Referred for Assessment when eGFR < 15) proportion: 4/7 * 100 = 57.14%
Reason_id = 2 (Referred for assessment within 1 year of predicted date of reaching ESRF) proportion: 1/7 * 100 = 14.29%
Reason_id = 4 (Medically Complex) proportion: 2/7 * 100 = 28.57%

Absolute numbers (Graph5)
The same computation as Graph4 is used (function get_reasons) except that percentage argument is equal to false.
Each bar then represents the amount of dahsboardata items per reason, per quarter_id for list_status = “working_up” in a unit.

Under Reasons why patients were in the "not documented" category at time of starting dialysis

Proportions (Graph6)

Same calculation as Graph4 with function get_reasons and argument list_status="no_decision".

Absolute numbers (Graph7)
Same calculation as Graph4 with function get_reasons and arguments list_status="no_decision", percentage=False.


Main functions used for the graphs 4-7 called by get_reasons function

get_reason_counts function – sum of all dashboarddata records per reason_id, unit_id, quarter_id (all quarters: >= some quarter_id) in a unit
E.g., select quarter_id, reason_id, count(reason_id) as count1 from txfirst_dashboarddata left join txfirst_quarter on quarter_id = txfirst_quarter.id where unit_id = 4 and txfirst_quarter.quarter >= 201601 and list_status = "working_up" group by quarter_id, reason_id order by quarter_id

Similar to:

select quarter_id, reason_id, count(reason_id) as count1 from txfirst_dashboarddata where unit_id = 4 and quarter_id >= 1 and list_status = "working_up" group by quarter_id, reason_id order by quarter_id


get_total_counts function – sum of all dashboarddata records per list_status and quarter_id >= some quarter_id in a unit
E.g., select quarter_id, count(quarter_id) as count1 from txfirst_dashboarddata left join txfirst_quarter on quarter_id = txfirst_quarter.id where unit_id = 4 and txfirst_quarter.quarter >= 201601 and list_status = "working_up" group by quarter_id order by quarter_id

or:

select quarter_id, count(quarter_id) as count1 from txfirst_dashboarddata where unit_id = 4 and list_status = "working_up" and quarter_id >= 1 group by quarter_id order by quarter_id