public void EndEdit() { trn_doctor_hdr DoctorHdr = _PatientRegis.trn_doctor_hdrs.FirstOrDefault(); if (DoctorHdr == null) { DoctorHdr = new trn_doctor_hdr(); _PatientRegis.trn_doctor_hdrs.Add(DoctorHdr); } trn_doctor_ekg DoctorEKG = DoctorHdr.trn_doctor_ekgs.FirstOrDefault(); if (DoctorEKG == null) { DoctorEKG = new trn_doctor_ekg(); DoctorHdr.trn_doctor_ekgs.Add(DoctorEKG); } //DoctorEcho.PropertyChanged += new PropertyChangedEventHandler(DoctorEcho_PropertyChanged); // if (DoctorEKG.trek_doc_result_thai != null && DoctorEKG.trek_doc_result_thai != string.Empty && DoctorEKG.trek_doc_result_thai != "") // { //DoctorEKG.trek_doc_result_thai += "\r\n" + cbmConclusionEKG.Text; DoctorEKG.trek_doc_result_thai = favoriteTextBox1.Text; DoctorEKG.trek_doc_result_eng = favoriteTextBox1.Text; // } // else { DoctorEKG.trek_doc_result_thai += cbmConclusionEKG.Text; } // this.cbmConclusionEKG.SelectedValue = ""; // cbmConclusionEKG.Focus(); //} //else { cbmConclusionEKG.Focus(); } }
private void LoadOtherExam() { if (Program.CurrentRegis != null) { DateTime dateNow = Program.GetServerDateTime(); var objRegis = dbc.trn_patient_regis.Where(x => x.tpr_id == Program.CurrentRegis.tpr_id).FirstOrDefault(); var objDoc = objRegis.trn_doctor_hdrs.FirstOrDefault(); if (objDoc == null) { objDoc = new trn_doctor_hdr(); objDoc.trh_create_by = "OtherExam"; objDoc.trh_create_date = dateNow; objDoc.trh_update_by = "OtherExam"; objDoc.trh_update_date = dateNow; objRegis.trn_doctor_hdrs.Add(objDoc); } var objExam = objDoc.trn_doctor_exams.FirstOrDefault(); if (objExam == null) { objExam = new trn_doctor_exam(); objExam.trxm_create_by = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username; objDoc.trn_doctor_exams.Add(objExam); } objExam.trxm_update_by = Program.CurrentUser == null ? null : Program.CurrentUser.mut_username; DataBinding_trn_doctor_exam.DataSource = objExam; } }
public StatusTransaction SendToBook(int tpr_id, int mrm_id, int tps_id, ref string messegeSend) { try { using (InhCheckupDataContext cdc = new InhCheckupDataContext()) { try { cdc.Connection.Open(); DbTransaction tran = cdc.Connection.BeginTransaction(); cdc.Transaction = tran; trn_patient_regi tpr = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault(); trn_doctor_hdr doctor = tpr.trn_doctor_hdrs.FirstOrDefault(); if (doctor == null) { doctor = new trn_doctor_hdr(); tpr.trn_doctor_hdrs.Add(doctor); } StatusTransaction result = new TransactionQueueCls().SendToBook(ref tpr, ref messegeSend); if (result == StatusTransaction.True) { new TransactionPlanCls().endPlan(ref tpr, mrm_id); new TransactionQueueCls().endQueue(ref tpr, tps_id); cdc.SubmitChanges(); cdc.Transaction.Commit(); return(StatusTransaction.True); } else { return(result); } } catch (Exception ex) { cdc.Transaction.Rollback(); Program.MessageError("SendQueue", "SendToResult", ex, false); return(StatusTransaction.Error); } finally { cdc.Connection.Close(); } } } catch (Exception ex) { Program.MessageError("SendQueue", "SendToResult", ex, false); return(StatusTransaction.Error); } }
public bool RegisterPatient(tmp_getptarrived arrivedData) { try { using (InhCheckupDataContext cdc = new InhCheckupDataContext()) { DateTime dateNow = Program.GetServerDateTime(); EmrClass.GetDataFromWSTrakCare cls = new EmrClass.GetDataFromWSTrakCare(); trn_patient tpt = cdc.trn_patients.Where(x => x.tpt_hn_no == arrivedData.papmi_no).FirstOrDefault(); bool flagNewPatient = true; if (tpt != null) { flagNewPatient = false; } cls.otherClinicSkipToCheckB(arrivedData, ref tpt, Program.CurrentSite.mhs_id);//add Program.CurrentSite.mhs_id suriya 03/04/2015 List <trn_patient_regi> listRegis = tpt.trn_patient_regis.Where(x => x.tpr_en_no == arrivedData.paadm_admno).ToList(); foreach (trn_patient_regi regis in listRegis) { trn_doctor_hdr docHdr = regis.trn_doctor_hdrs.FirstOrDefault(); if (docHdr == null) { docHdr = new trn_doctor_hdr(); regis.trn_doctor_hdrs.Add(docHdr); docHdr.trh_create_date = dateNow; docHdr.trh_create_by = "SysImp"; docHdr.trh_update_date = dateNow; docHdr.trh_update_by = "SysImp"; } } if (flagNewPatient) { cdc.trn_patients.InsertOnSubmit(tpt); } cdc.SubmitChanges(); trn_patient_regi PatientRegis = tpt.trn_patient_regis.OrderByDescending(x => x.tpr_id).FirstOrDefault(); if (PatientRegis != null) { new EmrClass.GetPTPackageCls().setRelationOrderSet(ref PatientRegis); cdc.SubmitChanges(); } return(true); } } catch (Exception ex) { Program.MessageError("EmrClass.FunctionDataCls", "RegisterPatient", ex, false); return(false); } }
public void EndEdit() { trn_doctor_hdr DoctorHdr = _PatientRegis.trn_doctor_hdrs.FirstOrDefault(); if (DoctorHdr == null) { DoctorHdr = new trn_doctor_hdr(); _PatientRegis.trn_doctor_hdrs.Add(DoctorHdr); } trn_doctor_est DoctorEST = DoctorHdr.trn_doctor_ests.FirstOrDefault(); if (DoctorEST == null) { DoctorEST = new trn_doctor_est(); DoctorHdr.trn_doctor_ests.Add(DoctorEST); } DoctorEST.tres_doc_result_thai = favoriteTextBox1.Text; DoctorEST.tres_doc_result_eng = favoriteTextBox1.Text; }
public void EndEdit() { trn_doctor_hdr DoctorHdr = _PatientRegis.trn_doctor_hdrs.FirstOrDefault(); if (DoctorHdr == null) { DoctorHdr = new trn_doctor_hdr(); _PatientRegis.trn_doctor_hdrs.Add(DoctorHdr); } trn_doctor_echo DoctorEcho = DoctorHdr.trn_doctor_echos.FirstOrDefault(); if (DoctorEcho == null) { DoctorEcho = new trn_doctor_echo(); DoctorHdr.trn_doctor_echos.Add(DoctorEcho); } //DoctorEcho.PropertyChanged += new PropertyChangedEventHandler(DoctorEcho_PropertyChanged); DoctorEcho.trec_doc_result_thai = favoriteTextBox1.Text; DoctorEcho.trec_doc_result_eng = favoriteTextBox1.Text; }
private void btnDefault_Click(object sender, EventArgs e) { trn_doctor_hdr doctorHdr = _PatientRegis.trn_doctor_hdrs.FirstOrDefault(); trn_doctor_checkup doctorCheckup = doctorHdr.trn_doctor_checkups.FirstOrDefault(); doctorCheckup.PropertyChanged -= doctor_checkup_PropertyChanged; if (doctorCheckup != null) { doctorCheckup.trcp_ga = 'N'; doctorCheckup.trcp_ga_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_ga_remark_en = "With in normal limit."; doctorCheckup.trcp_extremities = 'N'; doctorCheckup.trcp_ext_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_ext_remark_en = "With in normal limit."; doctorCheckup.trcp_chest = 'N'; doctorCheckup.trcp_chest_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_chest_remark_en = "With in normal limit."; doctorCheckup.trcp_cvs = 'N'; doctorCheckup.trcp_cvs_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_cvs_remark_en = "With in normal limit."; doctorCheckup.trcp_abdomen = 'N'; doctorCheckup.trcp_abdomen_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_abdomen_remark_en = "With in normal limit."; doctorCheckup.trcp_neuro = 'N'; doctorCheckup.trcp_neuro_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_neuro_remark_en = "With in normal limit."; doctorCheckup.trcp_other = 'N'; doctorCheckup.trcp_other_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_other_remark_en = "With in normal limit."; doctorCheckup.trcp_heent = 'N'; doctorCheckup.trcp_heent_remark = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_remark_en = "With in normal limit."; doctorCheckup.trcp_h_head = 'N'; doctorCheckup.trcp_heent_head = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_head_en = "With in normal limit."; doctorCheckup.trcp_h_eyes = 'N'; doctorCheckup.trcp_heent_eyes = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_eyes_en = "With in normal limit."; doctorCheckup.trcp_h_ears = 'N'; doctorCheckup.trcp_heent_ears = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_ears_en = "With in normal limit."; doctorCheckup.trcp_h_nose = 'N'; doctorCheckup.trcp_heent_nose = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_nose_en = "With in normal limit."; doctorCheckup.trcp_h_throat = 'N'; doctorCheckup.trcp_heent_throat = "อยู่ในเกณฑ์ปกติ"; doctorCheckup.trcp_heent_throat_en = "With in normal limit."; } doctorCheckup.PropertyChanged += doctor_checkup_PropertyChanged; }
private void LoadQuestionare(ref trn_patient_regi _patientRegis) { trn_ques_patient quesPatient = _patientRegis.trn_ques_patients.FirstOrDefault(); if (quesPatient != null) { trn_doctor_hdr doctorHdr = _patientRegis.trn_doctor_hdrs.FirstOrDefault(); if (quesPatient.tqp_ill_concern == 'A') { doctorHdr.trh_chief_complaint = "Annaul Check-up"; } else if (quesPatient.tqp_ill_concern == 'O') { if (quesPatient.tqp_ill_conc_oth != null && quesPatient.tqp_ill_conc_oth != "") { doctorHdr.trh_chief_complaint = "Other { " + quesPatient.tqp_ill_conc_oth + " }"; } else { doctorHdr.trh_chief_complaint = "Other"; } } else { doctorHdr.trh_chief_complaint = "N/A"; } List <string> remarkHyper = new List <string>(); List <string> remarkHeart = new List <string>(); List <string> remarkDiab = new List <string>(); List <string> remarkStroke = new List <string>(); List <string> remarkSeizure = new List <string>(); List <string> remarkCancer = new List <string>(); List <string> remarkOther = new List <string>(); List <string> CurrentMedicine = new List <string>(); if (quesPatient.tqp_ill_cur_med == 'H') { if (quesPatient.tqp_ill_cmed_diab == true) { CurrentMedicine.Add("ยารักษาเบาหวาน"); } if (quesPatient.tqp_ill_cmed_demia == true) { CurrentMedicine.Add("ยารักษาโรคไขมันในเลือดสูง"); } if (quesPatient.tqp_ill_cmed_diab == true) { CurrentMedicine.Add("ไขมันในเลือดผิดปกติ"); } if (quesPatient.tqp_ill_cmed_hyper == true) { CurrentMedicine.Add("ยารักษาโรคความดันโลหิตสูง"); } if (quesPatient.tqp_ill_cmed_cardi == true) { CurrentMedicine.Add("ยารักษาโรคหัวใจและหลอดเลือด"); } if (quesPatient.tqp_ill_cmed_horm == true) { CurrentMedicine.Add("ฮอร์โมน"); } if (quesPatient.tqp_ill_cmed_oth == true) { CurrentMedicine.Add("ยาอื่นๆ(" + quesPatient.tqp_ill_cmed_others + ")"); } } if (quesPatient.tqp_fhis_f_disease == 'D') { if (quesPatient.tqp_fhis_fdis_hyper == true) { remarkHyper.Add("บิดา"); chHypertension.Checked = true; } if (quesPatient.tqp_fhis_fdis_heart == true) { remarkHeart.Add("บิดา"); chHeartDisease.Checked = true; } if (quesPatient.tqp_fhis_fdis_diab == true) { remarkDiab.Add("บิดา"); chDiabetes.Checked = true; } if (quesPatient.tqp_fhis_fdis_stro == true) { remarkStroke.Add("บิดา"); chStroke.Checked = true; } if (quesPatient.tqp_fhis_fdis_canc == true) { remarkCancer.Add("บิดา"); chCancer.Checked = true; } if (quesPatient.tqp_fhis_fdis_oth == true) { remarkOther.Add("(บิดา) : " + quesPatient.tqp_fhis_fdis_others); chOther.Checked = true; } } if (quesPatient.tqp_fhis_m_disease == 'D') { if (quesPatient.tqp_fhis_mdis_hyper == true) { remarkHyper.Add("มารดา"); chHypertension.Checked = true; } if (quesPatient.tqp_fhis_mdis_heart == true) { remarkHeart.Add("มารดา"); chHeartDisease.Checked = true; } if (quesPatient.tqp_fhis_mdis_diab == true) { remarkDiab.Add("มารดา"); chDiabetes.Checked = true; } if (quesPatient.tqp_fhis_mdis_stro == true) { remarkStroke.Add("มารดา"); chStroke.Checked = true; } if (quesPatient.tqp_fhis_mdis_canc == true) { remarkCancer.Add("มารดา"); chCancer.Checked = true; } if (quesPatient.tqp_fhis_mdis_oth == true) { remarkOther.Add("(มารดา) : " + quesPatient.tqp_fhis_mdis_others); chOther.Checked = true; } } if (quesPatient.tqp_fhis_b_disease == 'D') { if (quesPatient.tqp_fhis_bdis_hyper == true) { remarkHyper.Add("พี่น้อง"); chHypertension.Checked = true; } if (quesPatient.tqp_fhis_bdis_heart == true) { remarkHeart.Add("พี่น้อง"); chHeartDisease.Checked = true; } if (quesPatient.tqp_fhis_bdis_diab == true) { remarkDiab.Add("พี่น้อง"); chDiabetes.Checked = true; } if (quesPatient.tqp_fhis_bdis_stro == true) { remarkStroke.Add("พี่น้อง"); chStroke.Checked = true; } if (quesPatient.tqp_fhis_bdis_canc == true) { remarkCancer.Add("พี่น้อง"); chCancer.Checked = true; } if (quesPatient.tqp_fhis_bdis_oth == true) { remarkOther.Add("(พี่น้อง) : " + quesPatient.tqp_fhis_bdis_others); chOther.Checked = true; } } doctorHdr.trh_hypertension_txt = string.Join(", ", remarkHyper); doctorHdr.trh_heart_disease_txt = string.Join(", ", remarkDiab); doctorHdr.trh_stroke_txt = string.Join(", ", remarkStroke); doctorHdr.trh_cancer_txt = string.Join(", ", remarkCancer); doctorHdr.trh_other_txt = string.Join(", ", remarkOther); if (CurrentMedicine.Count != 0) { gv_cur_med.Rows.Clear(); for (int i = 0; i < CurrentMedicine.Count; i++) { gv_cur_med.Rows.Add(i + 1, CurrentMedicine[i], "Delete", "O"); } } } }
private void DoctorFrm_tpridChanged(object sender, int?e, tpr_idStatus?status) { if (e == null) { if (cdc != null) { cdc.Dispose(); } newPatientProfileStationUC1.tpr_id = null; newPatientMappingUC1.tpr_id = null; additionalItemUC1.PatientRegis = null; tabAssessmentAndPlanUC1.PatientRegis = null; subjectiveUC1.PatientRegis = null; objectiveUC1.PatientRegis = null; ChOutstanding.Checked = false; StatusEmptyRoom(); } else { try { cdc = new InhCheckupDataContext(); trn_patient_regi PatientRegis = cdc.trn_patient_regis.Where(x => x.tpr_id == e).FirstOrDefault(); paRegis = PatientRegis; trn_doctor_hdr doctorHdr = paRegis.trn_doctor_hdrs.FirstOrDefault(); if (doctorHdr == null) { doctorHdr = new trn_doctor_hdr(); paRegis.trn_doctor_hdrs.Add(doctorHdr); } Program.CurrentHDR = paRegis.trn_doctor_hdrs.FirstOrDefault(); if (PatientRegis == null) { newPatientProfileStationUC1.tpr_id = null; newPatientMappingUC1.tpr_id = null; additionalItemUC1.PatientRegis = null; tabAssessmentAndPlanUC1.PatientRegis = null; subjectiveUC1.PatientRegis = null; objectiveUC1.PatientRegis = null; ChOutstanding.Checked = false; StatusEmptyRoom(); } else { if (Program.CurrentPatient_queue != null) { this.tps_id = Program.CurrentPatient_queue.tps_id; this.queue_mvt_id = Program.CurrentPatient_queue.mvt_id; } newPatientProfileStationUC1.tpr_id = PatientRegis.tpr_id; newPatientMappingUC1.tpr_id = PatientRegis.tpr_id; additionalItemUC1.PatientRegis = paRegis; tabAssessmentAndPlanUC1.PatientRegis = paRegis; subjectiveUC1.PatientRegis = paRegis; objectiveUC1.PatientRegis = paRegis; ChOutstanding.Checked = false; autoCompleteUC1.SelectedValue = Program.CurrentUser.mut_username; autoCompleteUC1.Enabled = false; if (this.FormStatus == formStatus.isStation) { switch (status) { case tpr_idStatus.NSWR: StatusNSWR(); break; case tpr_idStatus.WK: StatusWK(); break; } } else { ChOutstanding.Checked = false; StatusFooter(); } } } catch (Exception ex) { Program.MessageError(this.Name, "DoctorFrm_tpridChanged", ex, false); } } }
private void LoadData() { Clear(); if (_tpr_id != null && _trxr_type != null) { try { favoriteTextBox1.FavoriteOrder = _trxr_type; if (_trxr_type == "UU") { ChkSummaryResult.Text = "Abdomen Result"; ChkSummaryResult.Visible = true; } else if (_trxr_type == "DM") { ChkSummaryResult.Text = "Mammogram with Ultrasound Breast Result"; ChkSummaryResult.Visible = true; } else { ChkSummaryResult.Text = ""; ChkSummaryResult.Visible = false; } List <mst_conclusion_favorite_dtl> mst = new EmrClass.FavoriteCls().getFavorite(favoriteTextBox1.FavoriteOrder, favoriteTextBox1.FavoriteType); favoriteTextBox1.AutoCompleteListThList = mst.Select(x => x.mcfd_description).ToList(); cdc = new InhCheckupDataContext(); trn_patient_regi reg = cdc.trn_patient_regis.Where(x => x.tpr_id == _tpr_id).FirstOrDefault(); if (reg != null) { bool retrieve = true; var ret = reg.trn_patient_retrieves.Where(x => x.tpr_image_type == _trxr_type).FirstOrDefault(); if (ret != null) { retrieve = ret.tpr_flag_retrieve == null ? true : (bool)ret.tpr_flag_retrieve; } trn_doctor_hdr hdr = reg.trn_doctor_hdrs.FirstOrDefault(); if (hdr == null) { hdr = new trn_doctor_hdr(); reg.trn_doctor_hdrs.Add(hdr); } trn_doctor_xray xray = hdr.trn_doctor_xrays.Where(x => x.trxr_type == _trxr_type).FirstOrDefault(); if (xray == null) { xray = new trn_doctor_xray(); xray.trxr_not_show_rpt = 'N'; xray.trxr_type = _trxr_type; hdr.trn_doctor_xrays.Add(xray); } if (retrieve) { var result = LoadResult(reg.tpr_en_no); xray.trxr_order_code = result.trxr_order_code; xray.trxr_order_name = result.trxr_order_name; xray.trxr_order_date = result.trxr_order_date; xray.trxr_result_date = result.trxr_result_date; xray.trxr_overseen_by = result.trxr_overseen_by; xray.trxr_result = result.trxr_result; } var xray_images = xray.trn_doctor_xray_images.ToList(); int i = 0; foreach (trn_doctor_xray_image image in xray_images) { System.IO.MemoryStream ms = new System.IO.MemoryStream(image.trxm_image.ToArray()); Image img = Image.FromStream(ms); AddImage(img, image.trxm_sel_image == 'S' ? true : false); } txtPacURL.Text = LoadURL(reg.tpt_id, reg.tpr_en_no); DoctorXrayBS.DataSource = xray; } panel1.Enabled = true; } catch (Exception ex) { Program.MessageError("DialogImaging", "LoadData()", ex, false); panel1.Enabled = false; } } }