Example #1
0
    /// <summary>
    /// US:894
    /// US:892
    /// override
    /// initializes the control
    /// </summary>
    /// <param name="lEditMode"></param>
    /// <returns></returns>
    public override CStatus LoadControl(k_EDIT_MODE lEditMode)
    {
        EditMode = lEditMode;

        Enable(false);

        CPatientData p        = new CPatientData(BaseMstr.BaseData);
        string       strBlurb = string.Empty;
        CStatus      status   = p.GetPatientBlurb(PatientID, out strBlurb);

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

        sPatientBlurb.InnerText = strBlurb;

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

        if (EditMode == k_EDIT_MODE.UPDATE)
        {
            ddlPatChecklist.SelectedValue = PatCLID.ToString();

            //Manually Forcing OnSelChangeChecklist to fire
            OnSelChangeChecklist(this, new EventArgs());
        }

        return(new CStatus());
    }
Example #2
0
    /// <summary>
    /// method
    /// US:902
    /// returns the attribute specified by the place holder for the patient specified by the patient id
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="strPlaceHolder"></param>
    /// <returns></returns>
    private CStringStatus ParsePatient(string strPatientID, string strPlaceHolder)
    {
        CPatientData     Patient = new CPatientData(BaseData);
        CPatientDataItem di      = null;
        CStatus          status  = Patient.GetPatientDI(strPatientID, out di);

        if (!status.Status)
        {
            return(new CStringStatus(status, CExpression.NullTkn));
        }

        string strValue = CExpression.NullTkn;

        switch (strPlaceHolder)
        {
        case "patient.age":
            strValue = (di.Age < 1) ? CExpression.NullTkn : di.Age.ToString();
            break;

        case "patient.sex":
            strValue = (Convert.ToInt64(di.Sex) < 1) ? CExpression.NullTkn : Convert.ToInt64(di.Sex).ToString();
            break;
        }

        return(new CStringStatus(status, strValue));
    }
Example #3
0
    /// <summary>
    /// get the patient checklist ids that need to be threaded
    /// </summary>
    /// <param name="dtFrom"></param>
    /// <param name="dtTo"></param>
    /// <param name="lChecklistID"></param>
    /// <param name="lChecklistStatusID"></param>
    public CStatus GetPatCLIDs(
        DateTime dtFrom,
        DateTime dtTo,
        long lChecklistID,
        long lChecklistStatusID,
        long lServiceID)
    {
        PatCLIDs = string.Empty;

        CPatientData p      = new CPatientData(Master.BaseData);
        CStatus      status = null;
        DataSet      ds     = null;

        switch (ThreadType)
        {
        case k_MULTI_PAT_THREAD_TYPE.Refresh:
            status = p.GetMultiPatientSearchDS(
                dtFrom,
                dtTo,
                lChecklistID,
                lChecklistStatusID,
                lServiceID,
                out ds);
            break;

        case k_MULTI_PAT_THREAD_TYPE.Logic:
            status = p.GetMultiPatientPatCLIDSearchDS(
                dtFrom,
                dtTo,
                lChecklistID,
                lChecklistStatusID,
                lServiceID,
                out ds);
            break;

        default:
            return(new CStatus(false, k_STATUS_CODE.Failed, "TODO"));
        }

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

        string strPatCLIDs = string.Empty;

        CDataUtils.GetDSDelimitedData(
            ds,
            "PAT_CL_ID",
            ",",
            out strPatCLIDs);

        PatCLIDs = "," + strPatCLIDs;

        return(new CStatus());
    }
    /// <summary>
    /// override
    /// sets focus
    /// </summary>
    /// <param name="lEditMode"></param>
    /// <param name="lStatusCode"></param>
    /// <param name="strStatusComment"></param>
    /// <returns></returns>
    public override CStatus LoadControl(k_EDIT_MODE lEditMode)
    {
        CStatus status = new CStatus();

        //get all the patients for the mulitpatient
        string       strCLIDs             = String.Empty;
        string       strPatIDs            = String.Empty;
        CPatientData pat                  = new CPatientData(BaseMstr.BaseData);
        DataSet      dsMultiPatientSearch = null;

        status = pat.GetMultiPatientSearchDS(EventStartDate,
                                             EventEndDate,
                                             ChecklistID,
                                             ChecklistStatusID,
                                             ChecklistServiceID,
                                             out dsMultiPatientSearch);

        //get patient ids
        CDataUtils.GetDSDelimitedData(dsMultiPatientSearch,
                                      "PATIENT_ID",
                                      ",",
                                      out strPatIDs);
        strPatIDs = "," + strPatIDs;

        //get pat cl ids
        CDataUtils.GetDSDelimitedData(dsMultiPatientSearch,
                                      "CHECKLIST_ID",
                                      ",",
                                      out strCLIDs);
        strCLIDs = "," + strCLIDs;


        CPatChecklistData dta  = new CPatChecklistData(BaseMstr.BaseData);
        DataSet           dsCL = null;

        status = dta.GetOutOfDatePatCLDS(EventStartDate,
                                         EventEndDate,
                                         ChecklistID,
                                         ChecklistStatusID,
                                         strPatIDs,
                                         strCLIDs,
                                         out dsCL);

        //if (!CDataUtils.IsEmpty(dsCL))
        //{
        gvOutOfDateCL.DataSource = dsCL.Tables[0];
        gvOutOfDateCL.DataBind();
        //}

        return(status);
    }
Example #5
0
    /// <summary>
    /// builds the patient blurb
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="strBlurb"></param>
    /// <returns></returns>
    public CStatus GetPatientBlurb(string strPatientID, out string strBlurb)
    {
        strBlurb = string.Empty;
        CPatientData     p      = new CPatientData(this);
        CPatientDataItem di     = null;
        CStatus          status = p.GetPatientDI(strPatientID, out di);

        if (status.Status)
        {
            strBlurb = di.FirstName + " " + di.LastName + " " + di.SSNLast4 + ", " + di.Age + " yo " + di.SexLabel;
        }

        return(status);
    }
Example #6
0
    /// <summary>
    /// method
    /// gets result set of all the patients that match the patient filters from the database
    /// </summary>
    /// <param name="dtFrom"></param>
    /// <param name="dtTo"></param>
    /// <param name="lChecklistID"></param>
    /// <param name="lChecklistStatusID"></param>
    /// <returns></returns>
    protected CStatus GetPatients(
        DateTime dtFrom,
        DateTime dtTo,
        long lChecklistID,
        long lChecklistStatusID,
        long lChecklistServiceID)
    {
        CPatientData pat = new CPatientData(Master.BaseData);
        DataSet      dsMultiPatientSearch = null;
        CStatus      status = pat.GetMultiPatientSearchDS(
            dtFrom,
            dtTo,
            lChecklistID,
            lChecklistStatusID,
            lChecklistServiceID,
            out dsMultiPatientSearch);

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

        // add url value for each row based on the state id
        dsMultiPatientSearch.Tables[0].Columns.Add("WR_ITEM_GROUP_URL", Type.GetType("System.String"));

        foreach (DataRow dr in dsMultiPatientSearch.Tables[0].Rows)
        {
            switch (Convert.ToInt64(dr["WR_ITEM_GROUP_STATE_ID"]))
            {
            case (long)k_STATE_ID.Bad:
                dr["WR_ITEM_GROUP_URL"] = Resources.Images.STATE_BAD;
                break;

            case (long)k_STATE_ID.Good:
                dr["WR_ITEM_GROUP_URL"] = Resources.Images.STATE_GOOD;
                break;

            default:
                dr["WR_ITEM_GROUP_URL"] = Resources.Images.STATE_UNKNOWN;
                break;
            }
        }

        MultiPatients = dsMultiPatientSearch.Tables[0];

        return(new CStatus());
    }
Example #7
0
    /// <summary>
    /// event
    /// US:838
    /// handler for My Patients button click
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnMyPatients_Click(object sender, EventArgs e)
    {
        btnMyPatients.Focus();

        //get providers patients from the query
        //get a dataset matching criteria
        DataSet      dsPatients = null;
        CPatientData pat        = new CPatientData(BaseMstr.BaseData);
        CStatus      status     = pat.GetUserPatientDS(BaseMstr.UserID, out dsPatients);

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

        PatientLookup(sender, e, Convert.ToString(BaseMstr.UserID));
    }
