<name>circ_count</name>
<tag>circs</tag>
<iteration>0</iteration>
- <report_title>Open Circulations</report_title>
- <heading>Circulation Status.Migrated.Count of Circs</heading>
- <query>SELECT 'Closed Circulations', x_migrate::TEXT, COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NOT NULL GROUP BY 2 UNION ALL SELECT 'Open Circulations', x_migrate::TEXT, COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NULL GROUP BY 2</query>
+ <report_title>Migrated Circulations</report_title>
+ <heading>Circulation Status.Count of Circs</heading>
+ <query>SELECT 'Closed Circulations', COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NOT NULL AND x_migrate
+ UNION ALL SELECT 'Open Circulations', COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NULL AND x_migrate</query>
+ </report>
+
+ <report>
+ <name>circ_count_unmigrated</name>
+ <tag>circs</tag>
+ <iteration>0</iteration>
+ <report_title>Open Un-migrated Circulations</report_title>
+ <heading>Circulation Status.Count of Circs</heading>
+ <query>SELECT 'No Matching User', COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NULL AND x_migrate = FALSE AND usr IS NULL
+ UNION ALL SELECT 'No Matching Item', COUNT(id) FROM action_circulation_legacy WHERE xact_finish IS NULL AND x_migrate = FALSE AND target_copy IS NULL </query>
</report>
<report>
<iteration>0</iteration>
<heading>Collision List</heading>
<query>SELECT ac.barcode FROM asset_copy_legacy ac WHERE ac.barcode ~* 'collision' ORDER BY 1 LIMIT 20</query>
- <note>This is a shortlist of patron barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report.</note>
+ <note>This is a shortlist of copy barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report.</note>
</report>
<report>
<tag>bibs</tag>
<iteration>1</iteration>
<heading>Count</heading>
- <query>SELECT COUNT(eg) FROM bib_id_map</query>
+ <query>SELECT COUNT(id) FROM biblio_record_entry_stage WHERE x_migrate = TRUE</query>
</report>
<report>
<tag>bibs</tag>
<iteration>0</iteration>
<heading>Count</heading>
- <query>SELECT COUNT(eg) FROM bib_id_map where eg::INTEGER NOT IN (SELECT DISTINCT record FROM asset_call_number)</query>
+ <query>SELECT COUNT(id) FROM biblio_record_entry where id NOT IN (SELECT DISTINCT record FROM asset_call_number)</query>
</report>
<report>
<query>SELECT COUNT(map.id), aou.name, au_sc.name FROM actor_stat_cat_entry_usr_map map JOIN actor_stat_cat au_sc ON au_sc.id = map.stat_cat JOIN actor.org_unit aou ON aou.id = au_sc.owner GROUP BY 2, 3 ORDER BY 2,3</query>
</report>
+ <report>
+ <name>usr_thresholds</name>
+ <report_title>Patron Thresholds</report_title>
+ <tag>actors</tag>
+ <iteration>0</iteration>
+ <heading>Pateron Group.Org Unit.Penalty.Threshold</heading>
+ <query>SELECT pgt.name, aou.shortname, sp.name, p.threshold FROM permission_grp_penalty_threshold p
+ JOIN actor.org_unit aou ON aou.id = p.org_unit JOIN permission.grp_tree pgt ON pgt.id = p.grp JOIN config.standing_penalty sp ON sp.id = p.penalty
+ ORDER BY 2, 1, 3</query>
+ </report>
+
+
<!-- ACQUISITIONS REPORTS -->
<report>
<name>fund_count</name>
<iteration>0</iteration>
<report_title>Migrated Serial MFHDs</report_title>
<heading>Number of MFHDs</heading>
- <query>SELECT COUNT(id) FROM seriarecord_entry</query>
+ <query>SELECT COUNT(id) FROM serial_record_entry</query>
+ </report>
+
+ <!-- DEDUPE REPORTS -->
+
+ <asset>
+ <name>dedupe_explain</name>
+ <tag>dedupe</tag>
+ <file>dedupe_process.asciidoc</file>
+ </asset>
+
+ <report>
+ <name>dedupe_bib_groups</name>
+ <tag>dedupe</tag>
+ <iteration>0</iteration>
+ <report_title>Scoring and Bib Record Groups</report_title>
+ <heading>Count.Bib Record Groups</heading>
+ <query>SELECT COUNT(id), 'Total Bibs Being Evaluated' FROM biblio.record_entry WHERE deleted IS FALSE AND id IN (SELECT eg::BIGINT FROM bib_id_map)
+ UNION ALL SELECT (COUNT(DISTINCT incoming_bib)), 'Incoming Bibs With Matches Found' FROM bib_matches
+ UNION ALL SELECT (COUNT(bre.id) - (SELECT COUNT(DISTINCT incoming_bib) FROM bib_matches)), 'Incoming Bibs With No Match'
+ FROM biblio.record_entry bre WHERE bre.deleted IS FALSE AND bre.id IN (SELECT eg::BIGINT FROM bib_id_map)
+ UNION ALL SELECT COUNT(DISTINCT incoming_bib), 'Incoming Bibs Being Merged into Incumbent' FROM bib_matches WHERE incumbent_bib_score >= incoming_bib_score
+ UNION ALL SELECT COUNT(id), 'Incumbent Bibs With Higher Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score > incoming_bib_score
+ UNION ALL SELECT COUNT(id), 'Incumbent Bibs With Equal Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score = incoming_bib_score
+ UNION ALL SELECT COUNT(id), 'Incumbent Bibs With Lower Scores to Incoming' FROM bib_matches WHERE incumbent_bib_score < incoming_bib_score
+ ;</query>
+ </report>
+
+ <report>
+ <name>dedupe_format_count</name>
+ <tag>dedupe</tag>
+ <iteration>0</iteration>
+ <report_title>Count of Items Matching By Format</report_title>
+ <heading>Count.Format(s)</heading>
+ <query>SELECT COUNT(id), search_formats FROM bib_matches GROUP BY 2 ORDER BY 2;</query>
+ </report>
+
+ <report>
+ <name>dedupe_score_ranges</name>
+ <tag>dedupe</tag>
+ <iteration>0</iteration>
+ <report_title>Count of Items Matching By Format</report_title>
+ <heading>Lowest Record Score.Largest Record Score.Record Set</heading>
+ <query>SELECT MIN(incumbent_bib_score), MAX(incumbent_bib_score), 'Incumbent Records' FROM bib_matches
+ UNION ALL SELECT MIN(incoming_bib_score), MAX(incoming_bib_score), 'Incoming Records' FROM bib_matches ;
+ </query>
+ </report>
+
+
+ <report>
+ <name>dedupe_sample_set</name>
+ <tag>dedupe</tag>
+ <iteration>0</iteration>
+ <report_title>Sample of 20 Matching Dedupe Record Sets</report_title>
+ <heading>Bib Being Merged Into.Bib Being Merged</heading>
+ <query>SELECT incumbent_bib, incoming_bib FROM bib_matches WHERE incumbent_bib_score >= incoming_bib_score LIMIT 20 ;
+ </query>
</report>
+ <!-- NOTICES REPORTS -->
+
+ <report>
+ <name>notices_overview</name>
+ <tag>notices</tag>
+ <iteration>0</iteration>
+ <report_title>Overview of Notices for Migration</report_title>
+ <heading>ID.Active.Owner.Name.Delay.Validator.Reactor</heading>
+ <query>SELECT ed.id, ed.active, aou.shortname, LEFT(ed.name,25) || '...', ed.delay, ed.validator, ed.reactor
+ FROM action_trigger.event_definition ed
+ JOIN actor.org_unit aou ON aou.id = ed.owner
+ WHERE ed.owner IN (SELECT DISTINCT home_ou FROM actor_usr)
+ OR ed.owner IN (SELECT DISTINCT parent_ou FROM actor.org_unit WHERE id in (SELECT DISTINCT home_ou FROM actor_usr));
+ </query>
+ </report>
+
+ <report>
+ <name>notices_count</name>
+ <tag>notices</tag>
+ <iteration>0</iteration>
+ <report_title>Count of Notices Run with State</report_title>
+ <heading>Count of Notices.State.ID.Owner.Name</heading>
+ <query>SELECT COUNT(ate.id), ate.state, ed.id, aou.shortname, LEFT(ed.name,25) || '...'
+ FROM action_trigger.event_definition ed
+ JOIN actor.org_unit aou ON aou.id = ed.owner
+ JOIN action_trigger.event ate ON ate.event_def = ed.id
+ WHERE ed.owner IN (SELECT DISTINCT home_ou FROM actor_usr)
+ OR ed.owner IN (SELECT DISTINCT parent_ou FROM actor.org_unit WHERE id in (SELECT DISTINCT home_ou FROM actor_usr))
+ GROUP BY 2,3,4;
+ </query>
+ </report>
+
+
</reports_file>