Example #1
0
    /// <summary>
    /// US:1945 US:1880 load control
    /// </summary>
    /// <param name="lEditMode"></param>
    /// <returns></returns>
    public override CStatus LoadControl(k_EDIT_MODE lEditMode)
    {
        EditMode = lEditMode;

        tbNoteTitle.Text = string.Empty;

        CPatientItemData     PatientItemData = new CPatientItemData(BaseMstr.BaseData);
        CPatientItemDataItem di = null;

        CStatus status = new CStatus();

        //if no pat item id then load the most recent
        if (PatientItemID < 1)
        {
            status = PatientItemData.GetMostRecentPatientItemDI(PatientID,
                                                                ItemID,
                                                                out di);
            if (!status.Status)
            {
                return(status);
            }
        }
        else
        {
            status = PatientItemData.GetPatientItemDI(PatientID,
                                                      ItemID,
                                                      PatientItemID,
                                                      out di);
            if (!status.Status)
            {
                return(status);
            }
        }

        if (string.IsNullOrEmpty(di.PatientID))
        {
            return(new CStatus());
        }

        DataSet ds = null;

        status = PatientItemData.GetPatientItemComponentDS(di.PatientID, di.PatItemID, di.ItemID, out ds);
        if (!status.Status)
        {
            return(status);
        }

        tbNoteTitle.Text = di.ItemLabel + "\r\n";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            tbNoteTitle.Text += dr["ITEM_COMPONENT_LABEL"].ToString() + "\r\n";
            tbNoteTitle.Text += dr["COMPONENT_VALUE"].ToString() + "\r\n";
        }

        tbNoteTitle.Text += "\r\n";

        return(new CStatus());
    }
    protected CStatus LoadPatItemAndComponents()
    {
        CPatientItemData     dta = new CPatientItemData(BaseMstr.BaseData);
        CPatientItemDataItem di  = null;
        CStatus status           = dta.GetPatientItemDI(
            PatientID,
            ItemID,
            Convert.ToInt64(ddlItems.SelectedValue),
            out di);

        if (!status.Status)
        {
            return(status);
        }

        // set date/time
        txtEntryDate.Text         = CDataUtils.GetDateAsString(di.EntryDate);
        calEntryDate.SelectedDate = di.EntryDate;
        ucTimePicker.SetTime(di.EntryDate);

        if (di.ItemTypeID == (long)k_ITEM_TYPE_ID.NoteTitle)
        {
            ucNoteTitle.ItemID        = di.ItemID;
            ucNoteTitle.PatientItemID = Convert.ToInt64(ddlItems.SelectedValue);
            ucNoteTitle.PatientID     = PatientID;
            status = ucNoteTitle.LoadControl(k_EDIT_MODE.UPDATE);
            if (!status.Status)
            {
                return(status);
            }
        }
        else
        {
            status = LoadPatComponents();
            if (!status.Status)
            {
                return(status);
            }
        }

        status = LoadPatComments();
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }