There's been a lot of questions around whether a foreigner boarding a flight bound for China is required to fill in their health details 14 days in advance and show the green QR code when checking in for your flight. Officially the CAAC (Civil Aviation Administration of China) only mandates Chinese citizens to do so.
However, recently there seems to be more airlines requesting this from all passengers regardless of nationality. Included below are:
Links to the CAAC policy in both English and Chinese
http://www.caac.gov.cn/en/XWZX/202004/t20200409_201956.html (EN)
http://www.caac.gov.cn/XXGK/XXGK/TZTG/202004/t20200407_201929.html (中文)
Airlines as well as your departing and transiting country might have separated rules on health codes and/or forms. Please check with the airline and port authorities directly on separate requirements if there are any.
Note that the Health Code App must be filled in at least 14 days prior to departure in order to get a green QR code.
All passengers will be required to provide Certificates of Negative Nucleic Acid + IgM Anti-Body Blood Tests Results taken no less than 48hrs prior to boarding.
Both tests must be verified with the consulate, and a Health Declaration form issued (as per the Health Declaration Form Page).