Example #8
0
    /// <summary>
    /// Generates the TIU text for a patient checklist
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="lPatCLID"></param>
    /// <param name="strText"></param>
    /// <returns></returns>
    public CStatus GetTIUText(string strPatientID,
                              long lPatCLID,
                              out string strNoteTitleTag,
                              out string strText)
    {
        strText         = string.Empty;
        strNoteTitleTag = string.Empty;

        CStatus status = new CStatus();

        //patient data - get the di just in case we need more than the blurb
        CPatientDataItem diPat   = new CPatientDataItem();
        CPatientData     patData = new CPatientData(this);

        status = patData.GetPatientDI(strPatientID, out diPat);

        //get the patient blurb
        string strBlurb = String.Empty;

        patData.GetPatientBlurb(strPatientID, out strBlurb);

        //build the TIU note text...

        //legend
        strText += "Definitions:\r\n";

        //ts
        strText += CDataUtils.DelimitString("TS = The temporal state of an attribute defines whether the patient has had the test or event within a given time period",
                                            "\r\n",
                                            80);
        strText += "\r\n";

        //os
        strText += CDataUtils.DelimitString("OS = The outcome state of an attribute defines the resultant state of an attribute (e.g. normal, abnormal, problem/decision required)",
                                            "\r\n",
                                            80);
        strText += "\r\n";

        //ds
        strText += CDataUtils.DelimitString("DS = The decision state of an attribute defines a rule-based state of an attribute (e.g. Go, No-Go)",
                                            "\r\n",
                                            80);

        strText += "\r\n";


        strText += "\r\n";

        DateTime dtNoteDate  = DateTime.Now;
        string   strNoteDate = CDataUtils.GetDateTimeAsString(dtNoteDate);

        strText += "Date: " + strNoteDate;
        strText += "\r\n\r\n";

        //--demographics
        strText += CDataUtils.DelimitString(strBlurb, "\r\n", 80);
        strText += "\r\n";

        //patient checklist data
        CPatChecklistDataItem diPatChecklist = new CPatChecklistDataItem();

        status = GetPatChecklistDI(lPatCLID, out diPatChecklist);

        //checklist data
        CChecklistDataItem diChecklist = new CChecklistDataItem();
        CChecklistData     clData      = new CChecklistData(this);

        status = clData.GetCheckListDI(diPatChecklist.ChecklistID, out diChecklist);

        //get the note title tag for the checklist, this is used to
        //write the correct note to MDWS
        strNoteTitleTag = diChecklist.NoteTitleTag;

        //--Checklist Name
        strText += "Checklist: ";
        strText += CDataUtils.DelimitString(diChecklist.ChecklistLabel, "\r\n", 80);
        strText += "\r\n";

        //--Procedure Date
        strText += "Procedure Date: ";
        if (!CDataUtils.IsDateNull(diPatChecklist.ProcedureDate))
        {
            strText += CDataUtils.GetDateAsString(diPatChecklist.ProcedureDate);
        }
        else
        {
            strText += "None";
        }
        strText += "\r\n\r\n";

        //patient checklist items and overall state
        long    lColTSStateID       = 0;
        long    lColOSStateID       = 0;
        long    lColDSStateID       = 0;
        long    lSummaryStateID     = 0;
        DataSet dsItems             = null;
        CPatChecklistItemData diCLI = new CPatChecklistItemData(this);

        status = diCLI.GetPatCLItemsByPatCLIDDS(lPatCLID,
                                                out lColTSStateID,
                                                out lColOSStateID,
                                                out lColDSStateID,
                                                out lSummaryStateID,
                                                out dsItems);
        //--overall Checklist state
        string strOverallState = "Unknown";

        switch (lSummaryStateID)
        {
        case (long)k_STATE_ID.Bad:
            strOverallState = "Bad";
            break;

        case (long)k_STATE_ID.Good:
            strOverallState = "Good";
            break;
        }

        strText += "Overall Checklist State: ";
        strText += strOverallState;
        strText += "\r\n\r\n";

        strText += "Checklist Items:";
        strText += "\r\n\r\n";

        //loop over checklist items
        foreach (DataTable table in dsItems.Tables)
        {
            foreach (DataRow dr in table.Rows)
            {
                CPatChecklistItemDataItem itm = new CPatChecklistItemDataItem(dr);
                if (itm != null)
                {
                    //get the data for the item
                    CItemDataItem idi     = new CItemDataItem();
                    CItemData     itmData = new CItemData(this);

                    itmData.GetItemDI(itm.ItemID, out idi);
                    strText += CDataUtils.DelimitString("* " + idi.ItemLabel, "\r\n", 80);
                    strText += "\r\n";

                    //temporal state
                    CTemporalStateDataItem diTSi = new CTemporalStateDataItem();
                    CTemporalStateData     tsdi  = new CTemporalStateData(this);
                    tsdi.GetTemporalStateDI(itm.TSID, out diTSi);
                    strText += "TS: ";
                    strText += CDataUtils.DelimitString(diTSi.TSLabel, "\r\n", 80);
                    strText += "  ";

                    //outcome state
                    COutcomeStateDataItem diOSi = new COutcomeStateDataItem();
                    COutcomeStateData     osdi  = new COutcomeStateData(this);
                    osdi.GetOutcomeStateDI(itm.OSID, out diOSi);
                    strText += "OS: ";
                    strText += CDataUtils.DelimitString(diOSi.OSLabel, "\r\n", 80);
                    strText += " ";

                    //decision state
                    CDecisionStateDataItem diDSi = new CDecisionStateDataItem();
                    CDecisionStateData     dsdi  = new CDecisionStateData(this);
                    dsdi.GetDecisionStateDI(itm.DSID, out diDSi);

                    string strDS = String.Empty;
                    strDS += "DS: ";
                    strDS += diDSi.DSLabel;

                    //if decision state is overriden pull out the
                    //last comment
                    if (itm.IsOverridden == k_TRUE_FALSE_ID.True)
                    {
                        DataSet dsComments = null;

                        //todo: override history is now stored in a diff table
                        //this is obsolete will delete after testing
                        //status = diCLI.GetPatientItemCommmentDS(
                        //    itm.PatCLID,
                        //    itm.ItemID,
                        //    out dsComments);

                        status = diCLI.GetPatItemOverrideCommmentDS(itm.PatCLID,
                                                                    itm.ChecklistID,
                                                                    itm.ItemID,
                                                                    out dsComments);
                        //first record is the newest comment
                        if (!CDataUtils.IsEmpty(dsComments))
                        {
                            //string strComment = CDataUtils.GetDSStringValue(dsComments, "comment_text");
                            //DateTime dtComment = CDataUtils.GetDSDateTimeValue(dsComments, "comment_date");
                            //
                            string   strComment     = CDataUtils.GetDSStringValue(dsComments, "override_comment");
                            DateTime dtComment      = CDataUtils.GetDSDateTimeValue(dsComments, "override_date");
                            long     lCommentUserID = CDataUtils.GetDSLongValue(dsComments, "user_id");

                            DataSet   dsUser = null;
                            CUserData ud     = new CUserData(this);
                            ud.GetUserDS(lCommentUserID, out dsUser);
                            string strUser = String.Empty;
                            if (!CDataUtils.IsEmpty(dsUser))
                            {
                                strUser = CDataUtils.GetDSStringValue(dsUser, "name");
                            }

                            strDS += " Overridden ";
                            strDS += CDataUtils.GetDateAsString(dtComment);
                            strDS += " ";
                            strDS += strUser;
                            strDS += "\r\n\r\n";

                            strDS += strComment;
                        }
                    }

                    //ds
                    strText += CDataUtils.DelimitString(strDS, "\r\n", 80);

                    strText += "\r\n\r\n";
                }
            }
        }

        return(status);
    }
