示例#1
0
 public int?CheckRoomSkip(int?tpr_id)
 {
     try
     {
         if (tpr_id != null)
         {
             using (InhCheckupDataContext cdc = new InhCheckupDataContext())
             {
                 trn_patient_regi PatientRegis = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
                 if (PatientRegis != null)
                 {
                     trn_patient_skip_queue PatientSkipQueue = PatientRegis.trn_patient_skip_queues.Where(x => x.tpsq_active == true).FirstOrDefault();
                     if (PatientSkipQueue != null)
                     {
                         return((int)PatientSkipQueue.mrm_id);
                     }
                 }
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         Program.MessageError("ReserveSkipCls", "ReserveSkipCls", ex, false);
         return(null);
     }
 }
示例#2
0
        private void GV_Null_Result_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                dbc.Connection.Close();
                dbc = new InhCheckupDataContext();

                Clearfrm();
                SetTprID = Convert1.ToInt32(GV_Null_Result["Coltprid", e.RowIndex].Value);
                SetEN    = Convert1.ToString(GV_Null_Result["EN", e.RowIndex].Value);

                CurrentRegis = (from t1 in dbc.trn_patient_regis
                                where t1.tpr_id == SetTprID
                                select t1).FirstOrDefault();
                Program.CurrentRegis = CurrentRegis;
                if (CurrentRegis != null)
                {
                    UIProfileHorizontal1.Loaddata(SetTprID, Program.CurrentSite.mhs_id);

                    //new code//
                    this.subjectiveUC1.PatientRegis           = CurrentRegis;
                    this.objectiveUC1.PatientRegis            = CurrentRegis;
                    this.tabAssessmentAndPlanUC1.PatientRegis = CurrentRegis;

                    if (tabControl1.SelectedTab.Tag.ToString() != "1")
                    {
                        tabControl1.SelectedIndex = 0;
                    }
                    btnSaveDraft.Enabled = true;
                    btnSendAuto.Enabled  = true;
                }
            }
        }
示例#3
0
 public void Clear()
 {
     this.Enabled              = false;
     txtHeight.Text            = "";
     txtWeight.Text            = "";
     txtSystolic.Text          = "";
     txtDiastolic.Text         = "";
     txtPulse.Text             = "";
     txtRight500.Text          = "";
     txtLeft500.Text           = "";
     txtRight1000.Text         = "";
     txtLeft1000.Text          = "";
     txtRight2000.Text         = "";
     txtLeft2000.Text          = "";
     txtRight3000.Text         = "";
     txtLeft3000.Text          = "";
     txtRight4000.Text         = "";
     txtLeft4000.Text          = "";
     txtSugar.Text             = "";
     txtAlbumin.Text           = "";
     txtMicro.Text             = "";
     txtCholesterol.Text       = "";
     txtTrig.Text              = "";
     txtHDL.Text               = "";
     bsPatientRegis.DataSource = new trn_patient_regi();
     _PatientRegis             = null;
 }
示例#4
0
 public StatusTransaction pendingPatientCheckpointB(int tpr_id, int mhs_id, List <int> list_mvt_id)
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             trn_patient_regi tpr = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
             tpr.tpr_pending = true;
             EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
             foreach (int mvt_id in list_mvt_id)
             {
                 mst_room_hdr mrm = mst.GetMstRoomHdrByMvt(mvt_id, mhs_id);
                 updatePendingPatientPlan(ref tpr, mvt_id, mrm.mrm_id, mhs_id);
                 insertPatientPending(ref tpr, mrm.mrm_id);
             }
             cdc.SubmitChanges();
             return(StatusTransaction.True);
         }
     }
     catch (Exception ex)
     {
         Program.MessageError("ClsPendingOnStation", "pendingPatientCheckpointB", ex, false);
         return(StatusTransaction.Error);
     }
 }
