Query | Affected | Num. rows | Took (ms) | Actions |
---|
SELECT `County`.`county_name`, COUNT(*) as cnt, `County`.`id` FROM `pvers`.`transfusions` AS `Transfusion` LEFT JOIN `pvers`.`counties` AS `County` ON (`Transfusion`.`county_id` = `County`.`id`) WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY `County`.`county_name`, `County`.`id` HAVING COUNT(*) > 0 | 13 | 13 | 423 | maybe slow |
SELECT `Designation`.`name`, COUNT(*) as cnt, `Designation`.`id` FROM `pvers`.`transfusions` AS `Transfusion` LEFT JOIN `pvers`.`designations` AS `Designation` ON (`Transfusion`.`designation_id` = `Designation`.`id`) WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY `Designation`.`name`, `Designation`.`id` HAVING COUNT(*) > 0 | 3 | 3 | 2 | maybe slow |
SELECT `County`.`id`, `County`.`county_name` FROM `pvers`.`counties` AS `County` WHERE 1 = 1 ORDER BY `County`.`county_name` ASC | 49 | 49 | 0 | |
SELECT `Transfusion`.`gender`, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY gender HAVING COUNT(*) > 0 | 2 | 2 | 2 | |
SELECT ((case
when trim(age_years) in ('neonate', 'infant', 'child', 'adolescent', 'adult', 'elderly') then age_years
when year(now()) - right(date_of_birth, 4) between 0 and 1 then 'infant'
when year(now()) - right(date_of_birth, 4) between 1 and 10 then 'child'
when year(now()) - right(date_of_birth, 4) between 18 and 65 then 'adult'
when year(now()) - right(date_of_birth, 4) between 10 and 18 then 'adolescent'
when year(now()) - right(date_of_birth, 4) between 65 and 155 then 'elderly'
else 'unknown'
end)) as ager, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY ((case
when trim(age_years) in ('neonate', 'infant', 'child', 'adolescent', 'adult', 'elderly') then age_years
when year(now()) - right(date_of_birth, 4) between 0 and 1 then 'infant'
when year(now()) - right(date_of_birth, 4) between 1 and 10 then 'child'
when year(now()) - right(date_of_birth, 4) between 18 and 65 then 'adult'
when year(now()) - right(date_of_birth, 4) between 10 and 18 then 'adolescent'
when year(now()) - right(date_of_birth, 4) between 65 and 155 then 'elderly'
else 'unknown'
end)) HAVING COUNT(*) > 0 | 5 | 5 | 2 | maybe slow |
SELECT year(ifnull(created, created)) as year, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY year(ifnull(created, created)) HAVING COUNT(*) > 0 ORDER BY `year` ASC | 4 | 4 | 2 | maybe slow |
SELECT ((case
when reaction_fever is not null then 'Fever'
when reaction_chills is not null then 'Chills/Rigors'
when reaction_flushing is not null then 'Flushing'
when reaction_vomiting is not null then 'Nausea/Vomiting'
when reaction_dermatological is not null then reaction_dermatological
when reaction_chest is not null then 'Chest pain'
when reaction_dyspnoea is not null then 'Dyspnoea'
when reaction_hypotension is not null then 'Hypotension'
when reaction_tachycardia is not null then 'Tachycardia'
when reaction_dark is not null then 'Haemoglobinuria- Dark urine'
when reaction_oliguria is not null then 'Oliguria'
when reaction_anuria is not null then 'Anuria'
when reaction_haematological is not null then 'Unexplained bleeding'
when reaction_other is not null then 'Others'
else 'N/A'
end)) as rtype, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY ((case
when reaction_fever is not null then 'Fever'
when reaction_chills is not null then 'Chills/Rigors'
when reaction_flushing is not null then 'Flushing'
when reaction_vomiting is not null then 'Nausea/Vomiting'
when reaction_dermatological is not null then reaction_dermatological
when reaction_chest is not null then 'Chest pain'
when reaction_dyspnoea is not null then 'Dyspnoea'
when reaction_hypotension is not null then 'Hypotension'
when reaction_tachycardia is not null then 'Tachycardia'
when reaction_dark is not null then 'Haemoglobinuria- Dark urine'
when reaction_oliguria is not null then 'Oliguria'
when reaction_anuria is not null then 'Anuria'
when reaction_haematological is not null then 'Unexplained bleeding'
when reaction_other is not null then 'Others'
else 'N/A'
end)) HAVING COUNT(*) > 0 | 6 | 6 | 4 | maybe slow |
SELECT `Transfusion`.`previous_reactions`, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`previous_reactions` != '' GROUP BY previous_reactions HAVING COUNT(*) > 0 | 2 | 2 | 2 | |
SELECT `Transfusion`.`previous_transfusion`, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`previous_transfusion` != '' GROUP BY previous_transfusion HAVING COUNT(*) > 0 | 2 | 2 | 2 | |
SELECT DATE_FORMAT(created, "%b %Y") as month, month(ifnull(created, created)) as salit, COUNT(*) as cnt FROM `pvers`.`transfusions` AS `Transfusion` WHERE `Transfusion`.`submitted` IN (1, 2) AND `Transfusion`.`copied` != 1 GROUP BY DATE_FORMAT(created, "%b %Y"), salit HAVING COUNT(*) > 0 ORDER BY `salit` ASC | 14 | 14 | 2 | maybe slow |