Example #9
0
    /// <summary>
    /// US:1883 US:834 refresh multipatient view
    /// </summary>
    /// <param name="plistPatChecklistIDs"></param>
    /// <returns></returns>
    public CStatus RefreshMultiPatientChecklists(CDataConnection conn,
                                                 CData data,
                                                 DateTime dtFrom,
                                                 DateTime dtTo,
                                                 long lChecklistID,
                                                 long lServiceID,
                                                 long lChecklistStatus)
    {
        //this class is used to do all transfers
        //from MDWS to the VAPPCT database
        CMDWSTransfer xfer = new CMDWSTransfer(data);

        //get the multi patient checklist ds, uses the same filters
        // as the website form does
        DataSet      dsMulti = null;
        CPatientData pd      = new CPatientData(data);
        CStatus      status  = pd.GetMultiPatientSearchDS(
            dtFrom,
            dtTo,
            lChecklistID,
            lChecklistStatus,
            lServiceID,
            out dsMulti);

        if (!status.Status)
        {
            //write the event to the event table
            WriteEvent(data, "GetMultiPatientSearchDS", status.StatusComment);
            return(status);
        }

        foreach (DataTable table in dsMulti.Tables)
        {
            foreach (DataRow dr in table.Rows)
            {
                //checklist ID
                long lPatChecklistID = Convert.ToInt64(dr["pat_cl_id"].ToString());

                //get the items for this pat checklist id
                DataSet         dsChecklistItems = null;
                CVAPPCTCommData commData         = new CVAPPCTCommData(data);
                status = commData.GetPatChecklistItemDS(lPatChecklistID,
                                                        out dsChecklistItems);
                if (!status.Status)
                {
                    //write the event to the event table
                    WriteEvent(data, "GetPatChecklistItemDS", status.StatusComment);
                    return(status);
                }

                //refresh the checklist items
                status = RefreshPatientCheckList(
                    conn,
                    data,
                    dsChecklistItems);
                if (!status.Status)
                {
                    //write the event to the event table
                    WriteEvent(data, "RefreshPatientCheckList", status.StatusComment);
                    return(status);
                }

                //refresh the checklist collection items
                DataSet dsCLCollectionItems = null;
                status = commData.GetPatientCLCollectionItemDS(lPatChecklistID,
                                                               out dsCLCollectionItems);
                if (!status.Status)
                {
                    //write the event to the event table
                    WriteEvent(data, "GetPatientCLCollectionItemDS", status.StatusComment);
                    return(status);
                }

                //refresh the checklist items
                status = RefreshPatientCheckList(
                    conn,
                    data,
                    dsCLCollectionItems);
                if (!status.Status)
                {
                    //write the event to the event table
                    WriteEvent(data, "RefreshPatientCheckList", status.StatusComment);
                    return(status);
                }
            }
        }

        return(status);
    }