示例#5
0
        private void RDGeneral_CheckedChanged(object sender, EventArgs e)
        {
            DDCompany.Enabled = false; txtEmployeeID.Enabled = false;
            trn_patient_regi currentRegis = (trn_patient_regi)trnpatientregisBindingSource.Current;

            if (currentRegis != null)
            {
                if (RDGeneral.Checked)
                {
                    currentRegis.tpr_patient_type = Convert.ToChar(RDGeneral.Tag);
                    currentRegis.tpr_company_id   = null;
                    currentRegis.tpr_employee_no  = null;
                }
                else if (RDAviationPilot.Checked)
                {
                    currentRegis.tpr_patient_type = Convert.ToChar(RDAviationPilot.Tag);
                    currentRegis.tpr_company_id   = null;
                    currentRegis.tpr_employee_no  = null;
                }
                else if (RDcorporate.Checked)
                {
                    currentRegis.tpr_patient_type = Convert.ToChar(RDcorporate.Tag);
                    DDCompany.Enabled             = true; txtEmployeeID.Enabled = true;
                }
                //else if (RDaviationAircrew.Checked)
                //{
                //    currentRegis.tpr_patient_type = Convert.ToChar(RDaviationAircrew.Tag);
                //    currentRegis.tpr_company_id = null;
                //    currentRegis.tpr_employee_no = null;
                //}
            }
        }
示例#6
0
        public StatusTransaction skipOnStationSendManaul(int tpr_id, int tps_id, int next_mrm_id, int next_mvt_id)
        {
            try
            {
                InhCheckupDataContext cdc = new InhCheckupDataContext();

                trn_patient_regi  tpr = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
                trn_patient_queue tps = tpr.trn_patient_queues.Where(x => x.tps_id == tps_id).FirstOrDefault();

                Class.FunctionDataCls func = new Class.FunctionDataCls();
                updatePlanForSkip(ref tpr, tps_id);
                skipReserveCurrentQueue(ref tpr, tps_id);
                func.deleteCurrentQueue(ref cdc, ref tpr, tps_id);
                func.insertNextQueue(ref tpr, next_mrm_id, next_mvt_id);
                try
                {
                    cdc.SubmitChanges();
                    return(StatusTransaction.True);
                }
                catch (System.Data.Linq.ChangeConflictException)
                {
                    foreach (ObjectChangeConflict occ in cdc.ChangeConflicts)
                    {
                        cdc.Refresh(System.Data.Linq.RefreshMode.KeepChanges, occ.Object);
                    }
                    cdc.SubmitChanges();
                    return(StatusTransaction.True);
                }
            }
            catch (Exception ex)
            {
                Program.MessageError("ClsSkipOnStation", "skipOnStationSendManaul", ex, false);
                return(StatusTransaction.Error);
            }
        }
示例#7
0
        public void updatePendingPatientPlan(ref trn_patient_regi tpr, int mvt_id, int mhs_id)
        {
            EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
            mst_room_hdr mrm = mst.GetMstRoomHdrByMvt(mvt_id, mhs_id);

            updatePendingPatientPlan(ref tpr, mrm.mrm_id, mvt_id, mhs_id);
        }
示例#8
0
        private void btnCleargraph_Click(object sender, EventArgs e)
        {
            chart1.Series["Rt"].Points.Clear();
            chart1.Series["Lt"].Points.Clear();
            trn_patient_regi    patient_regis = (trn_patient_regi)bsPatientRegis.Current;
            trn_audiometric_hdr patient_audio = patient_regis.trn_audiometric_hdrs.FirstOrDefault();

            if (patient_audio != null)
            {
                patient_audio.tdh_right_level_250  = null;
                patient_audio.tdh_right_level_500  = null;
                patient_audio.tdh_right_level_750  = null;
                patient_audio.tdh_right_level_1000 = null;
                patient_audio.tdh_right_level_1500 = null;
                patient_audio.tdh_right_level_2000 = null;
                patient_audio.tdh_right_level_3000 = null;
                patient_audio.tdh_right_level_4000 = null;
                patient_audio.tdh_right_level_6000 = null;
                patient_audio.tdh_right_level_8000 = null;

                patient_audio.tdh_left_level_250  = null;
                patient_audio.tdh_left_level_500  = null;
                patient_audio.tdh_left_level_750  = null;
                patient_audio.tdh_left_level_1000 = null;
                patient_audio.tdh_left_level_1500 = null;
                patient_audio.tdh_left_level_2000 = null;
                patient_audio.tdh_left_level_3000 = null;
                patient_audio.tdh_left_level_4000 = null;
                patient_audio.tdh_left_level_6000 = null;
                patient_audio.tdh_left_level_8000 = null;
            }
        }
