Exemple #1
0
    protected void GraphItemComponent(DataRow drItemComponent)
    {
        AddStripLines(drItemComponent);

        Series srsPatItems = chrtPatItems.Series["srsPatItems"];

        if (srsPatItems == null)
        {
            return;
        }
        srsPatItems.ToolTip = "Value = #VALY{n}\nDate = #VALX{g}";

        DataRow[] drPIC = PatientItemComponents.Select(
            "item_component_id = " + drItemComponent["item_component_id"].ToString(),
            "entry_date");
        chrtPatItems.DataSource = drPIC;
        chrtPatItems.DataBind();
    }
Exemple #2
0
    /// <summary>
    /// method
    /// loads the date and component values for a row
    /// </summary>
    /// <param name="gvr"></param>
    protected void LoadGridViewRowComponents(GridViewRow gvr)
    {
        if (gvr == null)
        {
            return;
        }

        DataRowView drv = (DataRowView)gvr.DataItem;

        if (drv == null)
        {
            return;
        }

        DataRow dr = drv.Row;

        if (dr == null)
        {
            return;
        }

        Panel   pnlComponents       = (Panel)gvr.FindControl("pnlComponents");
        Panel   pnlViewValue        = (Panel)gvr.FindControl("pnlViewValue");
        Literal litHiddenValues     = (Literal)gvr.FindControl("litHiddenValues");
        Literal litShownValues      = (Literal)gvr.FindControl("litShownValues");
        Button  btnShowHiddenValues = (Button)gvr.FindControl("btnShowHiddenValues");
        Button  btnTrend            = (Button)gvr.FindControl("btnTrend");

        if (pnlComponents == null ||
            litHiddenValues == null ||
            litShownValues == null ||
            btnShowHiddenValues == null ||
            pnlViewValue == null ||
            btnTrend == null)
        {
            return;
        }

        pnlComponents.Visible       = true;
        pnlViewValue.Visible        = false;
        btnShowHiddenValues.Enabled = true;

        litHiddenValues.Text = string.Empty;
        litShownValues.Text  = string.Empty;

        // filter the patient items by item id for the item we're on
        DataRow[] draPatientItems = PatientItems.Select("ITEM_ID = " + dr["ITEM_ID"].ToString());
        if (draPatientItems == null || draPatientItems.Count() < 1)
        {
            litShownValues.Text         = "NA";
            btnShowHiddenValues.Enabled = false;
            btnTrend.Enabled            = false;
            return;
        }

        long lItemTypeID = Convert.ToInt64(dr["ITEM_TYPE_ID"]);

        if (lItemTypeID == (long)k_ITEM_TYPE_ID.Laboratory)
        {
            btnTrend.Enabled = true;
        }

        // filter by patient item id for the first item in the list
        // the first item in the list should be the the most recent one
        // if the first item in the list isnt the most recent check the stored procedure for errors
        DataRow[] draPatientItemComps = PatientItemComponents.Select("PAT_ITEM_ID = " + draPatientItems[0]["PAT_ITEM_ID"].ToString());
        if (draPatientItemComps == null && draPatientItemComps.Count() < 1)
        {
            litShownValues.Text         = "NA";
            btnShowHiddenValues.Enabled = false;
            btnTrend.Enabled            = false;
            return;
        }

        foreach (DataRow drItemComp in draPatientItemComps)
        {
            StringBuilder sbItemCompHTML = new StringBuilder();
            sbItemCompHTML.Append("<img alt=\"");
            sbItemCompHTML.Append(Server.HtmlEncode(drItemComp["ITEM_COMPONENT_LABEL"].ToString()));
            sbItemCompHTML.Append(" Component State Image\" width=\"10\" height=\"10\" src=\"");

            long lStateID = Convert.ToInt64(drItemComp["IC_STATE_ID"]);
            switch (lStateID)
            {
            case (long)k_STATE_ID.Good:
                sbItemCompHTML.Append(Resources.Images.STATE_GOOD_SMALL);
                break;

            case (long)k_STATE_ID.Bad:
                sbItemCompHTML.Append(Resources.Images.STATE_BAD_SMALL);
                break;

            case (long)k_STATE_ID.Unknown:
                sbItemCompHTML.Append(Resources.Images.STATE_UNKNOWN_SMALL);
                break;
            }

            sbItemCompHTML.Append("\" />");
            sbItemCompHTML.Append("<span style=\"font-weight:bold;\">");
            sbItemCompHTML.Append(Server.HtmlEncode(drItemComp["ITEM_COMPONENT_LABEL"].ToString()));

            switch (lItemTypeID)
            {
            case (long)k_ITEM_TYPE_ID.Laboratory:
            case (long)k_ITEM_TYPE_ID.QuestionFreeText:
                sbItemCompHTML.Append(": </span>");
                sbItemCompHTML.Append(Server.HtmlEncode(drItemComp["COMPONENT_VALUE"].ToString()));
                break;

            case (long)k_ITEM_TYPE_ID.QuestionSelection:
                sbItemCompHTML.Append("</span>");
                break;
            }

            sbItemCompHTML.Append("<div class=\"app_horizontal_spacer\"></div>");

            switch (lStateID)
            {
            case (long)k_STATE_ID.Good:
                litHiddenValues.Text += sbItemCompHTML.ToString();
                break;

            case (long)k_STATE_ID.Bad:
            case (long)k_STATE_ID.Unknown:
                litShownValues.Text += sbItemCompHTML.ToString();
                break;
            }
        }

        btnShowHiddenValues.Enabled = (String.IsNullOrEmpty(litHiddenValues.Text)) ? false : btnShowHiddenValues.Enabled;
    }