protected void Page_Load(object sender, EventArgs e) { if (!this.IsLoggedIn()) { Response.Redirect("Default.aspx", true); } //set session time remaining strMilisecondsSessionExpire = SessionTimeRemaining(); strSessionTimeout = SessionTimeRemaining(); // register Ext.NET library icons ResourceManager1.RegisterIcon(Icon.Information); //pass the master to the popup ucPatLookup.BaseMstr = this; ucLogin.BaseMstr = this; ucVerticalMenu.BaseMstr = this; ucEncounterType.BaseMstr = this; if (!this.IsLoggedIn()) { //put us back in login mode ucLogin.SetMode(1); this.ClosePatient(); } //------------------------------------------------------------------------------ // Get "Last updated" info string strLastUpdated = this.GetVSStringValue("LAST_UPDATED"); if (!String.IsNullOrEmpty(strLastUpdated)) { divLastModified.Visible = true; divLastModified.InnerText = strLastUpdated; } //remove PATIENTNAME session variable if //not logged in and patient_id is empty if (!this.IsLoggedIn() || String.IsNullOrEmpty(this.SelectedPatientID)) { Session["PATIENTNAME"] = null; } //------------------------------------------------------------------------------ // NOT POSTBACK //------------------------------------------------------------------------------ #region not_postback if (!IsPostBack) { //get system settings DataSet dsSys = new DataSet(); if (Session["SYSSETTINGS"] == null) { CSystemSettings sys = new CSystemSettings(); Session["SYSSETTINGS"] = sys.GetSystemSettingsDS(this); } dsSys = (DataSet)Session["SYSSETTINGS"]; //get site if (Session["SiteID"] == null) { CSystemSettings SysSettings = new CSystemSettings(); DataSet dsSite = SysSettings.GetSiteDS(this); string strSiteID = utils.GetStringValueFromDS(dsSite, "SITE_ID"); Session["SiteID"] = strSiteID; } } #endregion //------------------------------------------------------------------------------ // IS POSTBACK //------------------------------------------------------------------------------ #region isPostBack if (IsPostBack) { //get the postback control string strPostBackControl = Request.Params["__EVENTTARGET"]; if (strPostBackControl != null) { #region PatientLookup //did we do a patient lookup? if (strPostBackControl.Equals("PATIENT_LOOKUP")) { //Clears previously looked up patient id, treatment id this.SelectedPatientID = ""; this.SelectedTreatmentID = -1; this.SelectedEncounterID = ""; this.SelectedProblemID = -1; this.ClosePatient(); //get the patient id string[] strArg = Request.Form["__EVENTARGUMENT"].Split('|'); //pass the patient id to the base, this will cache //it in the db fx_session_value table this.SelectedPatientID = strArg[0]; //check if it is an event lookup if (strArg.Length > 1) { if (strArg[1].ToLower().Equals("event")) { Session["EVENT_LOOKUP"] = true; } } //set the current treatment id, gets list of records with newest first DataSet t_recs = treatment.GetRecordList(this, this.SelectedPatientID, 2); //OPEN CASES - Revamp only uses this if (t_recs != null && t_recs.Tables[0].Rows.Count > 0) { this.SelectedTreatmentID = Convert.ToInt32(t_recs.Tables[0].Rows[0]["treatment_id"].ToString()); } //------------------------------------------------------------------------------ //GET INITIAL VISIT ID //GET PATIENT NAME FOR THE DEMOGRAPHICS BLURB if (this.IsLoggedIn() && !String.IsNullOrEmpty(this.SelectedPatientID))//must be logged in too... { if (Session["InitialVisit"] == null) { CEncounter patInitVisit = new CEncounter(); CDataUtils dUtils = new CDataUtils(); DataSet dsInitVisit = patInitVisit.GetInitialVisitDS(this, this.SelectedPatientID, this.SelectedTreatmentID); Session["InitialVisit"] = dUtils.GetStringValueFromDS(dsInitVisit, "encounter_id"); } if (Session["PATIENTNAME"] == null) { CPatient cpat = new CPatient(); Session["PATIENTNAME"] = cpat.GetPatientName(this); } //GET SELECTED PATIENT'S DEMOGRAPHICS CPatient pat = new CPatient(); CDataUtils utils = new CDataUtils(); DataSet clientDemographics = new DataSet(); Session["PAT_DEMOGRAPHICS_DS"] = pat.GetPatientDemographicsDS(this); clientDemographics = (DataSet)Session["PAT_DEMOGRAPHICS_DS"]; foreach (DataTable patTable in clientDemographics.Tables) { foreach (DataRow patRow in patTable.Rows) { this.APPMaster.PatientHasOpenCase = false; if (!patRow.IsNull("OPENCASE_COUNT")) { if (Convert.ToInt32(patRow["OPENCASE_COUNT"]) > 0) { this.APPMaster.PatientHasOpenCase = true; } } } } } //-------------------------------------------------------------------------------------- //VERIFY STATUS OF THE PATIENT RECORD CPatientLock plock = new CPatientLock(this); string strLockProviderName = String.Empty; string strLockProviderEmail = String.Empty; this.IsPatientLocked = plock.IsPatientLocked(this.SelectedPatientID, out strLockProviderName, out strLockProviderEmail); Session["PAT_LOCK_PROVIDER"] = strLockProviderName; Session["PAT_LOCK_EMAIL"] = strLockProviderEmail; //REDIRECT USER ------------------------------------------------------------------------ long lSoapNoteUR = (long)SUATUserRight.NoteSubjectiveUR + (long)SUATUserRight.NoteObjectiveUR + (long)SUATUserRight.NoteAssessmentUR + (long)SUATUserRight.NotePlanUR; if (this.APPMaster.HasUserRight(lSoapNoteUR)) { Response.Redirect("pat_summary.aspx", true); } else if (this.APPMaster.HasUserRight((long)SUATUserRight.ProcessNewPatientsUR)) { Response.Redirect("pat_demographics.aspx", false); } else { Response.Redirect("revamp.aspx", true); } } #endregion #region OtherLookups //did we do a user lookup? if (strPostBackControl.Equals("USER_LOOKUP")) { //get the uidpwd string strArg = Request.Form["__EVENTARGUMENT"]; //pass the patient id to the base, this will cache //it in the db fx_session_value table this.SelectedProviderID = strArg; Response.Redirect("user_admin.aspx", true); } //did we do a Portal Patient Lookup? if (strPostBackControl.Equals("PORTAL_PATIENT_LOOKUP")) { //get the uidpwd string strArg = Request.Form["__EVENTARGUMENT"]; //pass the patient id to the base, this will cache //it in the db fx_session_value table this.SelectedPatientID = strArg; Response.Redirect("pat_portal_account.aspx", true); } //-- 2/22/2011 close currently looked up patient if (strPostBackControl.Equals("CLOSE_PATIENT")) { this.SelectedPatientID = ""; this.SelectedTreatmentID = -1; this.LookupSearchCase = -1; Response.Redirect("revamp.aspx", true); } #endregion } } #endregion #region ShowUsernameAndPatientDemographics if (this.IsLoggedIn()) { //Name Of User Currently logged on. string strUserLoggedOn = String.Empty; if (Session["USERLOGGEDON"] == null) { strUserLoggedOn += "<img alt=\"Account Activity\" src=\"Images/information.png\" style=\"cursor: pointer; vertical-align: middle; margin-right: 3px;\" onclick=\"showAccDetails();\" />"; strUserLoggedOn += UserLoggedOn(); strUserLoggedOn += " - "; strUserLoggedOn += DateTime.Now.ToShortDateString(); strUserLoggedOn += " "; strUserLoggedOn += DateTime.Now.ToShortTimeString(); lblUserLoggedOn.Text = strUserLoggedOn; Session["USERLOGGEDON"] = strUserLoggedOn; } else { lblUserLoggedOn.Text = Session["USERLOGGEDON"].ToString(); } //draw the patient info bar at the top patDemoInfoBar.InnerHtml = ""; //GET PATIENT NAME for the demographics blurb //Render Left Vertical Menu for selected patient if (this.IsLoggedIn() && !String.IsNullOrEmpty(this.SelectedPatientID))//must be logged in too... { if (Session["PATIENTNAME"] == null) { CPatient cpat = new CPatient(); Session["PATIENTNAME"] = cpat.GetPatientName(this); } string[] strPatInfo = (string[])Session["PATIENTNAME"]; patDemoInfoBar.InnerHtml = strPatInfo[0]; //render vertical menu ucVerticalMenu.RenderVerticalMenu(); } else { this.ClosePatient(); } } #endregion //load the patient treatment/encounter info //if we are in group note, hide it... bool bSkipSelectedPatientCheck = false; string strPage = ""; strPage = this.GetPageName().ToLower(); if (strPage.IndexOf("pat_portal_account.aspx") > -1) { pnlTxTree.Visible = false; bSkipSelectedPatientCheck = true; } else if (strPage.IndexOf("cms_menu_edit.aspx") > -1) { pnlTxTree.Visible = false; bSkipSelectedPatientCheck = true; if (IsPostBack) { if (this.OnMasterSAVE()) { BuildMenu(); } } } else if (strPage.IndexOf("cms_page_edit.aspx") > -1) { pnlTxTree.Visible = false; bSkipSelectedPatientCheck = true; } else { pnlTxTree.Visible = true; patDemoInfoBar.Visible = true; bSkipSelectedPatientCheck = false; } // ---------------- if (!bSkipSelectedPatientCheck) { if (!String.IsNullOrEmpty(this.SelectedPatientID)) { pnlTxTree.Visible = true; pnlDemoInfoBar.Visible = true; } else { pnlTxTree.Visible = false; pnlDemoInfoBar.Visible = false; } } if (!this.IsLoggedIn()) { pnlLogoff.Visible = false; } else { pnlLogoff.Visible = true; } //get account activity details GetAccountDetails(); // Build the Menu & Toolbar HTML string BuildMenu(); //check if user has new messages btnEmailNew.Attributes.CssStyle.Add("vertical-align", "middle"); btnEmailNew.Attributes.CssStyle.Add("margin-right", "8px"); btnEmailNew.Attributes.CssStyle.Add("cursor", "pointer"); btnEmailNew.Visible = this.HasNewMessage(); btnEmailNew.Attributes.Add("onclick", "winrpt.showReport('messagescenter',['null'],{maximizable:false, width:($(window).width() - 50), height:($(window).height() - 50)});"); }
//page load protected void Page_Load(object sender, EventArgs e) { //TIU SUPPORT if (m_BaseMstr.APPMaster.TIU) { tpTIUNote.Visible = true; string strConfirm = ""; strConfirm += "if( confirm('"; strConfirm += "You are about to send a TIU note to CPRS. REVAMP TIU Notes on CPRS cannot be modified. If you do not want to send the TIU note at this time click Cancel."; strConfirm += "\\n\\n"; strConfirm += "Do you want to continue?"; strConfirm += "') )"; strConfirm += "{"; strConfirm += " __doPostBack('"; strConfirm += btnWriteTIU.ClientID; strConfirm += "', ''); "; //if you dont return true you lose the please wait! strConfirm += " return true;"; strConfirm += "}"; strConfirm += "else"; strConfirm += "{"; strConfirm += " return false;"; strConfirm += "}"; //add the JS to the button click btnWriteTIU.OnClientClick = strConfirm; if (!IsPostBack) { string strUserName = String.Empty; string strPWD = String.Empty; long lRegionID = 0; long lSiteID = 0; string strNoteTitleLabel = String.Empty; long lNoteClinicID = 0; bool bStatus = GetMDWSAccountInfo(m_BaseMstr.FXUserID, out strUserName, out strPWD, out lRegionID, out lSiteID, out strNoteTitleLabel, out lNoteClinicID); CMDWSUtils mdws = new CMDWSUtils(); mdws.LoadNoteTitlesDDL(strNoteTitleLabel, m_BaseMstr, ddlNoteTitle); mdws.LoadClinicsDDL(lNoteClinicID, m_BaseMstr, ddlClinic); GetTIUNote(); } } else { pnlViewNote.Visible = false; pnlWriteNote.Visible = false; tpTIUNote.Visible = false; } if (!IsPostBack && !bSecondPass) { //VERIFY STATUS OF THE PATIENT RECORD CPatientLock plock = new CPatientLock(m_BaseMstr); string strLockProviderName = String.Empty; string strLockProviderEmail = String.Empty; m_BaseMstr.IsPatientLocked = plock.IsPatientLocked(m_BaseMstr.SelectedPatientID, out strLockProviderName, out strLockProviderEmail); Session["PAT_LOCK_PROVIDER"] = strLockProviderName; Session["PAT_LOCK_EMAIL"] = strLockProviderEmail; } bool bRecLock = BaseMstr.IsPatientLocked; //check soap sections rights mode lROSubjective = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteSubjectiveUR); lROObjective = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteObjectiveUR); lROAssessment = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteAssessmentUR); if (bRecLock) { lROSubjective = (long)RightMode.ReadOnly; lROObjective = (long)RightMode.ReadOnly; lROAssessment = (long)RightMode.ReadOnly; } //just return if no patient is loaded if (BaseMstr.SelectedPatientID.Length < 1) { return; } //wire up the main save button if (BaseMstr.OnMasterSAVE()) { MasterSave(); } DisableSOAPNote(); switch (rblAssessmentView.SelectedIndex) { case 0: vwDiagnosis.Style.Add("display", "block"); vwAssessmentNote.Style.Add("display", "none"); txtAssessment.Visible = false; break; case 1: vwDiagnosis.Style.Add("display", "none"); vwAssessmentNote.Style.Add("display", "block"); txtAssessment.Visible = true; break; } //----------------------------------------------------------------- // NOT POSTBACK #region NotPostback if (!IsPostBack) { mvwObjectiveOptions.ActiveViewIndex = 0; rblObjectiveView.SelectedIndex = 1; //Default Note rblAssessmentView.SelectedIndex = 0; vwDiagnosis.Style.Add("display", "block"); //Diagnosis View ucAxes.Load_Assessment(); ucAxes.AutoSelectProblemInit(); ucProblemList.Initialize(); } #endregion //----------------------------------------------------------------- // IS POSTBACK #region IsPostBack if (IsPostBack) { string EvtSender = String.Empty; if (Request.Params.Get("__EVENTTARGET") != null) { EvtSender = Request.Params.Get("__EVENTTARGET").ToString(); //if a selection was made on the diagnosis popups if (Regex.IsMatch(EvtSender, "axis(1)", RegexOptions.IgnoreCase)) { ucProblemList.Initialize(); } } } #endregion //TIU SUPPORT if (m_BaseMstr.APPMaster.TIU) { //get the postback control string strPostBackControl = Request.Params["__EVENTTARGET"]; if (strPostBackControl != null) { //did we do a click write tiu? if (strPostBackControl.IndexOf("btnWriteTIU") > -1) { WriteTIU(); } } } }