Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- DiagnosticRelated::ReportActualizeWorker
- -- Запрос с параматрами
- SELECT "receptions"."id", "receptions"."legal_entity_id", "receptions"."performer_id", "receptions"."ehealth_status"
- FROM "receptions"
- INNER JOIN "ehealth_async_jobs" ON "ehealth_async_jobs"."jobable_id" = "receptions"."id" AND
- "ehealth_async_jobs"."jobable_type" = 'Ehr::Encounter'
- LEFT OUTER JOIN "diagnostic_related_reports"
- ON "diagnostic_related_reports"."reportable_id" = "receptions"."id" AND
- "diagnostic_related_reports"."reportable_type" = 'Ehr::Encounter'
- WHERE "receptions"."encounter_class_id" != 1293
- AND "receptions"."ehealth_status" = 1
- AND "receptions"."legal_entity_id" IN (3047, 1733, 1453)
- AND "receptions"."signed_at" BETWEEN '2024-05-12 21:00:00' AND '2024-05-13 07:24:20.115435'
- AND "diagnostic_related_reports"."id" IS NULL
- ORDER BY "receptions"."id" ASC
- LIMIT 100
- -- Остальные запросы с этой джобы
- SELECT "ehr_procedures"."id",
- "ehr_procedures"."legal_entity_id",
- "ehr_procedures"."performer_id",
- "ehr_procedures"."ehealth_status"
- FROM "ehr_procedures"
- INNER JOIN "ehealth_async_jobs" ON "ehealth_async_jobs"."jobable_id" = "ehr_procedures"."id" AND
- "ehealth_async_jobs"."jobable_type" = 'Ehr::Procedure'
- LEFT OUTER JOIN "diagnostic_related_reports"
- ON "diagnostic_related_reports"."reportable_id" = "ehr_procedures"."id" AND
- "diagnostic_related_reports"."reportable_type" = 'Ehr::Procedure'
- WHERE "ehr_procedures"."encounter_id" IS NULL
- AND "ehr_procedures"."ehealth_status" = 1
- AND "ehr_procedures"."legal_entity_id" IN (3047, 1733, 1453)
- AND "ehr_procedures"."signed_at" BETWEEN '2024-05-12 21:00:00' AND '2024-05-13 07:24:20.166089'
- AND "diagnostic_related_reports"."id" IS NULL
- ORDER BY "ehr_procedures"."id" ASC
- LIMIT 100
- SELECT "ehr_diagnostic_reports"."id",
- "ehr_diagnostic_reports"."legal_entity_id",
- "ehr_diagnostic_reports"."performer_id",
- "ehr_diagnostic_reports"."ehealth_status"
- FROM "ehr_diagnostic_reports"
- INNER JOIN "ehealth_async_jobs" ON "ehealth_async_jobs"."jobable_id" = "ehr_diagnostic_reports"."id" AND
- "ehealth_async_jobs"."jobable_type" = 'Ehr::DiagnosticReport'
- LEFT OUTER JOIN "diagnostic_related_reports"
- ON "diagnostic_related_reports"."reportable_id" = "ehr_diagnostic_reports"."id" AND
- "diagnostic_related_reports"."reportable_type" = 'Ehr::DiagnosticReport'
- WHERE "ehr_diagnostic_reports"."encounter_id" IS NULL
- AND "ehr_diagnostic_reports"."ehealth_status" = 1
- AND "ehr_diagnostic_reports"."legal_entity_id" IN (3047, 1733, 1453)
- AND "ehr_diagnostic_reports"."signed_at" BETWEEN '2024-05-12 21:00:00' AND '2024-05-13 07:24:20.193687'
- AND "diagnostic_related_reports"."id" IS NULL
- ORDER BY "ehr_diagnostic_reports"."id" ASC
- LIMIT 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement