Exemple #1
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);
    }
Exemple #3
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());
    }