示例#1
0
        protected string formatUrl(string patientID)
        {
            string        urlVars = "epid=" + CustomCryptoHelper.Encrypt(patientID) + "&patientList=yes";
            StringBuilder sb      = new StringBuilder(Request.ApplicationPath);

            sb.Append("/Core/DataEntryForms/index.aspx?");
            sb.Append(urlVars);
            sb.Append("&verifyPatientId=true");
            return(sb.ToString());
        }
示例#2
0
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);

            EFormTitle.Text = base.EFormTitle;

//			PatientName.Text = "";

            if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0)
            {
                PatientName.Text  = "";
                PatientName.Text += Session[SessionKey.PtFirstName].ToString();
            }
            if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0)
            {
                PatientName.Text += " " + Session[SessionKey.PtLastName].ToString();
            }

            // centralize setting of new eform drop down this with eform list
            ListItemCollection lic = new ListItemCollection();

            lic.Add(new ListItem("", ""));
            XmlNodeList list = CaisisConfiguration.GetEFormsList();

            foreach (XmlNode node in list)
            {
                string   name  = node.Attributes["displayname"].Value;
                string   value = node.Attributes["name"].Value;
                ListItem item  = new ListItem(name, value);
                lic.Add(item);
            }
            // Old Code to populate dropdown list
            //lic.Add(new ListItem("Prostate Surgery EForm", "Prostate Surgery EForm"));
            ////lic.Add(new ListItem("Prostate New Patient EForm", "Prostate New Patient EForm"));
            //lic.Add(new ListItem("Urology Prostate Follow Up", "Uro Pros FU"));
            //lic.Add(new ListItem("GU Prostate Follow Up", "GU Pros FU"));
            EFormDropDown.DataSource     = lic;
            EFormDropDown.DataTextField  = "Text";
            EFormDropDown.DataValueField = "Value";
            EFormDropDown.DataBind();

            string epid = CustomCryptoHelper.Encrypt(Session[SessionKey.PatientId].ToString());

            StartNewEFormImg.Attributes.Add("onClick", "if (checkEformTypeChosen('" + EFormDropDown.ClientID + "')) { startBtnClick(this.id, '" + epid + "' ) } else { alert('Please select an EForm type.') }");

            // set repeater
            this.SetPatientEFormList();

//			this.ShowEFormNarrative();
        }
示例#3
0
        protected void rptClinicItemCreated(Object Sender, RepeaterItemEventArgs e)
        {
            // create a reference to the current tr
            System.Web.UI.HtmlControls.HtmlContainerControl clinicListRow;
            clinicListRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("clinicListRow");

            Literal eformStatus;

            eformStatus = (System.Web.UI.WebControls.Literal)e.Item.FindControl("eformStatus");

            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string localApptPatientId = ((DataRowView)e.Item.DataItem)["ApptPatientId"].ToString();

                if (localApptPatientId == "")
                {
                    clinicListRow.Attributes.Add("onclick", "alert('This patient is not in the database.  No information about this patient beyond the data listed on this page is currently available.');");
                }
                else
                {
                    string urlVars = "epid=" + CustomCryptoHelper.Encrypt(localApptPatientId) + "&patientList=yes&listType=" + Server.UrlEncode(this.listTitle);
                    string url     = PageUtil.EscapeSingleQuotes("../DataEntryForms/index.aspx?" + urlVars + "&verifyPatientId=true");
                    clinicListRow.Attributes.Add("onclick", "parent.location='" + url + "';");
                }

                string currentStatus = ((DataRowView)e.Item.DataItem)["CurrentStatus"].ToString();

                if (!currentStatus.Equals(""))
                {
                    string summary         = ((DataRowView)e.Item.DataItem)["EFormName"].ToString() + " last updated by " + ((DataRowView)e.Item.DataItem)["UpdatedBy"].ToString() + " on " + ((DataRowView)e.Item.DataItem)["UpdatedTime"].ToString();
                    string spanOpeningText = "<a span onmouseover=\"showToolTipMessage('" + summary + "')\" onmouseout=\"hideToolTip()\">";
                    string spanClosingText = "</span>";

                    if (currentStatus.Equals(EformStatusManager.Status_DataEntryComplete) || currentStatus.Equals(EformStatusManager.Status_DataEntryInProgress) || currentStatus.Equals(EformStatusManager.Status_Narrated))
                    {
                        eformStatus.Text = spanOpeningText + "EForm Initiated" + spanClosingText;
                    }
                    else if (currentStatus.Equals(EformStatusManager.Status_Approved))
                    {
                        eformStatus.Text = spanOpeningText + "EForm Approved" + spanClosingText;
                    }
                }
            }
        }
