Is it illegal for doctors to publish patient cases by coding?

It violates the law and infringes on patients' right to privacy.

Article 1032 of China's Civil Law stipulates that natural persons have the right to privacy. No organization or individual may infringe upon the privacy rights of others by spying, harassing, exposing or making public.

Privacy is the private space, private activities and private information that natural people live in peace and don't want to be known by others. Personal medical records belong to the health information of natural persons, which are closely related to natural persons and have specific signs. They belong to their private information and should be protected by law.