示例#9
0
 public void Clear()
 {
     this.Enabled = false;
     bsPatientRegis.DataSource = new trn_patient_regi();
     _PatientRegis             = null;
     btnCleargraph_Click(null, null);
 }
示例#10
0
 public StatusTransaction endQueue(ref trn_patient_regi tpr, int tps_id)
 {
     try
     {
         DateTime dateNow             = Program.GetServerDateTime();
         List <trn_patient_queue> tps = tpr.trn_patient_queues
                                        .Where(x => x.tps_id == tps_id).ToList();
         tps.ForEach(x =>
         {
             x.mrd_id          = Program.CurrentRoom.mrd_id;
             x.tps_send_by     = Program.CurrentUser.mut_username;
             x.tps_end_date    = dateNow;
             x.tps_status      = "ED";
             x.tps_ns_status   = null;
             x.tps_update_by   = Program.CurrentUser.mut_username;
             x.tps_update_date = dateNow;
         });
         return(StatusTransaction.True);
     }
     catch (Exception ex)
     {
         Program.MessageError("TransactionQueueCls", "endQueue", ex, false);
         return(StatusTransaction.Error);
     }
 }
示例#11
0
        public bool SendToCheckBOnStation(int tpr_id, int tps_id)
        {
            try
            {
                using (InhCheckupDataContext cdc = new InhCheckupDataContext())
                {
                    DateTime         dateNow = Program.GetServerDateTime();
                    trn_patient_regi tpr     = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();

                    patient_regisToCheckB(ref tpr);
                    queueToCheckB(ref tpr, dateNow);

                    trn_patient_queue tps = tpr.trn_patient_queues.Where(x => x.tps_id == tps_id).FirstOrDefault(); // update status ห้องปัจจุบัน
                    tps.tps_send_by     = Program.CurrentUser.mut_username;
                    tps.tps_end_date    = dateNow;
                    tps.tps_status      = "ED";
                    tps.tps_ns_status   = null;
                    tps.tps_update_by   = Program.CurrentUser.mut_username;
                    tps.tps_update_date = dateNow;
                    cdc.SubmitChanges();
                }
                return(true);
            }
            catch
            {
            }
            return(false);
        }
示例#12
0
 public void Clear()
 {
     this.Enabled = false;
     carotidUC1.Clear();
     carotidDuplexReport1.Clear();
     _PatientRegis = null;
 }
示例#13
0
        private void LoadLabResult(ref trn_patient_regi _patient_regis)
        {
            trn_patient_regi objPatient = _patient_regis;
            trn_carotid_hdr  objTCH     = bsCarotidHDR.OfType <trn_carotid_hdr>().FirstOrDefault();

            using (InhCheckupDataContext dbc = new InhCheckupDataContext())
            {
                string en           = objPatient.tpr_en_no;
                string hn           = objPatient.trn_patient.tpt_hn_no;
                var    objotherxray = (from t1 in dbc.trn_other_xrays
                                       where t1.tox_en_no == en &&
                                       t1.trn_patient_regi.trn_patient.tpt_hn_no == hn &&
                                       t1.tox_room_type == "CD"
                                       select t1).FirstOrDefault();
                if (objotherxray != null)
                {
                    txtpatientOrderResult.Text = objTCH.tch_patient_result == null ? objotherxray.tox_result : objTCH.tch_patient_result;
                    txtComment.Text            = objTCH.tch_patient_comt == null ? objotherxray.tox_patient_comt : objTCH.tch_patient_comt;
                    txtResult.Text             = objTCH.tch_result == null ? objotherxray.tox_order_name : objTCH.tch_result;
                    txtRequestDate.Text        = objTCH.tch_request_date == null?objotherxray.tox_order_date.Value.ToShortDateString() : objTCH.tch_request_date.Value.ToShortDateString();

                    //request_date = Convert.ToDateTime(objotherxray.tox_order_date.Value.ToShortDateString());
                    //report_date = Convert.ToDateTime(objotherxray.tox_result_date.Value.ToShortDateString());
                    txtReportDateTime.Text = objTCH.tch_report_date == null?objotherxray.tox_result_date.Value.ToShortDateString() : objTCH.tch_report_date.Value.ToShortDateString();
                }
            }
        }