示例#4
0
        protected void rptInPatientItemCreated(Object Sender, RepeaterItemEventArgs e)
        {
            // create a reference to the current tr
            System.Web.UI.HtmlControls.HtmlContainerControl inPatientRow;
            inPatientRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("inPatientRow");

            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string currentPatientId = ((DataRowView)e.Item.DataItem)["PatientId"].ToString();

                if (currentPatientId.Equals(""))
                {
                    inPatientRow.Attributes.Add("onclick", "alert('This patient is not in the database.  No information about this patient beyond the data listed on this page is currently available.');");
                }
                else
                {
                    string urlVars = "epid=" + CustomCryptoHelper.Encrypt(currentPatientId) + "&patientList=yes&listType=" + Server.UrlEncode(this.listTitle);
                    string url     = PageUtil.EscapeSingleQuotes("../DataEntryForms/index.aspx?" + urlVars + "&verifyPatientId=true");
                    inPatientRow.Attributes.Add("onclick", "parent.location='" + url + "';");
                }
            }
        }
示例#5
0
        private void SetLinkToPagePatientData(Object Sender, RepeaterItemEventArgs e, HtmlControl ctrl)
        {
            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (((DataRowView)e.Item.DataItem)["patientId"].ToString().Length > 0)
                {
                    string localPatientId = ((DataRowView)e.Item.DataItem)["patientId"].ToString();

                    string currentClass = ctrl.Attributes["class"].ToString();
                    ctrl.Style["cursor"] = "pointer";
                    if (localPatientId == "")
                    {
                        ctrl.Attributes.Add("onClick", "javascript:alert('This patient is not in the database.  No information about this patient beyond the data listed on this page is currently available.');");
                    }
                    else
                    {
                        string urlVars = "epid=" + CustomCryptoHelper.Encrypt(localPatientId) + "&patientList=yes";
                        string url     = Page.ResolveUrl("~/Core/DataEntryForms/Index.aspx?findClicked=true&epid=" + CustomCryptoHelper.Encrypt(localPatientId)) + "&patientList=yes";
                        ctrl.Attributes.Add("onClick", "top.location='" + url + "';");
                    }
                }
            }
        }
示例#6
0
        protected void rptItemCreated(Object sender, RepeaterItemEventArgs e)
        {
            // create a reference to the current tr
            System.Web.UI.HtmlControls.HtmlContainerControl listRow;
            listRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("listRow");


            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string localPatientId = ((DataRowView)e.Item.DataItem)["patientId"].ToString();

                if (localPatientId == "")
                {
                    listRow.Attributes.Add("onClick", "alert('This patient is not in the database.  No information about this patient beyond the data listed on this page is currently available.');");
                }
                else
                {
                    string urlVars = "epid=" + CustomCryptoHelper.Encrypt(localPatientId) + "&patientList=yes";

                    listRow.Attributes.Add("onClick", "parent.location='../DataEntryForms/index.aspx?" + urlVars + "';");
                }
            }
        }
