
                select
                    EV.EvnVizitPL_id as "EvnVizitPL_id",
                    to_char(EV.EvnVizitPL_setDate, 'DD.MM.YYYY') as "EvnVizitPL_setDate",
                    L.Lpu_Nick as "Lpu_Nick",
                    D.Diag_FullName as "Diag_FullName",
                    D.Diag_Code as "Diag_Code"
                from
                    v_EvnVizitPL EV
                    inner join v_LpuSection LS  on '10101000001774' = LS.LpuSection_id
                    inner join v_LpuUnit LU  on LU.LpuUnit_id = LS.LpuUnit_id
                    inner join LpuUnitType LUT  on LU.LpuUnitType_id = LUT.LpuUnitType_id
                    left join v_Lpu L  on L.Lpu_id = EV.Lpu_id
                    left join v_Diag D on D.Diag_id = EV.Diag_id
                where
                    EV.EvnVizitPL_setDT > '2022-03-30 18:23'
                    and EV.EvnVizitPL_setDT < '2022-05-01 00:57'
                    and EV.Person_id = '532914'
                    and LUT.LpuUnitType_Code = 2
                    and coalesce(D.Diag_Code, '') not between 'A15.0' and 'A19.9' and coalesce(D.Diag_Code, '') not between 'F00.0' and 'F99.1'
                    
                limit 1
            
