public bool CheckPatientAlreadyAllocated(EntityPatientAdmit entAdmit) { bool b = false; try { List <tblBedAllocationToPatient> admit = (from tbl in objData.tblBedAllocationToPatients where tbl.IsDelete == false && tbl.DischargeDate == null && tbl.PatientId == entAdmit.PatientId select tbl).ToList(); if (admit.Count > 0) { b = true; } else { b = false; } } catch (Exception ex) { throw ex; } return(b); }
public bool CheckPatientExistforSameDate(EntityPatientAdmit entAdmit) { bool b = false; try { List <tblPatientAdmitDetail> admit = (from tbl in objData.tblPatientAdmitDetails where tbl.IsDelete == false && tbl.IsDischarge == false && tbl.PatientId == entAdmit.PatientId select tbl).ToList(); if (admit.Count > 0) { b = true; } else { b = false; } } catch (Exception ex) { throw ex; } return(b); }
public bool GetDischargeInfo(int patId) { bool IsDischarge = false; try { EntityPatientAdmit admit = (from tbl in objData.tblPatientAllocToDocs join tblAdmit in objData.tblPatientAdmitDetails on tbl.PatientId equals tblAdmit.AdmitId where tbl.IsDelete == false && tbl.PateintAllocId == patId select new EntityPatientAdmit { AdmitId = tbl.PatientId, IsDischarge = tblAdmit.IsDischarge }).FirstOrDefault(); if (admit != null) { IsDischarge = Convert.ToBoolean(admit.IsDischarge); } } catch (Exception ex) { throw ex; } return(IsDischarge); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { Session["Status"] = "Edit"; lblMessage.Text = string.Empty; ImageButton imgEdit = (ImageButton)sender; GridViewRow cnt = (GridViewRow)imgEdit.NamingContainer; Session["TestInvoiceId"] = Convert.ToInt32(cnt.Cells[0].Text); EntityPatientAdmit entPat = mobjDeptBLL.ChechDischargeDone(Convert.ToInt32(cnt.Cells[0].Text)); if (entPat != null) { List <TestAllocation> lst = new clsTestAllocation().GetTestInvoiceDetails(Convert.ToInt32(cnt.Cells[0].Text)); if (cnt != null) { ListItem item = ddlPatient.Items.FindByText(Convert.ToString(cnt.Cells[2].Text)); ddlPatient.SelectedValue = item.Value; txtAllocDate.Text = string.Format("{0:MM/dd/yyyy}", Convert.ToDateTime(cnt.Cells[1].Text)); txtNetAmount.Text = Convert.ToString(cnt.Cells[4].Text); if (lst.Count > 0) { txtDiscountAmt.Text = Convert.ToString(lst[0].DiscountAmount); txtTotal.Text = Convert.ToString(Convert.ToDecimal(txtNetAmount.Text) + Convert.ToDecimal(txtDiscountAmt.Text)); txtDiscount.Text = string.Format("{0:}", Convert.ToDecimal(txtDiscountAmt.Text) / Convert.ToDecimal(txtTotal.Text) * 100); } EntityCustomerTransaction transactionStatus = mobjDeptBLL.GetTransactionStatus(Convert.ToInt32(Session["TestInvoiceId"])); if (transactionStatus != null) { chkIsCash.Checked = Convert.ToBoolean(transactionStatus.IsCash); } foreach (TestAllocation objTest in lst) { foreach (GridViewRow row in dgvAllTests.Rows) { if (Convert.ToInt32(dgvAllTests.DataKeys[row.RowIndex].Value) == objTest.TestId) { CheckBox chk = (CheckBox)row.FindControl("chkSelect"); chk.Checked = true; break; } } } } BtnUpdate.Visible = true; BtnSave.Visible = false; MultiView1.SetActiveView(View1); } else { lblMsg.Text = "Patient Is Already Discharged"; } } catch (Exception ex) { lblMsg.Text = ex.Message; } }
public EntityPatientAdmit GetAdmitDate(int AdmitId) { EntityPatientAdmit lst = (from tbl in objData.tblPatientAdmitDetails where tbl.IsDelete == false && tbl.AdmitId == AdmitId select new EntityPatientAdmit { AdmitDate = tbl.AdmitDate }).FirstOrDefault(); return(lst); }
protected void BtnEdit_Click(object sender, EventArgs e) { int lintCnt = 0; try { EntityBedAllocToPatient entDept = new EntityBedAllocToPatient(); entDept.BedId = Convert.ToInt32(Session["Bed_Id"]); entDept.FloorId = Convert.ToInt32(Session["Floor_Id"]); entDept.RoomId = Convert.ToInt32(Session["Room_Id"]); entDept.PatientId = Convert.ToInt32(Session["Pat_Id"]); if (!string.IsNullOrEmpty(txtAllocDate.Text)) { entDept.AllocationDate = Convert.ToDateTime(txtAllocDate.Text); } else { entDept.AllocationDate = null; } PatientMasterBLL mobjPatient = new PatientMasterBLL(); EntityPatientAdmit entAdmit = new EntityPatientAdmit() { PatientId = Convert.ToInt32(ddlPatientName.SelectedValue) }; bool Status = mobjPatient.CheckPatientAlreadyAllocated(entAdmit); if (!Status) { lintCnt = mobjDeptBLL.InsertAllocBed(entDept); if (lintCnt > 0) { lblMessage.Text = "Record Updated Successfully"; } else { lblMessage.Text = "Record Not Updated"; } } else { lblMessage.Text = "This Patient Already Allocated to Another Bed"; } } catch (Exception ex) { lblMessage.Text = ex.Message; } GetBedAlloc(); MultiView1.SetActiveView(View1); }
public int Save(EntityPatientAdmit admit) { int i = 0; try { tblPatientAdmitDetail objAdmit = new tblPatientAdmitDetail() { AdmitDate = admit.AdmitDate, AdmitTime = admit.PatientAdmitTime, CompanyId = admit.CompanyId, InsuranceComId = admit.InsuranceComId, CompanyName = admit.CompanyName, InsuranceName = admit.InsuName, IsCompany = admit.IsCompany, IsDelete = false, IsDischarge = false, IsInsured = admit.IsInsured, IsIPD = admit.IsIPD, IsOPD = admit.IsOPD, PatientType = admit.PatientType, PatientId = admit.PatientId, Dignosys = admit.Dignosys, Age = admit.Age, Weight = admit.Weight, AgeIn = admit.AgeIn, IPDNo = admit.IPDNo, OPDNo = admit.OPDNo, DeptCategory = admit.DeptCategory, DeptDoctorId = admit.DeptDoctorId }; objData.tblPatientAdmitDetails.InsertOnSubmit(objAdmit); objData.SubmitChanges(); i = 1; } catch (Exception ex) { throw ex; } return(i);; }
public EntityPatientAdmit ChechDischargeDone(int TestInvoiceNo) { EntityPatientAdmit entpat = null; try { entpat = (from tbl in objData.tblPatientAdmitDetails join tbltest in objData.tblTestInvoices on tbl.AdmitId equals tbltest.PatientId where tbltest.IsDelete == false && tbl.IsDischarge == false && tbltest.TestInvoiceNo == TestInvoiceNo select new EntityPatientAdmit { }).FirstOrDefault(); } catch (Exception ex) { throw ex; } return(entpat); }
public int UpdatePatient(EntityPatientAdmit entAdmit) { int cnt = 0; try { tblPatientAdmitDetail admit = (from tbl in objData.tblPatientAdmitDetails where tbl.AdmitId == entAdmit.AdmitId && tbl.IsDischarge == false select tbl).FirstOrDefault(); if (admit != null) { admit.CompanyId = entAdmit.CompanyId; admit.IsCompany = entAdmit.IsCompany; admit.IsInsured = entAdmit.IsInsured; admit.IsIPD = entAdmit.IsIPD; admit.PatientType = entAdmit.PatientType; admit.IsOPD = entAdmit.IsOPD; admit.PatientId = entAdmit.PatientId; admit.InsuranceComId = entAdmit.InsuranceComId; admit.Age = entAdmit.Age; admit.Weight = entAdmit.Weight; admit.AgeIn = entAdmit.AgeIn; admit.IPDNo = entAdmit.IPDNo; admit.OPDNo = entAdmit.OPDNo; admit.Dignosys = entAdmit.Dignosys; admit.DeptCategory = entAdmit.DeptCategory; admit.DeptDoctorId = entAdmit.DeptDoctorId; admit.InsuranceName = entAdmit.InsuName; admit.CompanyName = entAdmit.CompanyName; } objData.SubmitChanges(); cnt++; } catch (Exception ex) { throw ex; } return(cnt); }
protected void ddlPatient_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlPatient.SelectedIndex > 0) { EntityPatientAdmit lst = MobjClaim.GetinsuranceComName(Convert.ToInt32(ddlPatient.SelectedValue)); ListItem lstitem = ddlInsuranceComName.Items.FindByText(lst.CompanyName); if (lstitem != null) { ddlInsuranceComName.SelectedValue = lstitem.Value; } BindData(); } else { lblMsg.Text = "Please Select Patient."; } } catch (Exception ex) { lblMessage.Text = ex.Message; } }
public EntityPatientAdmit GetinsuranceComName(int AdmitId) { EntityPatientAdmit lst = null; try { lst = (from tbl in objData.tblPatientAdmitDetails join tblI in objData.tblCompanyMasters on tbl.CompanyId equals tblI.PKId where tbl.AdmitId == AdmitId && tbl.IsDelete == false select new EntityPatientAdmit { CompanyId = tbl.CompanyId, CompanyName = tblI.CompanyName }).FirstOrDefault(); return(lst); } catch (Exception ex) { throw ex; } }
public EntityPatientAdmit GetPatientAdmitDetails(int AdmitId) { EntityPatientAdmit admit = null; try { admit = (from tbl in objData.tblPatientAdmitDetails where tbl.IsDelete == false && tbl.AdmitId == AdmitId select new EntityPatientAdmit { AdmitDate = tbl.AdmitDate, AdmitId = tbl.AdmitId, PatientId = tbl.PatientId, Age = tbl.Age.Value, IsDischarge = tbl.IsDischarge }).FirstOrDefault(); } catch (Exception ex) { throw ex; } return(admit); }
protected void BtnSave_Click(object sender, EventArgs e) { try { EntityPatientAdmit entAdmit = new EntityPatientAdmit(); entAdmit.PatientId = Convert.ToInt32(ddlPatientName.SelectedValue); TimeSpan objTime = new TimeSpan(0, 0, 0); entAdmit.AdmitDate = Convert.ToDateTime(txtAdmitDate.Text).Add(objTime); entAdmit.PatientAdmitTime = Convert.ToString(objTime); entAdmit.Dignosys = txtDignosys.Text; entAdmit.DeptCategory = Convert.ToInt32(ddlDeptCategory.SelectedValue); entAdmit.DeptDoctorId = Convert.ToInt32(ddlDeptDoctor.SelectedValue); if (rbtnIPD.Checked) { DataTable ldt1 = new DataTable(); ldt1 = mobjPatient.GetNewIPDNumber(); if (ldt1.Rows.Count > 0 && ldt1 != null && (ldt1.Rows[0]["PatientIPDNo"].ToString() != string.Empty)) { txtIPDNo.Text = ldt1.Rows[0]["PatientIPDNo"].ToString(); } entAdmit.IsIPD = true; entAdmit.PatientType = "IPD"; entAdmit.IsOPD = false; entAdmit.IPDNo = Convert.ToString(txtIPDNo.Text); entAdmit.OPDNo = ""; } if (rbtnOPD.Checked) { DataTable ldt1 = new DataTable(); ldt1 = mobjPatient.GetNewOPDNumber(); if (ldt1.Rows.Count > 0 && ldt1 != null && (ldt1.Rows[0]["PatientOPDNo"].ToString() != string.Empty)) { txtIPDNo.Text = ldt1.Rows[0]["PatientOPDNo"].ToString(); } entAdmit.IsIPD = false; entAdmit.IsOPD = true; entAdmit.PatientType = "OPD"; entAdmit.OPDNo = Convert.ToString(txtIPDNo.Text); entAdmit.IPDNo = ""; } if (!string.IsNullOrEmpty(txtAge.Text)) { entAdmit.Age = Convert.ToInt32(txtAge.Text); } entAdmit.AgeIn = ddlAge.SelectedItem.Text; entAdmit.Weight = Convert.ToString(txtWeight.Text); entAdmit.IsCompany = chkCom.Checked ? true : false; entAdmit.IsInsured = ChkInsurance.Checked ? true : false; if (chkCom.Checked) { entAdmit.CompanyId = Convert.ToInt32(ddlCompName.SelectedValue); entAdmit.CompanyName = Convert.ToString(ddlCompName.SelectedItem.Text); } else { entAdmit.CompanyId = 0; entAdmit.CompanyName = string.Empty; } if (ChkInsurance.Checked) { entAdmit.InsuranceComId = Convert.ToInt32(ddlInsurance.SelectedValue); entAdmit.InsuName = Convert.ToString(ddlInsurance.SelectedItem.Text); } else { entAdmit.InsuranceComId = 0; entAdmit.InsuName = string.Empty; } bool Status = mobjPatient.CheckPatientExistforSameDate(entAdmit); if (!Status) { int i = mobjPatient.Save(entAdmit); if (i > 0) { Clear(); lblMessage.Text = "Record Save Successfully."; } else { lblMessage.Text = "Record Save Successfully."; } } else { lblMessage.Text = "This Patient Was Not Discharged."; } GetOPDPatientList(); MultiView1.SetActiveView(View1); } catch (Exception ex) { lblMsg.Text = ex.Message; } }
protected void BtnEdit_Click(object sender, EventArgs e) { int lintCnt = 0; try { EntityPatientAdmit entAdmit = new EntityPatientAdmit(); entAdmit.AdmitId = Convert.ToInt32(Session["AdmitId"]); entAdmit.PatientId = Convert.ToInt32(ddlPatientName.SelectedValue); entAdmit.DeptCategory = Convert.ToInt32(ddlDeptCategory.SelectedValue); entAdmit.DeptDoctorId = Convert.ToInt32(ddlDeptDoctor.SelectedValue); TimeSpan objTime = new TimeSpan(0, 0, 0); entAdmit.AdmitDate = Convert.ToDateTime(txtAdmitDate.Text).Add(objTime); entAdmit.PatientAdmitTime = Convert.ToString(objTime); if (rbtnIPD.Checked) { entAdmit.IsIPD = true; entAdmit.PatientType = "IPD"; entAdmit.IsOPD = false; entAdmit.IPDNo = Convert.ToString(txtIPDNo.Text); entAdmit.OPDNo = ""; } if (rbtnOPD.Checked) { entAdmit.IsIPD = false; entAdmit.IsOPD = true; entAdmit.PatientType = "OPD"; entAdmit.IPDNo = ""; entAdmit.OPDNo = Convert.ToString(txtIPDNo.Text); } if (!string.IsNullOrEmpty(txtAge.Text)) { entAdmit.Age = Convert.ToInt32(txtAge.Text); } entAdmit.AgeIn = ddlAge.SelectedItem.Text; entAdmit.Weight = Convert.ToString(txtWeight.Text); entAdmit.IsCompany = chkCom.Checked ? true : false; entAdmit.IsInsured = ChkInsurance.Checked ? true : false; if (chkCom.Checked) { entAdmit.CompanyId = Convert.ToInt32(ddlCompName.SelectedValue); entAdmit.CompanyName = Convert.ToString(ddlCompName.SelectedItem.Text); } else { entAdmit.CompanyId = 0; entAdmit.CompanyName = string.Empty; } if (ChkInsurance.Checked) { entAdmit.InsuranceComId = Convert.ToInt32(ddlInsurance.SelectedValue); entAdmit.InsuName = Convert.ToString(ddlCompName.SelectedItem.Text); } else { entAdmit.InsuranceComId = 0; entAdmit.InsuName = string.Empty; } entAdmit.Dignosys = txtDignosys.Text; lintCnt = mobjPatient.UpdatePatient(entAdmit); if (lintCnt > 0) { lblMessage.Text = "Record Updated Successfully"; } else { lblMessage.Text = "Record Not Updated"; } } catch (Exception ex) { lblMsg.Text = ex.Message; } GetOPDPatientList(); MultiView1.SetActiveView(View1); }