示例#1
0
    /// <summary>
    /// event
    /// US:878
    /// saves the checklist
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void OnClickSaveChecklist(object sender, EventArgs e)
    {
        ShowMPE();

        CParameterList plistStatus = null;

        CStatus status = ValidateUserInput(out plistStatus);

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

        //if we are closing the checklist then write a note
        if (CDataUtils.ToLong(ddlChecklistState.SelectedValue) == (long)k_CHECKLIST_STATE_ID.Closed &&
            btnTIU.Enabled)
        {
            ShowTIUNote();
        }
        else
        {
            status = SaveControl();
            if (!status.Status)
            {
                ShowStatusInfo(status.StatusCode, plistStatus);
                return;
            }
        }
    }
示例#2
0
    /// <summary>
    /// selected region was changed.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            return;
        }

        if (ddlRegion.SelectedIndex != -1)
        {
            ddlSite.Items.Clear();

            DataSet   dsSite    = null;
            long      lRegionID = CDataUtils.ToLong(ddlRegion.SelectedValue);
            CSiteData siteData  = new CSiteData(BaseMstr.BaseData);

            //get all sites for this region
            siteData.GetSiteDS(lRegionID, out dsSite);
            CDropDownList.RenderDataSet(dsSite,
                                        ddlSite,
                                        "SITE_NAME",
                                        "SITE_ID");
        }

        ShowMPE();
    }
示例#3
0
    /// <summary>
    /// US:840
    /// event
    /// validates username and password fields
    /// redirects to the home page if successful
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOKLogin_Click(object sender, EventArgs e)
    {
        //login to the application through basemaster
        CStatus status = BaseMstr.AppUser.Login(txtUID.Text,
                                                txtPWD.Text,
                                                CDataUtils.ToLong(ddlSite.SelectedValue));

        if (!status.Status)
        {
            //this error seems to occur if the user gets in a state where
            //they are already logged in but try to login again. To avoid this
            //we disconnect and try one more time if we get this error
            if (status.StatusComment.ToLower().IndexOf("the remote procedure ") != -1)
            {
                BaseMstr.AppUser.LogOff();
                status = BaseMstr.AppUser.Login(txtUID.Text,
                                                txtPWD.Text,
                                                CDataUtils.ToLong(ddlSite.SelectedValue));
            }

            //if we fail then show the error
            if (!status.Status)
            {
                ShowStatusInfo(status);
                ShowMPE();
                return;
            }
        }

        //login was successful so redirect
        Response.Redirect("VAPPCTHome.aspx");
    }
示例#4
0
    protected void OnClickSearch(object sender, EventArgs e)
    {
        btnSearch.Focus();

        //get the values for the query
        string strFilterLabel = (chkFilterByName.Checked) ? txtFilterByName.Text : string.Empty;
        long   lFilterType    = (chkFilterType.Checked) ? CDataUtils.ToLong(ddlFilterType.SelectedValue) : -1;
        long   lFilterGroup   = (chkFilterByGroup.Checked) ? CDataUtils.ToLong(ddlFilterByGroup.SelectedValue) : -1;

        //get the data
        DataSet   ds       = null;
        CItemData ItemData = new CItemData(BaseMstr.BaseData);
        CStatus   status   = ItemData.GetItemDS(
            strFilterLabel,
            lFilterType,
            lFilterGroup,
            (long)Activefilter,
            out ds);

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

        ItemDataTable = ds.Tables[0];

        if (_Search != null)
        {
            _Search(this, new EventArgs());
        }
    }
