Exemplo n.º 1
0
        public bool aUfuv_hypertension(bean.fuv_hypertensionBean hm, string id, DataTable goodsList)
        {
            int    ret  = 0;
            String sql  = "";
            String sql0 = "";

            if (id == "")
            {
                id   = Result.GetNewId();
                sql  = @"insert into fuv_hypertension (id,aichive_no,Cardcode,Codebar,SocialSecuritycode,patientName,patientAge,dataSate,hypertension_code,visit_date,visit_type,symptom,other_symptom,sbp,dbp,weight,target_weight,bmi,target_bmi,heart_rate,other_sign,smoken,target_somken,wine,target_wine,sport_week,sport_once,target_sport_week,target_sport_once,salt_intake,target_salt_intake,mind_adjust,doctor_obey,assist_examine,drug_obey,untoward_effect,untoward_effect_drug,visit_class,referral_code,next_visit_date,visit_doctor,advice,create_name,create_time,update_name,update_time,transfer_organ,transfer_reason) values ";
                sql += @" ('" + id + "','" + hm.aichive_no + "', '" + hm.Cardcode + "', '" + hm.Codebar + "', '" + hm.SocialSecuritycode + "', '" + hm.patientName + "', '" + hm.patientAge + "', '" + hm.dataSate + "', '" + hm.hypertension_code + "', '" + hm.visit_date + "', '" + hm.visit_type + "','" + hm.symptom + "', '" + hm.other_symptom + "', '" + hm.sbp + "', '" + hm.dbp + "', '" + hm.weight + "', '" + hm.target_weight + "', '" + hm.bmi + "', '" + hm.target_bmi + "', '" + hm.heart_rate + "', '" + hm.other_sign + "','" + hm.smoken + "', '" + hm.target_somken + "', '" + hm.wine + "', '" + hm.target_wine + "', '" + hm.sport_week + "', '" + hm.sport_once + "', '" + hm.target_sport_week + "', '" + hm.target_sport_once + "', '" + hm.salt_intake + "', '" + hm.target_salt_intake + "','" + hm.mind_adjust + "', '" + hm.doctor_obey + "', '" + hm.assist_examine + "', '" + hm.drug_obey + "', '" + hm.untoward_effect + "', '" + hm.untoward_effect_drug + "', '" + hm.visit_class + "', '" + hm.referral_code + "', '" + hm.next_visit_date + "', '" + hm.visit_doctor + "','" + hm.advice + "', '" + hm.create_name + "', '" + hm.create_time + "', '" + hm.update_name + "', '" + hm.update_time + "', '" + hm.transfer_organ + "', '" + hm.transfer_reason + "')";

                if (goodsList.Rows.Count > 0)
                {
                    for (int i = 0; i < goodsList.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            sql0 += "insert into follow_medicine_record(follow_id,drug_name,num,dosage) values ('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "')";
                        }
                        else
                        {
                            sql0 += ",('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "')";
                        }
                    }
                }
            }
            else
            {
                sql = @"update fuv_hypertension set aichive_no ='" + hm.aichive_no + "',Cardcode='" + hm.Cardcode + "',Codebar='" + hm.Codebar + "',SocialSecuritycode='" + hm.SocialSecuritycode + "',patientName='" + hm.patientName + "',patientAge='" + hm.patientAge + "',dataSate='" + hm.dataSate + "',hypertension_code='" + hm.hypertension_code + "',visit_date='" + hm.visit_date + "',visit_type='" + hm.visit_type + "',symptom='" + hm.symptom + "',other_symptom='" + hm.other_symptom + "',sbp='" + hm.sbp + "',dbp='" + hm.dbp + "',weight='" + hm.weight + "',target_weight='" + hm.target_weight + "',bmi='" + hm.bmi + "',target_bmi='" + hm.target_bmi + "',heart_rate='" + hm.heart_rate + "',other_sign= '" + hm.other_sign + "',smoken='" + hm.smoken + "',target_somken='" + hm.target_somken + "',wine= '" + hm.wine + "',target_wine= '" + hm.target_wine + "',sport_week='" + hm.sport_week + "',sport_once='" + hm.sport_once + "',target_sport_week= '" + hm.target_sport_week + "',target_sport_once='" + hm.target_sport_once + "',salt_intake='" + hm.salt_intake + "',target_salt_intake='" + hm.target_salt_intake + "',mind_adjust='" + hm.mind_adjust + "',doctor_obey= '" + hm.doctor_obey + "',assist_examine='" + hm.assist_examine + "',drug_obey='" + hm.drug_obey + "',untoward_effect='" + hm.untoward_effect + "',untoward_effect_drug='" + hm.untoward_effect_drug + "',visit_class='" + hm.visit_class + "',referral_code='" + hm.referral_code + "',next_visit_date='" + hm.next_visit_date + "',visit_doctor='" + hm.visit_doctor + "',advice='" + hm.advice + "',create_name='" + hm.create_name + "',create_time='" + hm.create_time + "',update_name='" + hm.update_name + "',update_time='" + hm.update_time + "',transfer_organ='" + hm.transfer_organ + "',transfer_reason='" + hm.transfer_reason + "' where id = '" + id + "'";

                sql0 = @"delete from follow_medicine_record  where follow_id = '" + id + "';";
                if (goodsList.Rows.Count > 0)
                {
                    for (int i = 0; i < goodsList.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            sql0 += "insert into follow_medicine_record(follow_id,drug_name,num,dosage) values ('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "')";
                        }
                        else
                        {
                            sql0 += ",('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "')";
                        }
                    }
                }
            }
            if (sql0 != "")
            {
                DbHelperMySQL.ExecuteSql(sql0);
            }
            ret = DbHelperMySQL.ExecuteSql(sql);
            return(ret == 0 ? false : true);
        }
        private void button4_Click(object sender, EventArgs e)
        {
            bean.fuv_hypertensionBean fuv_hypertensionBean = new bean.fuv_hypertensionBean();

            fuv_hypertensionBean.patientName = this.textBox1.Text.Replace(" ", "");
            fuv_hypertensionBean.aichive_no  = this.textBox2.Text.Replace(" ", "");
            fuv_hypertensionBean.visit_date  = this.dateTimePicker1.Value.ToString();
            if (this.radioButton1.Checked == true)
            {
                fuv_hypertensionBean.visit_type = this.radioButton1.Text;
            }
            ;
            if (this.radioButton2.Checked == true)
            {
                fuv_hypertensionBean.visit_type = this.radioButton2.Text;
            }
            ;
            if (this.radioButton3.Checked == true)
            {
                fuv_hypertensionBean.visit_type = this.radioButton3.Text;
            }
            ;
            foreach (Control ctr in this.panel2.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        fuv_hypertensionBean.symptom += "," + ck.Text;
                    }
                }
            }
            if (fuv_hypertensionBean.symptom != null && fuv_hypertensionBean.symptom != "")
            {
                fuv_hypertensionBean.symptom = fuv_hypertensionBean.symptom.Substring(1);
            }
            fuv_hypertensionBean.other_symptom = this.richTextBox1.Text;

            fuv_hypertensionBean.sbp           = this.numericUpDown9.Value.ToString();
            fuv_hypertensionBean.dbp           = this.numericUpDown10.Value.ToString();
            fuv_hypertensionBean.weight        = this.numericUpDown11.Value.ToString();
            fuv_hypertensionBean.target_weight = this.numericUpDown12.Value.ToString();
            fuv_hypertensionBean.bmi           = this.numericUpDown14.Value.ToString();
            fuv_hypertensionBean.target_bmi    = this.numericUpDown15.Value.ToString();
            fuv_hypertensionBean.heart_rate    = this.numericUpDown16.Value.ToString();
            fuv_hypertensionBean.other_sign    = this.richTextBox3.Text;

            fuv_hypertensionBean.smoken            = this.numericUpDown1.Value.ToString();
            fuv_hypertensionBean.target_somken     = this.numericUpDown2.Value.ToString();
            fuv_hypertensionBean.wine              = this.numericUpDown3.Value.ToString();
            fuv_hypertensionBean.target_wine       = this.numericUpDown4.Value.ToString();
            fuv_hypertensionBean.sport_week        = this.numericUpDown5.Value.ToString();
            fuv_hypertensionBean.sport_once        = this.numericUpDown6.Value.ToString();
            fuv_hypertensionBean.target_sport_week = this.numericUpDown7.Value.ToString();
            fuv_hypertensionBean.target_sport_once = this.numericUpDown8.Value.ToString();
            if (this.radioButton4.Checked == true)
            {
                fuv_hypertensionBean.salt_intake = this.radioButton4.Text;
            }
            ;
            if (this.radioButton5.Checked == true)
            {
                fuv_hypertensionBean.salt_intake = this.radioButton5.Text;
            }
            ;
            if (this.radioButton6.Checked == true)
            {
                fuv_hypertensionBean.salt_intake = this.radioButton6.Text;
            }
            ;
            if (this.radioButton7.Checked == true)
            {
                fuv_hypertensionBean.target_salt_intake = this.radioButton7.Text;
            }
            ;
            if (this.radioButton8.Checked == true)
            {
                fuv_hypertensionBean.target_salt_intake = this.radioButton8.Text;
            }
            ;
            if (this.radioButton9.Checked == true)
            {
                fuv_hypertensionBean.target_salt_intake = this.radioButton9.Text;
            }
            ;
            if (this.radioButton10.Checked == true)
            {
                fuv_hypertensionBean.mind_adjust = this.radioButton10.Text;
            }
            ;
            if (this.radioButton11.Checked == true)
            {
                fuv_hypertensionBean.mind_adjust = this.radioButton11.Text;
            }
            ;
            if (this.radioButton12.Checked == true)
            {
                fuv_hypertensionBean.mind_adjust = this.radioButton12.Text;
            }
            ;
            if (this.radioButton13.Checked == true)
            {
                fuv_hypertensionBean.doctor_obey = this.radioButton13.Text;
            }
            ;
            if (this.radioButton14.Checked == true)
            {
                fuv_hypertensionBean.doctor_obey = this.radioButton14.Text;
            }
            ;
            if (this.radioButton15.Checked == true)
            {
                fuv_hypertensionBean.doctor_obey = this.radioButton15.Text;
            }
            ;

            fuv_hypertensionBean.assist_examine = this.textBox3.Text.Replace(" ", "");
            if (this.radioButton22.Checked == true)
            {
                fuv_hypertensionBean.drug_obey = this.radioButton22.Text;
            }
            ;
            if (this.radioButton23.Checked == true)
            {
                fuv_hypertensionBean.drug_obey = this.radioButton23.Text;
            }
            ;
            if (this.radioButton24.Checked == true)
            {
                fuv_hypertensionBean.drug_obey = this.radioButton24.Text;
            }
            ;
            if (this.radioButton16.Checked == true)
            {
                fuv_hypertensionBean.untoward_effect = this.radioButton16.Text;
            }
            ;
            if (this.radioButton17.Checked == true)
            {
                fuv_hypertensionBean.untoward_effect = this.radioButton17.Text;
            }
            ;
            fuv_hypertensionBean.untoward_effect_drug = this.textBox8.Text.Replace(" ", "");
            if (this.radioButton18.Checked == true)
            {
                fuv_hypertensionBean.visit_class = this.radioButton18.Text;
            }
            ;
            if (this.radioButton19.Checked == true)
            {
                fuv_hypertensionBean.visit_class = this.radioButton19.Text;
            }
            ;
            if (this.radioButton20.Checked == true)
            {
                fuv_hypertensionBean.visit_class = this.radioButton20.Text;
            }
            ;
            if (this.radioButton21.Checked == true)
            {
                fuv_hypertensionBean.visit_class = this.radioButton21.Text;
            }
            ;
            if (fuv_hypertensionBean.visit_class == "")
            {
                MessageBox.Show("随访分类不能为空!"); return;
            }
            ;
            fuv_hypertensionBean.advice = this.richTextBox2.Text;

            fuv_hypertensionBean.transfer_reason = this.textBox5.Text.Replace(" ", "");
            fuv_hypertensionBean.transfer_organ  = this.textBox6.Text.Replace(" ", "");
            fuv_hypertensionBean.next_visit_date = this.dateTimePicker2.Value.ToString();
            fuv_hypertensionBean.visit_doctor    = this.textBox7.Text.Replace(" ", "");


            //以下页面未用 数据库字段格式要求
            //Cardcode,Codebar,SocialSecuritycode,patientAge,dataSate,hypertension_code,referral_code,create_name,create_time,update_name,update_time
            fuv_hypertensionBean.create_time = DateTime.Now.ToString();
            fuv_hypertensionBean.update_time = DateTime.Now.ToString();


            bool isfalse = hypertensionPatient.aUfuv_hypertension(fuv_hypertensionBean, id, goodsList);

            if (isfalse)
            {
                this.DialogResult = DialogResult.OK;
            }
        }
 public bool aUfuv_hypertension(bean.fuv_hypertensionBean hm, string id, DataTable goodsList)
 {
     return(hPD.aUfuv_hypertension(hm, id, goodsList));
 }