The first traces of therapeutic activities in the territories that are now considered China date from the Shang dynasty (14th-11th centuries BCE). Though the Shang did not have a concept of "medicine" as distinct from other fields, their oracular inscriptions on bones and tortoise shells refer to illnesses that affected the Shang royal family: eye disorders, toothaches, bloated abdomen, etc., which Shang elites usually attributed to curses sent by their ancestors. There is no evidence that the Shang nobility used herbal remedies.
Stone and bone needles found in ancient tombs have made Joseph Needham speculate that acupuncture might have originated in the Shang dynasty. But most historians now make a distinction between medical lancing (or bloodletting) and acupuncture in the narrower sense of using metal needles to treat illnesses by stimulating specific points along circulation channels ("meridians") in accordance with theories related to the circulation of Qi. The earliest evidence for acupuncture in this sense dates to the second or first century BCE.
The Yellow Emperor's Inner Canon, the oldest received work of Chinese medical theory, was compiled around the first century BCE on the basis of shorter texts from different medical lineages. Written in the form of dialogues between the legendary Yellow Emperor and his ministers, it offers explanations on the relation between humans, their environment, and the cosmos, on the contents of the body, on human vitality and pathology, on the symptoms of illness, and on how to make diagnostic and therapeutic decisions in light of all these factors. Unlike earlier texts like Recipes for Fifty-Two Ailments, which was excavated in the 1970s from a tomb that had been sealed in 168 BCE, the Inner Canon rejected the influence of spirits and the use of magic. It was also one of the first books in which the cosmological doctrines of Yinyang and the Five Phases were brought to a mature synthesis.
The Treatise on Cold Damage Disorders and Miscellaneous Illnesses was collated by Zhang Zhongjing sometime between 196 and 220 CE, at the end of the Han dynasty. Focusing on drug prescriptions rather than acupuncture, it was the first medical work to combine Yinyang and the Five Phases with drug therapy. This formulary was also the earliest Chinese medical text to group symptoms into clinically useful "patterns" (zheng 證) that could serve as targets for therapy. Having gone through numerous changes over time, it now circulates as two distinct books: the Treatise on Cold Damage Disorders and the Essential Prescriptions of the Golden Casket, which were edited separately in the eleventh century, under the Song dynasty.
In the centuries that followed the completion of the Yellow Emperor's Inner Canon, several shorter books tried to summarize or systematize its contents. The Canon of Problems (probably second century CE) tried to reconcile divergent doctrines from the Inner Canon and developed a complete medical system centered on needling therapy. The AB Canon of Acupuncture and Moxibustion (Zhenjiu jiayi jing 針灸甲乙經, compiled by Huangfu Mi sometime between 256 and 282 CE) assembled a consistent body of doctrines concerning acupuncture; whereas the Canon of the Pulse (Maijing 脈經; ca. 280) presented itself as a "comprehensive handbook of diagnostics and therapy."