/// <summary> /// Used to get a dataset holding 1 item group by id /// </summary> /// <param name="lCheckListID"></param> /// <param name="cli"></param> /// <returns></returns> public CStatus GetCheckListDI(long lCheckListID, out CChecklistDataItem cli) { //initialize parameters cli = null; //create a status object and check for valid dbconnection CStatus status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); pList.AddInputParameter("pi_nCheckListID", lCheckListID); //get the dataset DataSet ds = null; CDataSet cds = new CDataSet(); status = cds.GetOracleDataSet(DBConn, "PCK_CHECKLIST.GetCheckListRS", pList, out ds); if (status.Status) { cli = new CChecklistDataItem(ds); } return(status); }
/// <summary> /// enable/disable tiu note button /// </summary> protected void EnableTIU() { if (ddlPatChecklist.SelectedValue != string.Empty) { long lPatCLID = Convert.ToInt32(ddlPatChecklist.SelectedValue); //checklist data CChecklistDataItem diChecklist = new CChecklistDataItem(); CChecklistData clData = new CChecklistData(BaseMstr.BaseData); clData.GetCheckListDI(ChecklistID, out diChecklist); string strNoteTitleTag = diChecklist.NoteTitleTag; if (strNoteTitleTag == null) { btnTIU.Enabled = false; return; } else { btnTIU.Enabled = true; } if (strNoteTitleTag == "-1") { btnTIU.Enabled = false; } else { btnTIU.Enabled = true; } } else { btnTIU.Enabled = false; } }
/// <summary> /// US:1951 US:1945 Used to update a checkList /// </summary> /// <param name="cli"></param> /// <returns></returns> public CStatus UpdateChecklist(CChecklistDataItem cli) { //create a status object and check for valid dbconnection CStatus status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); //add the rest of the parameters pList.AddInputParameter("pi_nChecklistID", cli.ChecklistID); pList.AddInputParameter("pi_vChecklistLabel", cli.ChecklistLabel); pList.AddInputParameter("pi_nServiceID", cli.ServiceID); pList.AddInputParameter("pi_vChecklistDescription", cli.ChecklistDescription); pList.AddInputParameter("pi_nActiveID", (long)cli.ActiveID); pList.AddInputParameter("pi_vNoteTitleTag", cli.NoteTitleTag); pList.AddInputParameter("pi_nNoteTitleClinicID", cli.NoteTitleClinicID); //execute the SP return(DBConn.ExecuteOracleSP("PCK_CHECKLIST.UpdateChecklist", pList)); }
/// <summary> /// event /// US:838 /// user selected a checklist item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnChecklistSelect(object sender, CAppUserControlArgs e) { CChecklistData cld = new CChecklistData(BaseMstr.BaseData); CChecklistDataItem di = null; CStatus status = cld.GetCheckListDI(Convert.ToInt32(e.EventData), out di); if (!status.Status) { ShowStatusInfo(status); } txtChecklist.Text = di.ChecklistLabel; ChecklistID = di.ChecklistID; }
/// <summary> /// override /// loads the dialog's controls with the checklist label of the specified checklist /// </summary> /// <param name="lEditMode"></param> /// <returns></returns> public override CStatus LoadControl(k_EDIT_MODE lEditMode) { Title = "Copy Checklist"; txtAs.Focus(); //get the current checklist name and show it CChecklistDataItem di = new CChecklistDataItem(); CChecklistData dta = new CChecklistData(BaseMstr.BaseData); CStatus status = dta.GetCheckListDI(ChecklistID, out di); if (!status.Status) { return(status); } lblTarget.Text = di.ChecklistLabel; return(new CStatus()); }
/// <summary> /// event /// US:838 /// captures the selected checklist id and displays the selected checklist's label /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnChecklistSelect(object sender, CAppUserControlArgs e) { ChecklistID = Convert.ToInt32(e.EventData); if (ChecklistID < 1) { Master.ShowStatusInfo(k_STATUS_CODE.Failed, "TODO"); return; } CChecklistData cld = new CChecklistData(Master.BaseData); CChecklistDataItem di = new CChecklistDataItem(); CStatus status = cld.GetCheckListDI(ChecklistID, out di); if (!status.Status) { Master.ShowStatusInfo(status); return; } tbChecklist.Text = di.ChecklistLabel; }
/// <summary> /// US:1951 US:1945 User to insert a checkList /// </summary> /// <param name="cli"></param> /// <param name="lChecklistID"></param> /// <returns></returns> public CStatus InsertChecklist(CChecklistDataItem cli, out long lChecklistID) { //initialize parameters lChecklistID = 0; //create a status object and check for valid dbconnection CStatus status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); //add the rest of the parameters pList.AddInputParameter("pi_vChecklistLabel", cli.ChecklistLabel); pList.AddInputParameter("pi_nServiceID", cli.ServiceID); pList.AddInputParameter("pi_vChecklistDescription", cli.ChecklistDescription); pList.AddInputParameter("pi_nIsActive", (long)cli.ActiveID); pList.AddInputParameter("pi_vNoteTitleTag", cli.NoteTitleTag); pList.AddInputParameter("pi_nNoteTitleClinicID", cli.NoteTitleClinicID); pList.AddOutputParameter("po_nChecklistID", lChecklistID); //execute the SP status = DBConn.ExecuteOracleSP("PCK_CHECKLIST.InsertChecklist", pList); if (status.Status) { //get the TS_ID returned from the SP call lChecklistID = pList.GetParamLongValue("po_nChecklistID"); } return(status); }
/// <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); }
/// <summary> /// Generates the TIU text for a patient checklist /// </summary> /// <param name="strPatientID"></param> /// <param name="lPatCLID"></param> /// <param name="strText"></param> /// <returns></returns> public CStatus GetTIUText(string strPatientID, long lPatCLID, out string strNoteTitleTag, out string strText) { strText = string.Empty; strNoteTitleTag = string.Empty; CStatus status = new CStatus(); //patient data - get the di just in case we need more than the blurb CPatientDataItem diPat = new CPatientDataItem(); CPatientData patData = new CPatientData(this); status = patData.GetPatientDI(strPatientID, out diPat); //get the patient blurb string strBlurb = String.Empty; patData.GetPatientBlurb(strPatientID, out strBlurb); //build the TIU note text... //legend strText += "Definitions:\r\n"; //ts strText += CDataUtils.DelimitString("TS = The temporal state of an attribute defines whether the patient has had the test or event within a given time period", "\r\n", 80); strText += "\r\n"; //os strText += CDataUtils.DelimitString("OS = The outcome state of an attribute defines the resultant state of an attribute (e.g. normal, abnormal, problem/decision required)", "\r\n", 80); strText += "\r\n"; //ds strText += CDataUtils.DelimitString("DS = The decision state of an attribute defines a rule-based state of an attribute (e.g. Go, No-Go)", "\r\n", 80); strText += "\r\n"; strText += "\r\n"; DateTime dtNoteDate = DateTime.Now; string strNoteDate = CDataUtils.GetDateTimeAsString(dtNoteDate); strText += "Date: " + strNoteDate; strText += "\r\n\r\n"; //--demographics strText += CDataUtils.DelimitString(strBlurb, "\r\n", 80); strText += "\r\n"; //patient checklist data CPatChecklistDataItem diPatChecklist = new CPatChecklistDataItem(); status = GetPatChecklistDI(lPatCLID, out diPatChecklist); //checklist data CChecklistDataItem diChecklist = new CChecklistDataItem(); CChecklistData clData = new CChecklistData(this); status = clData.GetCheckListDI(diPatChecklist.ChecklistID, out diChecklist); //get the note title tag for the checklist, this is used to //write the correct note to MDWS strNoteTitleTag = diChecklist.NoteTitleTag; //--Checklist Name strText += "Checklist: "; strText += CDataUtils.DelimitString(diChecklist.ChecklistLabel, "\r\n", 80); strText += "\r\n"; //--Procedure Date strText += "Procedure Date: "; if (!CDataUtils.IsDateNull(diPatChecklist.ProcedureDate)) { strText += CDataUtils.GetDateAsString(diPatChecklist.ProcedureDate); } else { strText += "None"; } strText += "\r\n\r\n"; //patient checklist items and overall state long lColTSStateID = 0; long lColOSStateID = 0; long lColDSStateID = 0; long lSummaryStateID = 0; DataSet dsItems = null; CPatChecklistItemData diCLI = new CPatChecklistItemData(this); status = diCLI.GetPatCLItemsByPatCLIDDS(lPatCLID, out lColTSStateID, out lColOSStateID, out lColDSStateID, out lSummaryStateID, out dsItems); //--overall Checklist state string strOverallState = "Unknown"; switch (lSummaryStateID) { case (long)k_STATE_ID.Bad: strOverallState = "Bad"; break; case (long)k_STATE_ID.Good: strOverallState = "Good"; break; } strText += "Overall Checklist State: "; strText += strOverallState; strText += "\r\n\r\n"; strText += "Checklist Items:"; strText += "\r\n\r\n"; //loop over checklist items foreach (DataTable table in dsItems.Tables) { foreach (DataRow dr in table.Rows) { CPatChecklistItemDataItem itm = new CPatChecklistItemDataItem(dr); if (itm != null) { //get the data for the item CItemDataItem idi = new CItemDataItem(); CItemData itmData = new CItemData(this); itmData.GetItemDI(itm.ItemID, out idi); strText += CDataUtils.DelimitString("* " + idi.ItemLabel, "\r\n", 80); strText += "\r\n"; //temporal state CTemporalStateDataItem diTSi = new CTemporalStateDataItem(); CTemporalStateData tsdi = new CTemporalStateData(this); tsdi.GetTemporalStateDI(itm.TSID, out diTSi); strText += "TS: "; strText += CDataUtils.DelimitString(diTSi.TSLabel, "\r\n", 80); strText += " "; //outcome state COutcomeStateDataItem diOSi = new COutcomeStateDataItem(); COutcomeStateData osdi = new COutcomeStateData(this); osdi.GetOutcomeStateDI(itm.OSID, out diOSi); strText += "OS: "; strText += CDataUtils.DelimitString(diOSi.OSLabel, "\r\n", 80); strText += " "; //decision state CDecisionStateDataItem diDSi = new CDecisionStateDataItem(); CDecisionStateData dsdi = new CDecisionStateData(this); dsdi.GetDecisionStateDI(itm.DSID, out diDSi); string strDS = String.Empty; strDS += "DS: "; strDS += diDSi.DSLabel; //if decision state is overriden pull out the //last comment if (itm.IsOverridden == k_TRUE_FALSE_ID.True) { DataSet dsComments = null; //todo: override history is now stored in a diff table //this is obsolete will delete after testing //status = diCLI.GetPatientItemCommmentDS( // itm.PatCLID, // itm.ItemID, // out dsComments); status = diCLI.GetPatItemOverrideCommmentDS(itm.PatCLID, itm.ChecklistID, itm.ItemID, out dsComments); //first record is the newest comment if (!CDataUtils.IsEmpty(dsComments)) { //string strComment = CDataUtils.GetDSStringValue(dsComments, "comment_text"); //DateTime dtComment = CDataUtils.GetDSDateTimeValue(dsComments, "comment_date"); // string strComment = CDataUtils.GetDSStringValue(dsComments, "override_comment"); DateTime dtComment = CDataUtils.GetDSDateTimeValue(dsComments, "override_date"); long lCommentUserID = CDataUtils.GetDSLongValue(dsComments, "user_id"); DataSet dsUser = null; CUserData ud = new CUserData(this); ud.GetUserDS(lCommentUserID, out dsUser); string strUser = String.Empty; if (!CDataUtils.IsEmpty(dsUser)) { strUser = CDataUtils.GetDSStringValue(dsUser, "name"); } strDS += " Overridden "; strDS += CDataUtils.GetDateAsString(dtComment); strDS += " "; strDS += strUser; strDS += "\r\n\r\n"; strDS += strComment; } } //ds strText += CDataUtils.DelimitString(strDS, "\r\n", 80); strText += "\r\n\r\n"; } } } return(status); }
/// <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:1951 US:1945 method /// loads checklist data from the database into the checklist's controls /// </summary> /// <param name="lStatusCode"></param> /// <param name="strStatusComment"></param> /// <returns></returns> protected CStatus LoadChecklist() { CChecklistData cld = new CChecklistData(BaseMstr.BaseData); CChecklistDataItem clData = null; CStatus status = cld.GetCheckListDI(ChecklistID, out clData); if (!status.Status) { return(status); } ChecklistID = clData.ChecklistID; txtCLLabel.Text = clData.ChecklistLabel; txtCLNoteTitle.Text = clData.NoteTitleTag; if (txtCLNoteTitle.Text == "-1") { txtCLNoteTitle.Text = ""; } chkActive.Checked = (clData.ActiveID == k_ACTIVE_ID.Active) ? true : false; txtCLDesc.Text = clData.ChecklistDescription; try { ddlClinics.SelectedValue = Convert.ToString(clData.NoteTitleClinicID); } catch (Exception) { ddlClinics.SelectedIndex = -1; } try { ddlCLService.SelectedValue = Convert.ToString(clData.ServiceID); } catch (Exception) { ddlCLService.SelectedIndex = -1; } DataSet dsViewable = null; status = cld.GetCLViewableRolesDS(ChecklistID, out dsViewable); if (!status.Status) { return(status); } CCheckBoxList cbl = new CCheckBoxList(); cbl.CheckSelected(cblViewable, dsViewable); DataSet dsReadOnly = null; status = cld.GetCLReadOnlyRolesDS(ChecklistID, out dsReadOnly); if (!status.Status) { return(status); } cbl.CheckSelected(cblReadOnly, dsReadOnly); DataSet dsCloseable = null; status = cld.GetCLCloseableRolesDS(ChecklistID, out dsCloseable); if (!status.Status) { return(status); } cbl.CheckSelected(cblCloseable, dsCloseable); DataSet dsTIU = null; status = cld.GetCLTIURolesDS(ChecklistID, out dsTIU); if (!status.Status) { return(status); } cbl.CheckSelected(cblTIUNote, dsTIU); 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()); }