Beispiel #1
0
    /// <summary>
    /// US:1883 US:834 refresh a patient checklist
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="strPatChecklistID"></param>
    /// <returns></returns>
    public CStatus RefreshPatientCheckList(CDataConnection conn,
                                           CData data,
                                           string strPatientID,
                                           long lPatChecklistID)
    {
        //todo: check conn and data before continuing

        //get all the items for this patient checklist
        DataSet         dsChecklistItems = null;
        CVAPPCTCommData commData         = new CVAPPCTCommData(data);
        CStatus         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);
    }
Beispiel #2
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);
    }
Beispiel #3
0
    /// <summary>
    /// do the actual work of assigning the checklist
    /// </summary>
    /// <param name="state"></param>
    public void DoWork(Object state)
    {
        //thread hashcount work
        lock (HashCount)
        {
            if (!HashCount.ContainsKey(Thread.CurrentThread.GetHashCode()))
            {
                HashCount.Add(Thread.CurrentThread.GetHashCode(), 0);
            }

            HashCount[Thread.CurrentThread.GetHashCode()] = ((int)HashCount[Thread.CurrentThread.GetHashCode()]) + 1;
        }

        //create a new connection for the thread
        CDataDBConn conn = new CDataDBConn();

        conn.Connect();
        CData data = new CData(conn,
                               this.ClientIP,
                               this.UserID,
                               this.SessionID,
                               this.WebSession,
                               this.MDWSTransfer);
        //do real work here

        //get the items for this pat checklist id
        CStatus         status           = new CStatus();
        DataSet         dsChecklistItems = null;
        CVAPPCTCommData commData         = new CVAPPCTCommData(data);

        status = commData.GetPatChecklistItemDS(PatientChecklistID,
                                                out dsChecklistItems);
        if (!status.Status)
        {
            //todo
        }
        else
        {
            CCommunicator comm = new CCommunicator();

            //refresh the checklist items
            status = comm.RefreshPatientCheckList(conn,
                                                  data,
                                                  dsChecklistItems);
            if (!status.Status)
            {
                //todo:
            }
            else
            {
                //refresh the checklist collection items
                DataSet dsCLCollectionItems = null;
                status = commData.GetPatientCLCollectionItemDS(PatientChecklistID,
                                                               out dsCLCollectionItems);
                if (!status.Status)
                {
                    //todo:
                }
                else
                {
                    //refresh the checklist items
                    status = comm.RefreshPatientCheckList(conn,
                                                          data,
                                                          dsCLCollectionItems);
                    if (!status.Status)
                    {
                        //todo
                    }
                }
            }
        }

        //cleanup the database connection
        conn.Close();

        //signals we are done.
        Interlocked.Increment(ref ThreadCount);
        if (ThreadCount == ThreadMax)
        {
            if (eventX != null)
            {
                eventX.Set();
                ThreadCount = 0;
                ThreadMax   = 0;
            }
        }
    }