コード例 #1
0
    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
    }
コード例 #2
0
 public CStateDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         StateID    = CDataUtils.GetDSLongValue(ds, "STATE_ID");
         StateLabel = CDataUtils.GetDSStringValue(ds, "STATE_LABEL");
     }
 }
コード例 #3
0
ファイル: ucLogin.ascx.cs プロジェクト: govtmirror/REVAMP
    protected void GetPatientID()
    {
        CPatient   pat          = new CPatient();
        CDataUtils utils        = new CDataUtils();
        DataSet    dsPat        = pat.GetPatientIDRS(BaseMstr, BaseMstr.FXUserID);
        string     strPatientID = utils.GetDSStringValue(dsPat, "PATIENT_ID");

        BaseMstr.SelectedPatientID = strPatientID;
    }
コード例 #4
0
 public CServiceDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ServiceID    = CDataUtils.GetDSLongValue(ds, "SERVICE_ID");
         ServiceLabel = CDataUtils.GetDSStringValue(ds, "SERVICE_LABEL");
         IsActive     = (CDataUtils.GetDSLongValue(ds, "IS_ACTIVE") == (long)k_TRUE_FALSE_ID.True) ? true : false;
     }
 }
コード例 #5
0
 public CItemGroupDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ItemGroupLabel = CDataUtils.GetDSStringValue(ds, "ITEM_GROUP_LABEL");
         ItemGroupID    = CDataUtils.GetDSLongValue(ds, "ITEM_GROUP_ID");
         IsActive       = (CDataUtils.GetDSLongValue(ds, "IS_ACTIVE") == (long)k_TRUE_FALSE_ID.True) ? true : false;
     }
 }
コード例 #6
0
 public CItemComponentDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ItemID             = CDataUtils.GetDSLongValue(ds, "ITEM_ID");
         ItemComponentID    = CDataUtils.GetDSLongValue(ds, "ITEM_COMPONENT_ID");
         ItemComponentLabel = CDataUtils.GetDSStringValue(ds, "ITEM_COMPONENT_LABEL");
         SortOrder          = CDataUtils.GetDSLongValue(ds, "SORT_ORDER");
         ActiveID           = (k_ACTIVE_ID)CDataUtils.GetDSLongValue(ds, "ACTIVE_ID");
     }
 }
コード例 #7
0
 public CPlaceHolderDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         PlaceHolderID     = CDataUtils.GetDSLongValue(ds, "PLACE_HOLDER_ID");
         PlaceHolderLabel  = CDataUtils.GetDSStringValue(ds, "PLACE_HOLDER_LABEL");
         PlaceHolderSyntax = CDataUtils.GetDSStringValue(ds, "PLACE_HOLDER_SYNTAX");
         PHParentID        = CDataUtils.GetDSLongValue(ds, "PH_PARENT_ID");
         IsGroup           = (CDataUtils.GetDSLongValue(ds, "IS_GROUP") == (long)k_TRUE_FALSE_ID.True) ? true : false;
     }
 }
コード例 #8
0
 public CDecisionStateDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         DSLabel        = CDataUtils.GetDSStringValue(ds, "DS_LABEL");
         DSDefinitionID = CDataUtils.GetDSLongValue(ds, "DS_DEFINITION_ID");
         DSID           = CDataUtils.GetDSLongValue(ds, "DS_ID");
         IsActive       = (CDataUtils.GetDSLongValue(ds, "IS_ACTIVE") == (long)k_TRUE_FALSE_ID.True) ? true : false;
         IsDefault      = (CDataUtils.GetDSLongValue(ds, "IS_DEFAULT") == (long)k_TRUE_FALSE_ID.True) ? true : false;
     }
 }
コード例 #9
0
    protected string UserLoggedOn()
    {
        string     strUserName = String.Empty;
        CDataUtils utils       = new CDataUtils();
        CUser      user        = new CUser();
        DataSet    dsUser      = user.GetLoginUserDS(this, this.FXUserID);

        strUserName = utils.GetDSStringValue(dsUser, "NAME");

        return(strUserName);
    }
コード例 #10
0
    /// <summary>
    /// does the user have a security keys by key name
    /// </summary>
    /// <param name="ds"></param>
    /// <returns></returns>
    public bool HasSecurityKey(long lUserID,
                               string strKeyName)
    {
        //initialize parameters
        DataSet ds     = null;
        CStatus status = new CStatus();

        //transfer from MDWS if needed
        if (MDWSTransfer)
        {
            long     lCount = 0;
            CMDWSOps ops    = new CMDWSOps(this);
            status = ops.GetMDWSSecurityKeys(lUserID,
                                             true,
                                             out lCount);
            if (!status.Status)
            {
                return(false);
            }
        }

        //load the paramaters list
        CParameterList pList = new CParameterList(base.SessionID,
                                                  base.ClientIP,
                                                  base.UserID);

        pList.AddInputParameter("pi_vSecurityKeyName", strKeyName.Trim().ToUpper());

        //get the dataset
        CDataSet cds = new CDataSet();

        status = cds.GetOracleDataSet(base.DBConn,
                                      "PCK_SECURITY_KEY.GetSecurityKeyByNameRS",
                                      pList,
                                      out ds);

        if (!status.Status)
        {
            return(false);
        }

        string strKey = CDataUtils.GetDSStringValue(ds, "security_key_name");

        if (!String.IsNullOrEmpty(strKey))
        {
            if (strKey.Trim().ToLower() == strKeyName.Trim().ToLower())
            {
                return(true);
            }
        }

        return(false);
    }
コード例 #11
0
 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");
     }
 }
コード例 #12
0
 public CChecklistItemDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ChecklistID     = CDataUtils.GetDSLongValue(ds, "CHECKLIST_ID");
         ItemID          = CDataUtils.GetDSLongValue(ds, "ITEM_ID");
         CLITSTimePeriod = CDataUtils.GetDSLongValue(ds, "CLI_TS_TIME_PERIOD");
         TimeUnitID      = (k_TIME_UNIT_ID)CDataUtils.GetDSLongValue(ds, "TIME_UNIT_ID");
         SortOrder       = CDataUtils.GetDSLongValue(ds, "SORT_ORDER");
         ActiveID        = (k_ACTIVE_ID)CDataUtils.GetDSLongValue(ds, "ACTIVE_ID");
         Logic           = CDataUtils.GetDSStringValue(ds, "LOGIC");;
     }
 }
