Пример #1
0
    /// <summary>
    /// TIU SUPPORT - transfer MDWS patients
    /// </summary>
    /// <param name="strSearch"></param>
    /// <returns></returns>
    protected bool MDWSPatientTransfer(long lMatchType, string strSearch)
    {
        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 login if we are not connected
        long lMDWSUserID = 0;

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

        //transfer the patient(s)
        long lPatCount = 0;

        REVAMP.TIU.CMDWSOps mdws = new REVAMP.TIU.CMDWSOps(data);
        status = mdws.GetMDWSMatchPatients(strConnectionString,
                                           bAudit,
                                           BaseMstr.FXUserID,
                                           BaseMstr.Key,
                                           BaseMstr.Session,
                                           lMatchType,
                                           strSearch,
                                           out lPatCount);

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

        return(true);
    }
Пример #2
0
    /// <summary>
    /// TIU SUPPORT - get the tiu note
    /// </summary>
    protected void GetTIUNote()
    {
        //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)
        {
            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)
        {
            return;
        }

        //write the note to tiu
        string strNoteText = String.Empty;

        REVAMP.TIU.CMDWSOps ops = new REVAMP.TIU.CMDWSOps(data);
        status = ops.GetMDWSTIUNote(strConnectionString,
                                    bAudit,
                                    m_BaseMstr.FXUserID,
                                    m_BaseMstr.SelectedPatientID,
                                    m_BaseMstr.SelectedTreatmentID,
                                    m_BaseMstr.SelectedEncounterID,
                                    out strNoteText);

        if (status.Status)
        {
            if (strNoteText != String.Empty)
            {
                txtViewTIU.Text      = strNoteText;
                pnlWriteNote.Visible = false;
                pnlViewNote.Visible  = true;
            }
            else
            {
                pnlWriteNote.Visible = true;
                pnlViewNote.Visible  = false;

                //preload the the tiu note from SOAP
                string strSubjective = txtSubjective.Text.Trim();
                string strObjective  = txtObjective.Text.Trim();
                string strAssessment = txtAssessment.Text.Trim();

                string strNote = String.Empty;
                strNote += strSubjective;

                strNote += "\r\n\r\n";
                strNote += strObjective;

                strNote += "\r\n\r\nASSESSMENT/PLAN:\r\n\r\n";

                //
                //get the diagnosis
                CDataParameterList pListDiag = new CDataParameterList(m_BaseMstr);
                pListDiag.AddInputParameter("pi_vPatientID", m_BaseMstr.SelectedPatientID);
                pListDiag.AddInputParameter("pi_nTreatmentID", m_BaseMstr.SelectedTreatmentID);
                pListDiag.AddInputParameter("pi_vEncounterID", m_BaseMstr.SelectedEncounterID);

                long     lStatusCode      = 0;
                string   strStatusComment = String.Empty;
                DataSet  dsDiag           = null;
                CDataSet cds = new CDataSet();
                dsDiag = cds.GetOracleDataSet(m_BaseMstr.DBConn,
                                              "PCK_REVAMP_TIU.GetEncTIUNoteDiagRS",
                                              pListDiag,
                                              out lStatusCode,
                                              out strStatusComment);
                string strDiagnosis = "";

                if (!REVAMP.TIU.CDataUtils.IsEmpty(dsDiag))
                {
                    foreach (DataTable table in dsDiag.Tables)
                    {
                        foreach (DataRow row in table.Rows)
                        {
                            string strDiagCode       = "";
                            string strDiagnosticText = "";
                            strDiagCode       = REVAMP.TIU.CDataUtils.GetDSStringValue(row, "DIAG_CODE");
                            strDiagnosticText = REVAMP.TIU.CDataUtils.GetDSStringValue(row, "DIAGNOSTIC_TEXT");

                            strDiagnosis += strDiagCode + " " + strDiagnosticText;
                            strDiagnosis += "\r\n";
                        }
                    }
                }

                //add the diagnosis to the text
                strNote += "DIAGNOSIS:\r\n\r\n";

                strNote += strDiagnosis;
                strNote += "\r\n";

                //add the assessment plan to the text
                strNote += strAssessment;

                //set the contents of the text
                txtTIUNote.Text = strNote;
            }
        }
        else
        {
            pnlWriteNote.Visible = true;
            pnlViewNote.Visible  = false;
        }
    }
Пример #3
0
    /// <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;
        }
    }