Status Filter for IRHP Permit: Selects records where the IRHP permit status is 'irhp_permit_terminated'.
Date Filter for IRHP Permit: Filters permits based on the last_modified_on date being older than the current date minus the retention period defined in the data retention rules.
Comprehensive Application Cleanup: Also targets IRHP applications associated solely with terminated permits, ensuring applications that no longer have any active or non-terminated permits and were last modified more than 60 months ago are selected.
This procedure identifies terminated IRHP permits and their associated applications, selecting those permits and applications whose last modification dates are older than the defined retention periods.