Example #10
0
    /// <summary>
    /// override
    /// US:880
    /// loads the user control with the data related to the patient checklist id stored in the patient checklist id property
    /// </summary>
    /// <param name="lEditMode"></param>
    /// <returns></returns>
    public override CStatus LoadControl(k_EDIT_MODE lEditMode)
    {
        EditMode = lEditMode;

        CPatChecklistItemData pci = new CPatChecklistItemData(BaseMstr.BaseData);
        long    lTSColStateID     = 0;
        long    lOSColStateID     = 0;
        long    lDSColStateID     = 0;
        long    lSummaryStateID   = 0;
        DataSet dsChecklistItems  = null;
        CStatus statusPatCL       = pci.GetPatCLItemsByPatCLIDDS(
            PatientChecklistID,
            out lTSColStateID,
            out lOSColStateID,
            out lDSColStateID,
            out lSummaryStateID,
            out dsChecklistItems);

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

        TSColStateID = lTSColStateID;
        OSColStateID = lOSColStateID;
        DSColStateID = lDSColStateID;

        lblSummaryState.Visible = true;
        imgSummaryState.Visible = true;
        switch (lSummaryStateID)
        {
        case (long)k_STATE_ID.Bad:
            imgSummaryState.ImageUrl = Resources.Images.STATE_BAD_LARGE;
            break;

        case (long)k_STATE_ID.Good:
            imgSummaryState.ImageUrl = Resources.Images.STATE_GOOD_LARGE;
            break;

        default:
            imgSummaryState.ImageUrl = Resources.Images.STATE_UNKNOWN_LARGE;
            break;
        }

        CPatientData p = new CPatientData(BaseMstr.BaseData);
        DataSet      dsPatientItems = null;
        CStatus      statusPatItems = p.GetPatItemsByPatCLIDDS(PatientChecklistID, out dsPatientItems);

        if (!statusPatItems.Status)
        {
            return(statusPatItems);
        }
        PatientItems = dsPatientItems.Tables[0];

        DataSet dsPatientItemComponents = null;
        CStatus statusPatItemComps      = p.GetPatItemCompsByPatCLIDDS(PatientChecklistID, out dsPatientItemComponents);

        if (!statusPatItemComps.Status)
        {
            return(statusPatItemComps);
        }
        PatientItemComponents = dsPatientItemComponents.Tables[0];

        gvPatCLItems.DataSource = dsChecklistItems.Tables[0];
        gvPatCLItems.DataBind();

        //set the ui permissions based on the users role
        SetPermissions();

        return(new CStatus());
    }
