private static XmlDocument RenewDocSymptomProperty(XmlDocument xmlDoc, List <SmptomProperyName> SmptomProperList) { //首先清除所有以往添加的疾病症候特征信息列表 int PropertyCount = SmptomProperList.Count; XmlNodeList SymptomsList = xmlDoc.GetElementsByTagName("Symptoms"); XmlNode SymtomsNode = SymptomsList[0]; if (SymtomsNode.ChildNodes.Count > 0) { SymtomsNode.RemoveAll(); } string SymptomName = ""; string PropertyName = ""; string OptionName = ""; for (int i = 0; i < PropertyCount; i++) { SmptomProperyName tmpSmptomPropery = SmptomProperList[i]; SymptomName = tmpSmptomPropery.SymptomName; PropertyName = tmpSmptomPropery.PropertyName; OptionName = tmpSmptomPropery.OptionName; XmlElement SymptomElement = xmlDoc.CreateElement("Symptom"); SymptomElement.SetAttribute("SymptomName", SymptomName); SymptomElement.SetAttribute("PropertyName", PropertyName); SymptomElement.SetAttribute("OptionName", OptionName); SymtomsNode.AppendChild(SymptomElement); } return(xmlDoc); }
private static XmlDocument GetChiefcompaintPropertyInfo(string ChiefComplaint, XmlDocument xmlDoc) { SqlConnection CurConn = new SqlConnection(CDSSConnectionString); string SqlString = "SELECT distinct [FindingName], [PropertyName] ,[OptionName],[Specifity] FROM [DiagnosisData]" + "where ((PropertyName is not null) and (OptionName is not null) and " + "(FindingType ='Symptom')) and (FindingName=@ChiefComplaint) order by [Specifity] desc"; SqlCommand CurCmd = new SqlCommand(SqlString, CurConn); CurCmd.Parameters.AddWithValue("@ChiefComplaint", ChiefComplaint); CurConn.Open(); SqlDataReader CurReader = CurCmd.ExecuteReader(); List <SmptomProperyName> SmptomProperList = new List <SmptomProperyName>(); SmptomProperyName tmpPropertyName; while (CurReader.Read()) { tmpPropertyName.SymptomName = CurReader["FindingName"].ToString().Trim(); tmpPropertyName.PropertyName = CurReader["PropertyName"].ToString().Trim(); tmpPropertyName.OptionName = CurReader["OptionName"].ToString().Trim(); SmptomProperList.Add(tmpPropertyName); } int PropertyCount = SmptomProperList.Count; XmlNodeList SymptomsList = xmlDoc.GetElementsByTagName("Symptoms"); XmlNode SymtomsNode = SymptomsList[0]; string SymptomName = ""; string PropertyName = ""; string OptionName = ""; for (int i = 0; i < PropertyCount; i++) { SmptomProperyName tmpSmptomPropery = SmptomProperList[i]; SymptomName = tmpSmptomPropery.SymptomName; PropertyName = tmpSmptomPropery.PropertyName; OptionName = tmpSmptomPropery.OptionName; XmlElement SymptomElement = xmlDoc.CreateElement("Symptom"); SymptomElement.SetAttribute("SymptomName", SymptomName); SymptomElement.SetAttribute("PropertyName", PropertyName); SymptomElement.SetAttribute("OptionName", OptionName); SymtomsNode.AppendChild(SymptomElement); } return(xmlDoc); }