Ignore:
Timestamp:
Jun 10, 2010, 5:20:08 PM (14 years ago)
Author:
Sam Habiel
Message:

CGView: Added various shortcuts keys for menus; removed extra overbook prompt after booking if doing an overbook. You already get one before booking.
CGDocumentManager: Mickey mouse connection check to prevent prompting for access and verify if there's no connection to VISTA.
CGDocumentManager: Test SQL statement to retrieve Hospital Locations and default providers associated with them.
Remove garbage file {85FE etc}.rpt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r788 r794  
    240240                m_ds.Refresh();
    241241                                bool bRetry = true;
     242
     243                //Try to connect using supplied values for Server and Port
     244                //Why am I doing this? The library BMX net uses prompts for access and verify code
     245                //whether you can connect or not. Not good. So I test first whether
     246                //we can connect at all by doing a simple connection and disconnect.
     247                //TODO: Make this more robust by sending a TCPConnect message and seeing if you get a response.
     248
     249                if (m_Server != "" && m_Port != 0)
     250                {
     251                    System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient();
     252                    try
     253                    {
     254                        tcpClient.Connect(m_Server, m_Port); // open it
     255                        tcpClient.Close();                  // then close it
     256                    }
     257                    catch (System.Net.Sockets.SocketException ex)
     258                    {
     259                        throw ex;
     260                    }
     261                }
    242262                                do
    243263                                {
    244                                         try
    245                                         {
    246                                                 if (bReLogin == true)
    247                                                 {
    248                                                         //Prompt for Access and Verify codes
    249                                                         _current.m_ConnectInfo.LoadConnectInfo("", "");
    250                                                 }
    251                                                 else
    252                                                 {
     264                    try
     265                    {
     266                        if (bReLogin == true)
     267                        {
     268                            //Prompt for Access and Verify codes
     269                            _current.m_ConnectInfo.LoadConnectInfo("", "");
     270                        }
     271                        else
     272                        {
    253273                            if (m_Server != String.Empty && m_Port != 0 && m_AccessCode != String.Empty
    254274                                && m_VerifyCode != String.Empty)
     275                            {
    255276                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode);
     277                            }
    256278                            else if (m_Server != String.Empty && m_Port != 0)
    257279                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", "");
     
    259281                                m_ConnectInfo.LoadConnectInfo();
    260282                        }
    261                                                 bRetry = false;
    262                                         }
    263                                         catch (Exception ex)
    264                                         {
    265                                                 m_ds.Close();
    266                                                 if (MessageBox.Show("Unable to connect to VistA.  " + ex.Message , "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
    267                                                 {
    268                                                         bRetry = true;
    269                                                         _current.m_ConnectInfo.ChangeServerInfo();
    270                                                 }
    271                                                 else
    272                                                 {
    273                                                         bRetry = false;
    274                                                         throw ex;
    275                                                 }
    276                                         }
     283                        bRetry = false;
     284                    }
     285                    catch (System.Net.Sockets.SocketException)
     286                    {
     287                        MessageBox.Show("Cannot connect to VistA. ");
     288                    }
     289                    catch (Exception ex)
     290                    {
     291                        m_ds.Close();
     292                        if (MessageBox.Show("Unable to connect to VistA.  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
     293                        {
     294                            bRetry = true;
     295                            _current.m_ConnectInfo.ChangeServerInfo();
     296                        }
     297                        else
     298                        {
     299                            bRetry = false;
     300                            throw ex;
     301                        }
     302                    }
    277303                                }while (bRetry == true);
    278304
     
    415441                }
    416442
     443        //TODO:REMOVE THIS
    417444                public void LoadClinicSetupTable()
    418445                {
     
    613640
    614641                        //Build active provider table
    615                         sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND INTERNAL[PROVIDER_CLASS] > 0";
     642                        sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = ''";
    616643                        ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal);
    617644                        Debug.Write("LoadGlobalRecordsets -- Provider loaded\n");
     
    626653                        sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE DATE > '" + DateTime.Today.ToShortDateString() + "'";
    627654                        ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal);
     655            Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n");
     656
     657            sCommandText = @"SELECT HOSPITAL_LOCATION.BMXIEN 'BMXIEN', HOSPITAL_LOCATION.PROVIDER.PROVIDER 'PROVIDER', HOSPITAL_LOCATION.PROVIDER.DEFAULT_PROVIDER 'DEFAULT' FROM HOSPITAL_LOCATION";
     658            ConnectInfo.RPMSDataTable(sCommandText, "ClinicProviders", m_dsGlobal);
     659            Debug.Write("LoadingGlobalRecordsets -- ClinicProviders loaded\n");
    628660
    629661                        //Save the xml schema
Note: See TracChangeset for help on using the changeset viewer.