示例#5
0
    /// <summary>
    /// thread assign checklist to the patients
    /// </summary>
    /// <param name="strPatientIDs"></param>
    /// <param name="lChecklistID"></param>
    /// <returns></returns>
    public CStatus ThreadRunLogic(string strPatientCLIDs)
    {
        //get the patient ids into an array
        string[] astrPatientCLIDs = strPatientCLIDs.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

        // Allow a total of pListPatients.Count threads in the pool
        int nMaxCount = astrPatientCLIDs.Count();

        if (nMaxCount == 0)
        {
            return(new CStatus());
        }

        // Mark the event as unsignaled.
        ManualResetEvent eventX = new ManualResetEvent(false);

        //array of thread objects to do work
        CMPRunLogicThread[] threads = new CMPRunLogicThread[nMaxCount];

        //initialize the work items
        for (int i = 0; i < nMaxCount; i++)
        {
            //create a work item
            threads[i] = new CMPRunLogicThread(
                this,
                CDataUtils.ToLong(astrPatientCLIDs[i]),
                nMaxCount);

            // Make sure the work items have a reference to
            //the signaling event.
            threads[i].eventX = eventX;
        }

        //queue the work items
        for (int i = 0; i < nMaxCount; i++)
        {
            ThreadPool.QueueUserWorkItem(new WaitCallback(threads[i].DoWork));
        }

        // The call to exventX.WaitOne sets the event to wait until
        // eventX.Set() occurs.
        // Wait until event is fired, meaning eventX.Set() was called:
        eventX.WaitOne(Timeout.Infinite, true);

        // The WaitOne won't return until the event has been signaled.

        //done processing so see if we have any errors
        for (int i = 0; i < nMaxCount; i++)
        {
            if (!threads[i].Status.Status)
            {
                return(threads[i].Status);
            }
        }

        return(new CStatus());
    }
示例#6
0
    /// <summary>
    /// US:891
    /// US:894
    /// event
    /// refreshes the page with vista data
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void OnRefresh(object sender, EventArgs e)
    {
        //if MDWS is on, transfer data from mdws to the vappct db
        if (Master.MDWSTransfer)
        {
            //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);
            }

            //checklist id
            long lChecklistID = -1;
            if (chkChecklist.Checked)
            {
                lChecklistID = ChecklistID;
            }

            //set the checklist Status
            long lChecklistStatus = -1;
            if (chkChecklistStatus.Checked &&
                ddlChecklistStatus.SelectedItem != null &&
                ddlChecklistStatus.SelectedValue != "-1")
            {
                lChecklistStatus = CDataUtils.ToLong(ddlChecklistStatus.SelectedValue);
            }

            //set the checklist Status
            long lChecklistServiceID = -1;
            if (chkFilterByCLService.Checked &&
                ddlFilterByService.SelectedItem != null &&
                ddlFilterByService.SelectedValue != "-1")
            {
                lChecklistServiceID = CDataUtils.ToLong(ddlFilterByService.SelectedValue);
            }

            ThreadType = k_MULTI_PAT_THREAD_TYPE.Refresh;

            GetPatCLIDs(
                dtFrom,
                dtTo,
                lChecklistID,
                lChecklistStatus,
                lChecklistServiceID);

            ProcessingCancelled = false;
            Master.ShowStatusInfo(ThreadMultiPatient());
        }
    }
示例#7
0
 /// <summary>
 /// fired when a note is successfully saved
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OnNoteSaved(object sender, CAppUserControlArgs e)
 {
     //if we are closing this checklist then save it.
     if (CDataUtils.ToLong(ddlChecklistState.SelectedValue) == (long)k_CHECKLIST_STATE_ID.Closed)
     {
         CStatus status = SaveControl();
         if (!status.Status)
         {
             ShowStatusInfo(status.StatusCode, status.StatusComment);
             return;
         }
     }
 }
