Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Started GET "/api/v1/quality_indicators" for ::1 at 2024-02-02 11:19:43 +0200
- -- Processing by Api::V1::QualityIndicatorsController#index as HTML
- -------
- SELECT "dbo"."LegalEntities".* FROM "dbo"."LegalEntities" WHERE "dbo"."LegalEntities"."Id" = $1 LIMIT $2 [["Id", 3228], ["LIMIT", 1]]
- SELECT "mv_stat_legal_entity_total_receptions".* FROM "mv_stat_legal_entity_total_receptions" WHERE "mv_stat_legal_entity_total_receptions"."legal_entity_id" = $1 LIMIT $2 [["legal_entity_id", 3228], ["LIMIT", 1]]
- SELECT "mv_stat_legal_entity_total_service_requests".* FROM "mv_stat_legal_entity_total_service_requests" WHERE "mv_stat_legal_entity_total_service_requests"."legal_entity_id" = $1 LIMIT $2 [["legal_entity_id", 3228], ["LIMIT", 1]]
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT "mv_stat_legal_entity_total_completed_service_requests".* FROM "mv_stat_legal_entity_total_completed_service_requests" WHERE "mv_stat_legal_entity_total_completed_service_requests"."legal_entity_id" = $1 LIMIT $2 [["legal_entity_id", 3228], ["LIMIT", 1]]
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE')
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228) AND ("mv_stat_declarations"."declaration_status_code" = 'ACTIVE') AND (EXTRACT(YEAR FROM CAST(asserted_date AS DATE)) = 2024)
- SELECT COUNT("mv_stat_declarations"."id") FROM "mv_stat_declarations" WHERE ("mv_stat_declarations"."legal_entity_id" = 3228)
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT "mv_stat_legal_entity_total_reception_conditions".* FROM "mv_stat_legal_entity_total_reception_conditions" WHERE "mv_stat_legal_entity_total_reception_conditions"."legal_entity_id" = $1 LIMIT $2 [["legal_entity_id", 3228], ["LIMIT", 1]]
- SELECT COUNT(DISTINCT patient_id) FROM "mv_stat_receptions_conditions" WHERE "mv_stat_receptions_conditions"."legal_entity_id" = $1 AND "mv_stat_receptions_conditions"."legal_entity_id" = $2 AND "mv_stat_receptions_conditions"."prescription_program_id" = $3 AND "mv_stat_receptions_conditions"."medication_prescriptions_ehealth_status" IN ($4, $5) [["legal_entity_id", 3228], ["legal_entity_id", 3228], ["prescription_program_id", 1], ["medication_prescriptions_ehealth_status", 0], ["medication_prescriptions_ehealth_status", 1]]
- ↳ app/services/calculators/chronic_medication_rate_count_service.rb:27:in `specific_patients_count'
- Views::MvStatEmployeesParty Count (24.8ms) SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'ASSISTANT') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT COUNT("mv_stat_employees_parties"."Id") FROM "mv_stat_employees_parties" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED')
- SELECT COUNT(DISTINCT patient_id) AS "count_distinct_patient_id", legal_entity_id, patient_id AS "legal_entity_id_patient_id" FROM "mv_stat_receptions_conditions" WHERE "mv_stat_receptions_conditions"."legal_entity_id" = $1 GROUP BY legal_entity_id, patient_id HAVING (count(icpc2_code_id) = 1) [["legal_entity_id", 3228]]
- ELECT COUNT(DISTINCT patient_id) AS "count_distinct_patient_id", legal_entity_id, patient_id AS "legal_entity_id_patient_id" FROM "mv_stat_receptions_conditions" WHERE "mv_stat_receptions_conditions"."legal_entity_id" = $1 AND "mv_stat_receptions_conditions"."prescription_program_id" = $2 AND "mv_stat_receptions_conditions"."medication_prescriptions_ehealth_status" IN ($3, $4) GROUP BY legal_entity_id, patient_id HAVING (count(icpc2_code_id) = 1) [["legal_entity_id", 3228], ["prescription_program_id", 1], ["medication_prescriptions_ehealth_status", 0], ["medication_prescriptions_ehealth_status", 1]]
- SELECT COUNT(DISTINCT patient_id) AS "count_distinct_patient_id", legal_entity_id, patient_id AS "legal_entity_id_patient_id" FROM "mv_stat_receptions_conditions" WHERE "mv_stat_receptions_conditions"."legal_entity_id" = $1 AND "mv_stat_receptions_conditions"."prescription_program_id" = $2 AND "mv_stat_receptions_conditions"."medication_prescriptions_ehealth_status" IN ($3, $4) GROUP BY legal_entity_id, patient_id HAVING (count(icpc2_code_id) = 1) [["legal_entity_id", 3228], ["prescription_program_id", 1], ["medication_prescriptions_ehealth_status", 0], ["medication_prescriptions_ehealth_status", 1]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement