コード例 #1
0
        private void GridWaitResult_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                string HNno = GridWaitResult["ColHN1", e.RowIndex].Value.ToString();
                txtHN.Text = HNno;
                CurrentPFT = (from t1 in dbc.trn_pfts
                              where t1.trn_patient_regi.trn_patient.tpt_hn_no == HNno
                              orderby t1.tpr_id descending
                              select t1).FirstOrDefault();
                var objcurrentRegis = (from t1 in dbc.trn_pfts
                                       where t1.trn_patient_regi.trn_patient.tpt_hn_no == HNno
                                       orderby t1.tpr_id descending
                                       select new
                {
                    HN = t1.trn_patient_regi.trn_patient.tpt_hn_no,
                    EN = t1.trn_patient_regi.tpr_en_no,
                    FullName = t1.trn_patient_regi.trn_patient.tpt_othername,
                    Arrivedate = t1.trn_patient_regi.tpr_arrive_date,
                    CheckDocName = t1.tpf_doc_name
                }).FirstOrDefault();
                if (objcurrentRegis != null)
                {
                    txtENno.Text        = objcurrentRegis.EN;
                    txtName.Text        = objcurrentRegis.FullName;
                    txtArriveDate.Text  = objcurrentRegis.Arrivedate.Value.ToString("dd/MM/yyyy");
                    txtDoctorCheck.Text = objcurrentRegis.CheckDocName;

                    ch_ResultAlert.Enabled = false;
                    DateTimeAlert.Enabled  = false;
                    txtRemark.Enabled      = false;
                }
            }
        }
コード例 #2
0
 private void autoCompleteUC1_SelectedValueChanged(object sender, object e)
 {
     try
     {
         trn_pft pft = bsPatientPFT.OfType <trn_pft>().FirstOrDefault();
         if (pft != null)
         {
             if (e == null)
             {
                 txtDoctorCode.Text     = "";
                 pft.tpf_doc_code       = null;
                 pft.tpf_doctor_license = null;
                 pft.tpf_doctor_name_en = null;
                 pft.tpf_doctor_name_th = null;
             }
             else
             {
                 txtDoctorCode.Text     = ((DoctorProfile)e).SSUSR_Initials;
                 pft.tpf_doc_code       = ((DoctorProfile)e).SSUSR_Initials;
                 pft.tpf_doctor_license = ((DoctorProfile)e).CTPCP_SMCNo;
                 DoctorName dn = obj.GetDoctorName(((DoctorProfile)e).CTPCP_Desc);
                 pft.tpf_doctor_name_en = dn.NameEN;
                 pft.tpf_doctor_name_th = dn.NameTH;
             }
         }
     }
     catch (Exception ex)
     {
         Program.MessageError(this.Name, "autoCompleteUC1_SelectedValueChanged", ex, false);
     }
 }
コード例 #3
0
        public void EndEdit()
        {
            DateTime dateNow   = Program.GetServerDateTime();
            string   user_name = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username;

            trn_pft patientPFT = bsPatientPFT.OfType <trn_pft>().FirstOrDefault();

            if (patientPFT.tpf_create_by == null)
            {
                patientPFT.tpf_create_by   = user_name;
                patientPFT.tpf_create_date = dateNow;
            }
            patientPFT.tpf_update_by   = user_name;
            patientPFT.tpf_update_date = dateNow;
        }
コード例 #4
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                if (SaveData())
                {
                    ////Code Not Confirm
                    trn_pft objcurrentpft = (trn_pft)PFTbindingSource1.Current;
                    objcurrentpft.tpf_type       = 'N';
                    objcurrentpft.tpf_doc_result = true;
                    PictureBox p1 = new PictureBox();
                    using (Bitmap bitmap = new Bitmap(pictureBox_result.ClientSize.Width, pictureBox_result.ClientSize.Height))
                    {
                        pictureBox_result.DrawToBitmap(bitmap, pictureBox_result.ClientRectangle);
                        Bitmap bmp = new Bitmap(bitmap);
                        p1.SizeMode = PictureBoxSizeMode.StretchImage;
                        p1.Image    = (Image)bmp;
                    }
                    MemoryStream stream = new MemoryStream();
                    p1.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
                    byte[] img1 = stream.ToArray();
                    objcurrentpft.tpf_docscan_img = img1;
                    dbc.SubmitChanges();
                    lbAlertMsg.Text = "Save Data Completed.";
                }

                string result = new EmrClass.DocScan.SendToDocScanCls().Send(Program.CurrentRegis.tpr_id, "LR102", Program.CurrentSite.mhs_code, Program.CurrentUser.mut_username);
                //lbAlertMsg.Text = result;

                //if (docscan.SendtoDocscan("LR102", Program.CurrentRegis.tpr_id, Program.CurrentRegis.tpr_en_no, Program.getCurrentCareProvider))
                //{
                //    lbAlertMsg.Text = "Save Data Completed.";
                //}
                //else
                //{

                //}
            }
            catch
            {
                return;
            }
        }
コード例 #5
0
        private bool SaveData()
        {
            bool isCompleted = false;

            try
            {
                DateTime dtnow         = Program.GetServerDateTime();
                trn_pft  objcurrentpft = (trn_pft)PFTbindingSource1.Current;
                if (objcurrentpft.tpr_id == 0)
                {
                    objcurrentpft.tpr_id = Program.CurrentRegis.tpr_id;
                }
                if (objcurrentpft.tpf_create_by == null)
                {
                    objcurrentpft.tpf_create_by   = Program.CurrentUser.mut_username;
                    objcurrentpft.tpf_create_date = dtnow;
                }
                objcurrentpft.tpf_update_by   = Program.CurrentUser.mut_username;
                objcurrentpft.tpf_update_date = dtnow;
                objcurrentpft.tpf_result      = true;

                PictureBox p1 = new PictureBox();
                using (Bitmap bitmap = new Bitmap(pictureBox_result.ClientSize.Width, pictureBox_result.ClientSize.Height))
                {
                    pictureBox_result.DrawToBitmap(bitmap, pictureBox_result.ClientRectangle);
                    Bitmap bmp = new Bitmap(bitmap);
                    p1.SizeMode = PictureBoxSizeMode.StretchImage;
                    p1.Image    = (Image)bmp;
                }
                MemoryStream stream = new MemoryStream();
                p1.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
                byte[] img1 = stream.ToArray();
                objcurrentpft.tpf_docscan_img = img1;

                trn_ques_patient objqp = (trn_ques_patient)QestionPatientbindingSource1.Current;
                //load เคยมีอาการหรือปัญหาเหล่านี้หรือไม่
                if (objqp.tpr_id == 0)
                {
                    objqp.tpr_id = Program.CurrentRegis.tpr_id;
                }

                objqp.tqp_symp_faint     = Program.GetValueRadioTochar(pl_symp_faint);
                objqp.tqp_symp_shake     = Program.GetValueRadioTochar(pl_symp_shake);
                objqp.tqp_symp_wind      = Program.GetValueRadioTochar(pl_symp_wind);
                objqp.tqp_symp_breath    = Program.GetValueRadioTochar(pl_symp_breath);
                objqp.tqp_symp_vein      = Program.GetValueRadioTochar(pl_symp_vein);
                objqp.tqp_symp_paralysis = Program.GetValueRadioTochar(pl_symp_paralysis);

                // Load 5
                objqp.tqp_his_smok = Program.GetValueGroupBox(gb_his_smok);
                if (objqp.tqp_his_smok == 'S')
                {
                    objqp.tqp_his_smok_amt = Convert1.ToDouble(txt_his_smok_amt1.Text);
                    objqp.tqp_his_smok_dur = Convert1.ToDouble(txt_his_smok_dur1.Text);
                }
                else if (objqp.tqp_his_smok == 'Q')
                {
                    objqp.tqp_his_smok_amt = Convert1.ToDouble(txt_his_smok_amt2.Text);
                    objqp.tqp_his_smok_dur = Convert1.ToDouble(txt_his_smok_dur2.Text);
                }

                //load 6.1 ไอ
                objqp.tqp_cur_ill_cough  = Program.GetValueRadioTochar(pl2_cur_ill_cough);
                objqp.tqp_cur_ill_wcough = Program.GetValueRadioTochar(pl2_cur_ill_wcough);
                objqp.tqp_cur_ill_gcough = Program.GetValueRadioTochar(pl2_cur_ill_gcough);
                objqp.tqp_cur_ill_bcough = Program.GetValueRadioTochar(pl2_cur_ill_bcough);

                //6.2 เหนื่อยหอบ
                objqp.tqp_cur_ill_pant = Program.GetValueRadioTochar(pl3_cur_ill_pant);

                //ความถี่ของการเกิดอาการ
                objqp.tqp_pat_freq = Program.GetValueRadioTochar(pl4_pat_freq);
                if (objqp.tqp_create_by == null)
                {
                    objqp.tqp_create_by   = Program.CurrentUser.mut_username;
                    objqp.tqp_create_date = dtnow;
                }
                objqp.tqp_update_by   = Program.CurrentUser.mut_username;
                objqp.tqp_update_date = dtnow;

                PFTbindingSource1.EndEdit();
                QestionPatientbindingSource1.EndEdit();
                try
                {
                    dbc.SubmitChanges();
                }
                catch (System.Data.Linq.ChangeConflictException)
                {
                    foreach (System.Data.Linq.ObjectChangeConflict occ in dbc.ChangeConflicts)
                    {
                        dbc.Refresh(System.Data.Linq.RefreshMode.KeepChanges, occ.Object);
                    }
                    dbc.SubmitChanges();
                }
                isCompleted = true;
            }
            catch (Exception ex)
            {
                Program.MessageError(this.Name, "SaveData", ex, false);
            }
            return(isCompleted);
        }