// Checks to see if the appointment data in session is in the database private void ValidateSessionAppointmentData(string mrn, string physician, DateTime clinicDate) { EFormsDa da = new EFormsDa(); // UPDATE this to reference eformcontroller method DataTable table = da.GetPatientAppointmentRecord(mrn, physician, clinicDate); if (table.Rows.Count > 0) { DataRow row = table.Rows[0]; // populate controls with appointment data object objApptVisitType = row["ApptVisitType"]; if (objApptVisitType != DBNull.Value) { EncType.Value = row["ApptVisitType"].ToString(); } EncPhysician.Value = physician; string clinicDateString = clinicDate.ToShortDateString(); EncDateText.Text = clinicDateString; EncDate.Value = clinicDateString; } }
protected override void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); // disables view state // existing eforms use eform id to load components if (Request.QueryString["eformId"] != null && !Request.QueryString["eformId"].Equals("") && !Request.QueryString["eformId"].Equals("0")) { this.EFormId = int.Parse(Request.QueryString["eformId"]); // TODO: this query may be redundant EFormController ctr = new EFormController(); DataSet ds = ctr.GetRecord(int.Parse(Request.QueryString["eformId"])); if (ds.Tables[0].Rows.Count == 1) { this.EFormName = ds.Tables[0].Rows[0][EForm.EFormName].ToString(); isNewEForm = false; } } // new eform passes eform name in on url string when coming from list page else if (Request.QueryString["eform"] != null && !Request.QueryString["eform"].Equals("")) { this.EFormName = Request.QueryString["eform"]; if (Request.QueryString["status"] != null && Request.QueryString["status"].Equals("new")) { // TODO: BEFORE SETTING true we should see if this SAME eform has already been created today by the SAME physician; appears users click refresh isNewEForm = true; // do not check if user is allowed to enter multiple if (!EFormController.CanAllowMultiple(this.EFormName)) { Caisis.DataAccess.EFormsDa da = new EFormsDa(); DataRowView rv = da.GetPatientRecentEForm(this.EFormPatientId, Request.QueryString["eform"]); if (rv != null) { isNewEForm = false; this.EFormId = (int)rv["EFormId"]; this.EFormName = rv["EFormName"].ToString(); } } } } try { _status = this.SetEFormStatus(); } catch (ClientException ex) { Response.Write(ex.Message); Response.End(); } }
private void SetPageTitles(bool IsEFormApproved) { if (IsEFormApproved) { NavTitle.Text = "Print Narrative"; string approvedBy = ""; string approvedTime = ""; string userRealName = ""; // get the user who approved form and date EFormsDa da = new EFormsDa(); DataSet ds = da.GetEformsRecord(base.EFormId); if (ds.Tables[0].Rows.Count == 1) { approvedBy = ds.Tables[0].Rows[0][EForm.UpdatedBy].ToString(); approvedTime = ds.Tables[0].Rows[0][EForm.UpdatedTime].ToString(); UserDa userda = new UserDa(); DataSet userds = userda.GetByUserName(approvedBy); userRealName = userds.Tables[0].Rows[0]["UserFirstName"].ToString() + " " + userds.Tables[0].Rows[0]["UserLastName"].ToString(); } if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0) { NavTitle.Text += " for " + Session[SessionKey.PtFirstName].ToString(); } if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0) { NavTitle.Text += " " + Session[SessionKey.PtLastName].ToString(); } UserMsg.Text = "<span class=\"EFormAlertMsg\">This eform has been APPROVED by " + userRealName + " on " + approvedTime + " and is no longer available for update.</span><br/><br/><br/><br/>To print the narrative use the button located on the bottom right of this page."; } else { NavTitle.Text = "Approve Narrative"; if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0) { NavTitle.Text += " for " + Session[SessionKey.PtFirstName].ToString(); } if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0) { NavTitle.Text += " " + Session[SessionKey.PtLastName].ToString(); } UserMsg.Text = "If all data is accurate approve the eform using the button on the lower right. Once approved you will no longer be able to update the eform.<br><br>After approval, the narrative will remain available for printing."; } }
/// <summary> /// Determine if combination of session vars is a valid record in the appointments table /// </summary> /// <param name="mrn"></param> /// <param name="physician"></param> /// <param name="clinicDate"></param> public DataTable ValidateSessionAppointmentData(object mrn, object physician, object clinicDate) { DataTable table = new DataTable(); if (mrn != null && physician != null && clinicDate != null) { EFormsDa da = new EFormsDa(); table = da.GetPatientAppointmentRecord(mrn.ToString(), physician.ToString(), DateTime.Parse(clinicDate.ToString())); } return(table); }
override protected void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); base.SetTitle(ComponentTitle); EFormsDa eDa = new EFormsDa(); DataSet eDs = eDa.GetEformsRecord(this._eformId); DataView eDv = new DataView(eDs.Tables[0]); if (eDv.Count > 0) { EformName.Text = eDv[0][EForm.EFormName].ToString(); } }
/// <summary> /// Binds messages to Inbox repeater /// </summary> /// <param name="userId">logged in user</param> /// <param name="msgType">type of message to dislay</param> private void PopulateInbox(int userId, string msgType) { EFormsDa iDa = new EFormsDa(); DataSet iDs = iDa.GetEformsInbox(userId, msgType); if (iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0) { rptInbox.DataSource = iDs.Tables[0].DefaultView; rptInbox.DataBind(); InboxMessagesBody.Attributes.Add("onload", "top.TaskContainer.setNumMessages('" + iDs.Tables[0].Rows.Count + "')"); } }
private void SetPatientEFormList() { if (Session[SessionKey.PatientId] != null && Session[SessionKey.PatientId].ToString() != "") { EFormsDa da = new EFormsDa(); DataSet ds = da.GetPatientEForms(int.Parse(Session[SessionKey.PatientId].ToString())); if (ds.Tables[0].Rows.Count > 0) { NoEFormsTableRow.Visible = false; PatientEForms.DataSource = ds.Tables[0].DefaultView; PatientEForms.DataBind(); } } }
// Checks to see if the appointment data in session is in the database private void ValidateSessionAppointmentData(string mrn, string physician, DateTime clinicDate) { EFormsDa da = new EFormsDa(); // UPDATE this to reference eformcontroller method DataTable table = da.GetPatientAppointmentRecord(mrn, physician, clinicDate); if (table.Rows.Count > 0) { DataRow row = table.Rows[0]; string clinicDateString = clinicDate.ToShortDateString(); EncDateText_1.Text = clinicDateString; EncDate_1.Value = clinicDateString; } }
/// <summary> /// /// </summary> private void BuildRecentEforms() { string datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]); UserController uc = new UserController(); EFormController ec = new EFormController(); EFormsDa da = new EFormsDa(); int userId = uc.GetUserId(); System.Data.DataTable dt = da.GetUserRecentEforms(userId, datasetSql, null, null); if (dt.Rows.Count > 0) { UserEformsRpt.DataSource = dt; UserEformsRpt.DataBind(); NoEformsMessage.Visible = false; } }
/// <summary> /// when eform has already been approved redirects user to the clinic list /// </summary> private void CheckEFormApproval() { EFormController ect = new EFormController(); string status = ect.GetEFormStatus(_eformId); if (status.Equals(EformStatusManager.Status_Approved)) { string approvedBy = ""; string approvedTime = ""; string userRealName = ""; // get the user who approved form and date EFormsDa da = new EFormsDa(); DataSet ds = da.GetEformsRecord(_eformId); if (ds.Tables[0].Rows.Count == 1) { approvedBy = ds.Tables[0].Rows[0][EForm.UpdatedBy].ToString(); approvedTime = ds.Tables[0].Rows[0][EForm.UpdatedTime].ToString(); UserDa userda = new UserDa(); DataSet userds = userda.GetByUserName(approvedBy); userRealName = userds.Tables[0].Rows[0]["UserFirstName"].ToString() + " " + userds.Tables[0].Rows[0]["UserLastName"].ToString(); } string jsScript = "<script language=javascript>alert('This eform was approved by " + userRealName + " on " + approvedTime + " and can no longer be updated.\\n\\n You will now be redirected to the clinic list'); top.location.href = 'Index.aspx?status=home';</script>"; Response.Write(jsScript); } // submit parent frame with data else { // js script from parent page passes in url var when it should submit if (Request.QueryString["submitMe"] != null && Request.QueryString["submitMe"].ToString().ToLower().Equals("true")) { //submitMe() string jsScript = "<script language=javascript>parent.submitMe();</script>"; Response.Write(jsScript); } } }
/// <summary> /// If user has eforms pending display icon to reminders inbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SetInboxImage(object sender, EventArgs e) { string userName = new SecurityController().GetUserName(); UserDa uda = new UserDa(); DataSet uDs = uda.GetByUserName(userName); int userId = int.Parse(uDs.Tables[0].Rows[0]["UserId"].ToString()); EFormsDa iDa = new EFormsDa(); // string status = "'" + Caisis.UI.Core.Eforms.EformStatusManager.Status_DataEntryInProgress + "','" + Caisis.UI.Core.Eforms.EformStatusManager.Status_DataEntryReviewed + "'"; string status = "'" + EformStatusManager.Status_DataEntryInProgress + "'"; DataSet iDs = iDa.GetEformsInbox(userId, status); if (!(iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0)) { //splashKioskInbox.Src="../../Images/splashOptionsYouHaveMessages.gif"; splashKioskInbox.Visible = false; } }
/// <summary> /// /// </summary> private void BuildRecentEforms() { // string datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]); UserController uc = new UserController(); EFormController ec = new EFormController(); EFormsDa da = new EFormsDa(); int userId = uc.GetUserId(); // System.Data.DataTable dt = da.GetUserRecentEforms(userId, datasetSql, null, null); string msgType = "'" + EformStatusManager.Status_DataEntryInProgress + "','" + EformStatusManager.Status_DataEntryComplete + "','" + EformStatusManager.Status_Narrated + "'"; System.Data.DataSet iDs = da.GetEformsInbox(userId, msgType); if (iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0) { UserEformsRpt.DataSource = iDs.Tables[0].DefaultView; UserEformsRpt.DataBind(); NoEformsMessage.Visible = false; } }
private void BuildEformStatusList(string sortColumn, SortDirection direction) { // defaults sortColumn = !string.IsNullOrEmpty(sortColumn) ? sortColumn : BOL.EForm.EFormId; //DateTime enteredStartDate = DateTime.Today; //if (!string.IsNullOrEmpty(EnteredStartDate)) //{ // if (!DateTime.TryParse(EnteredStartDate, out enteredStartDate)) // { // enteredStartDate = DateTime.Today; // } //} //string searchDateText = enteredStartDate.ToShortDateString(); //// Set calendar box to match searchDate //DateChooser.Value = searchDateText; //_EnteredStartDate.Value = searchDateText; DateTime?enteredDateStart = null; if (!string.IsNullOrEmpty(EnteredStartDate)) { DateTime _enteredDateStart = new DateTime(); if (DateTime.TryParse(EnteredStartDate, out _enteredDateStart)) { enteredDateStart = _enteredDateStart; } _EnteredStartDate.Value = _enteredDateStart.ToShortDateString(); } DateTime?enteredDateEnd = null; if (!string.IsNullOrEmpty(EnteredEndDate)) { DateTime _enteredDateEnd = new DateTime(); if (DateTime.TryParse(EnteredEndDate, out _enteredDateEnd)) { enteredDateEnd = _enteredDateEnd.AddDays(1); } _EnteredEndDate.Value = _enteredDateEnd.ToShortDateString(); } DateTime?updatedDateStart = null; if (!string.IsNullOrEmpty(UpdatedStartDate)) { DateTime _updatedDateStart = new DateTime(); if (DateTime.TryParse(UpdatedStartDate, out _updatedDateStart)) { updatedDateStart = _updatedDateStart; } _UpdatedStartDate.Value = _updatedDateStart.ToShortDateString(); } DateTime?updatedDateEnd = null; if (!string.IsNullOrEmpty(UpdatedEndDate)) { DateTime _updatedDateEnd = new DateTime(); if (DateTime.TryParse(UpdatedEndDate, out _updatedDateEnd)) { updatedDateEnd = _updatedDateEnd.AddDays(1); } _UpdatedEndDate.Value = _updatedDateEnd.ToShortDateString(); } DateTime?clinicDateStart = null; if (!string.IsNullOrEmpty(ClinicStartDate)) { DateTime _clinicDateStart = new DateTime(); if (DateTime.TryParse(ClinicStartDate, out _clinicDateStart)) { clinicDateStart = _clinicDateStart; } _ClinicStartDate.Value = _clinicDateStart.ToShortDateString(); } DateTime?clinicDateEnd = null; if (!string.IsNullOrEmpty(ClinicEndDate)) { DateTime _clinicDateEnd = new DateTime(); if (DateTime.TryParse(ClinicEndDate, out _clinicDateEnd)) { clinicDateEnd = _clinicDateEnd.AddDays(1); } _ClinicEndDate.Value = _clinicDateEnd.ToShortDateString(); } string enteredBy = (!string.IsNullOrEmpty(EnteredBy)) ? EnteredBy : ""; string updatedBy = (!string.IsNullOrEmpty(UpdatedBy)) ? UpdatedBy : ""; string eFormName = (!string.IsNullOrEmpty(EFormName)) ? EFormName : ""; string eFormStatus = (!string.IsNullOrEmpty(EFormStatus)) ? EFormStatus : ""; string clinicPhysician = (!string.IsNullOrEmpty(ClinicPhysician)) ? ClinicPhysician : ""; _ClinicPhysician.Value = clinicPhysician; _EnteredBy.Value = enteredBy; _UpdatedBy.Value = updatedBy; _EFormStatus.Value = eFormStatus; // _EFormName.Value = eFormName; // Request.Form[_EFormName.ClientID] = eFormName; // Bind to datesource EFormsDa da = new EFormsDa(); DataTable dt = da.GetEforms(enteredDateStart, enteredDateEnd, enteredBy, updatedDateStart, updatedDateEnd, updatedBy, eFormName, eFormStatus, clinicDateStart, clinicDateEnd, clinicPhysician); dirtyRows.Clear(); string message = "No EForms match the search criteria"; // Set search message int records = dt.Rows.Count; int maxRecords = 300; if (records > maxRecords) { message = records + " EForms match the search criteria. The first " + maxRecords + " records are displayed here."; DataTable subsetDt = dt.Rows.Cast <System.Data.DataRow>().Take(maxRecords).CopyToDataTable(); DataView view = subsetDt.DefaultView; view.Sort = sortColumn + " " + (direction == SortDirection.Ascending ? "ASC" : "DESC"); EFormActivityRptr.DataSource = view; EFormActivityRptr.DataBind(); SearchResultsContainer.Visible = true; } else if (records < 1) { // set data entry visibility SearchResultsContainer.Visible = false; } else { DataView view = dt.DefaultView; view.Sort = sortColumn + " " + (direction == SortDirection.Ascending ? "ASC" : "DESC"); message = records + " EForms match the search criteria"; EFormActivityRptr.DataSource = view; EFormActivityRptr.DataBind(); SearchResultsContainer.Visible = true; } // set message SearchMessage.InnerText = message; }