
            with mv as (
                select
                    EvnPLDispDop13_IsRefusal,
                    EvnDirection_aid,
                    EvnPLDispDop13_consDT
                from v_EvnPLDispDop13
                where EvnPLDispDop13_id = '120101127799771'
                limit 1
            )
            select
                EvnPLDispDop13_id as "EvnPLDispDop13_id",
                (select EvnPLDispDop13_consDT from mv) as "EvnPLDispDop13_setDT",
                Error_Code as "Error_Code",
                Error_Message as "Error_Msg"
            from dbo.p_EvnPLDispDop13_upd (
                EvnPLDispDop13_id := '120101127799771',
                MedStaffFact_id := NULL,
                EvnPLDispDop13_IsNewOrder := '1',
                EvnPLDispDop13_IndexRep := 0,
                EvnPLDispDop13_IndexRepInReg := 1,
                PersonEvn_id := '120101009536790',
                EvnPLDispDop13_setDT := (select EvnPLDispDop13_consDT from mv),
                EvnPLDispDop13_disDT := '2022-02-28',
                Server_id := 0,
                Lpu_id := '3311009',
                DispClass_id := '1',
                PayType_id := '120101000000023',
                EvnPLDispDop13_fid := NULL,
                AttachType_id := 2,
                EvnPLDispDop13_IsStenocard := NULL,
                EvnPLDispDop13_IsShortCons := '2',
                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 := NULL,
                NeedDopCure_id := NULL,
                EvnPLDispDop13_IsStac := NULL,
                EvnPLDispDop13_IsSanator := NULL,
                EvnPLDispDop13_SumRick := NULL,
                RiskType_id := NULL,
                EvnPLDispDop13_IsSchool := NULL,
                EvnPLDispDop13_IsProphCons := NULL,
                EvnPLDispDop13_IsHypoten := NULL,
                EvnPLDispDop13_IsLipid := NULL,
                EvnPLDispDop13_IsHypoglyc := NULL,
                HealthKind_id := '6',
                EvnPLDispDop13_IsEndStage := '2',
                EvnPLDispDop13_IsFinish := '2',
                EvnPLDispDop13_IsTwoStage := '2',
                EvnPLDispDop13_consDT := (select EvnPLDispDop13_consDT from mv),
                EvnPLDispDop13_IsMobile := 1,
                EvnPLDispDop13_IsOutLpu := 1,
                Lpu_mid := NULL,
                CardioRiskType_id := '2',
                EvnPLDispDop13_IsRefusal := (select EvnPLDispDop13_IsRefusal from mv),
                EvnDirection_aid := (select EvnDirection_aid from mv),
                EvnPLDispDop13_Percent := NULL,
                EvnPLDispDop13_IsSuspectZNO := NULL,
                Diag_spid := NULL,
                pmUser_id := '391259790898'
            )
        
