update akuz.t_sick_call_accept
set begintime = acceptdate::date + interval '8 hour',
    endtime = acceptdate::date + interval '8 hour';

update akuz.t_sick_call_cancel
set Reason = coalesce(Reason,'') || ' ' || case TypeDeleteReason
                            when 0 then 'Неявка пациента'
                            when 3 then 'Врач отсутствует'
                    end
where TypeDeleteReason in (0,3);

update akuz.t_sick_call_cancel
set TypeDeleteReason = case TypeDeleteReason 
                            when 0 then 10
                            when 1 then 6
                            when 2 then 3
                            when 3 then 10
                            when 4 then 10
                    end;

update akuz.t_entry_history
set TypeDeleteReason = case TypeDeleteReason 
                            when 0 then 10
                            when 1 then 6
                            when 2 then 3
                            when 3 then 10
                            when 4 then 10
                    end;