示例#8
0
    /// <summary>
    /// event
    /// sets dialog title
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = "Login";
        txtUID.Focus();

        if (ddlSite.Items.Count < 1)
        {
            DataSet dsRegion = null;
            DataSet dsSite   = null;

            CSiteData siteData = new CSiteData(BaseMstr.BaseData);

            //get the regions
            CStatus status = siteData.GetRegionDS(out dsRegion);
            CDropDownList.RenderDataSet(dsRegion,
                                        ddlRegion,
                                        "REGION_NAME",
                                        "REGION_ID");

            //select the default region if set
            long lRegionID = 0;
            if (System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcRegionID"] != null)
            {
                string strRegion = System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcRegionID"].ToString();
                lRegionID = CDataUtils.ToLong(strRegion);
                CDropDownList.SelectItemByValue(ddlRegion,
                                                lRegionID);
            }

            //get all sites for this region
            status = siteData.GetSiteDS(lRegionID, out dsSite);
            CDropDownList.RenderDataSet(dsSite,
                                        ddlSite,
                                        "SITE_NAME",
                                        "SITE_ID");

            long lSiteID = 0;
            if (System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcSiteList"] != null)
            {
                string strSite = System.Configuration.ConfigurationManager.AppSettings["MDWSEmrSvcSiteList"].ToString();
                lSiteID = CDataUtils.ToLong(strSite);
                CDropDownList.SelectItemByValue(ddlSite,
                                                lSiteID);
            }
        }
    }
示例#9
0
    /// <summary>
    /// method
    /// US:838
    /// gets the selected option id given the option
    /// </summary>
    /// <param name="nOption"></param>
    /// <returns></returns>
    public CStatus GetSelectedOptionID(string strOption,
                                       bool bHasChecklistCriteria,
                                       out string strOptionID)
    {
        CStatus status = new CStatus();

        strOptionID = String.Empty;
        if (!String.IsNullOrEmpty(rblOptions.SelectedValue))
        {
            if (rblOptions.SelectedValue == strOption)
            {
                //option selected
                if (!String.IsNullOrEmpty(lbOptions.SelectedValue))
                {
                    long lTeamID = CDataUtils.ToLong(lbOptions.SelectedValue);
                    if (lTeamID > 0)
                    {
                        //set the team
                        strOptionID = lbOptions.SelectedValue;
                    }
                    else
                    {
                        //if the user chose All teams then make sure they
                        //have checklist criteria selected before running
                        //query, otherwise it takes way too long
                        if (!bHasChecklistCriteria)
                        {
                            lbOptions.SelectedIndex = -1;

                            status.Status     = false;
                            status.StatusCode = k_STATUS_CODE.Failed;
                            //todo: add comment to resources
                            status.StatusComment = "Please select additional Checklist search criteria before selecting 'All'";
                            return(status);
                        }
                    }
                }
            }
        }

        return(status);
    }
示例#10
0
        /// <summary>
        /// method
        /// checks the specified checkbox in the gridview based on a ds active field
        /// </summary>
        /// <param name="gv"></param>
        /// <param name="strCheckBoxID"></param>
        /// <param name="ds"></param>
        /// <param name="strIDFieldName"></param>
        /// <param name="strActiveFieldName"></param>
        public static void SetActive(
            GridView gv,
            string strCheckBoxID,
            DataSet ds,
            string strIDFieldName,
            string strActiveFieldName)
        {
            if (gv == null || ds == null)
            {
                return;
            }

            foreach (GridViewRow gvr in gv.Rows)
            {
                CheckBox cb = (CheckBox)gvr.FindControl(strCheckBoxID);
                if (cb == null)
                {
                    return;
                }

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    long lDSIdValue = CDataUtils.GetDSLongValue(row, strIDFieldName);
                    if (lDSIdValue < 1)
                    {
                        continue;
                    }

                    long lGVIdValue = CDataUtils.ToLong(gv.DataKeys[gvr.RowIndex].Value.ToString());
                    if (lDSIdValue == lGVIdValue)
                    {
                        long lIsActive = CDataUtils.GetDSLongValue(row, strActiveFieldName);
                        cb.Checked = (lIsActive == 1) ? true : false;
                        break;
                    }
                }
            }
        }
    /// <summary>
    /// US:1951 US:1945 method
    /// saves the values in the checklist controls as a checklist in the database
    /// </summary>
    /// <param name="lStatusCode"></param>
    /// <param name="strStatusComment"></param>
    /// <returns></returns>
    protected CStatus SaveChecklist()
    {
        CChecklistDataItem cldi = new CChecklistDataItem();

        cldi.ChecklistLabel       = txtCLLabel.Text;
        cldi.ChecklistDescription = txtCLDesc.Text;
        cldi.NoteTitleTag         = string.IsNullOrEmpty(txtCLNoteTitle.Text) ? "-1" : txtCLNoteTitle.Text;
        cldi.NoteTitleClinicID    = CDataUtils.ToLong(ddlClinics.SelectedValue);

        cldi.ServiceID = CDataUtils.ToLong(ddlCLService.SelectedValue);
        cldi.ActiveID  = (chkActive.Checked) ? k_ACTIVE_ID.Active : k_ACTIVE_ID.Inactive;

        CChecklistData CLData = new CChecklistData(BaseMstr.BaseData);
        CStatus        status = new CStatus();

        if (EditMode == k_EDIT_MODE.INSERT)
        {
            long lChecklistID = 0;
            status = CLData.InsertChecklist(cldi, out lChecklistID);
            if (status.Status)
            {
                EditMode    = k_EDIT_MODE.UPDATE;
                ChecklistID = lChecklistID;
            }
            else
            {
                EditMode    = k_EDIT_MODE.INSERT;
                ChecklistID = 0;
            }
        }
        else if (EditMode == k_EDIT_MODE.UPDATE)
        {
            cldi.ChecklistID = ChecklistID;
            status           = CLData.UpdateChecklist(cldi);
        }

        return(status);
    }
