/// <summary> /// override /// US:878 /// saves the checklist /// </summary> /// <param name="lStatusCode"></param> /// <param name="strStatusComment"></param> /// <returns></returns> public override CStatus SaveControl() { CPatChecklistData pcld = new CPatChecklistData(BaseMstr.BaseData); CPatChecklistDataItem di = null; CStatus status = pcld.GetPatChecklistDI(Convert.ToInt64(ddlPatChecklist.SelectedValue), out di); if (!status.Status) { return(status); } di.ChecklistStateID = (k_CHECKLIST_STATE_ID)Convert.ToInt64(ddlChecklistState.SelectedValue); di.ProcedureDate = CDataUtils.GetDate( tbProcedureDate.Text, ucProcedureTime.HH, ucProcedureTime.MM, ucProcedureTime.SS); status = pcld.UpdatePatChecklist(di); if (!status.Status) { return(status); } return(new CStatus()); }
/// <summary> /// method /// US:911 /// cancels the checklist specified by the patient checklist id /// </summary> /// <param name="lPatCLID"></param> /// <returns></returns> private CStatus CancelChecklist(long lPatCLID) { CPatChecklistData PatChecklist = new CPatChecklistData(BaseData); CPatChecklistDataItem di = null; CStatus status = PatChecklist.GetPatChecklistDI(lPatCLID, out di); if (!status.Status) { return(status); } di.ChecklistStateID = k_CHECKLIST_STATE_ID.Cancelled; return(PatChecklist.UpdatePatChecklist(di)); }
/// <summary> /// event /// displays the edit checklist item component dialog /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnClickEditItem(object sender, EventArgs e) { CPatChecklistData pcld = new CPatChecklistData(BaseMstr.BaseData); CPatChecklistDataItem di = null; CStatus status = pcld.GetPatChecklistDI(PatientChecklistID, out di); if (!status.Status) { ShowStatusInfo(k_STATUS_CODE.Failed, Resources.ErrorMessages.ERROR_SP_CURCHECKLIST); return; } if (di.ChecklistStateID == k_CHECKLIST_STATE_ID.Cancelled || di.ChecklistStateID == k_CHECKLIST_STATE_ID.Closed) { ShowStatusInfo(k_STATUS_CODE.Failed, Resources.ErrorMessages.ERROR_SP_CHECKLISTSTATE); return; } Button btnSender = (Button)sender; if (btnSender == null) { ShowStatusInfo(k_STATUS_CODE.Failed, Resources.ErrorMessages.ERROR_SP_ITEM); return; } ucItemEditor.PatientID = PatientID; ucItemEditor.ChecklistID = ChecklistID; ucItemEditor.ItemID = Convert.ToInt64(btnSender.Attributes["ITEM_ID"]); ucItemEditor.ChecklistItemID = Convert.ToInt64(btnSender.Attributes["ITEM_ID"]); ucItemEditor.PatientChecklistID = PatientChecklistID; k_EDIT_MODE lEditMode = k_EDIT_MODE.INITIALIZE; status = ucItemEditor.LoadControl(lEditMode); if (!status.Status) { ShowStatusInfo(status); return; } ucItemEditor.ShowMPE(); }
/// <summary> /// override /// validates the checklist's fields /// </summary> /// <param name="lStatusCode"></param> /// <param name="plistStatus"></param> /// <returns></returns> public override CStatus ValidateUserInput(out CParameterList plistStatus) { plistStatus = new CParameterList(); CPatChecklistData pcld = new CPatChecklistData(BaseMstr.BaseData); CPatChecklistDataItem di = null; CStatus status = pcld.GetPatChecklistDI(Convert.ToInt64(ddlPatChecklist.SelectedValue), out di); if (!status.Status) { plistStatus.AddInputParameter("ERROR_SP_CURCHECKLIST", Resources.ErrorMessages.ERROR_SP_CURCHECKLIST); return(status); } if (ChecklistStateID != di.ChecklistStateID && (di.ChecklistStateID == k_CHECKLIST_STATE_ID.Cancelled || di.ChecklistStateID == k_CHECKLIST_STATE_ID.Closed)) { plistStatus.AddInputParameter("ERROR_SP_CHECKLISTSTATE", Resources.ErrorMessages.ERROR_SP_CHECKLISTSTATE); status.Status = false; status.StatusCode = k_STATUS_CODE.Failed; return(status); } DateTime dtProceduteDate = CDataUtils.GetDate( tbProcedureDate.Text, ucProcedureTime.HH, ucProcedureTime.MM, ucProcedureTime.SS); if (dtProceduteDate != CDataUtils.GetNullDate() && dtProceduteDate < DateTime.Now) { plistStatus.AddInputParameter("ERROR_PROCEDURE_DATE", Resources.ErrorMessages.ERROR_PROCEDURE_DATE); } if (plistStatus.Count > 0) { status.Status = false; status.StatusCode = k_STATUS_CODE.Failed; } return(status); }
/// <summary> /// method /// US:902 /// runs the logic for the specified patient checklist if it is open /// </summary> /// <param name="lPatCLID"></param> /// <returns></returns> public CStatus RunLogic(long lPatCLID) { CPatChecklistData pcl = new CPatChecklistData(this); CPatChecklistDataItem di = null; CStatus status = pcl.GetPatChecklistDI(lPatCLID, out di); if (!status.Status) { return(status); } if (di.ChecklistStateID != k_CHECKLIST_STATE_ID.Open) { return(new CStatus()); } DataSet dsChecklistItems = null; CPatChecklistItemData pcli = new CPatChecklistItemData(this); status = pcli.GetPatCLItemsByPatCLIDDS(lPatCLID, out dsChecklistItems); if (!status.Status) { return(status); } foreach (DataRow drItem in dsChecklistItems.Tables[0].Rows) { try { //get the item type id long lItemTypeID = Convert.ToInt64(drItem["ITEM_TYPE_ID"]); string strPatientID = drItem["PATIENT_ID"].ToString(); long lPatChecklistID = Convert.ToInt64(drItem["PAT_CL_ID"]); long lChecklistID = Convert.ToInt64(drItem["CHECKLIST_ID"]); long lItemID = Convert.ToInt64(drItem["ITEM_ID"]); CExpressionList expList = new CExpressionList( this, drItem["PATIENT_ID"].ToString(), Convert.ToInt64(drItem["PAT_CL_ID"]), Convert.ToInt64(drItem["CHECKLIST_ID"]), Convert.ToInt64(drItem["ITEM_ID"])); status = expList.Load(drItem["LOGIC"].ToString()); if (!status.Status) { return(status); } //run the default logic for the collection if (lItemTypeID == (long)k_ITEM_TYPE_ID.Collection) { CItemCollectionData ColData = new CItemCollectionData(this); status = ColData.RunCollectionLogic(strPatientID, lPatChecklistID, lChecklistID, lItemID); if (!status.Status) { return(status); } } //run custom logic for the item status = expList.Evaluate(); if (!status.Status) { return(status); } } catch (Exception) { return(new CStatus( false, k_STATUS_CODE.Failed, LogicModuleMessages.ERROR_RUN_LOGIC)); } } return(new CStatus()); }
/// <summary> /// US:1956 US:885 load the control with data /// </summary> /// <param name="lEditMode"></param> /// <returns></returns> public override CStatus LoadControl(k_EDIT_MODE lEditMode) { CStatus status = CClinic.LoadClinicDLL(BaseMstr.BaseData, ddlClinics); if (!status.Status) { return(status); } //load the tiu note string strTIU = String.Empty; string strNoteTitle = String.Empty; CPatChecklistData clData = new CPatChecklistData(BaseMstr.BaseData); status = clData.GetTIUText( PatientID, PatChecklistID, out strNoteTitle, out strTIU); if (!status.Status) { return(status); } //keep the note title as a property NoteTitle = strNoteTitle; //select the note title default clinic from the checklist CPatChecklistDataItem pdi = new CPatChecklistDataItem(); status = clData.GetPatChecklistDI(PatChecklistID, out pdi); if (!status.Status) { return(status); } CChecklistDataItem cli = new CChecklistDataItem(); CChecklistData cld = new CChecklistData(BaseMstr.BaseData); status = cld.GetCheckListDI(pdi.ChecklistID, out cli); if (!status.Status) { return(status); } if (cli.NoteTitleClinicID > 0) { ddlClinics.SelectedValue = cli.NoteTitleClinicID.ToString(); } //show the note title at the top of the popup lblNoteTitle.Text = strNoteTitle; //the note title tag is the title of the note, but we need the ien //to write the note... long lNoteTitleIEN = 0; CNoteTitleData nd = new CNoteTitleData(BaseMstr.BaseData); status = nd.GetNoteTitleIEN(strNoteTitle, out lNoteTitleIEN); if (!status.Status) { return(status); } NoteTitleIEN = Convert.ToString(lNoteTitleIEN); //set the text for the note txtTIU.Text = strTIU; return(new CStatus()); }
/// <summary> /// US:1880 method /// loads the selected checklist /// </summary> /// <returns></returns> protected CStatus LoadChecklist() { PatCLID = Convert.ToInt64(ddlPatChecklist.SelectedValue); if (PatCLID < 1) { return(new CStatus(false, k_STATUS_CODE.Failed, "TODO")); } CPatientChecklist pcl = new CPatientChecklist(); CStatus status = pcl.LoadPatientChecklists(BaseMstr, PatientID, ddlPatChecklist); if (!status.Status) { return(status); } ddlPatChecklist.SelectedValue = PatCLID.ToString(); CPatChecklistData pcld = new CPatChecklistData(BaseMstr.BaseData); CPatChecklistDataItem di = null; status = pcld.GetPatChecklistDI(PatCLID, out di); if (!status.Status) { return(status); } ddlChecklistState.SelectedValue = Convert.ToInt64(di.ChecklistStateID).ToString(); ChecklistID = di.ChecklistID; ChecklistStateID = di.ChecklistStateID; EnableBasedOnChecklistState(); //enable/disable the button based on the checklist selected CPatChecklistData dta = new CPatChecklistData(BaseMstr.BaseData); DataSet dsCL = null; dta.GetOutOfDatePatCLDS(PatientID, ChecklistID, out dsCL); if (!CDataUtils.IsEmpty(dsCL)) { btnUpdateCLVersion.Enabled = true; lblVersion.Text = "New Version Available!"; } else { btnUpdateCLVersion.Enabled = false; lblVersion.Text = "Version is Current."; } if (!CDataUtils.IsDateNull(di.ProcedureDate)) { tbProcedureDate.Text = CDataUtils.GetDateAsString(di.ProcedureDate); calProcedureDate.SelectedDate = di.ProcedureDate; ucProcedureTime.SetTime(di.ProcedureDate); } else { tbProcedureDate.Text = string.Empty; calProcedureDate.SelectedDate = null; ucProcedureTime.HH = 0; ucProcedureTime.MM = 0; ucProcedureTime.SS = 0; } //checklist data - check for notetitle and disable tiu if we dont have one CChecklistData clData = new CChecklistData(BaseMstr.BaseData); CChecklistDataItem diChecklist = null; status = clData.GetCheckListDI(di.ChecklistID, out diChecklist); if (!status.Status) { return(status); } btnTIU.Enabled = (diChecklist.NoteTitleTag != "-1") ? true: false; CPatientData p = new CPatientData(BaseMstr.BaseData); string strBlurb = string.Empty; status = p.GetPatientBlurb(PatientID, out strBlurb); if (!status.Status) { return(status); } sPatientBlurb.InnerText = strBlurb + " for " + diChecklist.ChecklistLabel; ucPatCLItems.PatientChecklistID = di.PatCLID; ucPatCLItems.PatientID = di.PatientID; ucPatCLItems.ChecklistID = di.ChecklistID; status = LoadPatientChecklistItems(); if (!status.Status) { return(status); } EnableTIU(); return(new CStatus()); }