示例#7
0
        /// <summary>
        /// Set url for each batch print link page
        /// </summary>
        protected void SetBatchLinks()
        {
            if (Request.QueryString["batchPrint"] != null)
            {
                // initialize batchLink, urlVarWithMonth, & patientIds for constucting links to seperate the batches
                string batchLink = "?batchPrint=true&proc=" + Request.QueryString["proc"].ToString();
                string urlVarWithMonth = "";
                string patientId, patientIds = "", patientIdsLBL = "";
                string link = "";
                int    currentPatientNumber;

                // tracks the # of forms that are currently being processed for current batch
                double formsThisBatch = 0;

                // get the max forms allowed per batch
                maxFormsPerPrintJob = GetmaxFormsPerPrintJob();

                // calculate total # of batches that need to print
                double totalBatches = Math.Ceiling((totalNumberOfPatients / (double)maxFormsPerPrintJob));

                // initialize the  frist and last form numbers for first batch
                startSurveyNum = 1;
                endSurveyNum   = maxFormsPerPrintJob;

                for (int i = 4; i < lengthQS; i++) // patients start at index 3 in QS
                {
                    // track the current patient
                    currentPatientNumber = i - 3;
                    currentForm          = currentPatientNumber;

                    // increment the # of forms that are being processed for current batch
                    formsThisBatch++;

                    // if the limit for the # of forms per batch has been reached
                    if ((formsThisBatch > maxFormsPerPrintJob))
                    {
                        // initialize a new batch link for the next batch of forms
                        patientIds      = "";
                        batchLink       = "?batchPrint=true&proc=" + Request.QueryString["proc"].ToString();
                        urlVarWithMonth = "";
                        formsThisBatch  = 1;
                    }

                    // add to comma separated list of patient ids to print labels
                    patientId   = Request.QueryString.GetKey(i);
                    patientIds += patientId + ",";

                    // Construct seperate querystring for the Labels (eg. BatchPrintLabelContainer.aspx?pIds=1,2,3")
                    patientIdsLBL += patientId + ",";

                    // add curent patient to current batch link parameters
                    batchLink       += "&" + patientId + "=" + Request[patientId];
                    urlVarWithMonth += "&" + patientId + "=" + Request[patientId];

                    // startSurveyNum signifies first form in current batch.
                    // if '(currentForm MODULUS maxFormsPerPrintJob) == 1', currentForm is the first form in current batch
                    // OR, if maxFormsPerPrintJob == 1, currentForm is the first (and last) form in current batch
                    if ((currentForm % maxFormsPerPrintJob) == 1 || (maxFormsPerPrintJob == 1))
                    {
                        startSurveyNum = currentForm;
                    }

                    // endSurveyNum signifies last form in current batch.
                    // if '(currentForm MODULUS maxFormsPerPrintJob) == 0', currentForm is the last form in current batch
                    if ((currentForm % maxFormsPerPrintJob) == 0)
                    {
                        endSurveyNum = currentBatch * maxFormsPerPrintJob;

                        // add parameters for all forms in current batch for the batch link
                        link += "<a target=\"FormsContent\" onclick=\"setURLHolder('" + urlVarWithMonth + "', '" + startSurveyNum + "', '" + endSurveyNum + "')\" href=\"" + _printFormsPage + batchLink + "\">[" + currentBatch + "]</a>&nbsp;&nbsp;";

                        // increment to next batch
                        currentBatch++;
                    }

                    // if last patient has been reached, but current batch is not full
                    else if (currentPatientNumber == totalNumberOfPatients)
                    {
                        endSurveyNum = totalNumberOfPatients;

                        // add parameters for all forms in current batch for the batch link
                        link += "<a target=\"FormsContent\" onclick=\"setURLHolder('" + urlVarWithMonth + "', '" + startSurveyNum + "', '" + endSurveyNum + "')\" href=\"" + _printFormsPage + batchLink + "\">[" + currentBatch + "]</a>&nbsp;&nbsp;";

                        // increment to next batch
                        currentBatch++;
                    }
                }

                // show the link to print batches if there is more than one
                string updateScript;

                if (totalBatches > 1)
                {
                    updateScript = "ShowFormContent(" + bool.FalseString.ToLower() + ")";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFormContent", updateScript, true);

                    BatchPrintLinks.Text = totalNumberOfPatients + " forms have been split into " + totalBatches + " batches of (at most) " + maxFormsPerPrintJob + " for printing.  Select batch to print:&nbsp;&nbsp;" + link;
                }
                else
                {
                    updateScript = "ShowFormContent(" + bool.TrueString.ToLower() + ")";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFormContent", updateScript, true);

                    BatchPrintLinks.Text = "";
                }

                // For the LABELS; the string patientIds is a comma separated values of patient ids
                if (patientIdsLBL.EndsWith(","))
                {
                    patientIdsLBL = patientIdsLBL.Remove(patientIdsLBL.Length - 1); //remove last comma ","
                }

                // construct the querystring for labels (eg. BatchPrintLabelContainer.aspx?pIds=1,2,3";)
                printLabelsPageUrlvVars += "?pIds=" + CustomCryptoHelper.Encrypt(patientIdsLBL); //encrypt first
            }
        }
