CREATE OR REPLACE PROCEDURE akuz.sp_dropexpirediheclinicaldocumentevent()
    LANGUAGE plpgsql
AS
$$

BEGIN

    DELETE
    FROM akuz.t_ihe_clinicaldocument_event
    WHERE status = 2
      AND eventtime < current_date - 30;

END;
$$;