示例#14
0
 public bool skipChangeEstToEcho(ref trn_patient_regi tpr, int mhs_id)
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             DateTime      dateNow         = Program.GetServerDateTime();
             List <string> set_row_id_skip = cdc.mst_config_dtls
                                             .Where(x => x.mst_config_hdr.mfh_code == "ECHO" &&
                                                    x.mst_config_hdr.mhs_id == mhs_id &&
                                                    x.mst_config_hdr.mfh_status == 'A' &&
                                                    (x.mst_config_hdr.mfh_effective_date == null ? true : dateNow >= x.mst_config_hdr.mfh_effective_date.Value.Date) &&
                                                    (x.mst_config_hdr.mfh_expire_date == null ? true : dateNow <= x.mst_config_hdr.mfh_expire_date.Value))
                                             .Select(x => x.mfd_text).ToList();
             trn_patient_order_set order_skip_est_to_echo = tpr.trn_patient_order_sets
                                                            .Where(x => set_row_id_skip.Contains(x.tos_od_set_code) &&
                                                                   x.tos_status == true).FirstOrDefault();
             if (order_skip_est_to_echo != null)
             {
                 EmrClass.GetDataMasterCls getMaster = new EmrClass.GetDataMasterCls();
                 int est_mvt_id  = getMaster.GetMstEvent("ES").mvt_id;
                 int echo_mvt_id = getMaster.GetMstEvent("EC").mvt_id;
                 List <trn_patient_plan> planEST = tpr.trn_patient_plans.Where(x => x.mvt_id == est_mvt_id).ToList();
                 foreach (trn_patient_plan PatientPlan in planEST)
                 {
                     PatientPlan.mvt_id     = echo_mvt_id;
                     PatientPlan.tpl_status = 'P';
                 }
                 int pe_mvt_id = getMaster.GetMstEvent("PE").mvt_id;
                 List <trn_patient_plan> planPE = tpr.trn_patient_plans
                                                  .Where(x => x.mvt_id == pe_mvt_id).ToList();
                 foreach (var plan in planPE)
                 {
                     tpr.trn_patient_plans.Remove(plan);
                 }
                 try
                 {
                     List <trn_patient_event> eventEST = tpr.trn_patient_events.Where(x => x.mvt_id == est_mvt_id).ToList();
                     foreach (var ev in eventEST)
                     {
                         tpr.trn_patient_events.Remove(ev);
                     }
                 }
                 catch
                 {
                 }
                 return(true);
             }
             else
             {
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Program.MessageError("GetDataFromWSTrakCare", "skipChangeEstToEcho", ex, false);
         return(false);
     }
 }
示例#15
0
 public void Clear()
 {
     this.Enabled = false;
     pftMainUC1.Clear();
     pftOccMedUC1.Clear();
     _PatientRegis = null;
 }
