Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.TextBoxName.Focus();
        objClientMedications = new Streamline.UserBusinessServices.ClientMedication();

        FillStates();
        //for set the Search Button on Enter key
        this.TextBoxName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true};");
        this.TextBoxID.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxPhone.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxAddress.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxCity.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxSureScriptsIdentifier.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxFax.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        this.TextBoxZip.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + buttonSearch.UniqueID + "').click();return false;}} else {return true}; ");
        //
        //added By Priya
        if (Request.QueryString["img"] != null)
        {
            HiddenFieldImg.Value = Request.QueryString["img"].ToString();
            HiddenFieldPreferredDropDown1Value.Value = Request.QueryString["DropDownvalue1"].ToString();
            HiddenFieldPreferredDropDown2Value.Value = Request.QueryString["DropDownvalue2"].ToString();
        }
        ((LinkButton)PharmacySearchList.FindControl("LinkButtonNext")).Visible     = false;
        ((LinkButton)PharmacySearchList.FindControl("LinkButtonPrevious")).Visible = false;
    }
    /// <summary>
    ///Handles the Click event of btnClear.
    ///On page load the function is used to get list of medications.
    /// <Author>Author: Rishu Chopra</Author>
    /// <CreatedDate>Date: 01-Nov-07</CreatedDate>
    /// </summary>
    private void GetMedicationDrug()
    {
        Streamline.UserBusinessServices.ClientMedication ObjectClientMedication = null;
        DataSet DataSetDrug = null;

        //Code added by Loveena in ref to Tash#2571 dated 02Sep2009.
        //DataRow[] dataRowStaff = null;
        try
        {
            ObjectClientMedication = new Streamline.UserBusinessServices.ClientMedication();
            DataSetDrug            = new DataSet();
            if (System.Configuration.ConfigurationSettings.AppSettings["UseSoundexMedicationSearch"] == null || System.Configuration.ConfigurationSettings.AppSettings["UseSoundexMedicationSearch"].ToString() == "")
            {
                System.Configuration.ConfigurationSettings.AppSettings["UseSoundexMedicationSearch"] = "N";
            }
            char showDosagesInList =
                (System.Configuration.ConfigurationSettings.AppSettings["ShowDosagesInDrugList"].ToUpper() == "TRUE")
                    ? 'Y'
                    : 'N';

            DataSetDrug = ObjectClientMedication.ClientMedicationDrug(Request.QueryString["MedicationName"].ToString(), Convert.ToChar(System.Configuration.ConfigurationSettings.AppSettings["UseSoundexMedicationSearch"].ToString()), showDosagesInList);

            DrugSearchCriteria = Request.QueryString["MedicationName"].ToString();
            DataView DataViewDrug = new DataView(DataSetDrug.Tables[0]);
            DataViewDrug.Sort = "MedicationName";
            //DataGridDrug.DataSource = DataViewDrug;
            //DataGridDrug.PageIndex = 0;
            //DataGridDrug.DataBind();
            lvDrugData.DataSource = DataViewDrug;
            lvDrugData.DataBind();
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = "";
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
            ObjectClientMedication = null;
            DataSetDrug            = null;
        }
    }
        public string GetSystemReportsMedHistory(string _ReportName, string StartDate, string EndDate, string MedicationNameId)
        {
            string  ReportUrl = null;
            DataSet ds        = null;

            try
            {
                Streamline.UserBusinessServices.ClientMedication ObjClientMedication = new Streamline.UserBusinessServices.ClientMedication();
                ds = ObjClientMedication.GetSystemReports(_ReportName);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ReportUrl = ds.Tables[0].Rows[0]["ReportUrl"].ToString();
                    }
                }
                if (ReportUrl != String.Empty && ReportUrl != null) // set the parameters values to report
                {
                    if (_ReportName == "Medications - View Client Consent History")
                    {
                        ReportUrl = ReportUrl.Replace("<ClientId>", (((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId).ToString());
                        ReportUrl = ReportUrl.Replace("<StartDate>", StartDate.ToString());
                        ReportUrl = ReportUrl.Replace("<EndDate>", EndDate.ToString());
                        ReportUrl = ReportUrl.Replace("<Medication>", MedicationNameId.ToString());
                    }
                }
                return(ReportUrl);
            }

            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                ds = null;
            }
        }
