예제 #1
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
        CPatientChecklistLogic pcll = new CPatientChecklistLogic(data);

        Status = pcll.RunLogic(PatientChecklistID);

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

        //do the real work here
        //////////////////////////////////////////////////////////////

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


        CPatChecklistData     pcl          = new CPatChecklistData(data);
        string                strPatientID = PatientID;
        CPatChecklistDataItem di           = new CPatChecklistDataItem();

        di.ProcedureDate    = CDataUtils.GetNullDate();
        di.AssignmentDate   = DateTime.Now;
        di.ChecklistID      = ChecklistID;
        di.ChecklistStateID = k_CHECKLIST_STATE_ID.Open;
        di.PatientID        = strPatientID;
        di.StateID          = k_STATE_ID.Unknown;

        long lPatCLID = 0;

        Status = pcl.InsertPatChecklist(di, out lPatCLID);
        if (Status.Status)
        {
            if (MDWSTransfer)
            {
                //talk to the communicator to update the
                //patient checklist from mdws
                CCommunicator com = new CCommunicator();
                Status = com.RefreshPatientCheckList(
                    conn,
                    data,
                    strPatientID,
                    lPatCLID);
            }

            if (Status.Status)
            {
                CPatientChecklistLogic pcll = new CPatientChecklistLogic(data);
                Status = pcll.RunLogic(lPatCLID);
            }
        }

        //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;
            }
        }
    }
예제 #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;
            }
        }
    }