示例#16
0
 public bool skipReqDoctorOutDepartment(ref trn_patient_regi tpr)
 {
     try
     {
         if (tpr.tpr_req_doctor == 'Y' && tpr.tpr_req_inorout_doctor == "UT")
         {
             int?pe_mvt_id = GetEventID("PE");
             List <trn_patient_plan> planPE = tpr.trn_patient_plans.Where(x => x.mvt_id == pe_mvt_id).ToList();
             foreach (trn_patient_plan patient_plan in planPE)
             {
                 trn_patient_plan remove_plan = patient_plan;
                 if (patient_plan.tpl_id != 0)
                 {
                     remove_plan = tpr.trn_patient_plans.Where(x => x.tpl_id == patient_plan.tpl_id).FirstOrDefault();
                 }
                 tpr.trn_patient_plans.Remove(remove_plan);
             }
             return(true);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception ex)
     {
         Class.globalCls.MessageError("GetDataFromWSTrakCare", "skipReqDoctorOutDepartment", ex.Message);
         return(false);
     }
 }
示例#17
0
        public void updatePlanForSkipByMvt(ref trn_patient_regi tpr, int mvt_id)
        {
            trn_patient_plan currentPlan = tpr.trn_patient_plans.Where(x => x.mvt_id == mvt_id).FirstOrDefault();

            currentPlan.tpl_skip     = true;
            currentPlan.tpl_skip_seq = currentPlan.tpl_skip_seq == null ? 1 : currentPlan.tpl_skip_seq + 1;
        }
示例#18
0
 public bool checkOrderPMR(ref trn_patient_regi tpr, int mhs_id)
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             DateTime      dateNow        = Class.globalCls.GetServerDateTime();
             List <string> set_row_id_pmr = cdc.mst_config_dtls
                                            .Where(x => x.mst_config_hdr.mfh_code == "EPMR" &&
                                                   x.mst_config_hdr.mhs_id == mhs_id &&
                                                   x.mst_config_hdr.mfh_status == 'A' &&
                                                   (x.mst_config_hdr.mfh_effective_date == null ? true : dateNow >= x.mst_config_hdr.mfh_effective_date.Value.Date) &&
                                                   (x.mst_config_hdr.mfh_expire_date == null ? true : dateNow <= x.mst_config_hdr.mfh_expire_date.Value))
                                            .Select(x => x.mfd_text).ToList();
             trn_patient_order_set set_pmr = tpr.trn_patient_order_sets.Where(x => set_row_id_pmr.Contains(x.tos_od_set_code)).FirstOrDefault();
             if (set_pmr != null)
             {
                 tpr.tpr_PRM        = true;
                 tpr.tpr_PRM_doctor = false;
                 return(true);
             }
             else
             {
                 tpr.tpr_PRM        = false;
                 tpr.tpr_PRM_doctor = false;
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Class.globalCls.MessageError("GetDataFromWSTrakCare", "checkOrderPMR", ex.Message);
         return(false);
     }
 }
示例#19
0
        public void insertPatientPending(ref trn_patient_regi tpr, string mrm_code)
        {
            EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
            mst_room_hdr mrm = mst.GetMstRoomHdr(mrm_code);

            insertPatientPending(ref tpr, mrm.mrm_id);
        }
示例#20
0
 public bool AddPatientOrderSet(ref trn_patient_regi PatientRegis, string username, DateTime dateNow, EnumerableRowCollection <DataRow> PTPackage)
 {
     try
     {
         var grpPackage = PTPackage.Where(x => x.Field <string>("ARCOS_RowId") != null).GroupBy(x => x.Field <string>("ARCOS_RowId"));
         foreach (var grp in grpPackage)
         {
             trn_patient_order_set PatientOrderSet = PatientRegis.trn_patient_order_sets.Where(x => x.tos_item_row_id == grp.Key).FirstOrDefault();
             if (PatientOrderSet == null)
             {
                 PatientOrderSet = new trn_patient_order_set();
                 PatientOrderSet.tos_item_row_id = grp.Key;
                 PatientOrderSet.tos_create_date = dateNow;
                 PatientOrderSet.tos_create_by   = username;
                 PatientRegis.trn_patient_order_sets.Add(PatientOrderSet);
             }
             PatientOrderSet.tos_od_set_code = grp.FirstOrDefault().Field <string>("ARCOS_Code");
             PatientOrderSet.tos_od_set_name = grp.FirstOrDefault().Field <string>("ARCOS_Desc");
             PatientOrderSet.tos_status      = grp.All(y => y.Field <string>("OSTAT_Code") == "D") ? false : true;
             PatientOrderSet.tos_update_date = dateNow;
             PatientOrderSet.tos_update_by   = username;
         }
         return(true);
     }
     catch (Exception ex)
     {
         Class.globalCls.MessageError("GetPTPackageCls", "AddPatientOrderSet", ex.Message);
         return(false);
     }
 }