Exemple #4
0
        public override void Activate()
        {
            base.Activate();
            DataSet dataSetGraph = new DataSet();

            double GraphMaximum, GraphMinimum;

            GraphMaximum = 0.0;
            GraphMinimum = 0.0;
            double ItemGraphLowRedMinimum     = 0.0;
            double ItemGraphLowRedMaximum     = 0.0;
            double ItemGraphLowYellowMinimum  = 0.0;
            double ItemGraphLowYellowMaximum  = 0.0;
            double ItemGraphGreenMinimum      = 0.0;
            double ItemGraphGreenMaximum      = 0.0;
            double ItemGraphHighYellowMinimum = 0.0;
            double ItemGraphHighYellowMaximum = 0.0;
            double ItemGraphHighRedMinimum    = 0.0;
            double ItemGraphHighRedMaximum    = 0.0;


            Streamline.UserBusinessServices.ApplicationCommonFunctions objApplicationCommonFunctions;
            objectClientMedications = new Streamline.UserBusinessServices.ClientMedication();
            DataSet _DataSetHealthDataListGraph = null;

            ClientId = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId;
            _DataSetHealthDataListGraph = objectClientMedications.GetHeathDataGraphDropDown(ClientId);
            DataRow[] drHealthGraph = _DataSetHealthDataListGraph.Tables[0].Select("HealthDataCategoryId=" + HealthDataCatgeoryId);
            if (index >= 0)
            {
                itemName = _DataSetHealthDataListGraph.Tables[0].Rows[index]["ItemName"].ToString();
            }
            objApplicationCommonFunctions = new Streamline.UserBusinessServices.ApplicationCommonFunctions();
            GetMinMaxValue();
            //Added By Chandan For MultiGarph
            dataSetGraph = objApplicationCommonFunctions.GetGraphData(HealthDataCatgeoryId, HealthDataCatgeoryName, MinimumValue, MaximumValue);

            dataSetGraph.Tables[0].TableName = "HealthDataCategories";

            RadChartHealthData.ChartTitle.TextBlock.Text = _healthDataCatgeoryName;

            //RadChartHealthData.DataSource = new int[] { 1, 5, 6, 9, 5, 7 };
            Telerik.Charting.ChartSeries objectChartSeries = new Telerik.Charting.ChartSeries();

            objectChartSeries.DataYColumn = "ItemValue";
            objectChartSeries.Type        = Telerik.Charting.ChartSeriesType.Line;
            objectChartSeries.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.BlueViolet;


            if (dataSetGraph.Tables["HealthDataCategories"].Rows.Count != 0)
            {
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["MinimumValue"].ToString() != "")
                {
                    GraphMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["MinimumValue"]);
                }
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["MaximumValue"].ToString() != "")
                {
                    GraphMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["MaximumValue"]);
                }

                //ItemGraphLowRedMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowRedMinimum"].ToString() != "")
                {
                    ItemGraphLowRedMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowRedMinimum"]);
                }

                //ItemGraphLowRedMaximum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowRedMaximum"].ToString() != "")
                {
                    ItemGraphLowRedMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowRedMaximum"]);
                }

                //ItemGraphLowYellowMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowYellowMinimum"].ToString() != "")
                {
                    ItemGraphLowYellowMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowYellowMinimum"]);
                }


                //ItemGraphLowYellowMaximum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowYellowMaximum"].ToString() != "")
                {
                    ItemGraphLowYellowMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["LowYellowMaximum"]);
                }

                //ItemGraphGreenMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["GreenMinimum"].ToString() != "")
                {
                    ItemGraphGreenMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["GreenMinimum"]);
                }

                //ItemGraphGreenMaximum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["GreenMaximum"].ToString() != "")
                {
                    ItemGraphGreenMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["GreenMaximum"]);
                }

                //ItemGraphHighYellowMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighYellowMinimum"].ToString() != "")
                {
                    ItemGraphHighYellowMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighYellowMinimum"]);
                }

                //ItemGraphHighYellowMaximum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighYellowMaximum"].ToString() != "")
                {
                    ItemGraphHighYellowMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighYellowMaximum"]);
                }


                //ItemGraphHighRedMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighRedMinimum"].ToString() != "")
                {
                    ItemGraphHighRedMinimum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighRedMinimum"]);
                }

                //ItemGraphHighRedMinimum
                if (dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighRedMaximum"].ToString() != "")
                {
                    ItemGraphHighRedMaximum = Convert.ToDouble(dataSetGraph.Tables["HealthDataCategories"].Rows[0]["HighRedMaximum"]);
                }
            }

            //string[] xData;
            //xData = new string[12];
            //int rCount = 0;
            //string[] Months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

            //int arrayCounter = 0;

            //for (rCount = System.DateTime.Now.Month; rCount < 12; rCount++)
            //{
            //    xData[arrayCounter] = Months[rCount];
            //    arrayCounter++;
            //}

            //for (rCount = 0; rCount < System.DateTime.Now.Month; rCount++)
            //{
            //    xData[arrayCounter] = Months[rCount];
            //    arrayCounter++;
            //}
            string[] xData;
            xData = new string[12];

            int rCount = 0;

            string[] Months = { "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D" };

            int arrayCounter  = 0;
            int totalmonth    = MonthDeffrence();
            int SelectedMonth = StartDate.Month;
            int count         = 0;

            for (rCount = 0; rCount < totalmonth; rCount++)
            {
                //Find the selected index of the month from the array
                if (count == 0)
                {
                    xString += Months[MonthName(SelectedMonth - 1)] + ",";
                    count   += 1;
                }
                else
                {
                    SelectedMonth = SelectedMonth + 1;
                    if (SelectedMonth > 12)
                    {
                        SelectedMonth = 1;
                    }
                    xString += Months[MonthName(SelectedMonth - 1)] + ",";
                }
            }
            xString = xString.Substring(0, xString.Length - 1);

            Months = xString.Split(',');



            RadChartHealthData.PlotArea.XAxis.AutoScale = false;
            RadChartHealthData.PlotArea.XAxis.AddRange(0, (Months.Length - 1) * 30, 30);
            //foreach (string str in Months)
            //{
            //    RadChartHealthData.PlotArea.XAxis.Items.Add(new Telerik.Charting.ChartAxisItem(str));
            //}
            //RadChartHealthData.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color =System.Drawing.Color.Red;
            //RadChartHealthData.PlotArea.YAxis.Appearance.Width = 3;
            //RadChartHealthData.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.Red;

            RadChartHealthData.PlotArea.Appearance.Dimensions.Width = 800;
            rCount = 0;

            for (rCount = 0; rCount < Months.Length; rCount++)
            {
                RadChartHealthData.PlotArea.XAxis[rCount].TextBlock.Text = Months[rCount];
            }
            //RadChartHealthData.PlotArea.XAxis[Months.Length].TextBlock.Appearance.Visible = false;
            //RadChartHealthData.Chart.Legend.Items[0].TextBlock.Text = "Chandan";

            RadChartHealthData.PlotArea.XAxis.Appearance.Color = System.Drawing.Color.Maroon;
            RadChartHealthData.PlotArea.YAxis.AutoScale        = false;
            //RadChartHealthData.PlotArea.YAxis.AddRange(GraphMinimum, GraphMaximum, 50);
            //double range = Math.Round((GraphMaximum - GraphMinimum) / 5);
            double range = ((GraphMaximum - GraphMinimum) / 5);

            if (range > 0)
            {
                RadChartHealthData.PlotArea.YAxis.AddRange(GraphMinimum, GraphMaximum, range);
            }
            else
            {
                RadChartHealthData.PlotArea.YAxis.AddRange(GraphMinimum, GraphMaximum, 1);
            }


            //ItemGraphLowRedZone
            Telerik.Charting.ChartMarkedZone ItemGraphLowRedMinimumZone = new Telerik.Charting.ChartMarkedZone();
            ItemGraphLowRedMinimumZone.ValueStartY = ItemGraphLowRedMinimum;
            ItemGraphLowRedMinimumZone.ValueEndY   = ItemGraphLowRedMaximum;
            ItemGraphLowRedMinimumZone.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(230, 2, 8);// System.Drawing.Color.Red;
            //ItemGraphLowRedMinimumZone.Label.TextBlock.Text = "Low Red";

            //ItemGraphHighRedZone
            Telerik.Charting.ChartMarkedZone ItemGraphHighRedMinimumZone = new Telerik.Charting.ChartMarkedZone();
            ItemGraphHighRedMinimumZone.ValueStartY = ItemGraphHighRedMinimum;
            ItemGraphHighRedMinimumZone.ValueEndY   = ItemGraphHighRedMaximum;
            ItemGraphHighRedMinimumZone.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(230, 2, 8); //System.Drawing.Color.Red;
            // ItemGraphHighRedMinimumZone.Label.TextBlock.Text = "High Red";

            //ItemGraphLowYellowZone
            Telerik.Charting.ChartMarkedZone ItemGraphLowYellowZone = new Telerik.Charting.ChartMarkedZone();
            ItemGraphLowYellowZone.ValueStartY = ItemGraphLowYellowMinimum;
            ItemGraphLowYellowZone.ValueEndY   = ItemGraphLowYellowMaximum;
            ItemGraphLowYellowZone.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(246, 255, 0); //System.Drawing.Color.Yellow;
            // ItemGraphLowYellowZone.Label.TextBlock.Text = "Low Yellow";


            //ItemGraphHighYellowZone
            Telerik.Charting.ChartMarkedZone ItemGraphHighYellowZone = new Telerik.Charting.ChartMarkedZone();
            ItemGraphHighYellowZone.ValueStartY = ItemGraphHighYellowMinimum;
            ItemGraphHighYellowZone.ValueEndY   = ItemGraphHighYellowMaximum;
            ItemGraphHighYellowZone.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(246, 255, 0);// System.Drawing.Color.Yellow;
            //ItemGraphHighYellowZone.Label.TextBlock.Text = "High Yellow";

            //ItemGraphGreenwZone
            Telerik.Charting.ChartMarkedZone ItemGraphGreenwZone = new Telerik.Charting.ChartMarkedZone();
            ItemGraphGreenwZone.ValueStartY = ItemGraphGreenMinimum;
            ItemGraphGreenwZone.ValueEndY   = ItemGraphGreenMaximum;
            ItemGraphGreenwZone.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(147, 240, 0); //System.Drawing.Color.Green;
            // ItemGraphGreenwZone.Label.TextBlock.Text = "Green";


            RadChartHealthData.PlotArea.MarkedZones.Add(ItemGraphLowRedMinimumZone);
            RadChartHealthData.PlotArea.MarkedZones.Add(ItemGraphHighRedMinimumZone);
            RadChartHealthData.PlotArea.MarkedZones.Add(ItemGraphLowYellowZone);
            RadChartHealthData.PlotArea.MarkedZones.Add(ItemGraphHighYellowZone);
            RadChartHealthData.PlotArea.MarkedZones.Add(ItemGraphGreenwZone);

            SetGraphData();
        }