示例#8
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 protected string GetEncryptedPatientUrl()
 {
     if (Session[SessionKey.PatientId] != null && !string.IsNullOrEmpty(Session[SessionKey.PatientId].ToString()))
     {
         string url = Page.ResolveUrl("~/Core/DataEntryForms/Index.aspx?findClicked=true&epid=" + CustomCryptoHelper.Encrypt(Session[SessionKey.PatientId].ToString()));
         return(url);
     }
     else
     {
         return(string.Empty);
     }
 }
示例#9
0
        protected void LoadPrintingMaterial()
        {
            DataView dv = new DataView(GetSelectedPatients());

            if (dv.Table.Columns.Contains("Mail"))
            {
                dv.RowFilter = "Mail = 1";
                if (dv.Count > 0)
                {
                    string patientIds = String.Empty;
                    foreach (DataRowView drv in dv)
                    {
                        if (String.IsNullOrEmpty(patientIds))
                        {
                            patientIds = drv[Patient.PatientId].ToString();
                        }
                        else
                        {
                            patientIds = patientIds + "," + drv[Patient.PatientId].ToString();
                        }
                    }

                    if (RbPrintTypeSurveys.Checked)
                    {
                        PrintSurveysLetterDiv.Style["display"] = "";
                        PrintLabelsDiv.Style["display"]        = "none";
                        printFormButtonAnchor.Visible          = false;
                        printFormButtonAnchor.HRef             = "";

                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "SetPrintPackageSource('" + CustomCryptoHelper.Encrypt(patientIds) + "') ", true);
                    }
                    else if (RbPrintTypeLabels.Checked)
                    {
                        PrintSurveysLetterDiv.Style["display"] = "none";
                        PrintLabelsDiv.Style["display"]        = "";
                        printFormButtonAnchor.Visible          = true;
                        printFormButtonAnchor.HRef             = "javascript:printAddressLabels();";

                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "LoadAddressLabels('" + CustomCryptoHelper.Encrypt(patientIds) + "') ", true);
                    }
                }
            }
        }
示例#10
0
        public virtual void PopulateTableCell(TableCell cell, bool bPatientSpecific)
        {
            foreach (_PatientCalendarItem p in Schedule)
            {
                HyperLink label = new HyperLink();
                if (bPatientSpecific)
                {
                    // determine if passing along deviation infor
                    if (!string.IsNullOrEmpty(p.DeviationTable) && !string.IsNullOrEmpty(p.DeviationKey))
                    {
                        label.Attributes["onclick"] = "var rVal = loadPatientItem('" + CustomCryptoHelper.Encrypt(p.PatientItemId) + "','" + p.DeviationTable + "','" + p.DeviationKey + "'); if(rVal!=null) { return rVal; } else { return false; }";
                    }
                    else
                    {
                        label.Attributes["onclick"] = "var rVal = loadPatientItem('" + CustomCryptoHelper.Encrypt(p.PatientItemId) + "'); if(rVal!=null) { return rVal; } else { return false; }";
                    }
                }
                else
                {
                    label.Attributes["onclick"] = "var rVal = parent.loadPatientVisit('" + p.ProtocolId + "', '" + p.SchemaId + "','" + CustomCryptoHelper.Encrypt(p.PatientId) + "','" + p.TimelineId + "'); if(rVal!=null) { return rVal; } else { return false; }";
                }
                label.NavigateUrl = "#";
                label.Text        = p.Name;
                label.ToolTip     = string.Format("{0}{1}", GetVisitTitle(p), p.ItemDescriptions);

                label.CssClass = this.CssClass;
                GetJS(label, p, bPatientSpecific);
                cell.Controls.Add(label);
            }
        }