示例#21
0
        public void updatePendingPatientPlan(ref trn_patient_regi tpr, string mvt_code, int mrm_id, int mhs_id)
        {
            EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
            mst_event mvt = mst.GetMstEvent(mvt_code);

            updatePendingPatientPlan(ref tpr, mrm_id, mvt.mvt_id, mhs_id);
        }
示例#22
0
        private string GetTypeWaitingList(trn_patient_regi t0)
        {
            if (t0.tpr_vip_code != null && t0.tpr_vip_code != "" && t0.tpr_appoint_type == 'L')
            {
                return("VIP นัดไม่ตรงเวลา");
            }
            else if (t0.tpr_vip_code != null && t0.tpr_vip_code != "" && t0.tpr_appoint_type == 'T')
            {
                return("VIP นัดตรงเวลา");
            }

            if (t0.tpr_arrive_type == 'W')
            {
                return("Walk-in");
            }
            if (t0.tpr_arrive_type == 'A' && t0.tpr_appoint_type == 'L')
            {
                return("นัดไม่ตรงเวลา");
            }
            else if (t0.tpr_arrive_type == 'A' && t0.tpr_appoint_type == 'T')
            {
                return("นัดตรงเวลา");
            }
            return("");
        }
示例#23
0
        public void updatePendingPatientQueue(ref InhCheckupDataContext cdc, ref trn_patient_regi tpr, string mrm_code)
        {
            EmrClass.GetDataMasterCls mst = new EmrClass.GetDataMasterCls();
            mst_room_hdr mrm = mst.GetMstRoomHdr(mrm_code);

            updatePendingPatientQueue(ref cdc, ref tpr, mrm.mrm_id);
        }
示例#24
0
        public void bsPatient_CurrentChanged(object sender, EventArgs e)
        {
            if (((BindingSource)sender).Count == 0)
            {
                return;
            }
            using (InhCheckupDataContext cdc = new InhCheckupDataContext())
            {
                int tpr_id           = ((Patients)((BindingSource)sender).Current).tpr_id;
                trn_patient_regi tpr = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
                switch (tpr.tpr_patient_type)
                {
                case '1':
                    radioButton1.Checked = true;
                    break;

                case '2':
                    radioButton2.Checked = true;
                    break;

                case '3':
                    radioButton3.Checked = true;
                    break;
                }
            }
        }
示例#25
0
        private void GridPatient_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            string strEn          = Convert1.ToString(GridPatient["ColEN", e.RowIndex].Value);
            var    objcurrentRegi = (from t1 in dbc.trn_patient_regis
                                     where t1.tpr_en_no == strEn
                                     select t1).FirstOrDefault();

            if (objcurrentRegi != null)
            {
                txtHN.Text              = objcurrentRegi.trn_patient.tpt_hn_no;
                txtEN.Text              = objcurrentRegi.tpr_en_no;
                txtFullName.Text        = objcurrentRegi.trn_patient.tpt_othername;
                txtDOB.Text             = objcurrentRegi.trn_patient.tpt_dob_text; //objcurrentRegi.trn_patient.tpt_dob.Value.ToString("dd/MM/yyyy");
                txtGender.Text          = (objcurrentRegi.trn_patient.tpt_gender == 'F') ? "Female" : "Male";
                txtNationality.Text     = objcurrentRegi.trn_patient.tpt_nation_desc;
                txtAge.Text             = Program.CalculateAge(objcurrentRegi.trn_patient.tpt_dob.Value, Program.GetServerDateTime());
                txtVisitDate.Text       = (objcurrentRegi.tpr_arrive_date == null) ? "" : objcurrentRegi.tpr_arrive_date.Value.ToString("dd / MM / yyyy");
                txtVisitTime.Text       = (objcurrentRegi.tpr_arrive_date == null) ? "" : objcurrentRegi.tpr_arrive_date.Value.ToString("HH:mm:ss");
                txtAllergy.Text         = objcurrentRegi.trn_patient.tpt_allergy;
                PicProfile.Image        = Program.byteArrayToImage(objcurrentRegi.trn_patient.tpt_image.ToArray());
                DDsite.SelectedValue    = 0;
                DDStation.SelectedValue = 0;
                ShowReport(0, 0);
                currentRegis = objcurrentRegi;
            }
        }
