  
DELETE FROM VCLib.T_BASE_FEATURE_SETTINGS
WHERE ClientModuleFeature IN (
    SELECT ClientModuleFeatureID 
    FROM VCLib.T_CLIENT_MODULE_FEATURE 
    WHERE Name = 'ArmStatisticsWorkSpaceEnableWeb'
);

DELETE FROM vclib.T_CLIENT_MODULE_FEATURE
WHERE name = 'ArmStatisticsWorkSpaceEnableWeb'
  AND ClientModules = (
    SELECT ClientModuleId
    FROM vclib.T_CLIENT_MODULES cm
    WHERE ModuleType = 'HospitalARMSClientModule'
    LIMIT 1
  );

    
DELETE FROM VCLib.T_BASE_FEATURE_SETTINGS
WHERE ClientModuleFeature IN (
    SELECT ClientModuleFeatureID 
    FROM VCLib.T_CLIENT_MODULE_FEATURE 
    WHERE Name = 'ArmRegistryEnableWeb'
);

  DELETE FROM vclib.T_CLIENT_MODULE_FEATURE
WHERE name = 'ArmRegistryEnableWeb'
  AND ClientModules = (
    SELECT ClientModuleId
    FROM vclib.T_CLIENT_MODULES cm
    WHERE ModuleType = 'HospitalARMSClientModule'
    LIMIT 1
  );


  DELETE FROM VCLib.T_BASE_FEATURE_SETTINGS
WHERE ClientModuleFeature IN (
    SELECT ClientModuleFeatureID 
    FROM VCLib.T_CLIENT_MODULE_FEATURE 
    WHERE Name = 'ArmAccountRegisterWorkSpaceWeb'
);

  DELETE FROM vclib.T_CLIENT_MODULE_FEATURE
WHERE name = 'ArmAccountRegisterWorkSpaceWeb'
  AND ClientModules = (
    SELECT ClientModuleId
    FROM vclib.T_CLIENT_MODULES cm
    WHERE ModuleType = 'HospitalARMSClientModule'
    LIMIT 1
  );


    DELETE FROM VCLib.T_BASE_FEATURE_SETTINGS
WHERE ClientModuleFeature IN (
    SELECT ClientModuleFeatureID 
    FROM VCLib.T_CLIENT_MODULE_FEATURE 
    WHERE Name = 'RegistryPolyclinicWorkspaceEnableWeb'
);


DELETE FROM vclib.T_CLIENT_MODULE_FEATURE
WHERE Name = 'RegistryPolyclinicWorkspaceEnableWeb'
  AND ClientModules = (
      SELECT ClientModuleId
      FROM vclib.T_CLIENT_MODULES cm
      WHERE ModuleType = 'PolyclinicARMsClientModule'
      LIMIT 1
  );