Ejemplo n.º 1
0
    protected void Load_Templates()
    {
        //Get Group's templates
        long lGroupID = -1;

        if (htxtTemplateGroupID.Value.Length > 0)
        {
            long.TryParse(htxtTemplateGroupID.Value, out lGroupID);
        }

        if (lGroupID > 0)
        {
            dsTemplates             = template.GetGroupTemplatesDS(BaseMstr, lGroupID);
            repTemplates.DataSource = dsTemplates;
        }
        else
        {
            repTemplates.DataSource = null;
        }
        repTemplates.DataBind();
    }
Ejemplo n.º 2
0
    /// <summary>
    /// encounter template change
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void cboEncounterTemplates_OnSelectedIndexChanged(object sender, EventArgs e)
    {
        CTemplate template = new CTemplate();

        if (cboEncounterTemplates.SelectedIndex > 0)
        {
            long    lGroupID    = Convert.ToInt32(cboEncounterTemplates.SelectedValue);
            DataSet dsTemplates = template.GetGroupTemplatesDS(BaseMstr, lGroupID);

            foreach (DataTable dt in dsTemplates.Tables)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!dr.IsNull("TEMPLATE_ID"))
                    {
                        string strTemplateID = dr["TEMPLATE_ID"].ToString();

                        //set SUBJECTIVE templates dropdown
                        foreach (ListItem li in cboSTemplates.Items)
                        {
                            if (li.Value == strTemplateID)
                            {
                                string strParsedTemplate = template.GetParsedTemplateText2(BaseMstr,
                                                                                           BaseMstr.SelectedPatientID,
                                                                                           BaseMstr.SelectedEncounterID,
                                                                                           Convert.ToInt32(strTemplateID));

                                txtSubjective.Text = strParsedTemplate;
                            }
                        }

                        //set OBJECTIVE templates dropdown
                        foreach (ListItem li in cboOTemplates.Items)
                        {
                            if (li.Value == strTemplateID)
                            {
                                string strParsedTemplate = template.GetParsedTemplateText2(BaseMstr,
                                                                                           BaseMstr.SelectedPatientID,
                                                                                           BaseMstr.SelectedEncounterID,
                                                                                           Convert.ToInt32(strTemplateID));

                                txtObjective.Text = strParsedTemplate;
                            }
                        }

                        //set ASSESSMENT / PLAN templates dropdown
                        foreach (ListItem li in cboATemplates.Items)
                        {
                            if (li.Value == strTemplateID)
                            {
                                string strParsedTemplate = template.GetParsedTemplateText2(BaseMstr,
                                                                                           BaseMstr.SelectedPatientID,
                                                                                           BaseMstr.SelectedEncounterID,
                                                                                           Convert.ToInt32(strTemplateID));

                                txtAssessment.Text = strParsedTemplate;
                            }
                        }
                    }
                }
            }
        }
    }