示例#26
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (bsPatient.Count == 0)
     {
         return;
     }
     using (InhCheckupDataContext cdc = new InhCheckupDataContext())
     {
         int tpr_id           = ((Patients)bsPatient.Current).tpr_id;
         trn_patient_regi tpr = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
         if (radioButton1.Checked)
         {
             tpr.tpr_patient_type = '1';
         }
         else if (radioButton2.Checked)
         {
             tpr.tpr_patient_type = '2';
         }
         else
         {
             tpr.tpr_patient_type = '3';
         }
         cdc.SubmitChanges();
     }
 }
示例#27
0
        private StatusTransaction UpdatedLower()
        {
            try
            {
                try
                {
                    _timeLower = Convert.ToInt32(_timeLower).ToString();
                }
                catch
                {
                    _timeLower = "0";
                }

                using (InhCheckupDataContext cdc = new InhCheckupDataContext())
                {
                    DateTime         datenow         = Program.GetServerDateTime();
                    trn_patient_regi objpatientregis = (from t1 in cdc.trn_patient_regis
                                                        where t1.tpr_id == _tpr_id
                                                        select t1).FirstOrDefault();
                    objpatientregis.tpr_miss_lower      = (_checkLower == true) ? true : false;
                    objpatientregis.tpr_miss_lower_date = (_checkLower == true) ? (DateTime?)datenow : null;
                    objpatientregis.tpr_call_lower_time = Convert.ToInt32(_timeLower);
                    objpatientregis.tpr_call_lower_date = Program.GetServerDateTime().AddMinutes((double)objpatientregis.tpr_call_lower_time);
                    cdc.SubmitChanges();
                    return(StatusTransaction.True);
                }
                //End Set column [tus_miss_lower]
            }
            catch (Exception ex)
            {
                Program.MessageError("frmUltrasound2", "UpdatedLower", ex, false);
                return(StatusTransaction.Error);
            }
        }
示例#28
0
 private bool SkipLower()
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             DateTime         dateNow      = Program.GetServerDateTime();
             trn_patient_regi PatientRegis = cdc.trn_patient_regis
                                             .Where(x => x.tpr_id == tpr_id)
                                             .FirstOrDefault();
             PatientRegis.tpr_miss_lower = chkUltrasound.Checked;
             if (chkUltrasound.Checked)
             {
                 PatientRegis.tpr_miss_lower_date = dateNow;
                 PatientRegis.tpr_call_lower_time = Convert.ToInt32(txtMinuteLower.Text);
                 PatientRegis.tpr_call_lower_date = dateNow.AddMinutes(Convert.ToInt32(txtMinuteLower.Text));
             }
             else
             {
                 PatientRegis.tpr_miss_lower_date = null;
                 PatientRegis.tpr_call_lower_time = null;
                 PatientRegis.tpr_call_lower_date = null;
             }
             cdc.SubmitChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         Program.MessageError(this.Name, "SkipLower()", ex, false);
         return(false);
     }
 }
