Sha256: 5bf54498f03a48341d124135245a4f7b12332b120aadb48f1c237410a021a843

Contents?: true

Size: 1.39 KB

Versions: 116

Compression:

Stored size: 1.39 KB

Contents

-- A pathology report to help identify any HL7/delayed_job issues
-- the name of the view (the filename here) is significant as we'll compile all reporting_daily_*
-- views into a daily digest email
select
  (select count(*) from delayed_jobs) as delayed_jobs_total,
  (select count(*) from delayed_jobs where attempts = 0) as delayed_jobs_unprocessed,
  (select count(*) from delayed_jobs where last_error is not null and failed_at is null ) as delayed_jobs_retrying,
  (select count(*) from delayed_jobs where last_error is not null and failed_at is null ) as delayed_jobs_failed,
  (select max(created_at) from delayed_jobs) as delayed_jobs_latest_entry,
  (select count(*) from delayed_jobs where created_at >= now()::date) as delayed_jobs_added_today,
  (select jsonb_agg(query) from (select priority, count(*) from delayed_jobs group by priority ) query) as delayed_jobs_priority_counts,
  (select count(*) from feed_messages) as feed_messages_total,
  (select count(*) from feed_messages where created_at >= now()::date) as feed_messages_added_today,
  (select max(created_at) from feed_messages) as feed_messages_added_latest_entry, -- will be slow, needs index on feed_messages.created_at
  (select count(*) from pathology_observations where created_at::date >= now()::date) as pathology_observations_added_today,
  (select max(observed_at) from pathology_observations) as pathology_observations_latest_observed_at;

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.1.0 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.167 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.166 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.165 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.164 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.163 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.162 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.161 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.160 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.159 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.158 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.157 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.156 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.155 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.153 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.152 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.151 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.149 db/views/reporting_daily_pathology_v01.sql
renalware-core-2.0.148 db/views/reporting_daily_pathology_v01.sql