Example #11
0
    /// <summary>
    /// US:1880 method
    /// loads the selected checklist
    /// </summary>
    /// <returns></returns>
    protected CStatus LoadChecklist()
    {
        PatCLID = Convert.ToInt64(ddlPatChecklist.SelectedValue);
        if (PatCLID < 1)
        {
            return(new CStatus(false, k_STATUS_CODE.Failed, "TODO"));
        }

        CPatientChecklist pcl    = new CPatientChecklist();
        CStatus           status = pcl.LoadPatientChecklists(BaseMstr, PatientID, ddlPatChecklist);

        if (!status.Status)
        {
            return(status);
        }
        ddlPatChecklist.SelectedValue = PatCLID.ToString();

        CPatChecklistData     pcld = new CPatChecklistData(BaseMstr.BaseData);
        CPatChecklistDataItem di   = null;

        status = pcld.GetPatChecklistDI(PatCLID, out di);
        if (!status.Status)
        {
            return(status);
        }
        ddlChecklistState.SelectedValue = Convert.ToInt64(di.ChecklistStateID).ToString();
        ChecklistID      = di.ChecklistID;
        ChecklistStateID = di.ChecklistStateID;
        EnableBasedOnChecklistState();

        //enable/disable the button based on the checklist selected
        CPatChecklistData dta  = new CPatChecklistData(BaseMstr.BaseData);
        DataSet           dsCL = null;

        dta.GetOutOfDatePatCLDS(PatientID, ChecklistID, out dsCL);
        if (!CDataUtils.IsEmpty(dsCL))
        {
            btnUpdateCLVersion.Enabled = true;
            lblVersion.Text            = "New Version Available!";
        }
        else
        {
            btnUpdateCLVersion.Enabled = false;
            lblVersion.Text            = "Version is Current.";
        }


        if (!CDataUtils.IsDateNull(di.ProcedureDate))
        {
            tbProcedureDate.Text          = CDataUtils.GetDateAsString(di.ProcedureDate);
            calProcedureDate.SelectedDate = di.ProcedureDate;
            ucProcedureTime.SetTime(di.ProcedureDate);
        }
        else
        {
            tbProcedureDate.Text          = string.Empty;
            calProcedureDate.SelectedDate = null;
            ucProcedureTime.HH            = 0;
            ucProcedureTime.MM            = 0;
            ucProcedureTime.SS            = 0;
        }

        //checklist data - check for notetitle and disable tiu if we dont have one
        CChecklistData     clData      = new CChecklistData(BaseMstr.BaseData);
        CChecklistDataItem diChecklist = null;

        status = clData.GetCheckListDI(di.ChecklistID, out diChecklist);
        if (!status.Status)
        {
            return(status);
        }

        btnTIU.Enabled = (diChecklist.NoteTitleTag != "-1") ? true: false;

        CPatientData p        = new CPatientData(BaseMstr.BaseData);
        string       strBlurb = string.Empty;

        status = p.GetPatientBlurb(PatientID, out strBlurb);
        if (!status.Status)
        {
            return(status);
        }

        sPatientBlurb.InnerText = strBlurb + " for " + diChecklist.ChecklistLabel;

        ucPatCLItems.PatientChecklistID = di.PatCLID;
        ucPatCLItems.PatientID          = di.PatientID;
        ucPatCLItems.ChecklistID        = di.ChecklistID;
        status = LoadPatientChecklistItems();
        if (!status.Status)
        {
            return(status);
        }

        EnableTIU();

        return(new CStatus());
    }
