protected void GetAccountDetails() { #region account_details if (this.IsLoggedIn() && Session["ACC_DETAILS"] == null) { CUser user = new CUser(); DataSet dsUser = user.GetLoginUserDS(this, this.FXUserID); if (dsUser != null) { //divLoginInfo.Visible = true; CDataUtils utils = new CDataUtils(); string strAccDetails = String.Empty; DateTime dtLastLogin = utils.GetDSDateTimeValue(dsUser, "date_last_login"); string strLastLogin = utils.GetDateTimeAsString(dtLastLogin); string strLastLoginIP = utils.GetDSStringValue(dsUser, "last_login_ip"); DateTime dtFLastLogin = utils.GetDSDateTimeValue(dsUser, "last_flogin_date"); string strFLastLogin = utils.GetDateTimeAsString(dtFLastLogin); string strFLastLoginIP = utils.GetDSStringValue(dsUser, "last_flogin_ip"); long lFAttempts = utils.GetDSLongValue(dsUser, "flogin_attempts"); string strFAttempts = Convert.ToString(lFAttempts); strAccDetails += "Unsuccessful Logon Attempts Since Last Successful Logon: " + strFAttempts; strAccDetails += "<br>"; if (!String.IsNullOrEmpty(strFLastLoginIP)) { strAccDetails += "Last Unsuccessful Logon:"; strAccDetails += " " + strFLastLogin; strAccDetails += " - IP Address: " + strFLastLoginIP; } else { strAccDetails += "No Unsuccessful Logons"; } strAccDetails += "<br>"; strAccDetails += "Last Successful Logon:"; strAccDetails += " " + strLastLogin; strAccDetails += " - IP Address: " + strLastLoginIP; //litLoginInfo.Text = strAccDetails; Session["ACC_DETAILS"] = strAccDetails; } if (this.APPMaster.PasswordExpires > 0 && this.APPMaster.PasswordExpires <= 10) { this.StatusCode = 1; this.StatusComment = "Your account password will expire in " + Convert.ToString(this.APPMaster.PasswordExpires) + " days!"; } } #endregion }
public CPatientItemComponentDataItem(DataSet ds) { if (!CDataUtils.IsEmpty(ds)) { PatientID = CDataUtils.GetDSStringValue(ds, "PATIENT_ID"); EntryDate = CDataUtils.GetDSDateTimeValue(ds, "ENTRY_DATE"); ItemID = CDataUtils.GetDSLongValue(ds, "ITEM_ID"); PatItemID = CDataUtils.GetDSLongValue(ds, "PAT_ITEM_ID"); SourceTypeID = CDataUtils.GetDSLongValue(ds, "SOURCE_TYPE_ID"); ComponentValue = CDataUtils.GetDSStringValue(ds, "COMPONENT_VALUE"); ComponentID = CDataUtils.GetDSLongValue(ds, "ITEM_COMPONENT_ID"); } }
public CPatChecklistDataItem(DataSet ds) { if (!CDataUtils.IsEmpty(ds)) { PatientID = CDataUtils.GetDSStringValue(ds, "PATIENT_ID"); ChecklistID = CDataUtils.GetDSLongValue(ds, "CHECKLIST_ID"); AssignmentDate = CDataUtils.GetDSDateTimeValue(ds, "ASSIGNMENT_DATE"); ProcedureDate = CDataUtils.GetDSDateTimeValue(ds, "PROCEDURE_DATE"); StateID = (k_STATE_ID)CDataUtils.GetDSLongValue(ds, "STATE_ID"); ChecklistStateID = (k_CHECKLIST_STATE_ID)CDataUtils.GetDSLongValue(ds, "CHECKLIST_STATE_ID"); PatCLID = CDataUtils.GetDSLongValue(ds, "PAT_CL_ID"); } }
public CPatientItemDataItem(DataSet ds) { if (!CDataUtils.IsEmpty(ds)) { PatientID = CDataUtils.GetDSStringValue(ds, "PATIENT_ID"); EntryDate = CDataUtils.GetDSDateTimeValue(ds, "ENTRY_DATE"); ItemDescription = CDataUtils.GetDSStringValue(ds, "ITEM_DESCRIPTION"); ItemGroupID = CDataUtils.GetDSLongValue(ds, "ITEM_GROUP_ID"); ItemID = CDataUtils.GetDSLongValue(ds, "ITEM_ID"); ItemLabel = CDataUtils.GetDSStringValue(ds, "ITEM_LABEL"); ItemTypeID = CDataUtils.GetDSLongValue(ds, "ITEM_TYPE_ID"); LookbackTime = CDataUtils.GetDSLongValue(ds, "LOOKBACK_TIME"); PatItemID = CDataUtils.GetDSLongValue(ds, "PAT_ITEM_ID"); SourceTypeID = CDataUtils.GetDSLongValue(ds, "SOURCE_TYPE_ID"); } }
public CPatChecklistItemDataItem(DataRow dr) { PatCLID = CDataUtils.GetDSLongValue(dr, "PAT_CL_ID"); PatientID = CDataUtils.GetDSStringValue(dr, "PATIENT_ID"); ChecklistID = CDataUtils.GetDSLongValue(dr, "CHECKLIST_ID"); ItemID = CDataUtils.GetDSLongValue(dr, "ITEM_ID"); TSID = CDataUtils.GetDSLongValue(dr, "TS_ID"); TSStateID = CDataUtils.GetDSLongValue(dr, "TS_STATE_ID"); OSID = CDataUtils.GetDSLongValue(dr, "OS_ID"); OSStateID = CDataUtils.GetDSLongValue(dr, "OS_STATE_ID"); DSID = CDataUtils.GetDSLongValue(dr, "DS_ID"); DSStateID = CDataUtils.GetDSLongValue(dr, "DS_STATE_ID"); IsOverridden = (k_TRUE_FALSE_ID)CDataUtils.GetDSLongValue(dr, "IS_OVERRIDDEN"); IsEnabled = (k_TRUE_FALSE_ID)CDataUtils.GetDSLongValue(dr, "IS_ENABLE"); OverrideDate = CDataUtils.GetDSDateTimeValue(dr, "OVERRIDE_DATE"); }
/// <summary> /// loads the component from a data row /// </summary> /// <param name="dr"></param> /// <returns></returns> public CStatus Load(DataRow dr) { if (dr == null) { return(new CStatus(false, k_STATUS_CODE.Failed, "Could not load data row!")); } PatientID = CDataUtils.GetDSStringValue(dr, "PATIENT_ID"); EntryDate = CDataUtils.GetDSDateTimeValue(dr, "ENTRY_DATE"); ItemID = CDataUtils.GetDSLongValue(dr, "ITEM_ID"); PatItemID = CDataUtils.GetDSLongValue(dr, "PAT_ITEM_ID"); SourceTypeID = CDataUtils.GetDSLongValue(dr, "SOURCE_TYPE_ID"); ComponentValue = CDataUtils.GetDSStringValue(dr, "COMPONENT_VALUE"); ComponentID = CDataUtils.GetDSLongValue(dr, "ITEM_COMPONENT_ID"); return(new CStatus()); }
public CPatientDataItem(DataSet ds) { if (!CDataUtils.IsEmpty(ds)) { PatientID = CDataUtils.GetDSStringValue(ds, "PATIENT_ID"); FirstName = CDataUtils.GetDSStringValue(ds, "FIRST_NAME"); MI = CDataUtils.GetDSStringValue(ds, "MIDDLE_INITIAL"); LastName = CDataUtils.GetDSStringValue(ds, "LAST_NAME"); SSN = CDataUtils.GetDSStringValue(ds, "SSN"); DOB = CDataUtils.GetDSDateTimeValue(ds, "DATE_OF_BIRTH"); Sex = (k_SEX)CDataUtils.GetDSLongValue(ds, "SEX_ID"); SexLabel = CDataUtils.GetDSStringValue(ds, "SEX_LABEL"); SexAbbreviation = CDataUtils.GetDSStringValue(ds, "SEX_ABBREVIATION"); SSNLast4 = CDataUtils.GetDSStringValue(ds, "SSN_LAST_4"); Age = CDataUtils.GetDSLongValue(ds, "PATIENT_AGE"); } }
/// <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); }