
            with cte as (
                select
                    --dbo.tzGetDate() as curdate,
                    EvnPLDispDop13_IsRefusal,
                    EvnDirection_aid,
                    EvnPLDispDop13_consDT as EvnPLDispDop13_consDate
                from v_EvnPLDispDop13
                where EvnPLDispDop13_id = '890101015774247'
                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 := '890101015774247',
                    MedStaffFact_id := '890101000001676',
                    EvnPLDispDop13_IsNewOrder := '1',
                    EvnPLDispDop13_IndexRep := 0,
                    EvnPLDispDop13_IndexRepInReg := 1,
                    PersonEvn_id := '890101006010496',
                    EvnPLDispDop13_setDT := (select cte.EvnPLDispDop13_consDate from cte),
                    EvnPLDispDop13_disDT := '2022-03-03',
                    Server_id := 13101856,
                    Lpu_id := '13101856',
                    DispClass_id := '2',
                    PayType_id := '299',
                    EvnPLDispDop13_fid := '890101015242253',
                    AttachType_id := 2,
                    EvnPLDispDop13_IsStenocard := '1',
                    EvnPLDispDop13_IsShortCons := NULL,
                    EvnPLDispDop13_IsBrain := '1',
                    EvnPLDispDop13_IsDoubleScan := '1',
                    EvnPLDispDop13_IsTub := '1',
                    EvnPLDispDop13_IsTIA := '1',
                    EvnPLDispDop13_IsRespiratory := NULL,
                    EvnPLDispDop13_IsLungs := '1',
                    EvnPLDispDop13_IsTopGastro := '1',
                    EvnPLDispDop13_IsBotGastro := '1',
                    EvnPLDispDop13_IsSpirometry := '1',
                    EvnPLDispDop13_IsHeartFailure := '1',
                    EvnPLDispDop13_IsOncology := '1',
                    EvnPLDispDop13_IsEsophag := '1',
                    EvnPLDispDop13_IsSmoking := '2',
                    EvnPLDispDop13_IsRiskAlco := '1',
                    EvnPLDispDop13_IsAlcoDepend := '1',
                    EvnPLDispDop13_IsLowActiv := '1',
                    EvnPLDispDop13_IsIrrational := '1',
                    EvnPLDispDop13_IsUseNarko := '1',
                    Diag_id := NULL,
                    Diag_sid := NULL,
                    EvnPLDispDop13_IsDisp := '1',
                    NeedDopCure_id := NULL,
                    EvnPLDispDop13_IsStac := NULL,
                    EvnPLDispDop13_IsSanator := '1',
                    EvnPLDispDop13_SumRick := 1,
                    RiskType_id := '2',
                    EvnPLDispDop13_IsSchool := NULL,
                    EvnPLDispDop13_IsProphCons := NULL,
                    EvnPLDispDop13_IsHypoten := NULL,
                    EvnPLDispDop13_IsLipid := NULL,
                    EvnPLDispDop13_IsHypoglyc := NULL,
                    HealthKind_id := '2',
                    EvnPLDispDop13_IsEndStage := '2',
                    EvnPLDispDop13_IsFinish := '2',
                    EvnPLDispDop13_IsTwoStage := NULL,
                    EvnPLDispDop13_consDT := (SELECT cte.EvnPLDispDop13_consDate from cte),
                    EvnPLDispDop13_IsMobile := 1,
                    EvnPLDispDop13_IsOutLpu := 1,
                    Lpu_mid := NULL,
                    CardioRiskType_id := '2',
                    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 := '371986935390'
                )
        