示例#11
0
        protected void rptClinicItemCreated(Object Sender, RepeaterItemEventArgs e)
        {
            // create a reference to the current tr
            System.Web.UI.HtmlControls.HtmlContainerControl clinicListRow;
            clinicListRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("clinicListRow");


            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string localApptPatientId = "";
                string ptLastName         = "";
                string ptFirstName        = "";
                string ptMRN = "";

                DataRowView view = e.Item.DataItem as DataRowView;

                if (view != null)
                {
                    localApptPatientId = GetFieldValue(view, "ApptPatientId");
                    ptLastName         = GetFieldValue(view, "ApptLastName");
                    ptFirstName        = GetFieldValue(view, "ApptFirstName");
                    ptMRN = GetFieldValue(view, "ApptMRN");
                }

                //string localApptPatientId = ((DataRowView) e.Item.DataItem )["ApptPatientId"].ToString();
                //string ptLastName = ((DataRowView) e.Item.DataItem )["ApptLastName"].ToString();
                //string ptFirstName = ((DataRowView) e.Item.DataItem )["ApptFirstName"].ToString();
                //string ptMRN = ((DataRowView) e.Item.DataItem )["ApptMRN"].ToString();

                if (localApptPatientId == "")
                {
                    clinicListRow.Attributes.Add("onClick", "javascript:alert('This patient is not in the database.  No data is currently available for this patient.');");
                }
                else
                {
                    string epid = CustomCryptoHelper.Encrypt(localApptPatientId);
                    //build the url string for the row

                    string currentListRowUrl = "parent.location= patientRedirectPath + '?epid=" + epid;

                    if (ptLastName != "")
                    {
                        currentListRowUrl += "&ptLastName=" + ptLastName;
                    }

                    if (ptFirstName != "")
                    {
                        currentListRowUrl += "&ptFirstName=" + ptFirstName;
                    }

                    if (ptMRN != "")
                    {
                        currentListRowUrl += "&ptMRN=" + ptMRN;
                    }

                    //close off the url string
                    currentListRowUrl += "&verifyPatientId=true';";

                    clinicListRow.Attributes.Add("onClick", currentListRowUrl);
                }
            }
        }
示例#12
0
        protected void rptItemCreated(Object sender, RepeaterItemEventArgs e)
        {
            // create a reference to the current tr
            System.Web.UI.HtmlControls.HtmlContainerControl listRow;
            listRow = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("listRow");

            Literal inboxMessage;

            inboxMessage = (Literal)e.Item.FindControl("inboxMessage");
            //Please complete and approve <%# ((System.Data.DataRowView)Container.DataItem)["EFormName"]%> for <%# ((System.Data.DataRowView)Container.DataItem)["PtFirstName"]%> <%# ((System.Data.DataRowView)Container.DataItem)["PtLastName"]%> (MRN <%# ((System.Data.DataRowView)Container.DataItem)["PtMrn"]%>; DOB <%# ((System.Data.DataRowView)Container.DataItem)["PtBirthDateText"]%>)

            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string eformId        = ((DataRowView)e.Item.DataItem)[EForm.EFormId].ToString();
                string localPatientId = ((DataRowView)e.Item.DataItem)[EForm.PatientId].ToString();
                string eformName      = ((DataRowView)e.Item.DataItem)[EForm.EFormName].ToString();
                string status         = ((DataRowView)e.Item.DataItem)[EForm.CurrentStatus].ToString();
                string ptName         = ((DataRowView)e.Item.DataItem)[Patient.PtFirstName].ToString() + " " + ((DataRowView)e.Item.DataItem)[Patient.PtLastName].ToString();
                string ptMrn          = ((DataRowView)e.Item.DataItem)[Patient.PtMRN].ToString();

                if (localPatientId != "" && eformName != "")
                {
                    string urlVars = "eform=" + Server.UrlEncode(eformName) + "&status=" + status + "&epid=" + CustomCryptoHelper.Encrypt(localPatientId) + "&eformid=" + eformId + "";

                    listRow.Attributes.Add("onClick", "top.location='../Eforms/Index.aspx?" + urlVars + "';");
                }

                if (status.Equals(EformStatusManager.Status_DataEntryInProgress))
                {
                    inboxMessage.Text = "Please complete, review and approve " + eformName + " for " + ptName + " (MRN " + ptMrn + ") ";
                }
                else if (status.Equals(EformStatusManager.Status_DataEntryComplete))
                {
                    inboxMessage.Text = "Please review and approve " + eformName + " for " + ptName + " (MRN " + ptMrn + ") ";
                }
                else if (status.Equals(EformStatusManager.Status_Narrated))
                {
                    inboxMessage.Text = "Please approve " + eformName + " for " + ptName + " (MRN " + ptMrn + ") ";
                }
                else if (status.Equals(EformStatusManager.Status_Approved))
                {
                    inboxMessage.Text = "This eform is no longer editable, but please click to view the approved " + eformName + " for " + ptName + " (MRN " + ptMrn + ")";
                }
                else
                {
                    inboxMessage.Text = "Please click to view " + eformName + " for " + ptName + " (MRN " + ptMrn + ") ";
                }
            }
        }
示例#13
0
        /// <summary>
        /// If login url contains datasetId and page name then validate and redirect, otherwise continue on to default splash page
        /// Only works for eforms at the moment; easily generalized
        /// </summary>
        private void RedirectUser()
        {
            //http://localhost/dev4/Login.aspx?redirect=%2fdev4%2fCore%2fEforms%2fIndex.aspx%3feform%3dUro+Pros+FU&status=new&dsId=1&user=admin&epid=791D41350A007063

            if (Request.QueryString["eform"] != null && Request.QueryString["eform"].Length > 0 && Request.QueryString["ptId"] != null && PageUtil.IsInteger(Request.QueryString["ptId"]))
            {
                // need to automatically set purpose, user dataset, and make sure patient is in the dataset
                // reference UserController to SetPermissions and GroupViewCode
                int    loginId     = (int)Session[SessionKey.LoginId];
                string userPurpose = Request.Form["purpose"];
                // int datasetId = int.Parse(Request.QueryString["dsId"]);
                int    patientId = int.Parse(Request.QueryString["ptId"]);
                string eformName = Request.QueryString["eform"];

                // if redirecting to an existing eform, retrive eformId to ensure a new eform will now be created
                string eformId = String.Empty;
                if (Request.QueryString["eformId"] != null)
                {
                    eformId = Request.QueryString["eformId"].ToString();
                }

                int datasetId = 0;

                UserController ct           = new UserController();
                DataSet        userDatasets = ct.GetUserDatasets(userName.Value);
                // DataSet userDatasets = ct.GetUserDatasets();
                PatientController pc    = new PatientController();
                bool isPatientInDataset = false;

                foreach (DataRow dr in userDatasets.Tables[0].Rows)
                {
                    datasetId          = (int)dr[Dataset.DatasetId];
                    isPatientInDataset = pc.IsPatientInDataSet(patientId, datasetId);
                    if (isPatientInDataset)
                    {
                        break;
                    }
                }

                //bool userHasAccessToDataset = ct.VerifyUserAccessToDataset(datasetId);

                if (isPatientInDataset)
                {
                    Session[SessionKey.DatasetId]     = datasetId;
                    Session[SessionKey.GroupViewCode] = ct.SetGroupViewCode(datasetId, userName.Value);
                    // Session[SessionKey.GroupViewCode] = ct.SetGroupViewCode(datasetId);
                    ct.SetPermissions(userPurpose, datasetId, loginId, userName.Value);
                    // ct.SetPermissions(userPurpose, datasetId, loginId);

                    // set session vars for defaulting values when reaching eform
                    if (!string.IsNullOrEmpty(Request.QueryString["apptDate"].ToString()))
                    {
                        // should check that it is a date and culture format
                        Session[SessionKey.CurrentClinicDate] = Request.QueryString["apptDate"].ToString();
                    }
                    if (!string.IsNullOrEmpty(Request.QueryString["surgeon"].ToString()))
                    {
                        Session[SessionKey.CurrentListType] = "Clinic";
                        Session[SessionKey.CurrentListCrit] = Request.QueryString["surgeon"].ToString();
                    }


                    string epid        = CustomCryptoHelper.Encrypt(patientId.ToString());
                    string eformStatus = "new";
                    string baseUrl     = PageUtil.GetBasePath(Request);
                    string referralStr = (Request.QueryString["referral"] != null && Request.QueryString["referral"].ToUpper() == "TRUE") ? "&referral=true&status=Approved" : ("&status=" + eformStatus);

                    string redirectTo = baseUrl + "/Core/Eforms/Index.aspx?eform=" + eformName + "&epid=" + epid + "&eformId=" + eformId + referralStr;
                    // on top of eform name, need to append status=new and the patient epid (does not apply to referrals)

                    Response.Redirect(redirectTo);
                }
                else // we could not determine that this user has access to a dataset with this patient in it display message
                {
                    errorMessage.Text = "The system was unable to automatically direct you to the requested page. Please notify the system admin.";
                }
            }
            else
            {
                // default
                string purpose = Request.Form["purpose"].ToString();
                //Response.Redirect("Core/Utilities/Splash.aspx?login=true&purpose=" + purpose);
                Response.Redirect("Core/Utilities/SetAccessLevel.aspx?login=true&purpose=" + purpose);
            }
        }
示例#14
0
/*		old functionality - remove after testing - jf
 *              private void ShowEFormNarrative()
 *              {
 *                      EFormController ctr = new EFormController();
 *
 *                      int eformId = Convert.ToInt32(Request.QueryString["eformId"]);
 *
 *                      // get record using eform id because both approved and reviewed eforms may be displayed
 *                      DataSet eds = ctr.GetRecord(eformId);
 *
 *                      if(eds.Tables[0].Rows.Count > 0)
 *                      {
 *                              // display html from database,status must be "Previewed"
 *                              if(eds.Tables[0].Rows[0][Caisis.BOL.EForm.EFormReport].ToString().Length > 0)
 *                              {
 *                                      theNarrative.InnerHtml = eds.Tables[0].Rows[0][Caisis.BOL.EForm.EFormReport].ToString();
 *                              }
 *                      }
 *              }
 */
        protected void OnItemCreate(Object Sender, RepeaterItemEventArgs e)
        {
            HtmlContainerControl EFormCell;

            EFormCell = (HtmlContainerControl)e.Item.FindControl("EFormCell");

            HtmlContainerControl EFormRow;

            EFormRow = (HtmlContainerControl)e.Item.FindControl("EFormRow");

            HtmlImage EFormStatusImg;

            EFormStatusImg = (HtmlImage)e.Item.FindControl("EFormStatusImg");


            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string eformId = ((DataRowView)e.Item.DataItem)[EForm.EFormId].ToString();

                string eformStatus = ((DataRowView)e.Item.DataItem)[EForm.CurrentStatus].ToString();

                string patientId = ((DataRowView)e.Item.DataItem)["PatientId"].ToString();

                string epid = CustomCryptoHelper.Encrypt(patientId);

                if (eformStatus == EformStatusManager.Status_Deleted)
                {
                    // hide it
                    EFormRow.Visible = false;
                }
                else if (eformStatus == EformStatusManager.Status_Approved)
                {
                    // link to this page

                    EFormCell.Attributes.Add("onClick", "loadApprovedEForm('" + eformId + "');");

// this is old functionality, remove after testing - jf
//					EFormCell.Attributes.Add("onClick","document.location='PatientEFormList.aspx?eformId=" + eformId + "';");

                    EFormStatusImg.Src = "../../Images/EFormStatus_Approved.gif";

                    string ImgTitleString = "Approved " + ((DataRowView)e.Item.DataItem)["UpdatedTime"].ToString() + "\nby " + ((DataRowView)e.Item.DataItem)["UpdatedBy"].ToString();

                    EFormStatusImg.Attributes.Add("title", ImgTitleString);
                }
                else
                {
                    string ImgTitleString = "Last Updated " + ((DataRowView)e.Item.DataItem)["UpdatedTime"].ToString() + "\nby " + ((DataRowView)e.Item.DataItem)["UpdatedBy"].ToString();
                    EFormStatusImg.Attributes.Add("title", ImgTitleString);


                    if (eformStatus == EformStatusManager.Status_Narrated)
                    {
                        EFormStatusImg.Src = "../../Images/EFormStatus_DataReviewed.gif";
                    }
                    else if (eformStatus == EformStatusManager.Status_DataEntryComplete)
                    {
                        EFormStatusImg.Src = "../../Images/EFormStatus_DataComplete.gif";
                    }

                    // link back to workflow so user can finish the eform

                    EFormCell.Attributes.Add("OnClick", "document.location.href='PatientEFormList.aspx?eformId=" + eformId + "';");

                    string urlVars = "epid=" + epid + "&eformId=" + eformId + "&status=" + eformStatus;

                    EFormCell.Attributes.Add("onClick", "parent.location='Index.aspx?" + urlVars + "';");
                }
            }
        }
示例#15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private string GetEncryptedPatientUrl()
        {
            string url = "../DataEntryForms/index.aspx?findClicked=true&epid=" + CustomCryptoHelper.Encrypt(Session[SessionKey.PatientId].ToString());

            return(url);
        }