示例#29
0
        private void LoadLabResult(ref trn_patient_regi _patient_regis)
        {
            try
            {
                trn_patient_regi objrg = _patient_regis;
                using (InhCheckupDataContext dbc = new InhCheckupDataContext())
                {
                    int tpr_id = objrg.tpr_id;

                    var ObjLabFbs = (from t1 in dbc.trn_patient_labs
                                     where t1.tpl_hn_no == (Program.CurrentRegis == null ? objrg.trn_patient.tpt_hn_no : Program.CurrentRegis.trn_patient.tpt_hn_no) &&
                                     t1.tpl_en_no == (Program.CurrentPatient_queue == null ? objrg.tpr_en_no : Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no) &&
                                     t1.tpl_lab_no == "C0180"
                                     select t1.tpl_lab_value).FirstOrDefault();
                    var ObjLabCholes = (from t1 in dbc.trn_patient_labs
                                        where t1.tpl_hn_no == (Program.CurrentRegis == null ? objrg.trn_patient.tpt_hn_no : Program.CurrentRegis.trn_patient.tpt_hn_no) &&
                                        t1.tpl_en_no == (Program.CurrentPatient_queue == null ? objrg.tpr_en_no : Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no) && //Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no
                                        t1.tpl_lab_no == "C0130"
                                        select t1.tpl_lab_value).FirstOrDefault();
                    var ObjLabBmi = (from t1 in dbc.trn_basic_measure_dtls
                                     join t2 in dbc.trn_basic_measure_hdrs on t1.tbm_id equals t2.tbm_id
                                     where t2.tpr_id == tpr_id//tprid
                                     select t1.tbd_bmi).FirstOrDefault();
                    var ObjLabHbA = (from t1 in dbc.trn_patient_labs
                                     where t1.tpl_hn_no == (Program.CurrentRegis == null ? Program.CurrentRegis.trn_patient.tpt_hn_no : Program.CurrentRegis.trn_patient.tpt_hn_no) &&
                                     t1.tpl_en_no == (Program.CurrentPatient_queue == null ? Program.CurrentRegis.tpr_en_no : Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no) &&    //Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no
                                     t1.tpl_lab_no == "N0510"
                                     select t1.tpl_lab_value).FirstOrDefault();
                    var ObjLabLdl = (from t1 in dbc.trn_patient_labs
                                     where t1.tpl_hn_no == (Program.CurrentRegis == null ? Program.CurrentRegis.trn_patient.tpt_hn_no : Program.CurrentRegis.trn_patient.tpt_hn_no) && //Program.CurrentRegis.trn_patient.tpt_hn_no
                                     t1.tpl_en_no == (Program.CurrentPatient_queue == null ? Program.CurrentRegis.tpr_en_no : Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no) && //Program.CurrentPatient_queue.trn_patient_regi.tpr_en_no
                                     t1.tpl_lab_no == "C0159"
                                     select t1.tpl_lab_value).FirstOrDefault();
                    var ObjLabBp = (from t1 in dbc.trn_basic_measure_dtls
                                    join t2 in dbc.trn_basic_measure_hdrs on t1.tbm_id equals t2.tbm_id
                                    where t2.tpr_id == tpr_id
                                    select t1.tbd_systolic + "/" + t1.tbd_diastolic).FirstOrDefault();

                    //var ObjMobile = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tpr_id select t1.tpr_mobile_phone).FirstOrDefault();
                    //if (ObjMobile == null || ObjMobile == "")
                    //{
                    //    ObjMobile = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tpr_id select t1.tpr_office_phone).FirstOrDefault();
                    //}
                    //if (ObjMobile == null || ObjMobile == "")
                    //{
                    //    ObjMobile = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tpr_id select t1.tpr_home_phone).FirstOrDefault();
                    //}

                    txtfbs.Text = ObjLabFbs;
                    txtcho.Text = ObjLabCholes;
                    txtbmi.Text = ObjLabBmi;
                    txthb.Text  = ObjLabHbA;
                    txtldl.Text = ObjLabLdl;
                    txtbp.Text  = ObjLabBp;
                    //txtmobilephone.Text = ObjMobile;
                }
            }
            catch
            { }
        }
示例#30
0
        public bool? CallBackToBook(int tpr_id, string username)
        {
            try
            {
                DateTime dateNow = DateTime.Now;
                using (InhCheckupDataContext cdc = new InhCheckupDataContext())
                {
                    trn_patient_regi patientRegis = cdc.trn_patient_regis
                                                        .Where(x => x.tpr_id == tpr_id)
                                                        .FirstOrDefault();

                    trn_patient_doctor_approve doctorApprove = patientRegis.trn_patient_doctor_approve;

                    if (doctorApprove.tpda_status == "API")
                    {
                        return null;
                    }
                    doctorApprove.tpda_status = "CBB";
                    doctorApprove.tpda_process_by = username;
                    doctorApprove.tpda_process_date = dateNow;
                    cdc.SubmitChanges();
                    return true;
                }
            }
            catch
            {

            }
            return false;
        }