示例#12
0
    /// <summary>
    ///  US:1880 US:885 gets the note title ien (tag) for the note title passed in
    /// </summary>
    /// <param name="strNoteTitle"></param>
    /// <param name="lNoteTitleIEN"></param>
    /// <returns></returns>
    public CStatus GetNoteTitleIEN(string strNoteTitle, out long lNoteTitleIEN)
    {
        lNoteTitleIEN = 0;
        CStatus status = new CStatus();

        //make sure we have a valid note title
        if (String.IsNullOrEmpty(strNoteTitle))
        {
            //todo error?
            return(status);
        }

        DataSet dsNoteTitles = null;

        GetNoteTitleDS(out dsNoteTitles);

        //loop and find the title and return the ien
        if (!CDataUtils.IsEmpty(dsNoteTitles))
        {
            foreach (DataTable table in dsNoteTitles.Tables)
            {
                foreach (DataRow dr in table.Rows)
                {
                    string strTitle = Convert.ToString(dr["note_title_label"]);
                    if (strTitle.ToLower().Trim() ==
                        strNoteTitle.ToLower().Trim())
                    {
                        lNoteTitleIEN = CDataUtils.ToLong(Convert.ToString(dr["note_title_tag"]));
                        break;
                    }
                }
            }
        }

        return(status);
    }
示例#13
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;
    }
示例#14
0
    /// <summary>
    /// US:894
    /// US:899
    /// user clicked the search button
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void OnClickSearch(object sender, EventArgs e)
    {
        Master.ClearStatusInfo();

        CParameterList pListStatus = null;
        CStatus        status      = ValidateUserInput(out pListStatus);

        if (!status.Status)
        {
            Master.ShowStatusInfo(status.StatusCode, pListStatus);
            return;
        }

        //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);
        }

        //checklist id
        long lChecklistID = -1;

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

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

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

        ThreadType = k_MULTI_PAT_THREAD_TYPE.Logic;


        //service
        long lServiceID = -1;

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

        //has checklist service
        bool bHasChecklistService = false;

        if (ddlFilterByService.SelectedIndex > 0)
        {
            if (chkFilterByCLService.Checked)
            {
                bHasChecklistService = true;
            }
        }

        //get patient checklist ids
        GetPatCLIDs(
            dtFrom,
            dtTo,
            lChecklistID,
            lChecklistStatusID,
            lServiceID);

        ProcessingCancelled = false;

        //thread off the multi patient search
        status = ThreadMultiPatient();

        //handle a bad status that comes back with no message
        if (!status.Status)
        {
            if (String.IsNullOrEmpty(status.StatusComment))
            {
                status.StatusComment = "An error occured while processing records!";
            }
        }

        //show the status
        Master.ShowStatusInfo(status);
    }
