Beispiel #1
0
    /// <summary>
    /// load note titles ddl
    /// </summary>
    /// <param name="strNoteTitleLabel"></param>
    /// <param name="master"></param>
    /// <param name="ddlNoteTitle"></param>
    /// <returns></returns>
    public bool LoadNoteTitlesDDL(string strNoteTitleLabel,
                                  BaseMaster master,
                                  DropDownList ddlNoteTitle)
    {
        ddlNoteTitle.Items.Clear();

        REVAMP.TIU.CStatus status = new REVAMP.TIU.CStatus();

        //get data object and connection info
        string strConnectionString = String.Empty;

        REVAMP.TIU.CData data      = null;
        bool             bAudit    = false;
        CMDWSUtils       mdwsUtils = new CMDWSUtils();

        mdwsUtils.GetDataInfo(master,
                              master.Session,
                              out data,
                              out strConnectionString,
                              out bAudit);

        //check connection login if we are not connected
        long lMDWSUserID = 0;

        status = mdwsUtils.MDWSLogin(data,
                                     master,
                                     strConnectionString,
                                     bAudit,
                                     out lMDWSUserID);
        if (!status.Status)
        {
            return(false);
        }

        REVAMP.TIU.CNoteTitleData ntd = new REVAMP.TIU.CNoteTitleData(data);
        DataSet dsNoteTitles          = null;

        status = ntd.GetNoteTitleDS(strConnectionString,
                                    bAudit,
                                    master.FXUserID,
                                    master.Session,
                                    out dsNoteTitles);

        status = REVAMP.TIU.CDropDownList.RenderDataSet(dsNoteTitles,
                                                        ddlNoteTitle,
                                                        "NOTE_TITLE_LABEL",
                                                        "NOTE_TITLE_LABEL");
        ddlNoteTitle.SelectedIndex = -1;

        REVAMP.TIU.CDropDownList.SelectItemByValue(ddlNoteTitle, strNoteTitleLabel);

        return(true);
    }
    /// <summary>
    /// TIU SUPPORT - write a tiu note
    /// </summary>
    public void WriteTIU()
    {
        if (ddlClinic.SelectedIndex <= 0 ||
            ddlNoteTitle.SelectedIndex <= 0)
        {
            BaseMstr.StatusCode    = 1;
            BaseMstr.StatusComment = "Please select a valid note title and clinic!";
            ShowSysFeedback();
            return;
        }

        //status
        REVAMP.TIU.CStatus status = new REVAMP.TIU.CStatus();

        //get data object and connection info
        string strConnectionString = String.Empty;

        REVAMP.TIU.CData data      = null;
        bool             bAudit    = false;
        CMDWSUtils       mdwsUtils = new CMDWSUtils();

        mdwsUtils.GetDataInfo(BaseMstr,
                              Session,
                              out data,
                              out strConnectionString,
                              out bAudit);

        //check connection to mdws login if we are not connected
        long lMDWSUserID = 0;

        status = mdwsUtils.MDWSLogin(data,
                                     BaseMstr,
                                     strConnectionString,
                                     bAudit,
                                     out lMDWSUserID);
        if (!status.Status)
        {
            BaseMstr.StatusCode    = 1;
            BaseMstr.StatusComment = "Could not login to MDWS, please check your credentials!";
            ShowSysFeedback();
            return;
        }

        //get the MDWS patient id
        string strMDWSPatID  = "";
        string strProviderID = "";

        status = mdwsUtils.GetPatientIDs(strConnectionString,
                                         bAudit,
                                         m_BaseMstr,
                                         data,
                                         m_BaseMstr.SelectedPatientID,
                                         out strMDWSPatID,
                                         out strProviderID);

        if (!status.Status || strMDWSPatID == String.Empty)
        {
            BaseMstr.StatusCode    = 1;
            BaseMstr.StatusComment = "This patient does not have a MDWS patient id! Please contact your System Administrator!";
            ShowSysFeedback();
            return;
        }

        //get the note title IEN
        long lNoteTitleIEN = 0;

        REVAMP.TIU.CNoteTitleData nd = new REVAMP.TIU.CNoteTitleData(data);
        status = nd.GetNoteTitleIEN(strConnectionString,
                                    bAudit,
                                    m_BaseMstr.FXUserID,
                                    m_BaseMstr.Session,
                                    ddlNoteTitle.SelectedValue,
                                    out lNoteTitleIEN);
        if (!status.Status)
        {
            BaseMstr.StatusCode    = 1;
            BaseMstr.StatusComment = "Could not retrieve Note ID from MDWS! Please contact your System Administrator!";
            ShowSysFeedback();
            return;
        }

        //write the note to tiu
        REVAMP.TIU.CMDWSOps ops = new REVAMP.TIU.CMDWSOps(data);
        status = ops.WriteNote(strConnectionString,
                               bAudit,
                               m_BaseMstr.FXUserID,
                               m_BaseMstr.SelectedPatientID,
                               strMDWSPatID,
                               m_BaseMstr.SelectedTreatmentID,
                               m_BaseMstr.SelectedEncounterID,
                               Convert.ToString(lMDWSUserID),
                               txtSign.Text,
                               ddlClinic.SelectedValue,
                               Convert.ToString(lNoteTitleIEN),
                               txtTIUNote.Text);
        if (status.Status)
        {
            //this will get the newly saved note from MDWS
            //and swap the panels to view mode
            GetTIUNote();
        }
        else
        {
            BaseMstr.StatusCode    = 1;
            BaseMstr.StatusComment = status.StatusComment;
            ShowSysFeedback();
            return;
        }
    }