/// <summary> /// event /// pulls the latest data from MDWS and loads the checklist items' /// everytime the timer ticks /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnRefresh(object sender, EventArgs e) { ShowMPE(); CStatus status = null; if (BaseMstr.MDWSTransfer) { //get the selected patient checklist id long lPatCLID = Convert.ToInt64(ddlPatChecklist.SelectedValue); //talk to the communicator to update the //patient checklist from mdws CCommunicator com = new CCommunicator(); status = com.RefreshPatientCheckList( BaseMstr.DBConn, BaseMstr.BaseData, PatientID, lPatCLID); if (!status.Status) { ShowStatusInfo(status); return; } } status = LoadChecklist(); if (!status.Status) { ShowStatusInfo(status); } //set the UI permissions based on the user logged in SetPermissions(btnTIU.Enabled); }
protected void OnContinueExisting(object sender, CAppUserControlArgs e) { CPatChecklistDataItem di = new CPatChecklistDataItem(); di.ProcedureDate = CDataUtils.GetNullDate(); di.AssignmentDate = DateTime.Now; di.ChecklistID = ucExistingChecklist.ChecklistID; di.ChecklistStateID = k_CHECKLIST_STATE_ID.Open; di.PatientID = PatientID; di.StateID = k_STATE_ID.Unknown; long lPatCLID = 0; CPatChecklistData pcld = new CPatChecklistData(BaseMstr.BaseData); CStatus status = pcld.InsertPatChecklist(di, out lPatCLID); if (!status.Status) { ShowStatusInfo(status); return; } if (BaseMstr.MDWSTransfer) { //talk to the communicator to update the //patient checklist from mdws CCommunicator com = new CCommunicator(); status = com.RefreshPatientCheckList( BaseMstr.DBConn, BaseMstr.BaseData, PatientID, lPatCLID); if (!status.Status) { ShowStatusInfo(status); return; } } CPatientChecklist pcl = new CPatientChecklist(); status = pcl.LoadPatientChecklists(BaseMstr, PatientID, ddlPatChecklist); if (!status.Status) { ShowStatusInfo(status); return; } ddlPatChecklist.SelectedValue = lPatCLID.ToString(); status = LoadChecklist(); if (!status.Status) { ShowStatusInfo(status); return; } //set the UI permissions based on the user logged in SetPermissions(btnTIU.Enabled); }
/// <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; } } }
/// <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; } } }