コード例 #13
0
 /// <summary>
 /// US:1951 US:1945 loads data item from data set
 /// </summary>
 /// <param name="ds"></param>
 public CChecklistDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ChecklistID          = CDataUtils.GetDSLongValue(ds, "CHECKLIST_ID");
         ChecklistLabel       = CDataUtils.GetDSStringValue(ds, "CHECKLIST_LABEL");
         ServiceID            = CDataUtils.GetDSLongValue(ds, "SERVICE_ID");
         ChecklistDescription = CDataUtils.GetDSStringValue(ds, "CHECKLIST_DESCRIPTION");
         NoteTitleTag         = CDataUtils.GetDSStringValue(ds, "NOTE_TITLE_TAG");
         NoteTitleClinicID    = CDataUtils.GetDSLongValue(ds, "NOTE_TITLE_CLINIC_ID");
         ActiveID             = (k_ACTIVE_ID)CDataUtils.GetDSLongValue(ds, "ACTIVE_ID");
     }
 }
コード例 #14
0
 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");
     }
 }
コード例 #15
0
 public CItemDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ItemID          = CDataUtils.GetDSLongValue(ds, "ITEM_ID");
         ItemTypeID      = CDataUtils.GetDSLongValue(ds, "ITEM_TYPE_ID");
         ItemGroupID     = CDataUtils.GetDSLongValue(ds, "ITEM_GROUP_ID");
         ItemLabel       = CDataUtils.GetDSStringValue(ds, "ITEM_LABEL");
         ItemDescription = CDataUtils.GetDSStringValue(ds, "ITEM_DESCRIPTION");
         LookbackTime    = CDataUtils.GetDSLongValue(ds, "LOOKBACK_TIME");
         ActiveID        = (k_ACTIVE_ID)CDataUtils.GetDSLongValue(ds, "ACTIVE_ID");
         MapID           = CDataUtils.GetDSStringValue(ds, "MAP_ID");
     }
 }
コード例 #16
0
 public CTrueFalseDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         TrueFalseID   = CDataUtils.GetDSLongValue(ds, "TRUE_FALSE_ID");
         TrueLabel     = CDataUtils.GetDSStringValue(ds, "TRUE_LABEL");
         ActiveLabel   = CDataUtils.GetDSStringValue(ds, "ACTIVE_LABEL");
         DefaultLabel  = CDataUtils.GetDSStringValue(ds, "DEFAULT_LABEL");
         YesLabel      = CDataUtils.GetDSStringValue(ds, "YES_LABEL");
         EnableLabel   = CDataUtils.GetDSStringValue(ds, "ENABLE_LABEL");
         OverrideLabel = CDataUtils.GetDSStringValue(ds, "OVERRIDE_LABEL");
         SelectedLabel = CDataUtils.GetDSStringValue(ds, "SELECTED_LABEL");
     }
 }
コード例 #17
0
    protected string UserLoggedOn()
    {
        string strUserName = String.Empty;

        string[]   strUserNameParts;
        CDataUtils utils  = new CDataUtils();
        CUser      user   = new CUser();
        DataSet    dsUser = user.GetLoginUserDS(BaseMstr, BaseMstr.FXUserID);

        strUserName      = utils.GetDSStringValue(dsUser, "NAME");
        strUserNameParts = strUserName.Split(' ');
        strUserName      = strUserNameParts[1] + ", " + strUserNameParts[0];
        return(strUserName);
    }
コード例 #18
0
 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");
 }
コード例 #19
0
 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");
     }
 }
コード例 #20
0
 public CICRangeDataItem(DataSet ds)
 {
     if (!CDataUtils.IsEmpty(ds))
     {
         ItemID          = CDataUtils.GetDSLongValue(ds, "ITEM_ID");
         ItemComponentID = CDataUtils.GetDSLongValue(ds, "ITEM_COMPONENT_ID");
         ICRangeID       = CDataUtils.GetDSLongValue(ds, "IC_RANGE_ID");
         Units           = CDataUtils.GetDSStringValue(ds, "UNITS");
         LegalMin        = CDataUtils.GetDSDoubleValue(ds, "LEGAL_MIN");
         CriticalLow     = CDataUtils.GetDSDoubleValue(ds, "CRITICAL_LOW");
         Low             = CDataUtils.GetDSDoubleValue(ds, "LOW");
         High            = CDataUtils.GetDSDoubleValue(ds, "HIGH");
         CriticalHigh    = CDataUtils.GetDSDoubleValue(ds, "CRITICAL_HIGH");
         LegalMax        = CDataUtils.GetDSDoubleValue(ds, "LEGAL_MAX");
     }
 }
コード例 #21
0
    /// <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());
    }
コード例 #22
0
 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");
     }
 }
コード例 #23
0
ファイル: CAppUser.cs プロジェクト: whitten/CheckListTool
    /// <summary>
    /// US:866 Load the user data from the database
    /// </summary>
    /// <param name="lUserID"></param>
    /// <returns></returns>
    private CStatus LoadUserData(long lUserID)
    {
        DataSet ds = null;

        CUserData cud    = new CUserData(this);
        CStatus   status = cud.GetUserDS(lUserID, out ds);

        if (status.Status)
        {
            //cach the date the user logged in
            UserLoginDateTime = DateTime.Now;

            //cache the user id, role id, first name and last name
            UserID        = lUserID;
            UserRoleID    = CDataUtils.GetDSLongValue(ds, "user_role_id");
            UserFirstName = CDataUtils.GetDSStringValue(ds, "first_name");
            UserLastName  = CDataUtils.GetDSStringValue(ds, "last_name");
        }
        else
        {
            return(status);
        }

        //transfer user keys to our db
        if (MDWSTransfer)
        {
            CMDWSOps ops    = new CMDWSOps(this);
            long     lCount = 0;
            status = ops.GetMDWSSecurityKeys(lUserID, true, out lCount);
            if (!status.Status)
            {
                return(status);
            }
        }

        //set the admin, doc and nurse privs for this user
        DataSet dsRoles = null;

        status = cud.GetUserRolesDS(lUserID, out dsRoles);
        if (status.Status)
        {
            foreach (DataTable table in dsRoles.Tables)
            {
                foreach (DataRow dr in table.Rows)
                {
                    long lRoleID = CDataUtils.GetDSLongValue(dr, "USER_ROLE_ID");
                    if (lRoleID == (long)k_USER_ROLE_ID.Administrator)
                    {
                        IsAdministrator = true;
                    }
                    else if (lRoleID == (long)k_USER_ROLE_ID.Doctor)
                    {
                        IsDoctor = true;
                    }
                    else if (lRoleID == (long)k_USER_ROLE_ID.Nurse)
                    {
                        IsNurse = true;
                    }
                }
            }
        }

        return(status);
    }
コード例 #24
0
    /// <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);
    }
コード例 #25
0
    /// <summary>
    /// gets the item state id
    /// </summary>
    /// <param name="lCollItemID"></param>
    /// <param name="patItemDI"></param>
    /// <returns></returns>
    protected k_STATE_ID GetItemStateID(long lCollectionItemID,
                                        long lItemID,
                                        DataSet dsPatItemComps,
                                        CPatientItemDataItem patItemDI)
    {
        k_STATE_ID kStateID          = k_STATE_ID.Unknown;
        k_STATE_ID kOverallTSStateID = k_STATE_ID.NotSelected;
        k_STATE_ID kOverallOSStateID = k_STATE_ID.NotSelected;

        //get the entry date
        DateTime dtEntryDate = patItemDI.EntryDate;

        //get the checklist collection item di
        CChecklistItemDataItem cidDI = null;
        CChecklistItemData     cid   = new CChecklistItemData(BaseMstr.BaseData);

        cid.GetCLItemDI(ChecklistID, lCollectionItemID, out cidDI);

        //calculate how far the TS can go back
        long     lTS         = cidDI.CLITSTimePeriod;
        DateTime dtNow       = DateTime.Now;
        DateTime dtTSCompare = dtNow.AddDays(-1 * lTS);

        //check the TS and set overall TS state
        k_COMPARE kTS = CDataUtils.CompareDates(dtEntryDate, dtTSCompare);

        if (kTS == k_COMPARE.GREATERTHAN ||
            kTS == k_COMPARE.EQUALTO)
        {
            kOverallTSStateID = k_STATE_ID.Good;
        }
        else
        {
            //bad
            kOverallTSStateID = k_STATE_ID.Bad;
        }

        //list to hold the created component items
        CPatientItemCompList PatItemCompList = new CPatientItemCompList();

        //build a pat item component list loaded with the most recent
        //values
        foreach (DataTable tableComp in dsPatItemComps.Tables)
        {
            foreach (DataRow drComp in tableComp.Rows)
            {
                //values to load the component item
                long   lCompItemID       = CDataUtils.GetDSLongValue(drComp, "ITEM_ID");
                long   lComponentID      = CDataUtils.GetDSLongValue(drComp, "ITEM_COMPONENT_ID");
                string strComponentValue = CDataUtils.GetDSStringValue(drComp, "COMPONENT_VALUE");
                long   lPatItemID        = CDataUtils.GetDSLongValue(drComp, "PAT_ITEM_ID");
                //only this item
                if (lCompItemID == lItemID)
                {
                    CPatientItemComponentDataItem diComp = new CPatientItemComponentDataItem();
                    diComp.PatientID      = PatientID;
                    diComp.ItemID         = lCompItemID;
                    diComp.ComponentID    = lComponentID;
                    diComp.ComponentValue = strComponentValue;
                    diComp.PatItemID      = lPatItemID;

                    PatItemCompList.Add(diComp);
                }
            }
        }

        //we now have a list of item components for this item
        //loop and get status for this item and update the overall status
        bool bHasSelectedValue = false;

        foreach (CPatientItemComponentDataItem diPatItemComp in PatItemCompList)
        {
            //get the state id for this component
            CICStateDataItem   sdi = null;
            CItemComponentData icd = new CItemComponentData(BaseMstr.BaseData);
            icd.GetICStateDI(lItemID, diPatItemComp.ComponentID, out sdi);

            //switch on the type and get the value
            switch ((k_ITEM_TYPE_ID)patItemDI.ItemTypeID)
            {
            case k_ITEM_TYPE_ID.Laboratory:
            {
                bHasSelectedValue = true;

                //get the ranges
                CICRangeDataItem rdi = null;
                icd.GetICRangeDI(lItemID, diPatItemComp.ComponentID, out rdi);
                if (String.IsNullOrEmpty(diPatItemComp.ComponentValue))
                {
                    //does not have a value?
                    kOverallOSStateID = k_STATE_ID.Unknown;
                }
                else
                {
                    try
                    {
                        double dblValue = Convert.ToDouble(diPatItemComp.ComponentValue);

                        //max/high check
                        if (dblValue >= rdi.LegalMax)
                        {
                            if (kOverallOSStateID != k_STATE_ID.Bad)
                            {
                                kOverallOSStateID = k_STATE_ID.Unknown;
                            }
                        }
                        else
                        {
                            if (dblValue >= rdi.High)
                            {
                                kOverallOSStateID = k_STATE_ID.Bad;
                            }
                            else
                            {
                                if (kOverallOSStateID != k_STATE_ID.Bad)
                                {
                                    kOverallOSStateID = k_STATE_ID.Good;
                                }
                            }
                        }

                        //min/low check
                        if (dblValue <= rdi.LegalMin)
                        {
                            if (kOverallOSStateID != k_STATE_ID.Bad)
                            {
                                kOverallOSStateID = k_STATE_ID.Unknown;
                            }
                        }
                        else
                        {
                            if (dblValue <= rdi.Low)
                            {
                                kOverallOSStateID = k_STATE_ID.Bad;
                            }
                            else
                            {
                                if (kOverallOSStateID != k_STATE_ID.Bad)
                                {
                                    kOverallOSStateID = k_STATE_ID.Good;
                                }
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        if (kOverallOSStateID != k_STATE_ID.Bad)
                        {
                            kOverallOSStateID = k_STATE_ID.Unknown;
                        }
                    }
                }

                break;
            }

            case k_ITEM_TYPE_ID.NoteTitle:
            {
                //note titles are excluded from quick entry
                //and do not affect default logic. must use custom logic
                //for note titles
                bHasSelectedValue = true;
                kOverallOSStateID = k_STATE_ID.Unknown;
                break;
            }

            case k_ITEM_TYPE_ID.QuestionFreeText:
            {
                bHasSelectedValue = true;
                if (diPatItemComp.ComponentValue.Length < 1)
                {
                    //if they did not enter a value
                    //then the overall state is bad!
                    kOverallOSStateID = k_STATE_ID.Bad;
                }
                else
                {
                    kOverallOSStateID = k_STATE_ID.Good;
                }

                break;
            }

            case k_ITEM_TYPE_ID.QuestionSelection:
                if (!String.IsNullOrEmpty(diPatItemComp.ComponentValue))
                {
                    //only interested in the one they selected
                    if ((k_TRUE_FALSE_ID)Convert.ToInt64(diPatItemComp.ComponentValue) != k_TRUE_FALSE_ID.False)
                    {
                        bHasSelectedValue = true;
                        if (kOverallOSStateID != k_STATE_ID.Bad)
                        {
                            if ((k_STATE_ID)sdi.StateID == k_STATE_ID.Bad)
                            {
                                kOverallOSStateID = k_STATE_ID.Bad;
                            }
                            else
                            {
                                if ((k_STATE_ID)sdi.StateID == k_STATE_ID.Good)
                                {
                                    if (kOverallOSStateID != k_STATE_ID.Unknown)
                                    {
                                        kOverallOSStateID = k_STATE_ID.Good;
                                    }
                                }
                                else
                                {
                                    kOverallOSStateID = k_STATE_ID.Unknown;
                                }
                            }
                        }
                    }
                }
                break;
            }
        }//for each

        //if there is nothing selected then the overall os state is unk
        //and ts state is bad!
        if (!bHasSelectedValue)
        {
            kOverallOSStateID = k_STATE_ID.Unknown;
            kOverallTSStateID = k_STATE_ID.Bad;
        }

        if (kOverallTSStateID == k_STATE_ID.Bad ||
            kOverallOSStateID == k_STATE_ID.Bad)
        {
            kStateID = k_STATE_ID.Bad;
        }
        else if (kOverallTSStateID == k_STATE_ID.Good &&
                 kOverallOSStateID == k_STATE_ID.Good)
        {
            kStateID = k_STATE_ID.Good;
        }
        else
        {
            kStateID = k_STATE_ID.Unknown;
        }

        return(kStateID);
    }
コード例 #26
0
    /// <summary>
    /// load a gridview value row
    /// </summary>
    /// <param name="gvr"></param>
    protected void LoadGridViewValue(GridViewRow gvr)
    {
        if (gvr == null)
        {
            return;
        }

        Panel pnlComponents = (Panel)gvr.FindControl("pnlComponents");
        Panel pnlViewValue  = (Panel)gvr.FindControl("pnlViewValue");

        if (pnlComponents == null || pnlViewValue == null)
        {
            return;
        }

        //hide the components, show the value view
        pnlComponents.Visible = false;
        pnlViewValue.Visible  = true;

        //literal that holds status info
        Literal litHiddenCollValues = (Literal)gvr.FindControl("litHiddenCollValues");

        litHiddenCollValues.Text = String.Empty;

        //button to expand/collapse
        Button btnShowHiddenCollValues = (Button)gvr.FindControl("btnShowHiddenCollValues");

        //get the gridview data row
        DataRowView drv = (DataRowView)gvr.DataItem;
        DataRow     dr  = drv.Row;

        //get the item type is and item id
        long lItemTypeID = Convert.ToInt64(dr["ITEM_TYPE_ID"]);
        long lItemID     = Convert.ToInt64(dr["ITEM_ID"]);

        //hide the expand/collapse if this is not a collection
        if (lItemTypeID != (long)k_ITEM_TYPE_ID.Collection)
        {
            AjaxControlToolkit.CollapsiblePanelExtender cpe = (AjaxControlToolkit.CollapsiblePanelExtender)gvr.FindControl("cpeHiddenCollValues");
            cpe.CollapseControlID = null;
            cpe.Enabled           = false;

            btnShowHiddenCollValues.Visible = false;
        }

        //if this is a collection, build a status summary list of each ite,
        if (lItemTypeID == (long)k_ITEM_TYPE_ID.Collection)
        {
            btnShowHiddenCollValues.Visible = true;

            //get all the patient item components in the collection
            CItemCollectionData coll           = new CItemCollectionData(BaseMstr.BaseData);
            DataSet             dsPatItemComps = null;
            coll.GetItemColMostRecentPatICDS(lItemID, PatientID, out dsPatItemComps);

            //get all the items in the collection
            DataSet dsColl = null;
            CStatus status = coll.GetItemCollectionDS(lItemID, out dsColl);

            //html to hold the status
            StringBuilder sbItemCompCollHTML = new StringBuilder();

            //loop over all the items in the collection and build html
            foreach (DataTable tableColl in dsColl.Tables)
            {
                foreach (DataRow drColl in tableColl.Rows)
                {
                    //get values from the the item in the collection (not the patient items, the collection items)
                    long lActiveID   = CDataUtils.GetDSLongValue(drColl, "ACTIVE_ID");
                    long lCollItemID = CDataUtils.GetDSLongValue(drColl, "ITEM_ID");

                    //get the item so we can check entry date against TS etc...
                    CPatientItemDataItem patItemDI = null;
                    CPatientItemData     patData   = new CPatientItemData(BaseMstr.BaseData);
                    patData.GetMostRecentPatientItemDI(PatientID, lCollItemID, out patItemDI);

                    //only interested in ACTIVE items
                    if ((k_ACTIVE)lActiveID == k_ACTIVE.ACTIVE)
                    {
                        //image for state open the img tag
                        sbItemCompCollHTML.Append("<img alt=\"");
                        //sbItemCompCollHTML.Append(CDataUtils.GetDSStringValue(dr, "ITEM_LABEL"));
                        sbItemCompCollHTML.Append(" Collection Item State Image\" width=\"10\" height=\"10\" src=\"");

                        //get the current state of the item
                        k_STATE_ID lItemStateID = GetItemStateID(lItemID, lCollItemID, dsPatItemComps, patItemDI);

                        //add a red/green/yellow image based on the state of the item
                        if (lItemStateID == k_STATE_ID.Unknown ||
                            lItemStateID == k_STATE_ID.NotSelected)
                        {
                            sbItemCompCollHTML.Append(Resources.Images.STATE_UNKNOWN_SMALL);
                        }
                        else if (lItemStateID == k_STATE_ID.Good)
                        {
                            sbItemCompCollHTML.Append(Resources.Images.STATE_GOOD_SMALL);
                        }
                        else
                        {
                            sbItemCompCollHTML.Append(Resources.Images.STATE_BAD_SMALL);
                        }

                        //close out the image tag
                        sbItemCompCollHTML.Append("\" />");

                        //label, trunc so it displays nicely
                        string strLabel = CDataUtils.GetDSStringValue(drColl, "ITEM_LABEL");
                        if (strLabel.Length > 28)
                        {
                            strLabel = strLabel.Substring(0, 28) + "...";
                        }

                        //add the label after the image
                        sbItemCompCollHTML.Append(strLabel);

                        //add a line break
                        sbItemCompCollHTML.Append("<br>");
                    }
                }
            }

            //set the literal equal to the generated html
            litHiddenCollValues.Text = sbItemCompCollHTML.ToString();

            //enable the show/hide button
            btnShowHiddenCollValues.Enabled = (String.IsNullOrEmpty(litHiddenCollValues.Text)) ? false : btnShowHiddenCollValues.Enabled;
        }
    }
コード例 #27
0
    /// <summary>
    /// method to run logic over a colletion
    ///     1. all items in multi select must be have an option selected
    ///     2. all free text items must have data entered
    ///     3. labs and note titles are ignored
    ///     4. items that are not ACTIVE are ignored
    /// </summary>
    public CStatus RunCollectionLogic(string strPatientID,
                                      long lPatChecklistID,
                                      long lChecklistID,
                                      long lCollectionItemID)
    {
        //Get the patient checklist item data
        CPatChecklistItemData     PatChecklistItem = new CPatChecklistItemData(this);
        CPatChecklistItemDataItem pdi = null;

        PatChecklistItem.GetPatCLItemDI(lPatChecklistID,
                                        lCollectionItemID,
                                        out pdi);

        //get all the items in the collection
        CItemCollectionData coll   = new CItemCollectionData(this);
        DataSet             dsColl = null;
        CStatus             status = coll.GetItemCollectionDS(lCollectionItemID, out dsColl);

        //get all the patient item components in the collection
        DataSet dsPatItemComps = null;

        status = coll.GetItemColMostRecentPatICDS(lCollectionItemID, strPatientID, out dsPatItemComps);

        //if this collection item is overridden just return and don't update the state
        if (pdi.IsOverridden == k_TRUE_FALSE_ID.True)
        {
            bool bReturn = true;

            //check to see if there is a new result and override if there is...
            foreach (DataTable tableI in dsColl.Tables)
            {
                foreach (DataRow drI in tableI.Rows)
                {
                    //get values from the the item in the collection (not the patient items, the collection items)
                    long lItemID     = CDataUtils.GetDSLongValue(drI, "ITEM_ID");
                    long lItemTypeID = CDataUtils.GetDSLongValue(drI, "ITEM_TYPE_ID");
                    long lActiveID   = CDataUtils.GetDSLongValue(drI, "ACTIVE_ID");

                    //get the item so we can check entry date against TS etc...
                    CPatientItemDataItem patItemDI = null;
                    CPatientItemData     patData   = new CPatientItemData(this);
                    patData.GetMostRecentPatientItemDI(strPatientID, lItemID, out patItemDI);
                    DateTime dtEntryDate = patItemDI.EntryDate;

                    if (dtEntryDate > pdi.OverrideDate)
                    {
                        pdi.OverrideDate = CDataUtils.GetNullDate();
                        pdi.IsOverridden = k_TRUE_FALSE_ID.False;
                        PatChecklistItem.UpdatePatChecklistItem(pdi);
                        bReturn = false;
                        break;
                    }
                }
            }

            if (bReturn)
            {
                //return if this item is overridden and there are no new results
                return(new CStatus());
            }
        }

        //get the checklist item di
        CChecklistItemDataItem cidDI = null;
        CChecklistItemData     cid   = new CChecklistItemData(this);

        cid.GetCLItemDI(lChecklistID, lCollectionItemID, out cidDI);

        //calculate how far the TS can go back
        long     lTS         = cidDI.CLITSTimePeriod;
        DateTime dtNow       = DateTime.Now;
        DateTime dtTSCompare = dtNow.AddDays(-1 * lTS);

        //keeps the overall OS state of the items
        k_STATE_ID kOverallOSStateID = k_STATE_ID.NotSelected;

        //keeps the overall TS state of the items
        k_STATE_ID kOverallTSStateID = k_STATE_ID.NotSelected;

        //loop over the collection items
        foreach (DataTable table in dsColl.Tables)
        {
            foreach (DataRow dr in table.Rows)
            {
                //get values from the the item in the collection (not the patient items, the collection items)
                long lItemID     = CDataUtils.GetDSLongValue(dr, "ITEM_ID");
                long lItemTypeID = CDataUtils.GetDSLongValue(dr, "ITEM_TYPE_ID");
                long lActiveID   = CDataUtils.GetDSLongValue(dr, "ACTIVE_ID");

                //get the item so we can check entry date against TS etc...
                CPatientItemDataItem patItemDI = null;
                CPatientItemData     patData   = new CPatientItemData(this);
                patData.GetMostRecentPatientItemDI(strPatientID, lItemID, out patItemDI);
                DateTime dtEntryDate = patItemDI.EntryDate;

                //only interested in ACTIVE items
                if ((k_ACTIVE)lActiveID == k_ACTIVE.ACTIVE)
                {
                    //check the TS and set overall TS state
                    k_COMPARE kTS = CDataUtils.CompareDates(dtEntryDate, dtTSCompare);
                    if (kTS == k_COMPARE.GREATERTHAN ||
                        kTS == k_COMPARE.EQUALTO)
                    {
                        //good
                        if (kOverallTSStateID != k_STATE_ID.Bad)
                        {
                            kOverallTSStateID = k_STATE_ID.Good;
                        }
                    }
                    else
                    {
                        //bad
                        kOverallTSStateID = k_STATE_ID.Bad;
                    }

                    //list to hold the created component items
                    CPatientItemCompList PatItemCompList = new CPatientItemCompList();

                    //build a pat item component list loaded with the most recent
                    //values
                    foreach (DataTable tableComp in dsPatItemComps.Tables)
                    {
                        foreach (DataRow drComp in tableComp.Rows)
                        {
                            //values to load the component item
                            long   lCompItemID       = CDataUtils.GetDSLongValue(drComp, "ITEM_ID");
                            long   lComponentID      = CDataUtils.GetDSLongValue(drComp, "ITEM_COMPONENT_ID");
                            string strComponentValue = CDataUtils.GetDSStringValue(drComp, "COMPONENT_VALUE");
                            long   lPatItemID        = CDataUtils.GetDSLongValue(drComp, "PAT_ITEM_ID");
                            //only this item
                            if (lCompItemID == lItemID)
                            {
                                CPatientItemComponentDataItem diComp = new CPatientItemComponentDataItem();
                                diComp.PatientID      = strPatientID;
                                diComp.ItemID         = lCompItemID;
                                diComp.ComponentID    = lComponentID;
                                diComp.ComponentValue = strComponentValue;
                                diComp.PatItemID      = lPatItemID;

                                PatItemCompList.Add(diComp);
                            }
                        }

                        //we now have a list of item components for this item
                        //loop and get status for this item and update the overall status
                        bool bHasSelectedValue = false;
                        foreach (CPatientItemComponentDataItem diPatItemComp in PatItemCompList)
                        {
                            //get the state id for this component
                            CICStateDataItem   sdi = null;
                            CItemComponentData icd = new CItemComponentData(this);
                            icd.GetICStateDI(lItemID, diPatItemComp.ComponentID, out sdi);

                            //switch on the type and get the value
                            switch ((k_ITEM_TYPE_ID)lItemTypeID)
                            {
                            case k_ITEM_TYPE_ID.Laboratory:
                            {
                                bHasSelectedValue = true;

                                //get the ranges
                                CICRangeDataItem rdi = null;
                                icd.GetICRangeDI(lItemID, diPatItemComp.ComponentID, out rdi);
                                if (String.IsNullOrEmpty(diPatItemComp.ComponentValue))
                                {
                                    //does not have a value?
                                    kOverallOSStateID = k_STATE_ID.Unknown;
                                }
                                else
                                {
                                    try
                                    {
                                        double dblValue = Convert.ToDouble(diPatItemComp.ComponentValue);

                                        //max/high check
                                        if (dblValue >= rdi.LegalMax)
                                        {
                                            if (kOverallOSStateID != k_STATE_ID.Bad)
                                            {
                                                kOverallOSStateID = k_STATE_ID.Unknown;
                                            }
                                        }
                                        else
                                        {
                                            if (dblValue >= rdi.High)
                                            {
                                                kOverallOSStateID = k_STATE_ID.Bad;
                                            }
                                            else
                                            {
                                                if (kOverallOSStateID != k_STATE_ID.Bad)
                                                {
                                                    kOverallOSStateID = k_STATE_ID.Good;
                                                }
                                            }
                                        }

                                        //min/low check
                                        if (dblValue <= rdi.LegalMin)
                                        {
                                            if (kOverallOSStateID != k_STATE_ID.Bad)
                                            {
                                                kOverallOSStateID = k_STATE_ID.Unknown;
                                            }
                                        }
                                        else
                                        {
                                            if (dblValue <= rdi.Low)
                                            {
                                                kOverallOSStateID = k_STATE_ID.Bad;
                                            }
                                            else
                                            {
                                                if (kOverallOSStateID != k_STATE_ID.Bad)
                                                {
                                                    kOverallOSStateID = k_STATE_ID.Good;
                                                }
                                            }
                                        }
                                    }
                                    catch (Exception e)
                                    {
                                        if (kOverallOSStateID != k_STATE_ID.Bad)
                                        {
                                            kOverallOSStateID = k_STATE_ID.Unknown;
                                        }
                                    }
                                }

                                break;
                            }

                            case k_ITEM_TYPE_ID.NoteTitle:
                            {
                                //note titles are excluded from quick entry
                                //so if we have one our os state is unknown
                                bHasSelectedValue = true;
                                kOverallOSStateID = k_STATE_ID.Unknown;
                                break;
                            }

                            case k_ITEM_TYPE_ID.QuestionFreeText:
                            {
                                bHasSelectedValue = true;
                                if (diPatItemComp.ComponentValue.Length < 1)
                                {
                                    //if they did not enter a value
                                    //then the overall state is bad!
                                    kOverallOSStateID = k_STATE_ID.Bad;
                                }
                                break;
                            }

                            case k_ITEM_TYPE_ID.QuestionSelection:
                                if (!String.IsNullOrEmpty(diPatItemComp.ComponentValue))
                                {
                                    //only interested in the one they selected
                                    if ((k_TRUE_FALSE_ID)Convert.ToInt64(diPatItemComp.ComponentValue) != k_TRUE_FALSE_ID.False)
                                    {
                                        bHasSelectedValue = true;
                                        if (kOverallOSStateID != k_STATE_ID.Bad)
                                        {
                                            if ((k_STATE_ID)sdi.StateID == k_STATE_ID.Bad)
                                            {
                                                kOverallOSStateID = k_STATE_ID.Bad;
                                            }
                                            else
                                            {
                                                if ((k_STATE_ID)sdi.StateID == k_STATE_ID.Good)
                                                {
                                                    if (kOverallOSStateID != k_STATE_ID.Unknown)
                                                    {
                                                        kOverallOSStateID = k_STATE_ID.Good;
                                                    }
                                                }
                                                else
                                                {
                                                    kOverallOSStateID = k_STATE_ID.Unknown;
                                                }
                                            }
                                        }
                                    }
                                }
                                break;
                            }
                        }//for each

                        //if there is nothing selected then the
                        //overall TS state is bad and the OS state is unknown
                        if (!bHasSelectedValue)
                        {
                            kOverallOSStateID = k_STATE_ID.Unknown;
                            kOverallTSStateID = k_STATE_ID.Bad;
                        }
                    }
                }
            }
        }

        //
        //now update the collection item states.
        //

        //get the ts,os and ds possible values
        CChecklistItemData dCL  = new CChecklistItemData(this);
        DataSet            dsTS = null;

        dCL.GetTemporalStateDS(lChecklistID, lCollectionItemID, out dsTS);
        long lGoodTSID    = dCL.GetTSDefaultStateID(dsTS, k_STATE_ID.Good);
        long lBadTSID     = dCL.GetTSDefaultStateID(dsTS, k_STATE_ID.Bad);
        long lUnknownTSID = dCL.GetTSDefaultStateID(dsTS, k_STATE_ID.Unknown);

        DataSet dsOS = null;

        dCL.GetOutcomeStateDS(lChecklistID, lCollectionItemID, out dsOS);
        long lGoodOSID    = dCL.GetOSDefaultStateID(dsOS, k_STATE_ID.Good);
        long lBadOSID     = dCL.GetOSDefaultStateID(dsOS, k_STATE_ID.Bad);
        long lUnknownOSID = dCL.GetOSDefaultStateID(dsOS, k_STATE_ID.Unknown);

        DataSet dsDS = null;

        dCL.GetDecisionStateDS(lChecklistID, lCollectionItemID, out dsDS);
        long lGoodDSID    = dCL.GetDSDefaultStateID(dsDS, k_STATE_ID.Good);
        long lBadDSID     = dCL.GetDSDefaultStateID(dsDS, k_STATE_ID.Bad);
        long lUnknownDSID = dCL.GetDSDefaultStateID(dsDS, k_STATE_ID.Unknown);

        //update the TS state on the data item
        if (kOverallTSStateID == k_STATE_ID.Bad)
        {
            pdi.TSID = lBadTSID;
        }
        else if (kOverallTSStateID == k_STATE_ID.Good)
        {
            pdi.TSID = lGoodTSID;
        }
        else
        {
            pdi.TSID = lUnknownTSID;
        }

        //update the OS state on the data item
        if (kOverallOSStateID == k_STATE_ID.Bad)
        {
            pdi.OSID = lBadOSID;
        }
        else if (kOverallOSStateID == k_STATE_ID.Good)
        {
            pdi.OSID = lGoodOSID;
        }
        else
        {
            pdi.OSID = lUnknownOSID;
        }

        //update the ds state on the item data
        if (kOverallTSStateID == k_STATE_ID.Good &&
            kOverallOSStateID == k_STATE_ID.Good)
        {
            pdi.DSID = lGoodDSID;
        }
        else
        {
            pdi.DSID = lBadDSID;
        }

        //update the checklist item state
        status = PatChecklistItem.UpdatePatChecklistItem(pdi);

        return(status);
    }
コード例 #28
0
    /// <summary>
    /// US:1880 gets the most recent result, loops over all components and pieces together a string
    /// </summary>
    /// <param name="pid"></param>
    /// <param name="pidi"></param>
    /// <param name="strResult"></param>
    /// <returns></returns>
    public CStatus GetMostRecentResult(out string strResult)
    {
        strResult = string.Empty;

        //load the last result for this item
        CPatientItemData     pid  = new CPatientItemData(BaseMstr.BaseData);
        CPatientItemDataItem pidi = new CPatientItemDataItem();
        CStatus status            = pid.GetMostRecentPatientItemDI(PatientID, ItemID, out pidi);

        if (!status.Status)
        {
            return(status);
        }

        if (pidi.PatItemID < 1)
        {
            return(new CStatus());
        }

        DataSet dsComps = null;

        status = pid.GetPatientItemComponentDS(
            PatientID,
            pidi.PatItemID,
            pidi.ItemID,
            out dsComps);
        if (!status.Status)
        {
            return(status);
        }

        foreach (DataRow row in dsComps.Tables[0].Rows)
        {
            string strLabel = CDataUtils.GetDSStringValue(row, "item_component_label");
            string strValue = CDataUtils.GetDSStringValue(row, "component_value");
            string strUnits = CDataUtils.GetDSStringValue(row, "units");

            string strWarning = String.Empty;

            //question selection
            if (pidi.ItemTypeID == (long)k_ITEM_TYPE_ID.QuestionSelection)
            {
                if (strValue == "1")
                {
                    strResult += "<font face=\"verdana,arial\" size=\"-1\">";
                    strResult += strLabel;
                    strResult += "<br /></font>";
                }
            }

            //question free text
            else if (pidi.ItemTypeID == (long)k_ITEM_TYPE_ID.QuestionFreeText)
            {
                strResult += "<font face=\"verdana,arial\" size=\"-1\">";
                strResult += strLabel;
                strResult += ": ";
                strResult += strValue;
                strResult += "<br /></font>";
            }

            //lab
            else if (pidi.ItemTypeID == (long)k_ITEM_TYPE_ID.Laboratory)
            {
                if (CDataUtils.IsNumeric(strValue))
                {
                    double dblLegalMin     = CDataUtils.GetDSDoubleValue(row, "LEGAL_MIN");
                    double dblLow          = CDataUtils.GetDSDoubleValue(row, "LOW");
                    double dblCritialLow   = CDataUtils.GetDSDoubleValue(row, "CRITICAL_LOW");
                    double dblHigh         = CDataUtils.GetDSDoubleValue(row, "HIGH");
                    double dblCriticalHigh = CDataUtils.GetDSDoubleValue(row, "CRITICAL_HIGH");
                    double dblLegalMax     = CDataUtils.GetDSDoubleValue(row, "LEGAL_MAX");

                    double dblValue = Convert.ToDouble(strValue);
                    if (dblValue < dblLegalMin)
                    {
                        strWarning = "LESS THAN LEGAL MIN";
                    }
                    else if (dblValue < dblCritialLow)
                    {
                        strWarning = "CRITICAL LOW";
                    }
                    else if (dblValue < dblLow)
                    {
                        strWarning = "LOW";
                    }
                    else if (dblValue > dblLegalMax)
                    {
                        strWarning = "GREATER THAN LEGAL MAX";
                    }
                    else if (dblValue > dblCriticalHigh)
                    {
                        strWarning = "CRITICAL HIGH";
                    }
                    else if (dblValue > dblHigh)
                    {
                        strWarning = "HIGH";
                    }
                }

                strResult += "<font face=\"verdana,arial\" size=\"-1\">";
                strResult += strLabel;
                strResult += ": ";
                strResult += strValue;
                strResult += " ";
                strResult += strUnits;
                strResult += " ";
                strResult += strWarning;
                strResult += "<br /></font>";

                string strLegalMin     = CDataUtils.GetDSStringValue(row, "LEGAL_MIN");
                string strLow          = CDataUtils.GetDSStringValue(row, "LOW");
                string strCritialLow   = CDataUtils.GetDSStringValue(row, "CRITICAL_LOW");
                string strHigh         = CDataUtils.GetDSStringValue(row, "HIGH");
                string strCriticalHigh = CDataUtils.GetDSStringValue(row, "CRITICAL_HIGH");
                string strLegalMax     = CDataUtils.GetDSStringValue(row, "LEGAL_MAX");

                strResult += "<font face=\"verdana,arial\" size=\"-2\">";
                strResult += "(Legal Min: " + strLegalMin + " ";
                strResult += "Low: " + strLow + " ";
                strResult += "Critical Low: " + strCritialLow + " ";
                strResult += "High: " + strHigh + " ";
                strResult += "Critical High: " + strCriticalHigh + " ";
                strResult += "Legal Max: " + strLegalMax + ") ";
                strResult += "<br /><br /></font>";
            }
        }

        return(new CStatus());
    }
コード例 #29
0
    protected void btnChangePWD_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txtNewP.Text) ||
            string.IsNullOrEmpty(txtVNewP.Text) ||
            string.IsNullOrEmpty(txtOldP.Text))
        {
            Master.StatusCode    = 1;
            Master.StatusComment = "Password entries are empty!";
            ShowSysFeedback();
            return;
        }

        if (txtNewP.Text != txtVNewP.Text)
        {
            Master.StatusCode    = 1;
            Master.StatusComment = "New Password and Verify Password do not match!";
            ShowSysFeedback();
            return;
        }

        if (pnlSecQuestions.Visible)
        {
            if (cboQuestion1.SelectedIndex < 1 ||
                cboQuestion2.SelectedIndex < 1 ||
                txtAnswer1.Text.Trim().Length < 1 ||
                txtAnswer2.Text.Trim().Length < 1)
            {
                Master.StatusCode    = 1;
                Master.StatusComment = "Please select two challenge questions and enter the corresponding answers!";
                ShowSysFeedback();
                return;
            }
        }

        long   lStatusCode      = 0;
        string strStatusComment = string.Empty;

        //validate the password rules
        CSec sec = new CSec();

        if (!sec.ValidateUserAccountRules(Master, (string)Session["USER_NAME"], txtNewP.Text))
        {
            Master.StatusCode    = lStatusCode;
            Master.StatusComment = strStatusComment;
            ShowSysFeedback();
            return;
        }

        //all good so far, change the pwd, login and redirect
        lStatusCode = sec.ChangePassword(Master, (string)Session["USER_NAME"], txtOldP.Text, txtNewP.Text);

        if (lStatusCode != 0)
        {
            Master.StatusCode    = lStatusCode;
            Master.StatusComment = strStatusComment;
            ShowSysFeedback();
            return;
        }

        //update security challenge questions & answers
        CSecQuestions secquest = new CSecQuestions(Master);

        if (!secquest.UpdateSecQuestions(Convert.ToInt32(cboQuestion1.SelectedValue),
                                         txtAnswer1.Text.Trim(),
                                         Convert.ToInt32(cboQuestion2.SelectedValue),
                                         txtAnswer2.Text.Trim(),
                                         -1,
                                         String.Empty))
        {
            Master.StatusCode    = lStatusCode;
            Master.StatusComment = strStatusComment;
            ShowSysFeedback();
            return;
        }

        //if we get here we have successfully changed the password
        //now login with the new account
        if (sec.Login(Master, (string)Session["USER_NAME"], txtNewP.Text) != 0)
        {
            Master.StatusCode    = lStatusCode;
            Master.StatusComment = strStatusComment;
            ShowSysFeedback();
            return;
        }

        Master.StatusCode    = lStatusCode;
        Master.StatusComment = strStatusComment;

        CPatient   pat   = new CPatient();
        CDataUtils utils = new CDataUtils();
        DataSet    dsPat = pat.GetPatientIDRS(Master, Master.FXUserID);

        Master.SelectedPatientID = utils.GetDSStringValue(dsPat, "PATIENT_ID");

        CPatientEvent evt = new CPatientEvent(Master);

        evt.CompletedEvent(1);


        ShowSysFeedback();

        //successful login so clear txt boxes
        lblUID.Text          = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        txtOldP.Text         = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        txtNewP.Text         = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        txtVNewP.Text        = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        lblUID.Text          = string.Empty;
        txtOldP.Text         = string.Empty;
        txtNewP.Text         = string.Empty;
        txtVNewP.Text        = string.Empty;
        Session["USER_NAME"] = null;

        //set a session variable with the login time
        Session["SESSION_INITIATED"] = DateTime.Now;

        //redirect, we are now logged in
        //Master.Response.Redirect("portal_revamp.aspx");
        Master.Response.Redirect("portal_start.aspx");
    }