private void FillInputXMLByClass()
 {
     patexam_Class CurPatexam = new patexam_Class(CurAccessno);
     patregister_Class CurPatRegister = new patregister_Class(CurAccessno);
     //DataTable dt = new DataTable();
     //dt = ReportStyle_Class.GetApplyStyle();
     //if (dt != null)
     //{
     //    ReportStyle_Class d_style = new ReportStyle_Class(dt.Rows[0]);
     //    if (d_style.xmltext != "")
     //        myEditControl.LoadDocumentFromString(d_style.xmltext, "xml");
     //    else
     //    {
     //        string fileName = "";
     //        fileName = Share_Class.Dir + @"\xml\Apply.xml";
     //        myEditControl.ExecuteCommand("FileOpen", false, fileName);
     //    }
     //}
     //else
     //{
         string fileName = "";
         fileName = Share_Class.Dir + @"\xml\Apply.xml"; 
         myEditControl.ExecuteCommand("FileOpen", false, fileName);
     //}
         
     string d_ReportType = "检查申请单";
     myEditControl.SetDocumentParameterValue("hospitalname", Share_Class.hospital_name);
     myEditControl.SetDocumentParameterValue("ReportType", d_ReportType);
     myEditControl.SetDocumentParameterValue("patexam", CurPatexam);
     myEditControl.SetDocumentParameterValue("patregister", CurPatRegister);
 }
 public FTPSETUP_Class GetFTPSETUPByFTPCODE()
 {
     patregister_Class CurPatregister = new patregister_Class(CurPatexam.accessno);
     FTPSETUP_Class CurFTPSETUP = new FTPSETUP_Class(CurPatregister.ftpcode);
     if (CurFTPSETUP.id == 0)
         CurFTPSETUP.GetDataByFTPStatus();
     return CurFTPSETUP;
 }
 public SendMessage_Form(patexam_Class p_patexam)
 {
     InitializeComponent();
     patregister_Class d_Patregister = new patregister_Class(p_patexam.patid);
     Name_TextEdit.Text = d_Patregister.Name;
     patient_id_TextEdit.Text = p_patexam.Patient_id;
     xno_TextEdit.Text = p_patexam.xno;
     accesno_TextEdit.Text = p_patexam.accessno;
     telephone_ComboBoxEdit.Text = d_Patregister.Telephone;
     d_patexam = p_patexam;
 }
        private void FillInputByClass()
        {

            CurPatRegister = new patregister_Class(CurPatexam.patid);//'得到病人信息
            patient_name_Label.Text = CurPatRegister.Name; ;
            patient_sex_Label.Text = CurPatRegister.Sex;
            patient_age_Label.Text = CurPatRegister.Age;
            patient_id_Label.Text = CurPatexam.Patient_id;
            Label_xno.Text = CurPatexam.xno;
            Label_accessno.Text = CurPatexam.accessno;
            Label_addTime.Text = CurPatexam.checkdate.ToString();
            Labelbedno.Text = CurPatexam.BedNo;
            sqdep_Label.Text = CurPatexam.sqdep;

        }
        private void FillInputByClass(patexam_Class p_patexam)
        {
            patregister_Class d_Patregister = new patregister_Class(p_patexam.patid);

            Name_TextEdit.Text = d_Patregister.Name;
            sex_TextEdit.Text = d_Patregister.Sex;
            agetrue_TextEdit.Text = p_patexam.agetrue;
            sqdep_TextEdit.Text = p_patexam.sqdep;
            clinicinfo_MemoEdit.Text = p_patexam.clinicinfo;
            clinicend_MemoEdit.Text = p_patexam.clinicend;
            checkpos_MemoEdit.Text = p_patexam.checkpos;
            doctor_TextEdit.Text = p_patexam.Doctor;
            checkdate_TextEdit.Text = p_patexam.checkdate.ToString();
            modality_TextEdit.Text = p_patexam.modality;
            xno_TextEdit.Text = p_patexam.xno;
            checkid_TextEdit.Text = p_patexam.checkid.ToString();
            Radio_doctor_TextEdit.Text = p_patexam.radio_doctor;
            remark_MemoEdit.Text = p_patexam.exammark;

            //int  _index_Site = 0;
            //Font newFont   = new Font("宋体", 14, FontStyle.Bold);
            //string  _str[] = new string [6];
            //_str[0] = "肾功能不全";
            //_str[1] = "服用二甲双胍类药物";
            //_str[2] = "";
            //_str(3) = "";
            //_str(4) = "";

            //_index_Site = clinicinfo_MemoEdit.Text.ToString().IndexOf("检查目的")
            //If _index_Site > -1 Then
            //    clinicinfo_MemoEdit.Select(_index_Site, clinicinfo_MemoEdit.Text.ToString.Length - _index_Site)
            //    clinicinfo_MemoEdit.SelectionColor = Color.Red
            //    clinicinfo_MemoEdit.SelectionFont = newFont
            //    clinicinfo_MemoEdit.Select(clinicinfo_MemoEdit.Text.ToString().Length, 0)
            //    clinicinfo_MemoEdit.SelectionColor = Color.Black
            //End If

        }
        private void type_ComboBoxEdit_SelectedIndexChanged(object sender, EventArgs e)
        {
            string d_modality = d_patexam.modality;
            if (d_patexam.dep == "XRAY")
                d_modality = "DX";
            else if (d_patexam.dep == "MRI")
                d_modality = "MRI";
            else if (d_patexam.dep == "CT")
                d_modality = "CT";
            else if (d_patexam.dep == "DSA")
                d_modality = "DSA";
            if (type_ComboBoxEdit.Text == "设置")
            {
                Setup_Dict.setup_item_dic_dmb_Form fm = new Setup_Dict.setup_item_dic_dmb_Form(d_patexam.dep, d_modality, "短信类型");
                fm.ShowDialog();
                type_ComboBoxEdit.Properties.Items.Clear();
                type_ComboBoxEdit.Text = "";
                FillComboBox();
            }
            else
            {

                DataSet ds = new DataSet();
                ds = Setup_Dict.setup_item_dic_dmb_Class.GetITEM(d_patexam.dep, d_modality, "短信类型", "", type_ComboBoxEdit.Text);
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            Remark_MemoEdit.Text = ds.Tables[0].Rows[0]["item_value"].ToString();
                            Remark_MemoEdit.Text = Remark_MemoEdit.Text.Replace("[modcheckdate]", d_patexam.modcheckdate.ToString()).Replace("[modality]", d_patexam.modality).Replace("[appoint_date]", d_patexam.appoint_date.ToString());
                            patregister_Class d_Patregister = new patregister_Class(d_patexam.patid);
                            Remark_MemoEdit.Text = Remark_MemoEdit.Text.Replace("[name]", d_Patregister.Name).Replace("[othercheck]", d_patexam.othercheck);

                        }
                    }
                }
            }
        }
 public BaseReport_Form(patexam_Class p_Patexam)
 {
     InitializeComponent();
     clsPatexam = p_Patexam;
     clsPatregister = new patregister_Class(p_Patexam.accessno);
 }
 public virtual void ReBulid(string p_accessno)
 {
     clsPatexam = new patexam_Class(p_accessno);
     clsPatregister = new patregister_Class(p_accessno);
 }
 public BaseReport_Form(string p_accessno)
 {
     InitializeComponent();
     clsPatexam = new patexam_Class(p_accessno);
     clsPatregister = new patregister_Class(p_accessno);
 }
 public BaseReport_Form()
 {
     InitializeComponent();
     clsPatexam = new patexam_Class();
     clsPatregister = new patregister_Class();
 }
        private void FillClassByInputXML(ref patexam_Class p_Patexam, ref patregister_Class p_PatRegister)
        {

            myEditControl.ExecuteCommand("UpdateDataSourceForView", false, null);
            string d_xmltext = (string)myEditControl.ExecuteCommand("ViewXMLSource", false, null);
            p_Patexam = (patexam_Class)myEditControl.GetDocumnetParameterValue("patexam");
            p_PatRegister = (patregister_Class)myEditControl.GetDocumnetParameterValue("patregister");
            //CurPatReport.xmltext = d_xmltext;
            try
            {
                XTextTableElement reportinfotable = (XTextTableElement)myEditControl.GetElementById("reportinfotable");
                try
                {
                    XTextTableCellElement d_cell = reportinfotable.GetCell(0, 0, true);
                    CurPatexam.reportinfo = d_cell.Text;

                }
                catch { }
                XTextTableElement reportendtable = (XTextTableElement)myEditControl.GetElementById("reportendtable");
                try
                {
                    XTextTableCellElement d_cell = reportendtable.GetCell(0, 0, true);
                    CurPatexam.reportend = d_cell.Text;
                    //d_cell.ContentBuilder.AppendText(CurPatexam.reportend);
                }
                catch { }
                //string d_reportdisease = "";
                //for (int i = 0; i < reportdisease_CheckedListBoxControl.Items.Count; i++)
                //{
                //    if (reportdisease_CheckedListBoxControl.Items[i].CheckState == CheckState.Checked)
                //        d_reportdisease += reportdisease_CheckedListBoxControl.Items[i].Value.ToString().Trim() + ",";
                //}
                //if (d_reportdisease != "")
                //    d_reportdisease = d_reportdisease.TrimEnd(new char[] { ',' });
                //p_Patexam.reportdisease = d_reportdisease;
                //string d_disease = "";
                //for (int i = 0; i < diseasetype_CheckedListBoxControl.Items.Count; i++)
                //{
                //    if (diseasetype_CheckedListBoxControl.Items[i].CheckState == CheckState.Checked)
                //        d_disease += diseasetype_CheckedListBoxControl.Items[i].Value.ToString().Trim() + ",";
                //}
                //if (d_disease != "")
                //    d_disease = d_disease.TrimEnd(new char[] { ',' });
                //p_Patexam.diseasetype = d_disease;
            }
            catch { }
        }
        private void FillApplyByClass()
        {
            patexam_Class ApplyPatexam = new patexam_Class(CurPatexam.accessno);
            patregister_Class ApplyPatRegister = new patregister_Class(CurPatexam.accessno);
            if ((ApplyPatexam.dep == "US") || (ApplyPatexam.dep == "DG") || (ApplyPatexam.dep == "ES") || (ApplyPatexam.dep == "内窥镜"))
            {
                FTP_image_simpleButton.Visible = true;
            }
            else
                FTP_image_simpleButton.Visible = false;
            Image d_image = null;
            //if (ApplyPatexam.picture_path.Trim() != "")
            //{
            //    ApplyImage_Class d_applyimage = new ApplyImage_Class();
            //    d_image = d_applyimage.GetImage(ApplyPatexam.picture_path);
            //}
            if (d_image != null)
            {//图像
                apply_writerControl.ExecuteCommand(StandardCommandNames.FileNew, false, null);
                XTextImageElement imgElement = new XTextImageElement();
                imgElement.ImageValue = d_image;
                string d_GetValue = RisSetup_Class.GetINI("setup", "ApplyImageBig");
                float d_ApplyImageBig = 1;
                try
                {
                    if (d_GetValue != "")
                    {
                        d_ApplyImageBig = Convert.ToSingle(d_GetValue);
                    }
                }
                catch { d_ApplyImageBig = 1; }
                imgElement.Width = d_image.Width * d_ApplyImageBig;
                imgElement.Height = d_image.Height * d_ApplyImageBig;
                apply_writerControl.ExecuteCommand(StandardCommandNames.InsertImage, false, imgElement);

            }
            else
            {
                //DataTable dt = new DataTable();
                //dt = ReportStyle_Class.GetApplyStyle();
                //if (dt != null)
                //{
                //    ReportStyle_Class d_style = new ReportStyle_Class(dt.Rows[0]);
                //    if (d_style.xmltext != "")
                //        apply_writerControl.LoadDocumentFromString(d_style.xmltext, "xml");
                //    else
                //    {
                //        string fileName = "";
                //        fileName = Share_Class.Dir + @"\xml\Apply.xml";
                //        apply_writerControl.ExecuteCommand("FileOpen", false, fileName);
                //    }
                //}
                //else
                //{
                string fileName = "";
                fileName = Share_Class.Dir + @"\xmlStyle\Apply.xml";
                apply_writerControl.ExecuteCommand("FileOpen", false, fileName);
                //}

                string d_ReportType = "检查申请单";
                apply_writerControl.SetDocumentParameterValue("hospitalname", Share_Class.hospital_name);
                apply_writerControl.SetDocumentParameterValue("ReportType", d_ReportType);
                apply_writerControl.SetDocumentParameterValue("patexam", ApplyPatexam);
                apply_writerControl.SetDocumentParameterValue("patregister", ApplyPatRegister);
                apply_writerControl.ExecuteCommand("UpdateViewForDataSource", false, null);

            }
        }
        private void FillInputXMLByClass()
        {

            if (CurPatexam.reportdoc.Trim() == "")
            {// '如果报告医生为空,表示是第一次报告编辑,把当前用户设置成报告医生
                CurPatexam.reportdoc = Share_Class.User.user_id;
            }
            else
            {
                CurPatexam.reportdoc = CurPatexam.reportdoc.Trim();
            }
            if (CurPatexam.reportdate.Year == 1900)
            {// '如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                CurPatexam.reportdate = DateTime.Now;
            }

            if (CurPatexam.modcheckdate.Year == 1900)
            {// '如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                CurPatexam.modcheckdate = DateTime.Now;
            }
            if (CurPatexam.machinetype == "")
            {

                string d_GetValue = RisSetup_Class.GetINI("setup", CurPatexam.dep + "machinetype");
                CurPatexam.machinetype = d_GetValue;
            }
            string d_ReportType = "";
            try
            {

                if (CurPatexam.dep == "XRAY")
                {
                    d_ReportType = "X线检查报告单";
                }
                else if (CurPatexam.dep == "CT")
                {
                    d_ReportType = "CT检查报告单";
                }
                else if (CurPatexam.dep == "MRI")
                {
                    d_ReportType = "核磁共振(MRI)检查报告单";
                }
                else if (CurPatexam.dep == "DSA")
                {
                    d_ReportType = "DSA检查报告单";
                }
                else if (CurPatexam.dep == "DG")
                {
                    d_ReportType = "病理报告单";
                }
                else if (CurPatexam.dep == "内窥镜")
                {
                    d_ReportType = "电子内镜检查报告单";
                }
                else if (CurPatexam.dep == "US")
                {
                    d_ReportType = "多普勒超声检查报告单";
                }
                else
                {
                    d_ReportType = "报告单";
                }
            }
            catch { }
            patregister_Class CurPatregister = new patregister_Class(CurAccessno);
            myEditControl.SetDocumentParameterValue("hospitalname", Share_Class.hospital_name);
            myEditControl.SetDocumentParameterValue("ReportType", d_ReportType);
            myEditControl.SetDocumentParameterValue("patexam", CurPatexam);
            myEditControl.SetDocumentParameterValue("patregister", CurPatregister);
            myEditControl.ExecuteCommand("UpdateViewForDataSource", false, null);
        }
        public override bool Save()
        {
            //if (CurPatexam.dep != "DG")
            //{
            //    if (SaveQc_radiology("书写评价") == false)
            //        return false;

            //}
            //else
            //{
            //    SaveBitmap();
            //}
            patregister_Class d_patregistr = new patregister_Class();
            patexam_Class d_patexam = new patexam_Class();
            FillClassByInputXML(ref d_patexam, ref d_patregistr);
            d_patexam.advancedoc = "";
            d_patexam.advancedoc_code = "";
            d_patexam.reportdoc = Share_Class.User.user_id;
            d_patexam.reportdoc_code = Share_Class.User.doctor_code;
            myEditControl.SetDocumentParameterValue("patexam", d_patexam);
            myEditControl.ExecuteCommand("UpdateViewForDataSource", false, null);

            d_patexam.Save_Report();
            base.ReBulid(d_patexam.accessno);
            ShowDoctorImage();
            SaveXmlFile();
            myEditControl.DocumentOptions.ViewOptions.FieldTextColor = Color.Black;
            myEditControl.ExecuteCommand("FileSaveAs", false, Share_Class.Dir + @"\xml\" + CurPatexam.checkdate.Date.ToString("yyyyMMdd") + @"\" + CurPatexam.accessno + ".xml");
            return true;
        }
        public override void getTemplateContent(ref string p_template_diag, ref string p_template_describle, ref string p_template_part, ref string p_dep)
        {
            patregister_Class d_patregistr = new patregister_Class();
            patexam_Class p_patexam = new patexam_Class();
            FillClassByInputXML(ref p_patexam, ref d_patregistr);
            p_template_diag = p_patexam.reportend;
            p_template_describle = p_patexam.reportinfo;
            p_template_part = p_patexam.checkpos;
            //string d_reportdisease = this.ICD_10_ComboBoxEdit.Text.Trim();
            //if (d_reportdisease == "")
            //{
            //    for (int i = 0; i < reportdisease_CheckedListBoxControl.Items.Count; i++)
            //    {
            //        if (reportdisease_CheckedListBoxControl.Items[i].CheckState == CheckState.Checked)
            //            d_reportdisease += reportdisease_CheckedListBoxControl.Items[i].Value.ToString().Trim() + ",";
            //    }
            //    if (d_reportdisease != "")
            //        d_reportdisease = d_reportdisease.TrimEnd(new char[] { ',' });
            //}

            //p_patexam.reportdisease = d_reportdisease;
            //string d_disease = diseasetype_ComboBoxEdit.Text.Trim();
            //if (d_disease == "")
            //{
            //    for (int i = 0; i < diseasetype_CheckedListBoxControl.Items.Count; i++)
            //    {
            //        if (diseasetype_CheckedListBoxControl.Items[i].CheckState == CheckState.Checked)
            //            d_disease += diseasetype_CheckedListBoxControl.Items[i].Value.ToString().Trim() + ",";
            //    }
            //    if (d_disease != "")
            //        d_disease = d_disease.TrimEnd(new char[] { ',' });
            //}
            //p_patexam.diseasetype = d_disease;
        }
 public override void getTemplateContent(ref string p_template_diag, ref string p_template_describle, ref patexam_Class p_patexam)
 {
     patregister_Class d_patregistr = new patregister_Class();
     FillClassByInputXML(ref p_patexam, ref d_patregistr);
     p_template_diag = p_patexam.reportend;
     p_template_describle = p_patexam.reportinfo;
 }
        private void Init_List()
        {

            patregister_Class d_PatRegister = new patregister_Class(CurPatexam.patid); //'得到病人信息
            if (CurPatexam.reportdoc.Trim() == "")
            {// '如果报告医生为空,表示是第一次报告编辑,把当前用户设置成报告医生
                d_patientlist.Add("reportdoc", Share_Class.User.user_id);
            }
            else
            {
                d_patientlist.Add("reportdoc", CurPatexam.reportdoc.Trim());
            }
            if (CurPatexam.reportdate.Year == 1900)
            {// '如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                CurPatexam.reportdate = Share_Class.GetSysdate();
            }
            if (CurPatexam.modcheckdate.Year == 1900)
            {// '如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                CurPatexam.modcheckdate = Share_Class.GetSysdate();
            }
            if (CurPatexam.machinetype == "")
            {
                string d_GetValue = "";
                //d_GetValue = setup_check_room_Dmb_Class.machinetypebycheckroom(CurPatexam.modality, CurPatexam.othercheck, CurPatexam.dep);
                if (d_GetValue == "")
                {
                    d_GetValue = RisSetup_Class.GetINI("setup", "CTmachinetype");
                    CurPatexam.machinetype = d_GetValue;
                }
            }
            d_patientlist.Add("modcheckdate", CurPatexam.modcheckdate.ToString().Trim());
            d_patientlist.Add("age", d_PatRegister.Age.ToString().Trim());
            // '  d_patientlist.Add("machinetype", .machinetype.ToString().Trim());
            d_patientlist.Add("name", d_PatRegister.Name.ToString().Trim());
            d_patientlist.Add("sex", d_PatRegister.Sex.ToString().Trim());
            d_patientlist.Add("sqdep", CurPatexam.sqdep.ToString().Trim());
            d_patientlist.Add("checktype", CurPatexam.checktype.ToString().Trim());
            // ' d_patientlist.Add("checktype", .checktype.ToString().Trim());
            d_patientlist.Add("clinicend", CurPatexam.clinicend.ToString().Trim());
            d_patientlist.Add("bedNo", CurPatexam.BedNo.ToString().Trim());
            d_patientlist.Add("layerthick", CurPatexam.layerthick.ToString().Trim());
            d_patientlist.Add("xno", CurPatexam.xno.ToString().Trim());
            d_patientlist.Add("checkpos", CurPatexam.checkpos.ToString().Trim());
            d_patientlist.Add("layerinterval", CurPatexam.layerinterval.ToString().Trim());
            d_patientlist.Add("reportinfo", CurPatexam.reportinfo.ToString().Trim());
            d_patientlist.Add("reportend", CurPatexam.reportend.ToString().Trim());
            d_patientlist.Add("machinetype", CurPatexam.machinetype.ToString().Trim());
            //' d_patientlist.Add("modcheckdate", .modcheckdate.ToString.Trim)
            //' d_patientlist.Add("modcheckdate", .modcheckdate.ToString.Trim)       




        }
        private void FillInputByClass()
        {

            patregister_Class d_PatRegister = new patregister_Class(CurPatexam.patid);// '得到病人信息
            if (CurPatexam.reportdoc.Trim() == "")
            {// '如果报告医生为空,表示是第一次报告编辑,把当前用户设置成报告医生
                reportdoc_TextEdit.Text = Share_Class.User.user_id;
            }
            else
            {
                reportdoc_TextEdit.Text = CurPatexam.reportdoc.Trim();
            }

            if (CurPatexam.reportdate.Year == 1900)
            {// '如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                CurPatexam.reportdate = Share_Class.GetSysdate();
            }

            if (CurPatexam.modcheckdate.Year == 1900)
            { //'如果报告时间为1900,表示是第一次报告编辑,把当前时间设置成报告时间
                modcheckdate_ComboBoxEdit.Text = Share_Class.GetSysdate().ToString("yyyy-MM-dd");
            }
            else
            {
                modcheckdate_ComboBoxEdit.Text = CurPatexam.modcheckdate.ToString("yyyy-MM-dd");
                modcheckdate_ComboBoxEdit.Enabled = false;
            }
            machinetype_ComboBoxEdit.Text = CurPatexam.machinetype.Trim();
            Name_TextEdit.Text = d_PatRegister.Name.Trim();
            Sex_TextEdit.Text = d_PatRegister.Sex.Trim();
            Age_TextEdit.Text = d_PatRegister.Age.Trim();
            sqdep_ComboBoxEdit.Text = CurPatexam.sqdep.Trim();
            if (CurPatexam.checktype.Trim() == "")
            {
                checktype_ComboBoxEdit.Text = "平扫";
            }
            else
            {
                checktype_ComboBoxEdit.Text = CurPatexam.checktype.Trim();
            }
            checktype_ComboBoxEdit.Text = CurPatexam.checktype.Trim();
            clinicend_TextEdit.Text = CurPatexam.clinicend.Trim();
            bedno_TextEdit.Text = CurPatexam.BedNo.Trim();
            layerthick_ComboBoxEdit.Text = CurPatexam.layerthick.Trim();
            xno_TextEdit.Text = CurPatexam.xno.ToString().Trim();
            checkpos_ComboBoxEdit.Text = CurPatexam.checkpos.Trim();
            layerinterval_ComboBoxEdit.Text = CurPatexam.layerinterval.Trim();
            reportinfo_RichTextBox.Rtf = CurPatexam.reportinfo;

            reportend_RichTextBox.Rtf = CurPatexam.reportend;


            if (CurPatexam.machinetype != "")
            {
                machinetype_ComboBoxEdit.Text = CurPatexam.machinetype.Trim();
            }
            else
            {
                string d_GetValue = "";
                //d_GetValue = setup_check_room_Dmb_Class.machinetypebycheckroom(CurPatexam.modality,CurPatexam .othercheck, CurPatexam.dep);
                if (d_GetValue == "")
                {
                    d_GetValue = RisSetup_Class.GetINI("setup", "CTmachinetype");
                }
                machinetype_ComboBoxEdit.Text = d_GetValue;
            }

        }