
            with mv as (
                select
                    EvnPLDispDop13_IsRefusal,
                    EvnDirection_aid,
                    EvnPLDispDop13_consDT
                from v_EvnPLDispDop13
                where EvnPLDispDop13_id = '890101014292160'
                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 := '890101014292160',
                MedStaffFact_id := NULL,
                EvnPLDispDop13_IsNewOrder := '1',
                EvnPLDispDop13_IndexRep := 0,
                EvnPLDispDop13_IndexRepInReg := 1,
                PersonEvn_id := '890101011893671',
                EvnPLDispDop13_setDT := (select EvnPLDispDop13_consDT from mv),
                EvnPLDispDop13_disDT := '2022-01-15',
                Server_id := 0,
                Lpu_id := '13101857',
                DispClass_id := '1',
                PayType_id := '299',
                EvnPLDispDop13_fid := NULL,
                AttachType_id := 2,
                EvnPLDispDop13_IsStenocard := '1',
                EvnPLDispDop13_IsShortCons := '2',
                EvnPLDispDop13_IsBrain := '1',
                EvnPLDispDop13_IsDoubleScan := '1',
                EvnPLDispDop13_IsTub := '1',
                EvnPLDispDop13_IsTIA := '1',
                EvnPLDispDop13_IsRespiratory := '1',
                EvnPLDispDop13_IsLungs := '1',
                EvnPLDispDop13_IsTopGastro := '1',
                EvnPLDispDop13_IsBotGastro := '1',
                EvnPLDispDop13_IsSpirometry := '1',
                EvnPLDispDop13_IsHeartFailure := NULL,
                EvnPLDispDop13_IsOncology := NULL,
                EvnPLDispDop13_IsEsophag := '1',
                EvnPLDispDop13_IsSmoking := '1',
                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 := '1',
                EvnPLDispDop13_IsStac := NULL,
                EvnPLDispDop13_IsSanator := '1',
                EvnPLDispDop13_SumRick := 1,
                RiskType_id := '2',
                EvnPLDispDop13_IsSchool := NULL,
                EvnPLDispDop13_IsProphCons := NULL,
                EvnPLDispDop13_IsHypoten := '1',
                EvnPLDispDop13_IsLipid := '1',
                EvnPLDispDop13_IsHypoglyc := '1',
                HealthKind_id := '1',
                EvnPLDispDop13_IsEndStage := '2',
                EvnPLDispDop13_IsFinish := '2',
                EvnPLDispDop13_IsTwoStage := '1',
                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 := 1,
                Diag_spid := NULL,
                pmUser_id := '377900566735'
            )
        