Example #12
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 #13
0
    /// <summary>
    /// method
    /// US:838
    /// do the actual search for patients
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// <param name="strUserID"></param>
    /// <returns></returns>
    protected CStatus PatientLookup(
        Object sender,
        EventArgs e,
        string strUserID)
    {
        CParameterList pListStatus = null;

        //validate the user input
        CStatus status = ValidateUserInput(out pListStatus);

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

        //get values for the query

        //date from and date to
        DateTime dtFrom = CDataUtils.GetNullDate();
        DateTime dtTo   = CDataUtils.GetNullDate();

        if (chkFilterByEvent.Checked)
        {
            dtFrom = CDataUtils.GetDate(txtFromDate.Text);
            dtTo   = CDataUtils.GetDate(txtToDate.Text);
        }

        //last name
        string strLastName = String.Empty;

        if (chkLastName.Checked)
        {
            strLastName = txtLastName.Text;
        }

        //lssn
        string strLSSN = String.Empty;

        if (chkLSSN.Checked)
        {
            strLSSN = txtLSSN.Text;
        }

        //checklist id
        long lChecklistID = -1;

        if (chkChecklist.Checked)
        {
            lChecklistID = ChecklistID;
        }

        //checklist Status
        long lChecklistStatus = -1;

        if (chkChecklistStatus.Checked)
        {
            if (ddlChecklistStatus.SelectedItem != null)
            {
                if (ddlChecklistStatus.SelectedValue != "-1")
                {
                    lChecklistStatus = CDataUtils.ToLong(ddlChecklistStatus.SelectedValue);
                }
            }
        }

        //service
        long lServiceID = -1;

        if (chkFilterByCLService.Checked)
        {
            if (ddlFilterByService.SelectedItem != null)
            {
                if (ddlFilterByService.SelectedValue != "-1")
                {
                    lServiceID = CDataUtils.ToLong(ddlFilterByService.SelectedValue);
                }
            }
        }

        //do we have left side checklist criteria for the query
        bool bHasChecklistCriteria = HasChecklistCriteria(strUserID);

        //team
        string strTeamID = String.Empty;

        status = GetSelectedOptionID(
            OPTION_TEAMS,
            bHasChecklistCriteria,
            out strTeamID);
        if (!status.Status)
        {
            return(status);
        }

        //specialty
        string strSpecialtyID = String.Empty;

        status = GetSelectedOptionID(
            OPTION_SPECIALTIES,
            bHasChecklistCriteria,
            out strSpecialtyID);
        if (!status.Status)
        {
            return(status);
        }

        //ward
        string strWardID = String.Empty;

        status = GetSelectedOptionID(
            OPTION_WARDS,
            bHasChecklistCriteria,
            out strWardID);
        if (!status.Status)
        {
            return(status);
        }

        //clinic
        string strClinicID = String.Empty;

        status = GetSelectedOptionID(
            OPTION_CLINICS,
            bHasChecklistCriteria,
            out strClinicID);
        if (!status.Status)
        {
            return(status);
        }

        //if team, ward or specialty are loaded then we have criteria
        //beacause the user can search for patients without cl criteria
        //for team,ward,specialty searches
        if (!String.IsNullOrEmpty(strTeamID))
        {
            bHasChecklistCriteria = true;
        }
        if (!String.IsNullOrEmpty(strWardID))
        {
            bHasChecklistCriteria = true;
        }
        if (!String.IsNullOrEmpty(strSpecialtyID))
        {
            bHasChecklistCriteria = true;
        }
        if (!String.IsNullOrEmpty(strClinicID))
        {
            bHasChecklistCriteria = true;
        }

        //make sure some criteria is selected before searching
        if (!bHasChecklistCriteria)
        {
            status.Status        = false;
            status.StatusCode    = k_STATUS_CODE.Failed;
            status.StatusComment = "Please select at least one checklist search criteria before searching.";
            return(status);
        }

        //get a dataset matching criteria
        CPatientData pat = new CPatientData(BaseMstr.BaseData);
        DataSet      ds  = null;

        status = pat.GetPatientSearchDS(dtFrom,
                                        dtTo,
                                        strLastName,
                                        strLSSN,
                                        lChecklistID,
                                        lChecklistStatus,
                                        strUserID,
                                        strTeamID,
                                        strWardID,
                                        strSpecialtyID,
                                        strClinicID,
                                        lServiceID,
                                        out ds);
        if (status.Status)
        {
            //keep a copy of the full DS for paging if needed
            PatientDataTable = ds.Tables[0];

            //raise the event
            if (_Search != null)
            {
                _Search(sender, e);
            }
        }

        return(status);
    }
