Beispiel #1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        private int Update()
        {
            tuberculosis_follow_record info = GetData();

            info.name        = Names;
            info.aichive_no  = aichive_no;
            info.Cardcode    = id_number;
            info.update_user = frmLogin.userCode;
            info.update_name = frmLogin.name;
            info.update_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string issql = @"update tuberculosis_follow_record set upload_status=0,visit_date=@visit_date,month_order=@month_order,supervisor_type=@supervisor_type,visit_type=@visit_type,symptom=@symptom,symptom_other=@symptom_other,smoke_now=@smoke_now,smoke_next=@smoke_next,drink_now=@drink_now,drink_next=@drink_next,chemotherapy_plan=@chemotherapy_plan,`usage`=@usage,drugs_type=@drugs_type,miss=@miss,untoward_effect=@untoward_effect,untoward_effect_info=@untoward_effect_info,complication=@complication,complication_info=@complication_info,transfer_treatment_department=@transfer_treatment_department,transfer_treatment_reason=@transfer_treatment_reason,twoweek_visit_result=@twoweek_visit_result,handling_suggestion=@handling_suggestion,next_visit_date=@next_visit_date,visit_doctor=@visit_doctor,stop_date=@stop_date,stop_reason=@stop_reason,must_visit_num=@must_visit_num,actual_visit_num=@actual_visit_num,must_medicine_num=@must_medicine_num,actual_medicine_num=@actual_medicine_num,medicine_rate=@medicine_rate,estimate_doctor=@estimate_doctor,update_user=@update_user,update_name=@update_name,update_time=@update_time where id=(select a.id from( select id from tuberculosis_follow_record where `name`=@name and aichive_no=@aichive_no and Cardcode=@Cardcode order by create_time desc LIMIT 1)a)";

            MySqlParameter[] args = new MySqlParameter[] {
                new MySqlParameter("@name", info.name),
                new MySqlParameter("@aichive_no", info.aichive_no),
                new MySqlParameter("@Cardcode", info.Cardcode),
                new MySqlParameter("@visit_date", info.visit_date),
                new MySqlParameter("@month_order", info.month_order),
                new MySqlParameter("@supervisor_type", info.supervisor_type),
                new MySqlParameter("@visit_type", info.visit_type),
                new MySqlParameter("@symptom", info.symptom),
                new MySqlParameter("@symptom_other", info.symptom_other),
                new MySqlParameter("@smoke_now", info.smoke_now),
                new MySqlParameter("@smoke_next", info.smoke_next),
                new MySqlParameter("@drink_now", info.drink_now),
                new MySqlParameter("@drink_next", info.drink_next),
                new MySqlParameter("@chemotherapy_plan", info.chemotherapy_plan),
                new MySqlParameter("@usage", info.usage),
                new MySqlParameter("@drugs_type", info.drugs_type),
                new MySqlParameter("@miss", info.miss),
                new MySqlParameter("@untoward_effect", info.untoward_effect),
                new MySqlParameter("@untoward_effect_info", info.untoward_effect_info),
                new MySqlParameter("@complication", info.complication),
                new MySqlParameter("@complication_info", info.complication_info),
                new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                new MySqlParameter("@twoweek_visit_result", info.twoweek_visit_result),
                new MySqlParameter("@handling_suggestion", info.handling_suggestion),
                new MySqlParameter("@next_visit_date", info.next_visit_date),
                new MySqlParameter("@visit_doctor", info.visit_doctor),
                new MySqlParameter("@stop_date", info.stop_date),
                new MySqlParameter("@stop_reason", info.stop_reason),
                new MySqlParameter("@must_visit_num", info.must_visit_num),
                new MySqlParameter("@actual_visit_num", info.actual_visit_num),
                new MySqlParameter("@must_medicine_num", info.must_medicine_num),
                new MySqlParameter("@actual_medicine_num", info.actual_medicine_num),
                new MySqlParameter("@medicine_rate", info.medicine_rate),
                new MySqlParameter("@estimate_doctor", info.estimate_doctor),
                new MySqlParameter("@update_user", info.update_user),
                new MySqlParameter("@update_name", info.update_name),
                new MySqlParameter("@update_time", info.update_time),
            };
            return(DbHelperMySQL.ExecuteSql(issql, args));
        }
Beispiel #2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        private int Insert()
        {
            if (GetCount() >= 4)
            {
                MessageBox.Show("已添加四次,无法再添加");
                return(0);
            }
            tuberculosis_follow_record info = GetData();

            info.name            = Names;
            info.aichive_no      = aichive_no;
            info.Cardcode        = id_number;
            info.id_number       = id_number;
            info.create_user     = frmLogin.userCode;
            info.create_name     = frmLogin.name;
            info.create_time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            info.create_org      = frmLogin.organCode;
            info.create_org_name = frmLogin.organName;
            string issql = @"insert into tuberculosis_follow_record(id,name,aichive_no,Cardcode,id_number,visit_date,month_order,supervisor_type,visit_type,symptom,symptom_other,smoke_now,smoke_next,drink_now,drink_next,chemotherapy_plan,`usage`,drugs_type,miss,untoward_effect,untoward_effect_info,complication,complication_info,transfer_treatment_department,transfer_treatment_reason,twoweek_visit_result,handling_suggestion,next_visit_date,visit_doctor,stop_date,stop_reason,must_visit_num,actual_visit_num,must_medicine_num,actual_medicine_num,medicine_rate,estimate_doctor,create_user,create_name,create_time,create_org,create_org_name,upload_status) values(@id,@name,@aichive_no,@Cardcode,@id_number,@visit_date,@month_order,@supervisor_type,@visit_type,@symptom,@symptom_other,@smoke_now,@smoke_next,@drink_now,@drink_next,@chemotherapy_plan,@usage,@drugs_type,@miss,@untoward_effect,@untoward_effect_info,@complication,@complication_info,@transfer_treatment_department,@transfer_treatment_reason,@twoweek_visit_result,@handling_suggestion,@next_visit_date,@visit_doctor,@stop_date,@stop_reason,@must_visit_num,@actual_visit_num,@must_medicine_num,@actual_medicine_num,@medicine_rate,@estimate_doctor,@create_user,@create_name,@create_time,@create_org,@create_org_name,@upload_status)";

            MySqlParameter[] args = new MySqlParameter[] {
                new MySqlParameter("@id", info.id),
                new MySqlParameter("@name", info.name),
                new MySqlParameter("@aichive_no", info.aichive_no),
                new MySqlParameter("@Cardcode", info.Cardcode),
                new MySqlParameter("@id_number", info.id_number),
                new MySqlParameter("@visit_date", info.visit_date),
                new MySqlParameter("@month_order", info.month_order),
                new MySqlParameter("@supervisor_type", info.supervisor_type),
                new MySqlParameter("@visit_type", info.visit_type),
                new MySqlParameter("@symptom", info.symptom),
                new MySqlParameter("@symptom_other", info.symptom_other),
                new MySqlParameter("@smoke_now", info.smoke_now),
                new MySqlParameter("@smoke_next", info.smoke_next),
                new MySqlParameter("@drink_now", info.drink_now),
                new MySqlParameter("@drink_next", info.drink_next),
                new MySqlParameter("@chemotherapy_plan", info.chemotherapy_plan),
                new MySqlParameter("@usage", info.usage),
                new MySqlParameter("@drugs_type", info.drugs_type),
                new MySqlParameter("@miss", info.miss),
                new MySqlParameter("@untoward_effect", info.untoward_effect),
                new MySqlParameter("@untoward_effect_info", info.untoward_effect_info),
                new MySqlParameter("@complication", info.complication),
                new MySqlParameter("@complication_info", info.complication_info),
                new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                new MySqlParameter("@twoweek_visit_result", info.twoweek_visit_result),
                new MySqlParameter("@handling_suggestion", info.handling_suggestion),
                new MySqlParameter("@next_visit_date", info.next_visit_date),
                new MySqlParameter("@visit_doctor", info.visit_doctor),
                new MySqlParameter("@stop_date", info.stop_date),
                new MySqlParameter("@stop_reason", info.stop_reason),
                new MySqlParameter("@must_visit_num", info.must_visit_num),
                new MySqlParameter("@actual_visit_num", info.actual_visit_num),
                new MySqlParameter("@must_medicine_num", info.must_medicine_num),
                new MySqlParameter("@actual_medicine_num", info.actual_medicine_num),
                new MySqlParameter("@medicine_rate", info.medicine_rate),
                new MySqlParameter("@estimate_doctor", info.estimate_doctor),
                new MySqlParameter("@create_user", info.create_user),
                new MySqlParameter("@create_name", info.create_name),
                new MySqlParameter("@create_org", info.create_org),
                new MySqlParameter("@create_org_name", info.create_org_name),
                new MySqlParameter("@create_time", info.create_time),
                new MySqlParameter("@upload_status", "0"),
            };
            return(DbHelperMySQL.ExecuteSql(issql, args));
        }
Beispiel #3
0
        /// <summary>
        /// 获取界面数据
        /// </summary>
        /// <returns></returns>
        private tuberculosis_follow_record GetData()
        {
            tuberculosis_follow_record info = new tuberculosis_follow_record();

            info.visit_date  = 随访时间1.Value.ToString("yyyy-MM-dd HH:mm:ss");
            info.month_order = string.IsNullOrWhiteSpace(治疗月序1.Text) ? 0 : Convert.ToInt32(治疗月序1.Text);
            foreach (Control item in 督导人员1.Controls)
            {
                if (item is RadioButton)
                {
                    if (((RadioButton)item).Checked)
                    {
                        info.supervisor_type = ((RadioButton)item).Tag.ToString();
                    }
                }
            }
            foreach (Control item in 随访方式1.Controls)
            {
                if (item is RadioButton)
                {
                    if (((RadioButton)item).Checked)
                    {
                        info.visit_type = ((RadioButton)item).Tag.ToString();
                    }
                }
            }
            string symptom = string.Empty;

            foreach (Control item in 症状及体征1.Controls)
            {
                if (item is CheckBox)
                {
                    if (((CheckBox)item).Checked)
                    {
                        symptom += ((CheckBox)item).Tag.ToString() + ",";
                    }
                }
                else if (item is RichTextBox)
                {
                    info.symptom_other = ((RichTextBox)item).Text;
                }
            }
            info.symptom           = symptom.TrimEnd(',');
            info.smoke_now         = string.IsNullOrWhiteSpace(吸烟a1.Text) ? 0 : Convert.ToInt32(吸烟a1.Text);
            info.smoke_next        = string.IsNullOrWhiteSpace(吸烟a2.Text) ? 0 : Convert.ToInt32(吸烟a2.Text);
            info.drink_now         = string.IsNullOrWhiteSpace(饮酒a1.Text) ? 0 : Convert.ToInt32(饮酒a1.Text);
            info.drink_next        = string.IsNullOrWhiteSpace(饮酒a2.Text) ? 0 : Convert.ToInt32(饮酒a2.Text);
            info.chemotherapy_plan = 化疗方案1.Text;
            foreach (Control item in 用法1.Controls)
            {
                if (item is RadioButton)
                {
                    if (((RadioButton)item).Checked)
                    {
                        info.usage = ((RadioButton)item).Tag.ToString();
                    }
                }
            }
            foreach (Control item in 药品剂型1.Controls)
            {
                if (item is RadioButton)
                {
                    if (((RadioButton)item).Checked)
                    {
                        info.drugs_type = ((RadioButton)item).Tag.ToString();
                    }
                }
            }
            info.miss = Convert.ToInt32(string.IsNullOrWhiteSpace(漏服药次数1.Text) ? "0" : 漏服药次数1.Text);
            foreach (Control item in 药物不良反应1.Controls)
            {
                if (item is RadioButton)
                {
                    if (((RadioButton)item).Checked)
                    {
                        info.untoward_effect = ((RadioButton)item).Tag.ToString();
                    }
                }
                else if (item is TextBox)
                {
                    if (((TextBox)item).Name == "药物不良反应有1")
                    {
                        info.untoward_effect_info = ((TextBox)item).Text.ToString();
                    }
                }
            }
            info.transfer_treatment_department = 转诊科别1.Text;
            info.transfer_treatment_reason     = 转诊原因1.Text;
            info.twoweek_visit_result          = 转诊结果1.Text;
            info.handling_suggestion           = 处理意见1.Text;
            info.next_visit_date = 次随访时间1.Value.ToString("yyyy-MM-dd HH:mm:ss");
            info.visit_doctor    = 随访医生签名1.Text;
            string stop_reason = string.Empty;

            foreach (Control item in 停止治疗原因1.Controls)
            {
                if (item is CheckBox)
                {
                    if (((CheckBox)item).Checked)
                    {
                        stop_reason += ((CheckBox)item).Tag.ToString() + ",";
                    }
                }
            }
            info.stop_reason         = stop_reason.TrimEnd(',');
            info.stop_date           = 出现停止治疗时间1.Value.ToString("yyyy-MM-dd HH:mm:ss");
            info.must_visit_num      = string.IsNullOrWhiteSpace(应访视患者次数1.Text) ? 0 : Convert.ToInt32(应访视患者次数1.Text);
            info.actual_visit_num    = string.IsNullOrWhiteSpace(实际访视次数1.Text) ? 0 : Convert.ToInt32(实际访视次数1.Text);
            info.must_medicine_num   = string.IsNullOrWhiteSpace(应服药次数1.Text) ? 0 : Convert.ToInt32(应服药次数1.Text);
            info.actual_medicine_num = string.IsNullOrWhiteSpace(实际服药次数1.Text) ? 0 : Convert.ToInt32(实际服药次数1.Text);
            info.medicine_rate       = 药率1.Text;
            return(info);
        }