Example #1
0
        private static int BK101(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count101 = dbcBookLog.pw_CR_PatienBook_PatientProfile(tprID).Count();

            StatusPage = (count101 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #2
0
        private void DialogInterpretation_Load(object sender, EventArgs e)
        {
            using (CheckupDataContext cdc = new CheckupDataContext())
            {
                // Select lab group name for display on header
                var labGroup = cdc.trn_patient_ass_dtls.Where(x => x.tped_lab_code.Equals(dtl.tped_lab_code)).FirstOrDefault();
                txtLabGroup.Text = labGroup.tped_lab_name;
                // Select default interpretation
                var ptlGroup = cdc.mst_lab_recoms.Where(x => x.mlr_id.Equals(dtl.mlr_id)).FirstOrDefault();
                txtDefIntEN.Text = string.Empty;
                txtDefIntTH.Text = string.Empty;
                txtDefIntJP.Text = string.Empty;
                if (ptlGroup != null)
                {
                    txtDefIntEN.Text = string.IsNullOrEmpty(ptlGroup.mlr_en_name) ? "" : ptlGroup.mlr_en_name;
                    txtDefIntTH.Text = string.IsNullOrEmpty(ptlGroup.mlr_th_name) ? "" : ptlGroup.mlr_th_name;
                    txtDefIntJP.Text = string.IsNullOrEmpty(ptlGroup.mlr_jp_name) ? "" : ptlGroup.mlr_jp_name;
                }
            }

            txtNewIntEN.Text = dtl.tped_lab_result_eng;
            txtNewIntTH.Text = dtl.tped_lab_result_thai;
            txtNewIntJP.Text = dtl.tped_lab_result_jp;
            txtItemCode.Text = dtl.tped_lab_code;
            txtItemName.Text = dtl.tped_lab_name;

            txtNormalRange.Text = dtl.tped_lab_nrange;
            txtUnit.Text        = dtl.tped_lab_unit;
            txtResult.Text      = dtl.tped_lab_value;
            txtSummary.Text     = dtl.tped_summary.ToString();
        }
Example #3
0
        private static int BK111(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count111 = dbcBookLog.pw_CR_PatienBook_HearingTest_hdr(tprID).Count();

            StatusPage = (count111 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #4
0
        private static int BK102(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count102 = dbcBookLog.pw_CR_PatienBook_MedicalHistory(tprID).Count();

            StatusPage = (count102 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #5
0
        private static int BK104(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count104 = dbcBookLog.pw_CR_PatienBook_LaboratoryResult(tprID).Count();

            StatusPage = (count104 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #6
0
        private static int BK113(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count113 = dbcBookLog.pw_CR_PatienBook_DentalScreeningRecord_hdr(tprID).Count();

            StatusPage = (count113 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #7
0
 public void LoadData(CheckupDataContext dbc)
 {
     if (Program.CurrentRoom != null)
     {
         try
         {
             var objwaitlist = new Class.WaitingListCls().getWaitingRoomDtl(Program.CurrentRoom.mrd_id, Program.CurrentUser.mut_id);
             GridWaitingList.DataSource = new SortableBindingList <waitinglist>(objwaitlist.OrderBy(x => x.index).Select((item, index) => new waitinglist
             {
                 NO         = index + 1,
                 Callstatus = item.holded == true ? "HD" : "",
                 QueueNo    = item.tpr_queue_no,
                 HN         = item.tpt_hn_no,
                 FullName   = item.tpt_othername,
                 tpr_id     = item.tpr_id,
                 hilight    = item.reserve
             }).ToList());
             lbTitle.Text = string.Format("Waiting List (Total {0} คน)", objwaitlist.Count());
             timer1.Start();// Stat Timer
         }
         catch (Exception ex)
         {
             Program.MessageError("UIWaitList", "LoadData", ex, false);
             timer1.Start();
         }
     }
 }
Example #8
0
        private static int BK106(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count106 = dbcBookLog.pw_CR_PatienBook_ChestXRay(tprID)
                           .Where(s => s.trxr_result != null)
                           .Count();

            StatusPage = (count106 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #9
0
        private static int BK107(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count107 = dbcBookLog.pw_CR_PatienBook_UltrasoundAbdomen(tprID)
                           .Where(s => s.trxr_result != null)
                           .Count();

            StatusPage = (count107 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #10
0
        private static int BK109(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count109 = dbcBookLog.pw_CR_PatienBook_OtherTest(tprID)
                           .Where(s => s.trxm_exam != null)
                           .Count();

            StatusPage = (count109 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #11
0
        private static int BK110(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count1101 = dbcBookLog.pw_CR_PatienBook_Summary_N(tprID).Count();
            int count1102 = dbcBookLog.pw_CR_PatienBook_Summary_A(tprID).Count();
            int count110  = count1101 + count1102;

            StatusPage = (count110 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #12
0
        private static int BK1051(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count1051 = dbcBookLog.pw_CR_PatienBook_LaboratoryComparison_hdr(tprID)
                            .Where(s => s.vLab1 != null ||
                                   s.vLab2 != null ||
                                   s.vLab3 != null ||
                                   s.vLab4 != null ||
                                   s.vLab5 != null
                                   )
                            .Count();

            StatusPage = (count1051 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #13
0
        private static int BK103(int?tprID, CheckupDataContext dbcBookLog, int StatusPage)
        {
            int count1031 = dbcBookLog.pw_CR_PatienBook_PhysicalExamination_hdr(tprID).Count();
            int count1032 = dbcBookLog.pw_CR_PatienBook_PhysicalExamination_dtl(tprID)
                            .Where(s => s.vLab1 != null ||
                                   s.vLab2 != null ||
                                   s.vLab3 != null
                                   )
                            .Count();
            int count1033 = dbcBookLog.pw_CR_PatienBook_PhysicalExamination_dcd(tprID).Count();
            int count103  = count1031 + count1032 + count1033;

            StatusPage = (count103 > 0) ? 1 : 0;
            return(StatusPage);
        }
Example #14
0
        public bool CheckPath(CheckupDataContext dbc, string roomcode)
        {
            Boolean isCheck = false;
            var     chkpath = (from t in dbc.mst_reports
                               where t.mrt_code == roomcode
                               select t.mrt_path_file).FirstOrDefault();

            if (chkpath != null) //Exist report
            {
                isCheck = true;
            }
            else //Not exist report
            {
                isCheck = false;
            }

            return(isCheck);
        }
Example #15
0
        public void LoadData(CheckupDataContext dbc, int mshID)
        {
            // int mhs_id = string.IsNullOrEmpty(Program.CurrentSite.mhs_id.ToString()) ? int.MinValue : Convert.ToInt32(Program.CurrentSite.mhs_id.ToString());
            var waitingList = (from view1 in dbc.vw_waiting_rooms
                               where view1.mhs_id == mshID
                               orderby view1.mrm_seq_show
                               select new
            {
                Ename = view1.mrm_ename,
                Waiting = (view1.waiting_ps == null)?0:view1.waiting_ps,
                time = (view1.waiting_time == null) ? 0 : view1.waiting_time
            }).ToList();

            DGVStation.DataSource = new SortableBindingList <waintingroomqueue>(waitingList.Select((item, index) => new waintingroomqueue
            {
                No      = index + 1,
                Ename   = item.Ename,
                Waiting = Convert.ToInt32(item.Waiting),
                time    = Convert.ToInt32(item.time)
            }).ToList());
            lbsummaryQTY.Text  = waitingList.Sum(x => x.Waiting).ToString();
            lbSummaryTime.Text = waitingList.Sum(x => x.time).ToString();
        }
Example #16
0
        public bool SaveToDocScan(CheckupDataContext dbc, string roomcode, int tprid, string enCurrent, string careProvider)
        {
            Boolean isCompleted = false;

            try
            {
                DateTime datenow    = Program.GetServerDateTime();
                var      getDocCode = dbc.mst_report_docscans.Where(x => x.mst_report.mrt_code == roomcode &&
                                                                    x.mst_report.mrt_status == 'A' &&
                                                                    datenow >= x.mst_report.mrt_effective_date.Value &&
                                                                    (x.mst_report.mrt_expire_date != null ? (datenow <= x.mst_report.mrt_expire_date.Value) : true))
                                      .OrderBy(x => x.mds_page_no).ToList();

                int count = Directory.GetFiles(@"Imgs\Sub").Length;
                for (int i = 0; i < count; i++)
                {
                    #region old code
                    //byte[] img;
                    //if (roomcode == "PT101" || roomcode == "PT102" || roomcode == "PT103" || roomcode == "PT104")
                    //    ////Specific 1 page
                    //    img = ImageToBinary(@"Imgs/Sub/" + tprid + roomcode + "_" + DateTime.Now.ToString("yyyy-MM-dd", new CultureInfo("en-US")) + "1.jpg");

                    //else
                    //    img = ImageToBinary(@"Imgs/Sub/" + tprid + roomcode + "_" + DateTime.Now.ToString("yyyy-MM-dd", new CultureInfo("en-US")) + i + ".jpg");

                    ////SetData to Save
                    //var getDocCode = (from t1 in dbc.mst_reports
                    //                 join t2 in dbc.mst_report_docscans
                    //                 on t1.mrt_id equals t2.mrt_id
                    //                 where t1.mrt_code == roomcode
                    //                 && t1.mrt_status == 'A'
                    //                 && datenow >= t1.mrt_effective_date.Value
                    //                 && (t1.mrt_expire_date != null ? (datenow <= t1.mrt_expire_date.Value) : true)
                    //                 orderby t2.mds_page_no
                    //                 select new
                    //                 {
                    //                     filereport = t1.mrt_path_file + "/" + t1.mrt_file_name,
                    //                     t2.mds_doc_code,
                    //                     t2.mds_page_code,
                    //                     t2.mds_page_no,
                    //                 }).ToList();

                    // getDocCode = dbc.pw_Get_DocCode(roomcode).ToList();
                    //string hn = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tprid select t1.trn_patient.tpt_hn_no).FirstOrDefault();
                    //string strEn = enCurrent;
                    //string strHn = hn;
                    //string[] sAryHN = strHn.Split('-');
                    //string[] sAryEN = strEn.Split('-');
                    //string HN = sAryHN[0] + sAryHN[1] + sAryHN[2];
                    //string EN = sAryEN[0] + sAryEN[1] + sAryEN[2];
                    //DataTable Tmptable = new DataTable(); DataSet tmpds = new DataSet("dss");
                    //Tmptable.Columns.Add("code"); Tmptable.Columns.Add("page");
                    //tmpds.Tables.Add(Tmptable);
                    //foreach (var item in getDocCode)////not confirm
                    //{
                    //    var row = Tmptable.NewRow();
                    //    row["code"] = item.mds_doc_code;
                    //    row["page"] = item.mds_page_code + item.mds_page_no;
                    //    Tmptable.Rows.Add(row);
                    //}
                    //string page = TgetDocCode[i - 1]["page"].ToString();
                    //string doctorCode = Program.CurrentUser.mut_carevider_code;
                    //string locationCode = Program.CurrentSite.mhs_code;
                    //string documentCode = Tmptable.Rows[i - 1]["code"].ToString();
                    //string userId = "EMRCHECKUP";
                    //string programId = "EMRCHECKUP";
                    #endregion

                    byte[] img;
                    //if (roomcode == "PT101" || roomcode == "PT102" || roomcode == "PT103" || roomcode == "PT104")
                    //    ////Specific 1 page
                    //    img = ImageToBinary(@"Imgs/Sub/" + tprid + roomcode + "_" + DateTime.Now.ToString("yyyy-MM-dd", new CultureInfo("en-US")) + "1.jpg");

                    //else
                    img = ImageToBinary(@"Imgs/Sub/" + tprid + roomcode + "_" + DateTime.Now.ToString("yyyy-MM-dd", new CultureInfo("en-US")) + (i + 1) + ".jpg");

                    string hn            = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tprid select t1.trn_patient.tpt_hn_no).FirstOrDefault();
                    string HN            = hn.Replace("-", "");
                    string EN            = enCurrent.Replace("-", "");
                    string page          = getDocCode[i].mds_page_code + getDocCode[i].mds_page_no;
                    string doctorCode    = careProvider;
                    string locationCode  = Program.CurrentSite.mhs_code;
                    string documentCode  = getDocCode[i].mds_doc_code;
                    string userId        = "EMRCHECKUP";
                    string programId     = "EMRCHECKUP";
                    string DocscanResult = wsSaveDocscan.SaveToDocscan(img, HN, EN, page, careProvider, locationCode, documentCode, userId, programId);
                    if (string.IsNullOrEmpty(DocscanResult))
                    {
                    }
                    else
                    {
                        MessageBox.Show(DocscanResult);
                    }
                }
                isCompleted = true;

                if (isCompleted == true)
                {
                    DeleteFile();
                }
            }
            catch
            {
                DeleteFile();
            }

            return(isCompleted);
        }