protected void SelectedPatientChanged(object sender, EventArgs e) { if (Convert.ToInt32(Session["TechnicalAreaId"]) == 0) { return; //do nothing if we are in records } int technicalAreaID = (Convert.ToInt32(Session["TechnicalAreaId"])); string theUrl = string.Empty; int patientID = int.Parse(grdWaitingList.SelectedDataKey.Values["Ptn_PK"].ToString()); int moduleID = int.Parse(grdWaitingList.SelectedDataKey.Values["ModuleID"].ToString()); HttpContext.Current.Session["PatientId"] = patientID; HttpContext.Current.Session["PatientVisitId"] = 0; HttpContext.Current.Session["ServiceLocationId"] = 0; HttpContext.Current.Session["LabId"] = 0; Session["TechnicalAreaId"] = moduleID < 1 ? (Convert.ToInt32(Session["TechnicalAreaId"])) : moduleID; int WaitingListID = int.Parse(grdWaitingList.SelectedDataKey.Values["WaitingListID"].ToString()); //remove patient from the waiting list IPatientRegistration PManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); PManager.ChangeWaitingListStatus(WaitingListID, 1, Convert.ToInt32(base.Session["AppUserId"])); Response.Redirect(string.Format("~/ClinicalForms/frmPatient_Home.aspx?srvNm={0}&mod={1}", Session["TechnicalAreaName"].ToString(), Session["TechnicalAreaId"].ToString())); //String theOrdScript; //theOrdScript = "<script language='javascript' id='openPatient'>\n"; //theOrdScript += "window.opener.location.href = './ClinicalForms/frmPatient_Home.aspx';\n"; //theOrdScript += "window.close();\n"; //theOrdScript += "</script>\n"; //Page.ClientScript.RegisterStartupScript(this.GetType(), "closePage", theOrdScript); }
protected void grdChildInfo_RowDeleting(object sender, GridViewDeleteEventArgs e) { btnAdd.Text = "Add Child"; int p = Convert.ToInt32(e.RowIndex); dtTemp = (DataTable)ViewState["DT"]; GetAdmissionNo(); if (dtTemp.Rows[p][7].ToString() != "0") { IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); ptnMgrPMTCT.DeleteInfantInfo(Convert.ToInt16(dtTemp.Rows[p][7]), Convert.ToInt16(Session["AppUserId"])); } dtTemp.Rows[p].Delete(); dtTemp.AcceptChanges(); ViewState["DT"] = dtTemp; BindGrid((DataTable)ViewState["DT"]); TxtAdmissionNo.Text = Session["AdmissionNo"].ToString() + "_" + ViewState["iSerialNo"]; IQCareMsgBox.Show("DeleteSuccess", this); if (((DataTable)ViewState["DT"]).Rows.Count == 0) { btnsave.Enabled = false; //grdChildInfo.Rows.Count = -1; grdChildInfo.DataSource = ViewState["DT"]; grdChildInfo.DataBind(); } else { btnsave.Enabled = true; } }
protected void BindServiceDropdown() { BindFunctions BindManager = new BindFunctions(); IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(Session["AppUserId"])); DataTable theDT = new DataTable(); //if Admin user load all service areas if (Convert.ToString(Session["AppUserId"]) == "1") { theDT = DSModules.Tables[0]; } else { theDT = DSModules.Tables[2]; } if (theDT.Rows.Count > 0) { BindManager.BindCombo(ddlServices, theDT, "ModuleName", "ModuleID"); ptnMgr = null; } }
/// <summary> /// Gets the patient details. /// </summary> /// <param name="patientID">The patient identifier.</param> void GetPatientDetails() { try { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataTable theDT = ptnMgr.GetPatientRecord(this.PatientID); //Session["ClientInfo"] = theDS; if (theDT.Rows.Count > 0) { string patientName = String.Format("{0} {1} {2}", theDT.Rows[0]["Firstname"], theDT.Rows[0]["Middlename"], theDT.Rows[0]["Lastname"]); this.PatientNames = patientName; this.PatientGender = (theDT.Rows[0]["sex"].ToString() == "16") ? "Male" : "Female"; string patientFacilityID = theDT.Rows[0]["PatientFacilityID"].ToString(); int age = Convert.ToInt32(theDT.Rows[0]["age"]); this.PatientAgeYears = age; this.PatientFacilityID = patientFacilityID; } ptnMgr = null; } catch (Exception ex) { this.OnErrorOccured(this, new CommandEventArgs("Error", ex)); } }
/// <summary> /// Populates the published service area. /// </summary> void PopulateServiceArea() { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(this.FacilityID); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; ddlReferral.Items.Clear(); DataRow[] toBeDeleted; toBeDeleted = theDT.Select("ModuleName in('RECORDS', 'Pharmacy Dispense')"); if (toBeDeleted.Length > 0) { foreach (DataRow dr in toBeDeleted) { theDT.Rows.Remove(dr); theDT.AcceptChanges(); } } ddlReferral.Items.Add(new ListItem("Select", "")); foreach (DataRow dr in theDT.Rows) { ddlReferral.Items.Add(new ListItem(dr["ModuleName"].ToString(), dr["ModuleName"].ToString())); } // ddlReferral.DataTextField = "ModuleName"; //ddlReferral.DataValueField = "ModuleName"; //ddlReferral.DataSource = theDT; // ddlReferral.DataBind(); this.ddlReferral.Items.Add(new ListItem("Others", "Others")); }
/// <summary> /// Binds the dropdown. /// </summary> void BindDropdown() { //if (base.Session["TechnicalAreaId"] == null) //{ BindFunctions BindManager = new BindFunctions(); IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); DataView theModDV = new DataView(DSModules.Tables[0]); theModDV.RowFilter = "ModuleId NOT IN(206,207)"; IQCareUtils theModUtils = new IQCareUtils(); DataTable theDT = new DataTable(); theDT = theModUtils.CreateTableFromDataView(theModDV); //theDT = DSModules.Tables[0]; if (theDT.Rows.Count > 0) { BindManager.BindCombo(ddlCostCenter, theDT, "ModuleName", "ModuleID"); ptnMgr = null; } ///} }
/// <summary> /// Patients the details. /// </summary> void PatientDetails() { DataTable theDT; /* if (base.Session["PatientInformation"] == null) * {*/ IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); theDT = ptnMgr.GetPatientRecord(Convert.ToInt32(Session["PatientId"])); ptnMgr = null; /* } * else * { * theDT = (DataTable)base.Session["PatientInformation"]; * }*/ if (theDT.Rows.Count > 0) { lblname.Text = String.Format("{0} {1} {2}", theDT.Rows[0]["Firstname"], theDT.Rows[0]["Middlename"], theDT.Rows[0]["Lastname"]); // lblsex.Text = theDT.Rows[0]["sex"].ToString(); lblsex.Text = (theDT.Rows[0]["sex"].ToString() == "16") ? "Male" : "Female"; lbldob.Text = theDT.Rows[0]["Age"].ToString() + " years"; lblFacilityID.Text = theDT.Rows[0]["PatientFacilityID"].ToString(); } }
private void Init_Form() { AppTitle.Text = TouchGlobals.RootTitle + " [" + Session["AppLocation"].ToString() + "]"; if (Session["AppUserName"] != null) { lblUserName.Text = Session["AppUserName"].ToString(); } if (Session["AppLocation"] != null) { lblFacilityName.Text = Session["AppLocation"].ToString(); } string ObjFactoryParameter = "BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"; IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataSet theDs = ptnMgr.GetPatientRegistration(patientID, 12); DataTable theDTMod = (DataTable)Session["AppModule"]; DataView theDVMod = new DataView(theDTMod); theDVMod.RowFilter = "ModuleId=" + Convert.ToInt32(Session["TechnicalAreaId"]); setUserDetailsInTab(theDs.Tables[0]); }
protected void btnsave_Click(object sender, EventArgs e) { dtTemp = (DataTable)ViewState["DT"]; for (int i = 0; i < dtTemp.Rows.Count; i++) { if (dtTemp.Rows[i][7].ToString() == "0") { ViewState["Status"] = "Add"; Hashtable theHT = AddUpdateData(i); IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataTable theCustomDataDT = new DataTable(); DataTable theDS = ptnMgrPMTCT.SavePatientRegistrationPMTCT(theHT, theCustomDataDT); ViewState["visitPk"] = theDS.Rows[0]["Visit_ID"].ToString(); ViewState["PtnID"] = theDS.Rows[0]["PatientID"].ToString(); DataSet theDSInfantInfo = ptnMgrPMTCT.SaveInfantInfo(Convert.ToInt64(ViewState["PtnID"]), Convert.ToInt64(Session["AppLocationId"]), Convert.ToInt64(ViewState["visitPk"]), Convert.ToInt64(Session["PatientId"]), Convert.ToInt64(Session["AppUserId"])); BindGrid(dtTemp); } else { ViewState["Status"] = "Edit"; Hashtable theHT = AddUpdateData(i); IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataTable theCustomDataDT = new DataTable(); //DataTable theDS = ptnMgrPMTCT.UpdatePatientRegistrationPMTCT(theHT, theCustomDataDT); DataTable theDS = ptnMgrPMTCT.SavePatientRegistrationPMTCT(theHT, theCustomDataDT); BindGrid(dtTemp); } SaveCancel(); } }
private void openPatientDetails(int patientID) { HttpContext.Current.Session["PatientId"] = patientID; HttpContext.Current.Session["PatientVisitId"] = 0; HttpContext.Current.Session["ServiceLocationId"] = 0; HttpContext.Current.Session["LabId"] = 0; /* Session["TechnicalAreaName"] = null; * Session["TechnicalAreaId"] = 0;*/ #region "Refresh Patient Records" IPatientHome PManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical"); System.Data.DataSet thePDS = PManager.GetPatientDetails(Convert.ToInt32(HttpContext.Current.Session["PatientId"]), Convert.ToInt32(HttpContext.Current.Session["SystemId"]), Convert.ToInt32(HttpContext.Current.Session["TechnicalAreaId"])); HttpContext.Current.Session["PatientInformation"] = thePDS.Tables[0]; #endregion string theUrl = ""; if (Request.QueryString["srvNm"] == "Records") { Session["TechnicalAreaName"] = "Records"; theUrl = string.Format("{0}", "./frmAddTechnicalArea.aspx"); Response.Redirect(theUrl); } else { //Check if the patient is enrolled and go directly to patient home page if patient is enrolled IPatientRegistration PatRegMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet theDS = PatRegMgr.GetFieldNames(int.Parse(Request.QueryString["mod"]), Convert.ToInt32(Session["PatientId"])); if (theDS.Tables[3].Rows.Count > 0)//check if patient is care ended for reenrollment { //theUrl = string.Format("{0}?PatientId={1}&mod={2}", "./frmAddTechnicalArea.aspx", patientID, Request.QueryString["mod"]); /* * Code is commented for Care end patient, when patient is under Care End It should redirected to patient home page. * Dated: 14 jan 2015 */ //theUrl = string.Format("{0}?mod={1}", "./frmAddTechnicalArea.aspx", Request.QueryString["mod"]); theUrl = "./ClinicalForms/frmPatient_Home.aspx"; } else if (theDS.Tables[2].Rows.Count > 0 && theDS.Tables[2].Rows[0]["StartDate"].ToString() != "") { theUrl = "./ClinicalForms/frmPatient_Home.aspx"; } else { //theUrl = string.Format("{0}?PatientId={1}&mod={2}", "./frmAddTechnicalArea.aspx", patientID, Request.QueryString["mod"]); theUrl = string.Format("{0}?mod={1}", "./frmAddTechnicalArea.aspx", Request.QueryString["mod"]); } Response.Redirect(theUrl, false); } }
private void Init_page() { Session["PatientId"] = 0; IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; createserviceButtons(theDT); }
private void loadWaitList() { IPatientRegistration PManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); System.Data.DataTable theDt = PManager.GetPatientsOnWaitingList(Convert.ToInt32(ddwaitingList.SelectedItem.Value), Convert.ToInt32(Session["TechnicalAreaId"])); Session["WaitlistPatients"] = theDt; grdWaitingList.DataSource = Session["WaitlistPatients"]; grdWaitingList.DataBind(); }
/// <summary> /// Populates the patient details. /// </summary> void PopulatePatientDetails(int patientID) { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataTable theDT = ptnMgr.GetPatientRecord(patientID); //Session["ClientInfo"] = theDS; if (theDT.Rows.Count > 0) { lblname.Text = String.Format("{0} {1} {2}", theDT.Rows[0]["Firstname"], theDT.Rows[0]["Middlename"], theDT.Rows[0]["Lastname"]); lblFacilityID.Text = theDT.Rows[0]["PatientFacilityID"].ToString(); } ptnMgr = null; }
/// <summary> /// Populates the patient details. /// </summary> void PopulatePatientDetails() { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet theDS = ptnMgr.GetPatientRegistration(int.Parse(Session["PatientId"].ToString()), 12); //Session["ClientInfo"] = theDS; if (theDS.Tables[0].Rows.Count > 0) { lblname.Text = String.Format("{0} {1} {2}", theDS.Tables[0].Rows[0]["Firstname"], theDS.Tables[0].Rows[0]["Middlename"], theDS.Tables[0].Rows[0]["Lastname"]); lblsex.Text = theDS.Tables[0].Rows[0]["sex"].ToString(); lbldob.Text = theDS.Tables[0].Rows[0]["dob"].ToString(); lblIQno.Text = theDS.Tables[0].Rows[0]["IQNumber"].ToString(); } ptnMgr = null; }
/// <summary> /// Binds the service dropdown. /// </summary> void PopulateServiceDropdown() { BindFunctions BindManager = new BindFunctions(); IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; if (theDT.Rows.Count > 0) { BindManager.BindCombo(ddlServices, theDT, "ModuleName", "ModuleID"); ptnMgr = null; } }
/// <summary> /// Populates the patient details. /// </summary> void PopulatePatientDetails() { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataTable theDT = ptnMgr.GetPatientRecord(Convert.ToInt32(Session["PatientId"])); //Session["ClientInfo"] = theDS; if (theDT.Rows.Count > 0) { lblname.Text = String.Format("{0} {1} {2}", theDT.Rows[0]["Firstname"], theDT.Rows[0]["Middlename"], theDT.Rows[0]["Lastname"]); lblsex.Text = (theDT.Rows[0]["sex"].ToString() == "16") ? "Male" : "Female"; lbldob.Text = Convert.ToDateTime(theDT.Rows[0]["dob"]).ToString("dd-MMM-yyyy"); lblFacilityID.Text = theDT.Rows[0]["PatientFacilityID"].ToString(); lblIQno.Text = theDT.Rows[0]["IQNumber"].ToString(); } ptnMgr = null; }
protected void grdWaitingList_SelectedIndexChanged(object sender, EventArgs e) { if (Convert.ToInt32(Session["TechnicalAreaId"]) == 0) { return; //do nothing if we are in records } string theUrl = string.Empty; int patientID = int.Parse(grdWaitingList.SelectedDataKey.Values["Ptn_PK"].ToString()); HttpContext.Current.Session["PatientId"] = patientID; HttpContext.Current.Session["PatientVisitId"] = 0; HttpContext.Current.Session["ServiceLocationId"] = 0; HttpContext.Current.Session["LabId"] = 0; int WaitingListID = int.Parse(grdWaitingList.SelectedDataKey.Values["WaitingListID"].ToString()); //remove patient from the waiting list IPatientRegistration PManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); PManager.ChangeWaitingListStatus(WaitingListID, 1, Convert.ToInt32(base.Session["AppUserId"])); // Added for bug ID 1062 if (ddwaitingList.SelectedItem.Text == "Laboratory") { String theOrdScript; theOrdScript = "<script language='javascript' id='openPatient'>\n"; theOrdScript += "window.opener.location.href = './Laboratory/frm_LabTestResults.aspx';\n"; theOrdScript += "window.close();\n"; theOrdScript += "</script>\n"; Page.ClientScript.RegisterStartupScript(this.GetType(), "closePage", theOrdScript); } else// (ddwaitingList.SelectedItem.Text == "Pharmacy") { String theOrdScript; theOrdScript = "<script language='javascript' id='openPatient'>\n"; //theOrdScript += "window.opener.location.href = './ClinicalForms/frmPatient_Home.aspx';\n"; Bug ID 1062 theOrdScript += "window.opener.location.href = './ClinicalForms/frmPatient_History.aspx';\n"; theOrdScript += "window.close();\n"; theOrdScript += "</script>\n"; Page.ClientScript.RegisterStartupScript(this.GetType(), "closePage", theOrdScript); } // End addition. // theUrl = "./ClinicalForms/frmPatient_Home.aspx"; // Response.Redirect(theUrl, false); }
private void openPatientDetails(int patientID) { HttpContext.Current.Session["PatientId"] = patientID; HttpContext.Current.Session["PatientVisitId"] = 0; HttpContext.Current.Session["ServiceLocationId"] = 0; HttpContext.Current.Session["LabId"] = 0; HttpContext.Current.Session["PatientInformation"] = null; SessionManager.PatientId = patientID; SessionManager.VisitId = 0; string theUrl = ""; if (Request.QueryString["srvNm"] == "Records" || Request.QueryString["srvNm"] == "Consultation") { Session["TechnicalAreaName"] = "Records"; theUrl = string.Format("{0}?PatientId={1}", "./AddTechnicalArea.aspx", patientID); Response.Redirect(theUrl); } else { //Check if the patient is enrolled and go directly to patient home page if patient is enrolled IPatientRegistration PatRegMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet theDS = PatRegMgr.GetFieldNames(int.Parse(Request.QueryString["mod"]), patientID); if (theDS.Tables[3].Rows.Count > 0)//check if the patient was care ended for reenrolment { theUrl = string.Format("{0}?PatientId={1}&mod={2}", "./AddTechnicalArea.aspx", patientID, Request.QueryString["mod"]); } else if (theDS.Tables[2].Rows.Count > 0 && theDS.Tables[2].Rows[0]["StartDate"].ToString() != "") { Session["TechnicalAreaId"] = Request.QueryString["mod"]; theUrl = "~/ClinicalForms/frmPatient_Home.aspx"; } else { theUrl = string.Format("{0}?PatientId={1}&mod={2}", "./AddTechnicalArea.aspx", patientID, Request.QueryString["mod"]); } HttpContext.Current.ApplicationInstance.CompleteRequest(); Response.Redirect(theUrl, true); } }
protected void btnsave_Click(object sender, EventArgs e) { if (FieldValidation() == false) { return; } Hashtable theHT = AddUpdateData(); IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); CustomFieldClinical theCustomManager = new CustomFieldClinical(); DataTable theCustomDataDT = new DataTable(); //if (Request.QueryString["Name"] == "Add") if (Convert.ToInt32(Session["PatientId"]) == 0) { theCustomDataDT = theCustomManager.GenerateInsertUpdateStatement(pnlCustomList, "Insert", ApplicationAccess.PMTCTEnrollment, (DataSet)ViewState["CustomFieldsDS"]); } else ////if (Request.QueryString["Name"] == "Edit") { //CustomFieldClinical theCustomManager = new CustomFieldClinical(); theCustomDataDT = theCustomManager.GenerateInsertUpdateStatement(pnlCustomList, "Update", ApplicationAccess.PMTCTEnrollment, (DataSet)ViewState["CustomFieldsDS"]); //DataTable theDS = ptnMgrPMTCT.UpdatePatientRegistrationPMTCT(theHT,theCustomDataDT); //ViewState["PtnID"] = theDS.Rows[0]["PatientID"].ToString(); //UpdateCancel(); } DataTable theDS = ptnMgrPMTCT.SavePatientRegistrationPMTCT(theHT, theCustomDataDT); ViewState["PtnID"] = theDS.Rows[0]["PatientID"].ToString(); Session["PatientId"] = theDS.Rows[0]["PatientID"].ToString(); SaveCancel(); #region "Refresh Patient Records" IPatientHome PManager; PManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical"); System.Data.DataSet thePDS = PManager.GetPatientDetails(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["TechnicalAreaId"])); Session["PatientInformation"] = thePDS.Tables[0]; #endregion Session["PatientStatus"] = 0; }
protected void grdWaitingList_RowDeleting(object sender, GridViewDeleteEventArgs e) { DataTable theDT = (DataTable)Session["dtWaitingList"]; DataRow rowDelete = theDT.Rows[e.RowIndex]; if (Convert.ToInt32(rowDelete["Persisted"]) == 1) { rowDelete["RowStatus"] = QueueStatus.Deleted; rowDelete.AcceptChanges(); int waitingListId = Convert.ToInt32(rowDelete["WaitingListID"]); IPatientRegistration PManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); PManager.ChangeWaitingListStatus(waitingListId, (int)QueueStatus.Deleted, this.UserId); } else { theDT.Rows.RemoveAt(e.RowIndex); } }
/// <summary> /// Populates the published service area. /// </summary> void PopulateServiceArea() { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(this.FacilityID); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; ddlReferral.Items.Clear(); ddlReferral.Items.Add(new ListItem("Select..", "")); foreach (DataRow dr in theDT.Rows) { ddlReferral.Items.Add(new ListItem(dr["ModuleName"].ToString(), dr["ModuleName"].ToString())); } // ddlReferral.DataTextField = "ModuleName"; //ddlReferral.DataValueField = "ModuleName"; //ddlReferral.DataSource = theDT; // ddlReferral.DataBind(); this.ddlReferral.Items.Add(new ListItem("Others", "Others")); }
/// <summary> /// Binds the service dropdown. /// </summary> void PopulateServiceDropdown() { BindFunctions BindManager = new BindFunctions(); IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; DataView theDV = new DataView(theDT); theDV.RowFilter = "ModuleId NOT IN(206,207,7)"; IQCareUtils theModUtils = new IQCareUtils(); DataTable theNewDT = new DataTable(); theNewDT = theModUtils.CreateTableFromDataView(theDV); if (theNewDT.Rows.Count > 0) { BindManager.BindCombo(ddlServices, theNewDT, "ModuleName", "ModuleID"); ptnMgr = null; } }
void PopulateModules() { try { BindFunctions BindManager = new BindFunctions(); IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); DataTable theDT = new DataTable(); theDT = DSModules.Tables[0]; if (theDT.Rows.Count > 0) { BindManager.BindCombo(ddlDepartment, theDT, "ModuleName", "ModuleID"); ptnMgr = null; } } catch (Exception ex) { this.ShowErrorMessage(ref ex); } }
private void Init_Form() { AppTitle.Text = TouchGlobals.RootTitle + " [" + Session["AppLocation"].ToString() + "]"; if (Session["AppUserName"] != null) { lblUserName.Text = Session["AppUserName"].ToString(); } if (Session["AppLocation"] != null) { lblFacilityName.Text = Session["AppLocation"].ToString(); } //DateTime theTmpDate; //string strPatientEnrollmentId = string.Empty; //IPatientHome PatientManager; string ObjFactoryParameter = "BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"; //PatientManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical"); ////System.Data.DataSet theDS = PatientManager.GetPatientDetails(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"])); //System.Data.DataSet theDS = PatientManager.GetPatientDetails(Convert.ToInt32(Session["PatientId"]), Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["TechnicalAreaId"])); //PatientManager = null; IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataSet theDs = ptnMgr.GetPatientRegistration(patientID, 12); //#endregion DataTable theDTMod = (DataTable)Session["AppModule"]; DataView theDVMod = new DataView(theDTMod); theDVMod.RowFilter = "ModuleId=" + Convert.ToInt32(Session["TechnicalAreaId"]); setUserDetailsInTab(theDs.Tables[0]); BindServiceDropdown(); }
private void LoadWaitList() { IPatientRegistration PManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); int moduleID = Convert.ToInt32(Session["TechnicalAreaId"]); //System.Data.DataTable theDt = PManager.GetPatientsOnWaitingList(Convert.ToInt32(ddwaitingList.SelectedItem.Value), Convert.ToInt32(Session["TechnicalAreaId"])); System.Data.DataTable theDt = PManager.GetPatientsOnWaitingList( Convert.ToInt32(ddwaitingList.SelectedItem.Value), (moduleID > 0 ? moduleID : 0)); Session["WaitlistPatients"] = theDt; //check whether we need to filter by current user for consultation if (ddwaitingList.SelectedItem.Text == "Consultation") { this.PopulateUsersList(); ddWaitingFor.Visible = true; lblWaitingfor.Visible = true; ddWaitingFor.SelectedValue = base.Session["AppUserId"].ToString(); } grdWaitingList.DataSource = Session["WaitlistPatients"]; grdWaitingList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } (Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblpntStatus") as Label).Text = Session["lblpntstatus"].ToString(); if (Authentiaction.HasFunctionRight(ApplicationAccess.ChildEnrollment, FunctionAccess.View, (DataTable)Session["UserRight"]) == false) { string theUrl = string.Empty; theUrl = string.Format("../ClinicalForms/frmPatient_Home.aspx"); Response.Redirect(theUrl); } else if (Authentiaction.HasFunctionRight(ApplicationAccess.ChildEnrollment, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) { btnsave.Enabled = false; btnAdd.Enabled = false; } else if (Authentiaction.HasFunctionRight(ApplicationAccess.ChildEnrollment, FunctionAccess.Update, (DataTable)Session["UserRight"]) == false) { btnsave.Enabled = false; btnAdd.Enabled = false; } AddAttributes(); IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); theDS = ptnMgrPMTCT.GetChildDetail(Convert.ToInt16(Session["PatientId"].ToString()), Convert.ToInt16(Session["AppLocationId"].ToString())); dtTemp = theDS.Tables[0]; dtInfo = theDS.Tables[1]; string strPatientName = Session["PatientName"].ToString(); string[] strname = strPatientName.Split(','); ViewState["FName"] = strname[1].ToString(); ViewState["LName"] = strname[0].ToString(); GetAdmissionNo(); if (ViewState["DT"] == null) { ViewState["DT"] = dtTemp; ViewState["iSerialNo"] = Convert.ToInt16(dtInfo.Rows[0][0]) + 1; ViewState["FirstName"] = "Baby of " + strname[1].ToString(); ViewState["LastName"] = strname[0].ToString(); TxtFirstName.Text = ViewState["FirstName"].ToString(); TxtLastName.Text = ViewState["LastName"].ToString(); //TxtAdmissionNo.Text = Session["AdmissionNo"].ToString() + "-" + ViewState["iSerialNo"]; TxtAdmissionNo.Text = Session["AdmissionNo"].ToString() + "-" + ViewState["iSerialNo"]; } else { ViewState["FirstName"] = TxtFirstName.Text; ViewState["LastName"] = TxtLastName.Text; TxtFirstName.Text = ViewState["FirstName"].ToString(); TxtLastName.Text = ViewState["LastName"].ToString(); if (btnAdd.Text != "Update Child") { if (ViewState["AddStatus"] != "1") { if (Convert.ToString(TxtAdmissionNo.Text).IndexOf('-') >= 0) { TxtAdmissionNo.Text = Session["AdmissionNo"].ToString() + "-" + ViewState["iSerialNo"]; } } } } BindGrid(dtTemp); if (dtTemp.Rows.Count == 0) { btnsave.Enabled = false; } else { btnsave.Enabled = true; } }
private void LoadPatientDetail() { //IPatientRegistration PatientManager = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); ////int patientID = Convert.ToInt32(Request.QueryString["PatientId"]); int patientID = System.Convert.ToInt32(Session["PatientId"]); IPatientRegistration ptnMgrPMTCT = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataSet theDS = ptnMgrPMTCT.GetPatientRegistrationPMTCT(patientID); if (theDS.Tables[0].Rows.Count > 0) { Session["Add"] = 0; ViewState["visitPk"] = theDS.Tables[1].Rows[0]["Visit_ID"].ToString(); TxtFirstName.Text = theDS.Tables[0].Rows[0]["FirstName"].ToString(); TxtMiddleName.Text = theDS.Tables[0].Rows[0]["MiddleName"].ToString(); TxtLastName.Text = theDS.Tables[0].Rows[0]["LastName"].ToString(); TxtRegistrationDate.Text = String.Format("{0:dd-MMM-yyyy}", theDS.Tables[1].Rows[0]["VisitDate"]); DDGender.SelectedValue = theDS.Tables[0].Rows[0]["Sex"].ToString(); TxtDOB.Text = String.Format("{0:dd-MMM-yyyy}", theDS.Tables[0].Rows[0]["DOB"]); if (theDS.Tables[0].Rows[0]["DOBPrecision"].ToString() == "0") { RbtnDOBPrecExact.Checked = true; } else if (theDS.Tables[0].Rows[0]["DOBPrecision"].ToString() == "1") { RbtnDOBPrecEstimated.Checked = true; } else if (theDS.Tables[0].Rows[0]["DOBPrecision"].ToString() == "2") { RbtnDOBPrecExact.Checked = false; RbtnDOBPrecEstimated.Checked = false; } TxtAgeCurrentYears.Text = theDS.Tables[0].Rows[0]["AGE"].ToString(); TxtAgeCurrentMonths.Text = theDS.Tables[0].Rows[0]["Month"].ToString(); TxtAgeEnrollmentYears.Text = theDS.Tables[0].Rows[0]["EnrolAge"].ToString(); TxtAgeEnrollmentMonths.Text = theDS.Tables[0].Rows[0]["EnrolMonth"].ToString(); DDMaritalStatus.SelectedValue = theDS.Tables[0].Rows[0]["MaritalStatus"].ToString(); if (theDS.Tables[0].Rows[0]["TransferIn"].ToString() == "1") { chkTransferIn.Checked = true; } else { chkTransferIn.Checked = false; } ddReferredFrom.SelectedValue = theDS.Tables[0].Rows[0]["ReferredFrom"].ToString(); TxtANCNumber.Text = theDS.Tables[0].Rows[0]["ANCNumber"].ToString(); TxtPMTCTNumber.Text = theDS.Tables[0].Rows[0]["PMTCTNumber"].ToString(); TxtAdmissionNumber.Text = theDS.Tables[0].Rows[0]["AdmissionNumber"].ToString(); TxtOutPatientNumber.Text = theDS.Tables[0].Rows[0]["OutpatientNumber"].ToString(); TxtAddress.Text = theDS.Tables[0].Rows[0]["Address"].ToString(); ddVillageName.SelectedValue = theDS.Tables[0].Rows[0]["VillageName"].ToString(); ddDistrict.SelectedValue = theDS.Tables[0].Rows[0]["DistrictName"].ToString(); TxtPhoneNumber.Text = theDS.Tables[0].Rows[0]["Phone"].ToString(); ViewState["ANC"] = TxtANCNumber.Text; ViewState["PMTCT"] = TxtPMTCTNumber.Text; ViewState["Admission"] = TxtAdmissionNumber.Text; ViewState["Outpatient"] = TxtOutPatientNumber.Text; FillOldData(patientID); } else { Session["Add"] = 1; } }
private void createserviceButtons(DataTable modules) { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataSet DSModules = new DataSet(); DataTable theDT = new DataTable(); if (Convert.ToInt32(Session["AppUserId"]) > 1) { DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(Session["AppUserId"])); theDT = DSModules.Tables[2]; } else { DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); theDT = DSModules.Tables[0]; } //removing Workplan if KNH Static form service is not available Session["isKNHEnabled"] = false; DataTable dt = theDT; if (!object.Equals(theDT, null)) { int tmp = dt.AsEnumerable().Where(p => p.Field <int>("moduleid") == Convert.ToInt32("204")).Select(p => p.Field <int>("moduleid")).FirstOrDefault(); if (tmp > 0) { Session["isKNHEnabled"] = true; } } //first add the records button which is default present int i = 0; int cntr = 0; TableRow serviceRow = new TableRow(); TableCell recordsCell = new TableCell(); recordsCell.Attributes.Add("align", "center"); recordsCell.Attributes.Add("width", "25%"); recordsCell.Attributes.Add("height", "100px"); Button btnRecords = new Button(); btnRecords.Text = "Records"; btnRecords.BackColor = System.Drawing.ColorTranslator.FromHtml(aTileBackgroundColor[1].ToString()); btnRecords.Attributes.Add("class", "tileButton"); btnRecords.BorderStyle = BorderStyle.None; btnRecords.OnClientClick = String.Format("window.location = 'frmFindAddCustom.aspx?srvNm={0}&mod={1}'; return false;", "Records", 0); btnRecords.Height = Unit.Pixel(100); if (theDT.Rows.Count == 1) { btnRecords.Width = Unit.Percentage(70); } else if (theDT.Rows.Count == 2) { btnRecords.Width = Unit.Percentage(90); } else { btnRecords.Width = Unit.Percentage(100); } recordsCell.Controls.Add(btnRecords); serviceRow.Cells.Add(recordsCell); mainTable.Controls.Add(serviceRow); i = 1; cntr = 1; foreach (DataRow dr in theDT.Rows) { if (Convert.ToInt32(dr["ModuleID"]) != 201) { if (i % 4 == 0) { serviceRow = new TableRow(); } TableCell serviceCell = new TableCell(); serviceCell.Attributes.Add("align", "center"); serviceCell.Attributes.Add("width", "25%"); serviceCell.Attributes.Add("height", "100px"); Button btnService = new Button(); btnService.Text = dr[2].ToString(); btnService.Attributes.Add("data-moduleID", dr[1].ToString()); btnService.BackColor = System.Drawing.ColorTranslator.FromHtml(aTileBackgroundColor[cntr].ToString()); btnService.Attributes.Add("class", "tileButton"); btnService.BorderStyle = BorderStyle.None; btnService.OnClientClick = String.Format("window.location = 'frmFindAddCustom.aspx?srvNm={0}&mod={1}'; return false;", btnService.Text, dr[1]); btnService.Height = Unit.Pixel(100); if (theDT.Rows.Count == 1) { btnService.Width = Unit.Percentage(70); } else if (theDT.Rows.Count == 2) { btnService.Width = Unit.Percentage(90); } else { btnService.Width = Unit.Percentage(100); } serviceCell.Controls.Add(btnService); serviceRow.Cells.Add(serviceCell); if (i % 4 == 0) { mainTable.Controls.Add(serviceRow); } i += 1; cntr += 1; //resetting color counter if (i > cntr) { cntr = 1; } } } ptnMgr = null; }
protected void grdSearchResult_RowDataBound(object sender, GridViewRowEventArgs e) { //if (e.Row.RowType == DataControlRowType.DataRow) //{ // e.Row.BackColor = System.Drawing.Color.White; // e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';"); // e.Row.Attributes.Add("onclick",GetPostBackClientHyperlink(this.grdSearchResult, "Select$" + e.Row.DataItemIndex)); //} string theUrl = string.Empty; if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.BackColor = System.Drawing.Color.White; e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';"); if (Request.QueryString["FormName"] != null && Request.QueryString["FormName"].ToString() == "FamilyInfo") { theUrl = string.Format("{0}?RefId={1}&&PatientId={2}", "./ClinicalForms/frmFamilyInformation.aspx", e.Row.Cells[0].Text, Session["PtnRedirect"].ToString()); //e.Row.Attributes.Add("onclick", "window.location.href=('" + theUrl + "')"); e.Row.Attributes.Add("onclick", "fnSetSessionfamily('" + theUrl + "')"); } else if (Convert.ToInt32(e.Row.Cells[11].Text) == Convert.ToInt32(Session["AppLocationId"])) { if (Request.QueryString["FormName"] != null && Request.QueryString["FormName"].ToString() == "AppointmentMain") { //theUrl = string.Format("{0}&PatientId={1}&PatientEnrollmentID={2}&Locationid={3}", "./Scheduler/frmScheduler_AppointmentNew.aspx?name=Add", e.Row.Cells[0].Text, e.Row.Cells[5].Text, e.Row.Cells[12].Text); theUrl = string.Format("{0}&PatientId={1}", "./Scheduler/frmScheduler_AppointmentNew.aspx?name=Add", e.Row.Cells[0].Text); } else if (Request.QueryString["mnuClicked"] != null && Request.QueryString["mnuClicked"] == "DeletePatient") { theUrl = string.Format("{0}?PatientID={1}", "./AdminForms/frmAdmin_DeletePatient.aspx", e.Row.Cells[0].Text); } else if (theReportName != "") { if (theReportName == "ARVAdherence") { theUrl = string.Format("{0}ReportName={1}&PatientId={2}", "./Reports/frmReportViewer.aspx?", theReportName, e.Row.Cells[0].Text); } else { theUrl = string.Format("{0}?PatientId={1}", "./frmAddTechnicalArea.aspx", e.Row.Cells[0].Text); } } else { //Check if the patient is enrolled and go directly to patient home page if patient is enrolled IPatientRegistration PatRegMgr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); DataSet theDS = PatRegMgr.GetFieldNames(int.Parse(ddlServices.SelectedValue), Convert.ToInt32(e.Row.Cells[0].Text)); if (theDS.Tables[2].Rows.Count > 0 && theDS.Tables[2].Rows[0]["StartDate"].ToString() != "") { //theUrl = "./ClinicalForms/frmPatient_Home.aspx"; theUrl = string.Format("{0}?Values={1}", "./ClinicalForms/frmPatient_Home.aspx", e.Row.Cells[0].Text); } else { theUrl = string.Format("{0}?PatientId={1}", "./frmAddTechnicalArea.aspx", e.Row.Cells[0].Text); //theUrl = string.Format("{0}?Values={1}", "./ClinicalForms/frmPatient_Home.aspx", e.Row.Cells[0].Text); } } //e.Row.Attributes.Add("onclick", "window.location.href=('" + theUrl + "')"); e.Row.Attributes.Add("onclick", "fnSetSession('" + theUrl + "')"); } else { //string theScript = "alert('This Patient belongs to different Location. Please Log-in from " + e.Row.Cells[8].Text + ".');"; string theScript = "alert('This Patient belongs to a different Location. Please log-in with the patient\\'s location.');"; e.Row.Attributes.Add("onclick", theScript); } } }
public static DataTable GetPatientIdentifiers(int serviceAreaId = 0) { IPatientRegistration ipr = (IPatientRegistration)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientRegistration, BusinessProcess.Clinical"); return(ipr.GetIdentifiersByServiceAreaId(serviceAreaId)); }