I'd like to learn how to write scientific papers in medicine. I saw searching on google that there are many books regarding scientific writing but reading reviews it seems they are more oriented to editors that to writers. Is there a sort of reference which focus on grammar aspects or conventions about writing style that is suitable for a beginner? I'm a non english native speaker
You are looking for something like this one? English for Writing Research Papers. There is a series of books by Adrian Walwork on English usage in science, or a book by Hilary Glasman-Deal. Anothers are A Scientific Approach to Scientific Writing or Introduction to Scientific Publishing. Just don't read them all.
For medical article writing the must have is the AMA Manual of Style which covers all the nuts and bolts on the logistics, from how to format to how to deal with conflict between authors.
If your work involves more laboratory experiments, then Essentials of Writing Biomedical Research Papers will be helpful. It focuses more on the reporting of methods and results, describing charts and tables, etc.
Also, do know that pretty much every single type of research designs has an associated "reporting guideline." The most famous one are CONSORT for randomized controlled trials and STROBE for observational studies. You can find the collection on this website. These guidelines do not just lend more rigor to your work, but also serve as an excellent scaffolding for your articles.
You'll also need to keep in touch with current publications. Most publishers and database like PubMed allow users to build customized notifications so that when a potentially interesting article comes out you'll be notified.
There are other books on the actual writing and those suggested by user3624251 are quite good. The more general writing books that I'd recommend are Style: Lessons in Clarity and Grace by Williams and Writing Science: How to Write Papers That Get Cited and Proposals That Get Funded by Schimel. Both are heavy on structure and rhetoric, I learned a lot on how to structure a sentence to achieve the desirable effect from these two titles.
There is also another department on proper study design and application of statistics but I'm not going to further clutter this answer.
My general advice is: learn the art yourself and own it, try to avoid advice on writing that is overly dogmatic (e.g. You can only use passive voice, absolutely no "I" or "We".) Make time to write, no matter how short, make it a daily habit. And track your progress; things not tracked are harder to improve.