Exemple #5
0
    public void GridBind(string PharmacyName, string Address, string City, string State, string Zip, string Phone, string Fax, int PharmacyId, string SureScriptIdentifier, string Specialty, int startRowIndex, int endRowIndex, int CurrentPage, int PageSize)
    {
        objClientMedications = new Streamline.UserBusinessServices.ClientMedication();
        try
        {
            pharmacyId           = PharmacyId;
            pharmacyName         = PharmacyName;
            address              = Address;
            city                 = City;
            state                = State;
            zip                  = Zip;
            phone                = Phone;
            fax                  = Fax;
            sureScriptIdentifier = SureScriptIdentifier;
            //SortExpression = sortExpression;
            //StartrowIndex = startrowIndex;
            //MaximumRows = maximumRows;
            //startrowIndex = CurrentPage * 1 + 1;
            //endRowIndex = PageSize * CurrentPage + 1;
            using (DataSet dataSetPharmacies = objClientMedications.GetSearchPharmacies(PharmacyName.Trim(), Address.Trim(), City.Trim(), State.Trim(), Zip.Trim(), Phone.Trim(), Fax.Trim(), PharmacyId, SureScriptIdentifier.Trim(), Specialty.Trim(), startRowIndex, endRowIndex))
            {
                GridViewSearchPharmacies.DataSource = dataSetPharmacies.Tables["Pharmacy"];
                GridViewSearchPharmacies.DataBind();
                Session["PharmacySearch"] = dataSetPharmacies;
                int totalRows           = 0;
                int totalRecordsPerPage = 0;
                if (dataSetPharmacies.Tables["TotalRecords"].Rows[0]["TotalRecords"] != null)
                {
                    totalRows = Convert.ToInt32(dataSetPharmacies.Tables["TotalRecords"].Rows[0]["TotalRecords"].ToString());
                }
                totalRecordsPerPage = dataSetPharmacies.Tables["Pharmacy"].Rows.Count;
                int value = Convert.ToInt32((totalRows) / PageSize);
                if ((totalRows) % PageSize != 0 && value >= 0)
                {
                    LabelTotalPages.Text = Convert.ToString(value + 1) + ")";
                }
                else
                {
                    LabelTotalPages.Text = Convert.ToString(value) + ")";
                }
                if (CurrentPage == 0)
                {
                    LinkButtonPrevious.Enabled = false;

                    if (totalRows > PageSize)
                    {
                        LinkButtonNext.Enabled = true;
                    }
                    else
                    {
                        LinkButtonNext.Enabled = false;
                    }
                    LabelPageNumber.Text = "(Page " + (CurrentPage + 1).ToString() + " of";
                }

                else
                {
                    LinkButtonPrevious.Enabled = true;

                    if (totalRows <= (PageSize * (CurrentPage + 1)))
                    {
                        LinkButtonNext.Enabled = false;
                    }
                    else
                    {
                        LinkButtonNext.Enabled = true;
                    }
                    LabelPageNumber.Text = "(Page " + (CurrentPage + 1).ToString() + " of";
                }
            }

            //GridViewSearchPharmacies.DataSourceID = "ObjectDataSourcePharmacy";
            //GridViewSearchPharmacies.DataBind();
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }