Exemple #1
0
        /// Author Sonia
        /// <summary>
        /// This function is used to Bind ScriptHistory Grid and Other Details of Medication Order
        /// </summary>

        private void BindControls()
        {
            DataView DataViewClientMedicationScriptHistory;

            ShowHidePillImage = "display:none";
            try
            {
                DataViewClientMedicationScriptHistory = null;
                if (((Streamline.BaseLayer.StreamlinePrinciple)Context.User) != null)
                {
                    _clientMedicationId = Convert.ToInt32(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientOrderDetailsMedicationId.ToString());
                    HiddenFieldClientMedicationId.Value = _clientMedicationId.ToString();
                    GetMedicationOrderDetails();
                    MedicationClientPersonalInformationControl.showEditableAllergyList = false;
                    MedicationClientPersonalInformationControl.Activate();

                    //Fill the Script History Information
                    objectClientMedications = new ClientMedication();
                    if (HiddenFieldScriptId.Value.ToString() != "")
                    {
                        _DataSetClientMedicationScriptHistory = objectClientMedications.DownloadClientMedicationScriptHistory(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId, _clientMedicationId, Convert.ToInt32(HiddenFieldScriptId.Value.ToString()));
                    }
                    else
                    {
                        _DataSetClientMedicationScriptHistory = objectClientMedications.DownloadClientMedicationScriptHistory(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId, _clientMedicationId, -1);
                    }
                    DataViewClientMedicationScriptHistory            = _DataSetClientMedicationScriptHistory.Tables["ClientMedicationScripts"].DefaultView;
                    DataViewClientMedicationScriptHistory.Sort       = "ClientMedicationScriptId desc";
                    Session["DataViewClientMedicationScriptHistory"] = DataViewClientMedicationScriptHistory;
                    if (DataViewClientMedicationScriptHistory.Table.Rows.Count > 0)
                    {
                        Session["PharmacyName"]          = DataViewClientMedicationScriptHistory.Table.Rows[0]["PharmacyName"];
                        Session["OrderingMethod"]        = DataViewClientMedicationScriptHistory.Table.Rows[0]["OrderingMethod"];
                        DataGridScriptHistory.DataSource = DataViewClientMedicationScriptHistory;
                        DataGridScriptHistory.DataBind();
                        HiddenFieldLatestClientMedicationScriptId.Value = DataViewClientMedicationScriptHistory.Table.Rows[0]["ClientMedicationScriptId"].ToString();
                        HiddenFieldPrescriptionStatus.Value             = DataViewClientMedicationScriptHistory.Table.Rows[0]["Status"].ToString();
                    }
                    else
                    {
                        DataGridScriptHistory.DataBind();
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToLoginPage();", true);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                DataViewClientMedicationScriptHistory = null;
            }
        }
 public override bool RefreshPage()
 {
     if (Session["DataSetClientSummary"] != null)
     {
         MedicationClientPersonalInformation1.showEditableAllergyList = true;
         MedicationClientPersonalInformation1.Activate();
     }
     else
     {
         ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToLoginPage();", true);
     }
     return(true);
 }
Exemple #3
0
    public override void Activate()
    {
        try
        {
            CommonFunctions.Event_Trap(this);

            base.Activate();
            if (Session != null)
            {
                _DataSetClientSummary = (DataSet)Session["DataSetClientSummary"];
                if (_DataSetClientSummary.Tables["ClientInformation"].Rows.Count > 0)
                {
                    BindControls();
                }
                else
                {
                    ClearControls();
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToLoginPage();", true);
                return;
            }
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
        }
    }
Exemple #4
0
        public override void Activate()
        {
            try
            {
                //Code commented by Loveena in ref to Task#2486 If this window is opened
                //from the Medication History page, close should take the user back to the history page
                //to refill the controls on clicking the medication whether continue/discontinue as corresponding to task#2494.

                //CommonFunctions.Event_Trap(this);
                //base.Activate();
                ////Added by Chandan for task #2433 MM1.9
                //FillDiscontinueDropDown();
                ////End by Chandan
                ////Commented By Pramod on 10 Apr 2008 as checkbox should be enable of disable according to NewOrder Permission
                ////CheckBoxDiscontinued.Enabled = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).HasPermission(Permissions.AddMedication);
                ////TextBoxDiscontinue.Enabled = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).HasPermission(Permissions.NewOrder);
                ////Added new parameter by Chandan for passing DiscontinueReasonCode ref task #2433
                //CheckBoxDiscontinued.Attributes.Add("onclick", "return ValidateInputs('" + TextBoxDiscontinue.ClientID + "','" + HiddenFieldClientMedicationId.ClientID + "','" + CheckBoxDiscontinued.ClientID + "','" + DropDownDiscontinueReason.ClientID + "');return false");
                //_DataSetOrderDetails = new Streamline.UserBusinessServices.DataSets.DataSetClientMedicationOrders();
                //_DataSetOrderDetails.Clear();
                //BindControls();

                //code commented by Loveena ends over here.
            }
            catch (Exception ex)
            {
                if (ex.Data["CustomExceptionInformation"] == null)
                {
                    ex.Data["CustomExceptionInformation"] = "";
                }
                else
                {
                    ex.Data["CustomExceptionInformation"] = "";
                }
                if (ex.Data["DatasetInfo"] == null)
                {
                    ex.Data["DatasetInfo"] = null;
                }
                Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
                string strErrorMessage = "Error in loading Order Details";
                ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true);
            }
        }
Exemple #5
0
 /// <summary>
 /// Event Handler of Cancel Button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ButtonCancel_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentCloseDocument();
         //Code added by Loveena in ref to Task#2486 on 27-April-2009
         //to move back to page from where it has been opened.
         if (((HiddenField)(Page.FindControl("HiddenPageName"))).Value == "PatientMainPage")
         {
             ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToManagementPage();", true);
         }
         else if (((HiddenField)(Page.FindControl("HiddenPageName"))).Value == "ViewHistory")
         {
             ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToViewHistoryPageClearSession();", true);
         }
     }
     catch (Exception ex)
     {
         Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
     }
 }
Exemple #6
0
    public override void Activate()
    {
        try
        {
            CommonFunctions.Event_Trap(this);

            if (Session["DataSetClientSummary"] == null)
            {
                GetClientSummaryData();
            }

            this.TextBoxAddAllergy.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + LinkButtonAddAllergy.UniqueID + "').focus();return false;}} else {return true}; ");
            this.LinkButtonAddAllergy.Attributes.Add("onfocus", "ShowAllergySearchDivonLostFocus1('" + TextBoxAddAllergy.ClientID + "')");

            base.Activate();
            if (Session != null)
            {
                if (System.Configuration.ConfigurationSettings.AppSettings["ExternalInterface"].ToString().ToUpper() == "TRUE" && Session["ExternalClientInformation"] != null)
                {
                    _DataSetClientSummary = (DataSet)Session["ExternalClientInformation"];
                    if (_DataSetClientSummary.Tables["ClientHTMLSummary"].Rows.Count > 0)
                    {
                        BindControls();
                    }
                    else
                    {
                        ClearControls();
                    }
                }
                else
                {
                    _DataSetClientSummary = (DataSet)Session["DataSetClientSummary"];
                    if (_DataSetClientSummary.Tables["ClientInfoAreaHtml"].Rows.Count > 0)
                    {
                        BindControls();
                    }
                    else
                    {
                        ClearControls();
                    }
                }
                //if (!IsPostBack)
                //{
                //    HealthData.Activate();
                //    HealthGraph.Activate();
                //}
            }
            else
            {
                ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToLoginPage();", true);
                return;
            }
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }

            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
        }
    }
    /// <summary>
    /// <Author>Loveena</Author>
    /// <CreationDate>27-April-2009</CreationDate>
    /// <Description>To open Patient Search Window as ref to Task#2433</Description>
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>

    protected void ButtonPatientSearch_Click(object sender, EventArgs e)
    {
        ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "ShowClientSearch(" + ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId + ");", true);
    }
    /// <summary>
    /// Handles the selected Index Change of DropDwon Clients
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void DropDownListClients_SelectedIndexChanged(object sender, EventArgs e)
    {
        string    ClientId             = "";
        string    ExternalClientId     = "";
        string    UserCode             = "";
        DataTable DataTableClientsList = new DataTable();

        DataTableClientsList.Clear();
        DataSet dsExternalClientInfo = new DataSet();

        try
        {
            Streamline.UserBusinessServices.ApplicationCommonFunctions objApplicationCommonFunctions;
            objApplicationCommonFunctions        = new Streamline.UserBusinessServices.ApplicationCommonFunctions();
            Session["ExternalClientInformation"] = null;
            if (DropDownListClients.SelectedIndex > 0 && DropDownListClients.SelectedIndex == 1)
            {
                Session["LoadMgt"] = null;
                // fillComboBoxes();
                DropDownListClients.SelectedIndex = -1;
                //ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "MedicationMgt.ShowClientSearchDiv(" + ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId + ");", true);
                ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "ShowClientSearchDiv(" + ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId + ");", true);
            }

            else if (DropDownListClients.SelectedIndex > 0 && DropDownListClients.Text != "View Different Patients")
            {
                //Added by chandan for update/Insert the External Client information in streamline database
                if (System.Configuration.ConfigurationSettings.AppSettings["ExternalInterface"].ToString().ToUpper() == "TRUE")
                {
                    ClientId             = DropDownListClients.SelectedValue;
                    UserCode             = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserCode;
                    DataTableClientsList = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Clients;
                    if (DataTableClientsList.Rows.Count > 0)
                    {
                        DataRow[] dr = DataTableClientsList.Select("clientid=" + ClientId + "");
                        ExternalClientId = dr[0]["ExternalClientId"].ToString();
                    }

                    if (ExternalClientId != "")
                    {
                        //We are passing Externalclientid as clientid  to the external interface
                        dsExternalClientInfo = objApplicationCommonFunctions.GetExternalClientInfo(ExternalClientId);
                        //dsExternalClientInfo = objApplicationCommonFunctions.GetExternalClientInfo(Convert.ToInt32(ExternalClientId));
                        Session["ExternalClientInformation"] = dsExternalClientInfo;
                        if (dsExternalClientInfo != null)
                        {
                            if (dsExternalClientInfo.Tables.Count > 0)
                            {
                                objApplicationCommonFunctions.UpdateExternalInformation(dsExternalClientInfo, UserCode);
                            }
                        }
                    }
                }
                //SetClient(Convert.ToInt32(DropDownListClients.SelectedValue));
                ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).RefreshData = true;
                ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).SetClientInformation(Convert.ToInt32(DropDownListClients.SelectedValue), true);
                GetClientSummaryData();
            }
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
            DataTableClientsList = null;
            dsExternalClientInfo = null;
        }
    }
    public void ShowReport(string _strScriptIds)
    {
        FileStream fs;
        TextWriter ts;
        ArrayList  ScriptArrays;
        ArrayList  ChartScriptArrays;
        bool       _strFaxSendStatus   = false;
        string     _strFaxFaildMessage = "";

        try
        {
            string strPath  = "";
            string FileName = "";
            fs = new FileStream(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\Report.html"), FileMode.Create);
            ts = new StreamWriter(fs);
            divReportViewer.InnerHtml = "";

            string strPageHtml = "";
            ScriptArrays = new ArrayList();
            ScriptArrays = ApplicationCommonFunctions.StringSplit(_strScriptIds, "^");
            if (method.Trim().ToUpper() == "P")
            {
                //using (Streamline.BaseLayer.RDLCPrint objRDLC = new RDLCPrint())
                //{

                //    objRDLC.Run(this.reportViewer1.LocalReport, Server.MapPath("RDLC\\" + Context.User.Identity.Name), this.HiddenFieldAllFaxed.ToString(), false, false);
                //}
                ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "printRDLC();", true);
                _strFaxFailed = true;
            }
            else if (method.Trim().ToUpper() == "F")
            {
                if (pharmacyId != 0)
                {
                    //Send to Fax
                    SendToFax(pharmacyId);
                    if (_strFaxFailed == true)
                    {
                        _strFaxFaildMessage = "Script could not be faxed at this time.  The fax server is not available.  Please print the script or re-fax the script later.";
                        strPageHtml        += "<span style='float:left;position:absolute;padding-left:30%;color:Red;text-align:center;font-size: 12px;font-family:Microsoft Sans Serif;'><b>" + _strFaxFaildMessage + "</b></span><br/>";
                        //---Send for printing
                        //using (Streamline.BaseLayer.RDLCPrint objRDLC = new RDLCPrint())
                        //{

                        //    objRDLC.Run(this.reportViewer1.LocalReport, Server.MapPath("RDLC\\" + Context.User.Identity.Name), this.HiddenFieldAllFaxed.ToString(), false, false);
                        //}
                        ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "printRDLC();", true);
                    }
                }
                else
                {
                    //Send to Printer
                    ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "printRDLC();", true);
                }
            }

            for (int i = 0; i < ScriptArrays.Count; i++)
            {
                foreach (string file in Directory.GetFiles(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\")))
                {
                    FileName = file.Substring(file.LastIndexOf("\\") + 1);
                    if ((FileName.IndexOf("JPEG") >= 0 || FileName.IndexOf("jpeg") >= 0) && (FileName.IndexOf(ScriptArrays[i].ToString(), 3) >= 0))
                    {
                        strPageHtml += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName + "' style='width:100%' />";
                    }
                    strPath = "'..\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName;
                }
            }


            divReportViewer.InnerHtml = "";
            divReportViewer.InnerHtml = strPageHtml;

            ts.Close();
            //Response.Write(strPageHtml);
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }