Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Started GET "/api/v1/chronic_diseases/employees" for ::1 at 2024-02-15 09:45:04 +0200
- MainApplication::Dbo::LegalEntity Load (0.5ms)
- SELECT "dbo"."LegalEntities".* FROM "dbo"."LegalEntities" WHERE "dbo"."LegalEntities"."Id" = 3228 LIMIT 1 [["Id", 3228],
- View::MvStatistic::Level0::Employee Load (2.6ms)
- SELECT mv_stat_lvl_0_employees.id,
- mv_stat_lvl_0_employees.full_name,
- COUNT(DISTINCT mv_stat_lvl_1_declarations.patient_id) AS total_counter,
- COUNT(DISTINCT mv_stat_lvl_1_patients.id) filter (WHERE mv_stat_lvl_1_patients.is_smoking = true AND mv_stat_lvl_1_patients.age BETWEEN 18 AND 69) AS smoking_counter,
- COUNT(DISTINCT mv_stat_lvl_2_imt_indices.patient_id) filter (WHERE mv_stat_lvl_1_patients.age BETWEEN 18 AND 69 AND mv_stat_lvl_2_imt_indices.imt_index > 25 AND mv_stat_lvl_2_imt_indices.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999' ) AS overweight_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('K85', 'K86', 'K87') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999' ) AS hypertension_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('T90') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS diabetes_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('R96') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS asthma_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code LIKE 'P%' AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS derangement_counter,
- COUNT(DISTINCT mv_stat_lvl_0_receptions.patient_id) filter (WHERE mv_stat_lvl_0_receptions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS reception_counter FROM "mv_stat_lvl_0_employees" LEFT OUTER JOIN "mv_stat_lvl_0_receptions" ON "mv_stat_lvl_0_receptions"."employee_id" = "mv_stat_lvl_0_employees"."id" LEFT OUTER JOIN "mv_stat_lvl_1_declarations" ON "mv_stat_lvl_1_declarations"."employee_id" = "mv_stat_lvl_0_employees"."id" LEFT OUTER JOIN "mv_stat_lvl_2_imt_indices" ON "mv_stat_lvl_2_imt_indices"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" LEFT OUTER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" LEFT OUTER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_0_employees"."legal_entity_id" = 3228 AND "mv_stat_lvl_0_employees"."employee_type_ref_value" = 'DOCTOR' GROUP BY mv_stat_lvl_0_employees.id, mv_stat_lvl_0_employees.full_name
- View::MvStatistic::Level1::Declaration Count (0.9ms)
- SELECT COUNT(DISTINCT mv_stat_lvl_2_imt_indices.patient_id) FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" INNER JOIN "mv_stat_lvl_2_imt_indices" ON "mv_stat_lvl_2_imt_indices"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228 AND "mv_stat_lvl_1_patients"."age" BETWEEN '18.0' AND '69.0' AND "mv_stat_lvl_2_imt_indices"."asserted_date" BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999'
- View::MvStatistic::Level1::Declaration Count (0.7ms)
- SELECT COUNT("mv_stat_lvl_1_declarations"."id") FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228
- View::MvStatistic::Level0::Employee Count (0.4ms)
- SELECT COUNT("mv_stat_lvl_0_employees"."id") FROM "mv_stat_lvl_0_employees" WHERE "mv_stat_lvl_0_employees"."legal_entity_id" = 3228 AND "mv_stat_lvl_0_employees"."employee_type_ref_value" = 'DOCTOR'
- View::MvStatistic::Level1::Declaration Count (0.7ms)
- SELECT COUNT("mv_stat_lvl_1_patients"."id") FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228 AND "mv_stat_lvl_1_patients"."age" BETWEEN '18.0' AND '69.0' AND "mv_stat_lvl_1_patients"."is_smoking" = true
- View::MvStatistic::Level1::Declaration Count (1.1ms)
- SELECT COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" INNER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228 AND "mv_stat_lvl_1_reception_conditions"."code" IN ('K85', 'K86', 'K87') AND "mv_stat_lvl_1_reception_conditions"."asserted_date" BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999'
- View::MvStatistic::Level1::Declaration Count (0.9ms)
- SELECT COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" INNER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228 AND "mv_stat_lvl_1_reception_conditions"."code" = 'T90' AND "mv_stat_lvl_1_reception_conditions"."asserted_date" BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999'
- View::MvStatistic::Level1::Declaration Count (0.9ms)
- SELECT COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" INNER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228 AND "mv_stat_lvl_1_reception_conditions"."code" = 'R96' AND "mv_stat_lvl_1_reception_conditions"."asserted_date" BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999'
- View::MvStatistic::Level1::Declaration Count (0.7ms) SELECT COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" INNER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = '3228' AND (mv_stat_lvl_1_reception_conditions.code LIKE 'P%') AND "mv_stat_lvl_1_reception_conditions"."asserted_date" BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999'
- CACHE View::MvStatistic::Level1::Declaration Count (0.0ms)
- SELECT COUNT("mv_stat_lvl_1_declarations"."id") FROM "mv_stat_lvl_1_declarations" INNER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_1_declarations"."legal_entity_id" = 3228
- View::MvStatistic::Level0::Employee Load (3.8ms)
- SELECT mv_stat_lvl_0_employees.id,
- mv_stat_lvl_0_employees.full_name,
- COUNT(DISTINCT mv_stat_lvl_1_declarations.patient_id) AS total_counter,
- COUNT(DISTINCT mv_stat_lvl_1_patients.id) filter (WHERE mv_stat_lvl_1_patients.is_smoking = true AND mv_stat_lvl_1_patients.age BETWEEN 18 AND 69) AS smoking_counter,
- COUNT(DISTINCT mv_stat_lvl_2_imt_indices.patient_id) filter (WHERE mv_stat_lvl_1_patients.age BETWEEN 18 AND 69 AND mv_stat_lvl_2_imt_indices.imt_index > 25 AND mv_stat_lvl_2_imt_indices.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999' ) AS overweight_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('K85', 'K86', 'K87') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999' ) AS hypertension_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('T90') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS diabetes_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code IN ('R96') AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS asthma_counter,
- COUNT(DISTINCT mv_stat_lvl_1_reception_conditions.patient_id) filter (WHERE mv_stat_lvl_1_reception_conditions.code LIKE 'P%' AND mv_stat_lvl_1_reception_conditions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS derangement_counter,
- COUNT(DISTINCT mv_stat_lvl_0_receptions.patient_id) filter (WHERE mv_stat_lvl_0_receptions.asserted_date BETWEEN '2024-01-01 00:00:00' AND '2024-02-15 23:59:59.999999') AS reception_counter FROM "mv_stat_lvl_0_employees" LEFT OUTER JOIN "mv_stat_lvl_0_receptions" ON "mv_stat_lvl_0_receptions"."employee_id" = "mv_stat_lvl_0_employees"."id" LEFT OUTER JOIN "mv_stat_lvl_1_declarations" ON "mv_stat_lvl_1_declarations"."employee_id" = "mv_stat_lvl_0_employees"."id" LEFT OUTER JOIN "mv_stat_lvl_2_imt_indices" ON "mv_stat_lvl_2_imt_indices"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" LEFT OUTER JOIN "mv_stat_lvl_1_reception_conditions" ON "mv_stat_lvl_1_reception_conditions"."patient_id" = "mv_stat_lvl_1_declarations"."patient_id" LEFT OUTER JOIN "mv_stat_lvl_1_patients" ON "mv_stat_lvl_1_patients"."id" = "mv_stat_lvl_1_declarations"."patient_id" WHERE "mv_stat_lvl_0_employees"."legal_entity_id" = 3228 AND "mv_stat_lvl_0_employees"."employee_type_ref_value" = 'DOCTOR' GROUP BY mv_stat_lvl_0_employees.id, mv_stat_lvl_0_employees.full_name LIMIT 15 OFFSET 0
- Completed 200 OK in 41ms (Views: 0.3ms | ActiveRecord: 13.1ms | Allocations: 11806)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement