This work aims to use the chatGPT algorithm to analyze and summarize cases in medical literature of the Song Dynasty, understand the clinical practice experience of ancient Chinese medicine, and provide historical reference for the clinical application and research of modern Chinese medicine. Firstly, the application of Artificial Intelligence (AI) in medicine is explained through literature research. Secondly, the prescription recognition technology related to AI is introduced, and a method combining supervised learning and semi-supervised learning for prescription entity recognition is proposed. Combined with chatGPT technology, medical data mining is carried out to obtain information and knowledge of medical research in the Song Dynasty. chatGPT is applied to the identification of ancient Chinese medical prescriptions and the analysis of case data. The results show that: (1) The machine classifier performs well in classifying different flavor compounds, effective and ineffective prescriptions can be distinguished, and the accuracy increases with the increase of samples. (2) Data mining reveals the differences in disease stages, the primary and secondary contradictions in patients' bodies, and the primary and secondary differences in drug use. (3) Frequency statistics show that warm drugs account for 45.46%, confirming that warm drugs are the main ones for treating phlegm. Therefore, it is recommended to use chatGPT as an auxiliary tool in medical-related analysis and combine it with professional medical knowledge and clinical practice for comprehensive judgment and decision-making. Ancient medical prescriptions can be better identified, and case data can be analyzed by combining chatGPT technology in AI. It can well support ancient medicine study and lay a solid foundation for developing modern medical information data warehouse.