Ejemplo n.º 1
0
    //page load
    protected void Page_Load(object sender, EventArgs e)
    {
        //TIU SUPPORT
        if (m_BaseMstr.APPMaster.TIU)
        {
            tpTIUNote.Visible = true;

            string strConfirm = "";
            strConfirm += "if( confirm('";
            strConfirm += "You are about to send a TIU note to CPRS. REVAMP TIU Notes on CPRS cannot be modified. If you do not want to send the TIU note at this time click Cancel.";
            strConfirm += "\\n\\n";
            strConfirm += "Do you want to continue?";
            strConfirm += "') )";
            strConfirm += "{";
            strConfirm += " __doPostBack('";
            strConfirm += btnWriteTIU.ClientID;
            strConfirm += "', ''); ";
            //if you dont return true you lose the please wait!
            strConfirm += " return true;";
            strConfirm += "}";
            strConfirm += "else";
            strConfirm += "{";
            strConfirm += "  return false;";
            strConfirm += "}";

            //add the JS to the button click
            btnWriteTIU.OnClientClick = strConfirm;

            if (!IsPostBack)
            {
                string strUserName       = String.Empty;
                string strPWD            = String.Empty;
                long   lRegionID         = 0;
                long   lSiteID           = 0;
                string strNoteTitleLabel = String.Empty;
                long   lNoteClinicID     = 0;

                bool bStatus = GetMDWSAccountInfo(m_BaseMstr.FXUserID,
                                                  out strUserName,
                                                  out strPWD,
                                                  out lRegionID,
                                                  out lSiteID,
                                                  out strNoteTitleLabel,
                                                  out lNoteClinicID);

                CMDWSUtils mdws = new CMDWSUtils();
                mdws.LoadNoteTitlesDDL(strNoteTitleLabel,
                                       m_BaseMstr,
                                       ddlNoteTitle);
                mdws.LoadClinicsDDL(lNoteClinicID,
                                    m_BaseMstr,
                                    ddlClinic);
                GetTIUNote();
            }
        }
        else
        {
            pnlViewNote.Visible  = false;
            pnlWriteNote.Visible = false;
            tpTIUNote.Visible    = false;
        }

        if (!IsPostBack && !bSecondPass)
        {
            //VERIFY STATUS OF THE PATIENT RECORD
            CPatientLock plock = new CPatientLock(m_BaseMstr);

            string strLockProviderName  = String.Empty;
            string strLockProviderEmail = String.Empty;

            m_BaseMstr.IsPatientLocked   = plock.IsPatientLocked(m_BaseMstr.SelectedPatientID, out strLockProviderName, out strLockProviderEmail);
            Session["PAT_LOCK_PROVIDER"] = strLockProviderName;
            Session["PAT_LOCK_EMAIL"]    = strLockProviderEmail;
        }

        bool bRecLock = BaseMstr.IsPatientLocked;

        //check soap sections rights mode
        lROSubjective = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteSubjectiveUR);
        lROObjective  = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteObjectiveUR);
        lROAssessment = usrsec.GetRightMode(BaseMstr, (long)SUATUserRight.NoteAssessmentUR);

        if (bRecLock)
        {
            lROSubjective = (long)RightMode.ReadOnly;
            lROObjective  = (long)RightMode.ReadOnly;
            lROAssessment = (long)RightMode.ReadOnly;
        }

        //just return if no patient is loaded
        if (BaseMstr.SelectedPatientID.Length < 1)
        {
            return;
        }

        //wire up the main save button
        if (BaseMstr.OnMasterSAVE())
        {
            MasterSave();
        }

        DisableSOAPNote();

        switch (rblAssessmentView.SelectedIndex)
        {
        case 0:
            vwDiagnosis.Style.Add("display", "block");
            vwAssessmentNote.Style.Add("display", "none");
            txtAssessment.Visible = false;
            break;

        case 1:
            vwDiagnosis.Style.Add("display", "none");
            vwAssessmentNote.Style.Add("display", "block");
            txtAssessment.Visible = true;
            break;
        }

        //-----------------------------------------------------------------
        //  NOT POSTBACK
        #region NotPostback
        if (!IsPostBack)
        {
            mvwObjectiveOptions.ActiveViewIndex = 0;

            rblObjectiveView.SelectedIndex = 1; //Default Note

            rblAssessmentView.SelectedIndex = 0;
            vwDiagnosis.Style.Add("display", "block"); //Diagnosis View

            ucAxes.Load_Assessment();
            ucAxes.AutoSelectProblemInit();

            ucProblemList.Initialize();
        }
        #endregion


        //-----------------------------------------------------------------
        //  IS POSTBACK
        #region IsPostBack
        if (IsPostBack)
        {
            string EvtSender = String.Empty;
            if (Request.Params.Get("__EVENTTARGET") != null)
            {
                EvtSender = Request.Params.Get("__EVENTTARGET").ToString();
                //if a selection was made on the diagnosis popups
                if (Regex.IsMatch(EvtSender, "axis(1)", RegexOptions.IgnoreCase))
                {
                    ucProblemList.Initialize();
                }
            }
        }
        #endregion

        //TIU SUPPORT
        if (m_BaseMstr.APPMaster.TIU)
        {
            //get the postback control
            string strPostBackControl = Request.Params["__EVENTTARGET"];
            if (strPostBackControl != null)
            {
                //did we do a click write tiu?
                if (strPostBackControl.IndexOf("btnWriteTIU") > -1)
                {
                    WriteTIU();
                }
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.ClosePatient();
        ucLogin.BaseMstr = Master;

        //TIU SUPPORT
        if (!IsPostBack)
        {
            if (Master.APPMaster.TIU)
            {
                CMDWSUtils mdws = new CMDWSUtils();

                pnlMDWS.Visible = true;

                txtMDWSUserName.Text    = String.Empty;
                txtMDWSPWD.Text         = String.Empty;
                ddlRegion.SelectedIndex = -1;
                ddlSite.SelectedIndex   = -1;

                string strUserName       = String.Empty;
                string strPWD            = String.Empty;
                long   lRegionID         = 0;
                long   lSiteID           = 0;
                string strNoteTitleLabel = String.Empty;
                long   lNoteClinicID     = 0;

                bool bStatus = mdws.GetMDWSAccountInfo(Master.FXUserID,
                                                       out strUserName,
                                                       out strPWD,
                                                       out lRegionID,
                                                       out lSiteID,
                                                       out strNoteTitleLabel,
                                                       out lNoteClinicID,
                                                       Master);

                if (bStatus)
                {
                    //update account info on the screen
                    txtMDWSUserName.Text = strUserName;
                    txtMDWSPWD.Text      = strPWD;
                }

                mdws.LoadRegionsDDL(lRegionID, Master, ddlRegion);
                mdws.LoadSitesDDL(lRegionID, lSiteID, Master, ddlSite);

                //hide defaults if no account
                if (strUserName == null || strUserName.Trim() == String.Empty)
                {
                    lblNoteTitle.Visible = false;
                    ddlNoteTitle.Visible = false;
                    lblClinic.Visible    = false;
                    ddlClinic.Visible    = false;
                    btnSaveTIU.Visible   = false;
                }
                else
                {
                    //show and load defaults
                    lblNoteTitle.Visible = true;
                    ddlNoteTitle.Visible = true;
                    lblClinic.Visible    = true;
                    ddlClinic.Visible    = true;
                    btnSaveTIU.Visible   = true;

                    mdws.LoadNoteTitlesDDL(strNoteTitleLabel,
                                           Master,
                                           ddlNoteTitle);
                    mdws.LoadClinicsDDL(lNoteClinicID,
                                        Master,
                                        ddlClinic);
                }
            }
            else
            {
                pnlMDWS.Visible = false;
            }
        }

        //TIU SUPPORT
        //get the postback control
        if (Master.APPMaster.TIU)
        {
            CMDWSUtils mdwsUtils          = new CMDWSUtils();
            string     strPostBackControl = Request.Params["__EVENTTARGET"];
            if (strPostBackControl != null)
            {
                //did we do a patient lookup?
                if (strPostBackControl.IndexOf("btnSaveMDWS") > -1)
                {
                    long   lRegionID   = REVAMP.TIU.CDropDownList.GetSelectedLongID(ddlRegion);
                    long   lSiteID     = REVAMP.TIU.CDropDownList.GetSelectedLongID(ddlSite);
                    string strUserName = txtMDWSUserName.Text;
                    string strPWD      = txtMDWSPWD.Text;
                    if (!mdwsUtils.UpdateMDWSAccount(lRegionID,
                                                     lSiteID,
                                                     strUserName,
                                                     strPWD,
                                                     Master))
                    {
                        ShowSysFeedback();
                    }
                    else
                    {
                        //load titles and clinics if they are not loaded
                        if (ddlNoteTitle.Items.Count < 1)
                        {
                            lblNoteTitle.Visible = true;
                            ddlNoteTitle.Visible = true;
                            lblClinic.Visible    = true;
                            ddlClinic.Visible    = true;
                            btnSaveTIU.Visible   = true;

                            mdwsUtils.LoadNoteTitlesDDL("",
                                                        Master,
                                                        ddlNoteTitle);
                            mdwsUtils.LoadClinicsDDL(-1,
                                                     Master,
                                                     ddlClinic);
                        }
                    }
                }
                if (strPostBackControl.IndexOf("btnSaveTIU") > -1)
                {
                    long   lClinicID    = Convert.ToInt32(ddlClinic.SelectedValue);
                    string strNoteTitle = ddlNoteTitle.SelectedValue;
                    if (!mdwsUtils.UpdateMDWSDefaults(lClinicID,
                                                      strNoteTitle,
                                                      Master))
                    {
                        ShowSysFeedback();
                    }
                }
            }
        }
    }