示例#15
0
    /// <summary>
    /// US:834 Connect to the database using info from the
    /// app.config file will also load a CData object for use
    /// by other data classes and setup the connectsion to MDWS and
    /// return a mdwsSOAPClient for accessing MDWD methods
    /// </summary>
    /// <param name="lStatusCode"></param>
    /// <param name="strStatus"></param>
    /// <returns></returns>
    public CStatus Connect(out CData data,
                           out EmrSvcSoapClient mdwsSOAPClient)
    {
        data           = null;
        mdwsSOAPClient = null;

        //initialize parameters
        string strConnString = String.Empty;
        bool   bAudit        = false;

        //get the connection info from the web.config
        CStatus status = new CStatus();

        status = GetConnectionInfo(out strConnString, out bAudit);
        if (!status.Status)
        {
            return(status);
        }

        //Connect to the db, if successful caller can use the
        //CDataConnection::Conn property for access to the DB connection
        status = Connect(strConnString, bAudit);
        if (!status.Status)
        {
            //todo handle error
            return(status);
        }

        //create a new base data object
        //todo: more later
        //
        //get the ipaddress
        string      strIPAddress = String.Empty;
        string      strHost      = System.Net.Dns.GetHostName();
        IPHostEntry host;

        host = Dns.GetHostEntry(strHost);
        foreach (IPAddress ip in host.AddressList)
        {
            strIPAddress = ip.ToString();
        }

        //build the base data item used by data classes
        string strNow = CDataUtils.GetDateTimeAsString(DateTime.Now);

        data = new CData(this,
                         strIPAddress,
                         0,
                         "VAPPCTCOMM_" + strNow,
                         null,
                         true);

        //comm data class
        CVAPPCTCommData commData = new CVAPPCTCommData(data);

        //login to MDWS
        long     lUserID = 0;
        CMDWSOps ops     = new CMDWSOps(data);

        //uid and pwd need come from config file:
        //TODO: they need to be encrypted
        status = ops.MDWSLogin(ConfigurationSettings.AppSettings["MDWSEmrSvcUID"],
                               ConfigurationSettings.AppSettings["MDWSEmrSvcPWD"],
                               CDataUtils.ToLong(ConfigurationSettings.AppSettings["MDWSEmrSvcSiteList"]),
                               out lUserID,
                               out mdwsSOAPClient);
        if (!status.Status)
        {
            commData.SaveCommEvent("MDWSLogin_FAILED",
                                   status.StatusComment);
            return(status);
        }

        //set the user id on the CData object
        data.UserID = lUserID;

        //create the session so that we can call stored proc
        CUserData ud             = new CUserData(data);
        string    strFXSessionID = String.Empty;

        status = ud.CreateFXSession(out strFXSessionID);
        if (!status.Status)
        {
            commData.SaveCommEvent("MDWSSessionCreate_FAILED",
                                   status.StatusComment);
            return(status);
        }

        return(status);
    }
示例#16
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());
    }
示例#17
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);
    }
示例#18
0
        /// <summary>
        /// get the selected id as a long
        /// </summary>
        /// <param name="ddl"></param>
        /// <returns></returns>
        public static long GetSelectedLongID(DropDownList ddl)
        {
            string strID = GetSelectedID(ddl);

            return(CDataUtils.ToLong(strID));
        }