Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============================================================
- SELECT COUNT("dbo"."Employees"."Id") FROM "dbo"."Employees" INNER JOIN "dbo"."Parties" ON "dbo"."Employees"."PartyId" = "dbo"."Parties"."Id" WHERE "dbo"."Parties"."LegalEntityId" = 867 AND "dbo"."Employees"."EmployeeTypeRefValue" = 'DOCTOR' AND ("dbo"."Employees"."EmployeeStatusRefValue" = 'APPROVED') AND ("dbo"."Employees"."CreationTime" <= '2023-11-23 21:59:59.999999')
- ============================================================
- SELECT "ehr_ehealth_groups".* FROM "ehr_ehealth_groups" WHERE "ehr_ehealth_groups"."code" = 'CON100' LIMIT 1
- SELECT "ehr_ehealth_services"."id" FROM "ehr_ehealth_services" INNER JOIN "ehr_ehealth_service_groups" ON "ehr_ehealth_services"."id" = "ehr_ehealth_service_groups"."ehr_ehealth_service_id" WHERE "ehr_ehealth_service_groups"."ehr_ehealth_group_id" = 2152
- SELECT COUNT("calendar_events"."id") FROM "calendar_events" INNER JOIN "ehr_direction_service_requests" ON "ehr_direction_service_requests"."id" = "calendar_events"."service_request_id" INNER JOIN "ehr_ehealth_services" ON "ehr_ehealth_services"."id" = "ehr_direction_service_requests"."service_requestable_id" WHERE "calendar_events"."legal_entity_id" = 867 AND "calendar_events"."state" = 'approved' AND "ehr_direction_service_requests"."status" IN ('completed', 'active') AND (calendar_events.created_at <= '2023-11-23 21:59:59.999999') AND "ehr_ehealth_services"."id" IN (9005, 9010, 495917, 495958, 9008, 8978, 495927, 495922, 495947, 495920, 495932, 495931, 495925, 495950, 495961, 8986, 8988, 495933, 9000, 9001, 495937, 495939, 495926, 495946, 495945, 495928, 495929, 495913, 495923, 8999, 8983, 495911, 495914, 495916, 495936, 495938, 495943, 495930, 9007, 8979, 495934, 495935, 495940, 495949, 495951, 495953, 495954, 495955, 495959, 495960, 495963, 495964, 495952, 495956, 495915, 495918, 426962, 8980, 8981, 495948, 8993, 3227384, 3227383, 495921, 2247922, 8990, 8994, 9003, 8984, 8997, 8985, 8995, 495942, 495941, 495944, 9012, 9006, 8998, 8989, 495924, 8987, 495962, 495919, 9002, 9014, 8991, 9004, 8992, 8982, 8996, 9009, 495957, 8977, 495912, 9011, 9013)
- =============================================================
- SELECT COUNT(receptions.patient_id) AS count_receptions_patient_id, receptions.patient_id AS receptions_patient_id FROM "receptions" INNER JOIN "ehr_conditions" ON "ehr_conditions"."encounter_id" = "receptions"."id" INNER JOIN "medication_prescriptions" ON "medication_prescriptions"."encounter_id" = "receptions"."id" INNER JOIN "classification_icpc2_items" ON "classification_icpc2_items"."id" = "ehr_conditions"."icpc2_code_id" AND "classification_icpc2_items"."type" IN ('Classification::Icpc2::Condition') WHERE "receptions"."legal_entity_id" = 867 AND "receptions"."ehealth_status" = 1 AND "classification_icpc2_items"."type" IN ('Classification::Icpc2::Condition') AND "classification_icpc2_items"."code" BETWEEN 'K29' AND 'K99' AND "medication_prescriptions"."program_id" = 1 AND "medication_prescriptions"."ehealth_status" IN (0, 1) AND (receptions.asserted_date <= '2023-11-23 21:59:59.999999') GROUP BY receptions.patient_id HAVING (count(receptions.id) = 1)
- SELECT COUNT(receptions.patient_id) AS count_receptions_patient_id, receptions.patient_id AS receptions_patient_id FROM "receptions" INNER JOIN "ehr_conditions" ON "ehr_conditions"."encounter_id" = "receptions"."id" INNER JOIN "medication_prescriptions" ON "medication_prescriptions"."encounter_id" = "receptions"."id" INNER JOIN "classification_icpc2_items" ON "classification_icpc2_items"."id" = "ehr_conditions"."icpc2_code_id" AND "classification_icpc2_items"."type" IN ('Classification::Icpc2::Condition') WHERE "receptions"."legal_entity_id" = 867 AND "receptions"."ehealth_status" = 1 AND "classification_icpc2_items"."type" IN ('Classification::Icpc2::Condition') AND "classification_icpc2_items"."code" BETWEEN 'K29' AND 'K99' AND "medication_prescriptions"."program_id" = 1 AND "medication_prescriptions"."ehealth_status" = 1 AND (receptions.asserted_date <= '2023-11-23 21:59:59.999999') GROUP BY receptions.patient_id HAVING (count(receptions.id) = 1)
- ================================================================
- SELECT COUNT("declarations"."id") FROM "declarations" INNER JOIN "dbo"."Employees" ON "dbo"."Employees"."Id" = "declarations"."employee_id" INNER JOIN "declaration_statuses" ON "declaration_statuses"."id" = "declarations"."declaration_status_id" INNER JOIN "dbo"."Parties" ON "dbo"."Parties"."Id" = "dbo"."Employees"."PartyId" WHERE "dbo"."Parties"."LegalEntityId" = 867 AND "declaration_statuses"."code" = 'ACTIVE' AND (declarations.created_at <= '2023-11-23 21:59:59.999999')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement