The Code of the Industrial Property describes what can not be patented:
Surgical or therapeutic treatments of the human or animal body and diagnostic methods practiced on the human or animal body are not considered patentable methods. This provision does not apply to products, in particular substances or mixtures of substances which are used for the implementation of one of the mentioned methods.
Translating the letter of the law in practical instructions, every solution to a technical problem can be patented. 'Technical' is the key word.
Abstract ideas, theories or scientific discoveries (eg. gravity) are not patentable. But one can patent any mechanism, device or method that exploits these concepts.
It should be noted that computer programs, or software in general, are excluded from patentability only as such! This means that only the software on an abstract level, understood as a logical process, is not patentable. But every device that incorporates said concept in order to obtain a technical effect is patentable. Please refer to the specific section for further study.