
            with cte as (
                select
                    --dbo.tzGetDate() as curdate,
                    EvnPLDispDop13_IsRefusal,
                    EvnDirection_aid,
                    EvnPLDispDop13_consDT as EvnPLDispDop13_consDate
                from v_EvnPLDispDop13
                where EvnPLDispDop13_id = '140101029645765'
                limit 1
            )
            select
                EvnPLDispDop13_id as "EvnPLDispDop13_id",
                to_char((SELECT cte.EvnPLDispDop13_consDate from cte), 'YYYY-MM-DD') as "EvnPLDispDop13_setDT",
                error_code as "Error_Code",
                error_message as "Error_Msg"
            from
                dbo.p_EvnPLDispDop13_upd (
                    EvnPLDispDop13_id := '140101029645765',
                    MedStaffFact_id := '140101000042584',
                    EvnPLDispDop13_IsNewOrder := '1',
                    EvnPLDispDop13_IndexRep := 0,
                    EvnPLDispDop13_IndexRepInReg := 1,
                    PersonEvn_id := '140101013007456',
                    EvnPLDispDop13_setDT := (select cte.EvnPLDispDop13_consDate from cte),
                    EvnPLDispDop13_disDT := NULL,
                    Server_id := 140101000000014,
                    Lpu_id := '140101000000014',
                    DispClass_id := '1',
                    PayType_id := '140101000000001',
                    EvnPLDispDop13_fid := NULL,
                    AttachType_id := 2,
                    EvnPLDispDop13_IsStenocard := NULL,
                    EvnPLDispDop13_IsShortCons := NULL,
                    EvnPLDispDop13_IsBrain := NULL,
                    EvnPLDispDop13_IsDoubleScan := NULL,
                    EvnPLDispDop13_IsTub := NULL,
                    EvnPLDispDop13_IsTIA := NULL,
                    EvnPLDispDop13_IsRespiratory := NULL,
                    EvnPLDispDop13_IsLungs := NULL,
                    EvnPLDispDop13_IsTopGastro := NULL,
                    EvnPLDispDop13_IsBotGastro := NULL,
                    EvnPLDispDop13_IsSpirometry := NULL,
                    EvnPLDispDop13_IsHeartFailure := NULL,
                    EvnPLDispDop13_IsOncology := NULL,
                    EvnPLDispDop13_IsEsophag := NULL,
                    EvnPLDispDop13_IsSmoking := NULL,
                    EvnPLDispDop13_IsRiskAlco := NULL,
                    EvnPLDispDop13_IsAlcoDepend := NULL,
                    EvnPLDispDop13_IsLowActiv := NULL,
                    EvnPLDispDop13_IsIrrational := NULL,
                    EvnPLDispDop13_IsUseNarko := NULL,
                    Diag_id := NULL,
                    Diag_sid := NULL,
                    EvnPLDispDop13_IsDisp := '1',
                    NeedDopCure_id := NULL,
                    EvnPLDispDop13_IsStac := NULL,
                    EvnPLDispDop13_IsSanator := '1',
                    EvnPLDispDop13_SumRick := NULL,
                    RiskType_id := NULL,
                    EvnPLDispDop13_IsSchool := NULL,
                    EvnPLDispDop13_IsProphCons := NULL,
                    EvnPLDispDop13_IsHypoten := NULL,
                    EvnPLDispDop13_IsLipid := NULL,
                    EvnPLDispDop13_IsHypoglyc := NULL,
                    HealthKind_id := '2',
                    EvnPLDispDop13_IsEndStage := '1',
                    EvnPLDispDop13_IsFinish := '1',
                    EvnPLDispDop13_IsTwoStage := NULL,
                    EvnPLDispDop13_consDT := (SELECT cte.EvnPLDispDop13_consDate from cte),
                    EvnPLDispDop13_IsMobile := 1,
                    EvnPLDispDop13_IsOutLpu := 1,
                    Lpu_mid := NULL,
                    CardioRiskType_id := NULL,
                    EvnPLDispDop13_IsRefusal := (SELECT cte.EvnPLDispDop13_IsRefusal from cte),
                    EvnDirection_aid := (SELECT cte.EvnDirection_aid from cte),
                    EvnPLDispDop13_Percent := NULL,
                    EvnPLDispDop13_IsSuspectZNO := 1,
                    Diag_spid := NULL,
                    pmUser_id := '390078410510'
                )
        