Example #14
0
    /// <summary>
    /// loads the gridview after we are done updating the checklists
    /// </summary>
    protected CStatus LoadGridView()
    {
        //done processing the logic so now load the gridview
        //set the date from and date to
        DateTime dtFrom = CDataUtils.GetNullDate();
        DateTime dtTo   = CDataUtils.GetNullDate();

        if (chkFilterByEvent.Checked)
        {
            dtFrom = CDataUtils.GetDate(txtFromDate.Text);
            dtTo   = CDataUtils.GetDate(txtToDate.Text);
        }
        MPEventStartDate = dtFrom;
        MPEventEndDate   = dtTo;

        //checklist id
        long lChecklistID = -1;

        if (chkChecklist.Checked)
        {
            lChecklistID = ChecklistID;
        }
        MPChecklistID = lChecklistID;

        //set the checklist Status
        long lChecklistStatusID = -1;

        if (chkChecklistStatus.Checked &&
            ddlChecklistStatus.SelectedItem != null &&
            ddlChecklistStatus.SelectedValue != "-1")
        {
            lChecklistStatusID = CDataUtils.ToLong(ddlChecklistStatus.SelectedValue);
        }
        MPChecklistStatusID = lChecklistStatusID;

        long lChecklistServiceID = -1;

        if (chkFilterByCLService.Checked &&
            ddlFilterByService.SelectedItem != null &&
            ddlFilterByService.SelectedValue != "-1")
        {
            lChecklistServiceID = CDataUtils.ToLong(ddlFilterByService.SelectedValue);
        }
        MPChecklistServiceID = lChecklistServiceID;

        CStatus status = GetPatients(dtFrom,
                                     dtTo,
                                     lChecklistID,
                                     lChecklistStatusID,
                                     lChecklistServiceID);

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

        AddColumns();

        gvMultiPatientView.EmptyDataText = "No result(s) found.";
        gvMultiPatientView.DataSource    = MultiPatients;
        gvMultiPatientView.DataBind();

        //now that the grid is loaded check for new versions...

        //get all the patients for the mulitpatient
        string strCLIDs  = string.Empty;
        string strPatIDs = string.Empty;

        CPatientData pat = new CPatientData(Master.BaseData);
        DataSet      dsMultiPatientSearch = null;

        status = pat.GetMultiPatientSearchDS(
            MPEventStartDate,
            MPEventEndDate,
            MPChecklistID,
            MPChecklistStatusID,
            MPChecklistServiceID,
            out dsMultiPatientSearch);
        if (!status.Status)
        {
            return(status);
        }

        //patient ids
        CDataUtils.GetDSDelimitedData(
            dsMultiPatientSearch,
            "PATIENT_ID",
            ",",
            out strPatIDs);
        strPatIDs = "," + strPatIDs;

        //pat cl ids
        CDataUtils.GetDSDelimitedData(
            dsMultiPatientSearch,
            "CHECKLIST_ID",
            ",",
            out strCLIDs);

        strCLIDs = "," + strCLIDs;

        CPatChecklistData dta  = new CPatChecklistData(Master.BaseData);
        DataSet           dsCL = null;

        status = dta.GetOutOfDatePatCLDS(
            MPEventStartDate,
            MPEventEndDate,
            MPChecklistID,
            MPChecklistStatusID,
            strPatIDs,
            strCLIDs,
            out dsCL);
        if (!status.Status)
        {
            return(status);
        }

        btnUpdateCLVersion.Enabled = (!CDataUtils.IsEmpty(dsCL)) ? true : false;
        //EnableVersionUpdate = (!CDataUtils.IsEmpty(dsCL)) ? true : false;
        upLookup.Update();

        return(new CStatus());
    }