-- DIAR-4B verification
SET PAGESIZE 200
SET LINESIZE 240
SELECT SYS_CONTEXT('USERENV','DB_NAME') DB_NAME,
       SYS_CONTEXT('USERENV','CURRENT_SCHEMA') CURRENT_SCHEMA
FROM DUAL;

SELECT OBJECT_TYPE, COUNT(*) OBJECT_COUNT
FROM USER_OBJECTS
WHERE OBJECT_NAME IN (
'DASH_DIAR_IMPORT_RUNS','DASH_DIAR_SOURCE_CASES','DASH_DIAR_CASES',
'DASH_DIAR_CASE_ASSIGNMENTS','DASH_DIAR_CASE_HISTORY','DASH_DIAR_CASE_NOTES',
'DASH_DIAR_CASE_EVIDENCE','DASH_DIAR_IMPORT_SEQ','DASH_DIAR_SOURCE_SEQ',
'DASH_DIAR_CASE_SEQ','DASH_DIAR_ASSIGN_SEQ','DASH_DIAR_HISTORY_SEQ',
'DASH_DIAR_NOTE_SEQ','DASH_DIAR_EVID_SEQ')
GROUP BY OBJECT_TYPE ORDER BY OBJECT_TYPE;

SELECT STATUS_CODE, COUNT(*) FROM DASH_DIAR_CASES GROUP BY STATUS_CODE ORDER BY STATUS_CODE;
SELECT ENTITY_TYPE, COUNT(*) FROM DASH_DIAR_CASES GROUP BY ENTITY_TYPE ORDER BY ENTITY_TYPE;
SELECT SITE_CODE, COUNT(*) FROM DASH_DIAR_CASES GROUP BY SITE_CODE ORDER BY SITE_CODE;
SELECT MEMBER_DISPOSITION, COUNT(*) FROM DASH_DIAR_SOURCE_CASES GROUP BY MEMBER_DISPOSITION ORDER BY MEMBER_DISPOSITION;
