INSERT INTO [VCLib].[T_CLIENT_MODULE_FEATURE]
           ([ClientModuleFeatureID]
           ,[Name]
           ,[ClientModules]
           ,[EntityIndex]
           ,[Description])
select
           newid()
           ,'HeadOfPolyclinic'
           ,(select ClientModuleID from VCLib.T_CLIENT_MODULES cm where ModuleType = 'VmpClientModule')
           ,22
           ,'Поликлинический этап(Заведующий)'
where not exists(select * from [VCLib].[T_CLIENT_MODULE_FEATURE] cc where cc.Name = 'HeadOfPolyclinic')

