Example #1
0
    /// <summary>
    /// event
    /// US:838
    /// load the patient list based on the options selected
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbOptions_SelectedIndexChanged(object sender, EventArgs e)
    {
        CStatus status = new CStatus();

        if (rblOptions.SelectedIndex == -1)
        {
            return;
        }

        string strValue  = rblOptions.SelectedValue;
        string strUserID = string.Empty;

        if (strValue == OPTION_PROVIDERS)
        {
            //get the selected team id
            long lUserID = CDataUtils.ToLong(lbOptions.SelectedValue);

            //get the dataset from our db
            if (lUserID > 0)
            {
                //get providers patients from the query
                //get a dataset matching criteria
                DataSet      dsPatients = null;
                CPatientData pat        = new CPatientData(BaseMstr.BaseData);
                status    = pat.GetUserPatientDS(lUserID, out dsPatients);
                strUserID = Convert.ToString(lUserID);
            }
        }
        else if (strValue == OPTION_TEAMS)
        {
            //get the selected team id
            long lTeamID = CDataUtils.ToLong(lbOptions.SelectedValue);

            //get the dataset from our db
            if (lTeamID > 0)
            {
                CTeamData td      = new CTeamData(BaseMstr.BaseData);
                DataSet   dsTeams = null;
                status = td.GetTeamPatientsDS(lTeamID, out dsTeams);
            }
        }
        else if (strValue == OPTION_SPECIALTIES)
        {
            //get the selected team id
            long lSpecialtyID = CDataUtils.ToLong(lbOptions.SelectedValue);

            if (lSpecialtyID > 0)
            {
                //get the dataset from our db
                CSpecialtyData sd          = new CSpecialtyData(BaseMstr.BaseData);
                DataSet        dsSpecialty = null;
                status = sd.GetSpecialtyPatientsDS(lSpecialtyID, out dsSpecialty);
            }
        }
        else if (strValue == OPTION_CLINICS)
        {
            //get the selected team id
            long lClinicID = CDataUtils.ToLong(lbOptions.SelectedValue);
            if (lClinicID > 0)
            {
                //get the dataset from our db
                DataSet     dsClinics = null;
                CClinicData cd        = new CClinicData(BaseMstr.BaseData);
                status = cd.GetClinicPatientsDS(lClinicID,
                                                calApptFromDate.SelectedDate.GetValueOrDefault(),
                                                calApptToDate.SelectedDate.GetValueOrDefault(),
                                                out dsClinics);
            }
        }
        else if (strValue == OPTION_WARDS)
        {
            //get the selected team id
            long lWardID = CDataUtils.ToLong(lbOptions.SelectedValue);
            if (lWardID > 0)
            {
                //get the dataset from our db
                DataSet   dsWards = null;
                CWardData wd      = new CWardData(BaseMstr.BaseData);
                status = wd.GetWardPatientsDS(lWardID, out dsWards);
            }
        }

        status = PatientLookup(sender, e, strUserID);
        if (!status.Status)
        {
            ShowStatusInfo(status);
            upucPatientLookup.Update();
        }


        return;
    }
Example #2
0
 public override void SetData(CObjectData value)
 {
     base.SetData(value);
     this.m_Data = value as CTeamData;
 }
Example #3
0
    /// <summary>
    /// event
    /// US:838
    /// load the options list box based on the radio option selected
    /// </summary>
    /// <param name="bClearSearch"></param>
    /// <returns></returns>
    public CStatus LoadOptionsListBox(bool bClearSearch)
    {
        CStatus status = new CStatus();

        if (!String.IsNullOrEmpty(rblOptions.SelectedValue))
        {
            //hide clinic appt controls to start with
            ShowClinicApptControls(false);

            if (bClearSearch)
            {
                txtSearchOptions.Text = string.Empty;
            }
            //clear current options
            lbOptions.Items.Clear();

            //set enabled to start with
            lbOptions.Enabled        = true;
            txtSearchOptions.Enabled = true;
            btnSearchOptions.Enabled = true;

            string strValue = rblOptions.SelectedValue;
            if (strValue == OPTION_NONE)
            {
                //0=none
                lbOptions.Items.Clear();
                lbOptions.Enabled        = false;
                txtSearchOptions.Enabled = false;
                btnSearchOptions.Enabled = false;
            }
            else if (strValue == OPTION_TEAMS)
            {
                //get the dataset from our db
                DataSet   dsTeams = null;
                CTeamData td      = new CTeamData(BaseMstr.BaseData);
                status = td.GetTeamDS(out dsTeams);

                CListBox lb = new CListBox();
                lb.RenderDataSet(
                    dsTeams,
                    lbOptions,
                    "All",
                    "TEAM_LABEL",
                    "TEAM_ID");
            }
            else if (strValue == OPTION_SPECIALTIES)
            {
                //get the dataset from our db
                DataSet        dsSpecialties = null;
                CSpecialtyData sd            = new CSpecialtyData(BaseMstr.BaseData);
                status = sd.GetSpecialtyDS(out dsSpecialties);

                CListBox lb = new CListBox();
                lb.RenderDataSet(
                    dsSpecialties,
                    lbOptions,
                    "All",
                    "SPECIALTY_LABEL",
                    "SPECIALTY_ID");
            }
            else if (strValue == OPTION_CLINICS)
            {
                //show clinic appt controls
                ShowClinicApptControls(true);

                //get the dataset from our db
                DataSet     dsClinics = null;
                CClinicData cd        = new CClinicData(BaseMstr.BaseData);
                status = cd.GetClinicDS(out dsClinics);

                CListBox lb = new CListBox();
                lb.RenderDataSet(
                    dsClinics,
                    lbOptions,
                    "All",
                    "CLINIC_LABEL",
                    "CLINIC_ID");
            }
            else if (strValue == OPTION_WARDS)
            {
                //get the dataset from our db
                DataSet   dsWards = null;
                CWardData wd      = new CWardData(BaseMstr.BaseData);
                status = wd.GetWardDS(out dsWards);

                CListBox lb = new CListBox();
                lb.RenderDataSet(
                    dsWards,
                    lbOptions,
                    "All",
                    "WARD_LABEL",
                    "WARD_ID");
            }

            string strScript = string.Format("document.getElementById('{0}_{1}').focus();", rblOptions.ClientID, rblOptions.SelectedIndex);

            if (ScriptManager.GetCurrent(Page) != null && ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
            {
                ScriptManager.RegisterStartupScript(rblOptions, typeof(RadioButtonList), rblOptions.ClientID, strScript, true);
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(typeof(RadioButtonList), rblOptions.ClientID, strScript, true);
            }
        }

        return(status);
    }