Changeset 1194 for Scheduling


Ignore:
Timestamp:
May 29, 2011, 2:13:37 AM (13 years ago)
Author:
Sam Habiel
Message:

All changes to support BMX4. Now works with BMX 4.
AssemblyInfo: Bumped to 1.6 (will be 1.7 pending server changes).
Removed BMXNet23.dll and added BMXNET40.dll and BMXWIN40.dll.
Actual changes to support BMX 4 in the code:
All references to DocManager.ConnectInfo.bmxNetLib substituted with CGDocumentManager.Current.RemoteSession everywhere.
All Events use RemoteSession.EventServices APIs.
All references to DUZ use RemoteSession.User APIs.
All references to BMXNetLib.Piece changed to M.Piece.
Added RPC Logging Capability courtesy of BMX4.
Extensive changes in the Main[] class CGDocumentManager:

  • Added references to IndianHealthService.BMXNet.WinForm
  • Removed references to BMXNetLib and changed to RemoteSession
  • Singleton Instance constructor now private (overdue change).
  • Use new Event Framework part of Remote Session.
  • Login code totally rewritten to use BMXWIN40.dll.
  • RPMSDataTable references changed to TableFromCommand or TableFromSQL.

DAL:

Location:
Scheduling/branches/BMX4Support
Files:
2 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/branches/BMX4Support/AssemblyInfo.cs

    r1174 r1194  
    2828// by using the '*' as shown below:
    2929
    30 [assembly: AssemblyVersion("1.5.1.*")]
     30[assembly: AssemblyVersion("1.6.0.*")]
    3131
    3232//
     
    5858[assembly: AssemblyKeyFile("")]
    5959[assembly: AssemblyKeyName("")]
    60 [assembly: AssemblyFileVersionAttribute("1.5.1.0")]
     60[assembly: AssemblyFileVersionAttribute("1.6.0.0")]
    6161[assembly: ComVisibleAttribute(false)]
  • Scheduling/branches/BMX4Support/CGAVView.cs

    r1117 r1194  
    654654//                              sSql = "BSDX RAISE EVENT^" + sEvent + "^" + sParams + "^^";
    655655//                              DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "RaiseEvent");
    656                                 this.m_DocManager.ConnectInfo.RaiseEvent(sEvent, sParams, true);
     656                                CGDocumentManager.Current.RemoteSession.EventServices.TriggerEvent(sEvent, sParams, true);
    657657                        }
    658658                        catch (Exception ex)
     
    809809                {
    810810                        calendarGrid1.CGToolTip.Active = false;
    811                         string sMsg = " this access block?";
     811                        string sMsg;
    812812                        if (calendarGrid1.SelectedAppointments.AppointmentTable.Count > 1)
    813813                                sMsg = " these access blocks?";
     
    859859                        try
    860860                        {
    861                                 bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "+");
     861                                bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "+");
    862862                                if (bLock == false)
    863863                                {
     
    872872                                        return;
    873873                                }
    874                                 bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
     874                bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "-");
    875875                        }
    876876                        catch (Exception ex)
     
    947947                {
    948948                        this.calendarGrid1.CloseGrid();
    949                         DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
     949            CGDocumentManager.Current.RemoteSession.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
    950950                }
    951951
  • Scheduling/branches/BMX4Support/CGDocumentManager.cs

    r1143 r1194  
     1/* Main Class...:
     2 * Original Author: Horace Whitt
     3 * Current Author and Maintainer: Sam Habiel
     4 * License: LGPL. http://www.gnu.org/licenses/lgpl-2.1.html
     5*/
     6
    17using System;
    28using System.Windows.Forms;
     
    612using System.Threading;
    713using IndianHealthService.BMXNet;
     14using IndianHealthService.BMXNet.WinForm;
     15using IndianHealthService.BMXNet.WinForm.Configuration; //grrrr... too many namespaces here...
    816using Mono.Options;
    917using System.Runtime.InteropServices;
     
    4250                //M Connection member variables
    4351                private DataSet                                                                 m_dsGlobal = null;      // Holds all user data
    44                 private BMXNetConnectInfo                                               m_ConnectInfo = null;   // Connection to VISTA object
    45         private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate;     // Delegate to respond to messages from VISTA. Responds to event: BMXNetConnectInfo.BMXNetEvent
    4652
    4753        //Custom Printing
     
    5157        #region Properties
    5258
    53         /// <summary>
    54         /// Returns the document manager's BMXNetConnectInfo member
    55         /// </summary>
    56         public BMXNetConnectInfo ConnectInfo
    57         {
    58             get
    59             {
    60                 return m_ConnectInfo;
    61             }
    62         }
     59        public WinFramework WinFramework { get; private set; }  // Login Manager
     60        public RemoteSession RemoteSession { get; private set; } // Data Sesssion against the RPMS/VISTA server
     61        public RPCLogger RPCLogger { get; private set; }         // Logger for RPCs
    6362
    6463        /// <summary>
     
    153152
    154153        /// <summary>
    155         /// Constructor. Does absolutely nothing at this point.
     154        /// Private constructor for singleton instance.
    156155        /// </summary>
    157                 public CGDocumentManager()
     156                private CGDocumentManager()
    158157                {
    159158        }
     
    295294
    296295        #region BMXNet Event Handler
    297         private void CDocMgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
    298                 {
    299                         if (e.BMXEvent == "BSDX CALL WORKSTATIONS")
     296        private void CDocMgrEventHandler(Object obj, RemoteEventArgs e)
     297                {
     298                        if (e.EventType == "BSDX CALL WORKSTATIONS")
    300299                        {
    301300                                string sParam = "";
    302301                                string sDelim="~";
    303                                 sParam += this.m_ConnectInfo.UserName + sDelim;
     302                                sParam += this.RemoteSession.User.Name + sDelim;
    304303                                sParam += this.m_sHandle + sDelim;
    305304                                sParam += Application.ProductVersion + sDelim;
    306305                                sParam += this._views.Count.ToString();
    307                                 _current.m_ConnectInfo.RaiseEvent("BSDX WORKSTATION REPORT", sParam, true);
    308                         }
    309                         if (e.BMXEvent == "BSDX ADMIN MESSAGE")
    310                         {
    311                                 string sMsg = e.BMXParam;
     306                                _current.RemoteSession.EventServices.TriggerEvent("BSDX WORKSTATION REPORT", sParam, true);
     307                        }
     308                        if (e.EventType == "BSDX ADMIN MESSAGE")
     309                        {
     310                                string sMsg = e.EventType;
    312311                                ShowAdminMsgDelegate samd = new ShowAdminMsgDelegate(ShowAdminMsg);
    313                                 //this.Invoke(samd, new object [] {sMsg});
    314312                samd.Invoke(sMsg);
    315313                        }
    316                         if (e.BMXEvent == "BSDX ADMIN SHUTDOWN")
    317                         {
    318                                 string sMsg = e.BMXParam;
     314                        if (e.EventType == "BSDX ADMIN SHUTDOWN")
     315                        {
     316                                string sMsg = e.Details;
    319317                                CloseAllDelegate cad = new CloseAllDelegate(CloseAll);
    320                                 //this.Invoke(cad, new object [] {sMsg});
    321318                cad.Invoke(sMsg);
    322319                        }
     
    353350        private bool InitializeApp(bool bReLogin)
    354351                {
    355             //Set M connection info
    356             m_ConnectInfo = new BMXNetConnectInfo(m_Encoding); // Encoding is "" unless passed in command line
    357             _dal = new DAL(m_ConnectInfo);   // Data access layer
    358             //m_ConnectInfo.bmxNetLib.StartLog();    //This line turns on logging of messages
     352            //Note: There are 2 splashes -- one for being the parent of the log in forms
     353            // the next is invoked async and updated async while the GUI is loading
     354            // The reason is b/c an async form cannot be the parent of another that lies on the main thread
     355
     356            RPCLogger = new RPCLogger();
     357
     358            DSplash firstSplash = new DSplash();
     359
     360            firstSplash.Show();
    359361           
    360             //Create a delegate to process events raised by BMX.
    361             CDocMgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(CDocMgrEventHandler);
     362            /* IMPORTANT NOTE
     363             * LOGIN CODE IS COPIED ALMOST VERBATIM FROM THE SCHEMABUILDER APPLICAITON;
     364             * THE ONLY ONE I CAN FIND WHICH RELIES ON BMX 4 NEW WAYS WHICH I CAN'T FIGURE OUT
     365             */
     366            LoginProcess login;
     367            this.WinFramework = WinFramework.CreateWithNetworkBroker(true, RPCLogger);
     368           
     369            if (bReLogin) // if logging in again...
     370            {
     371                this.WinFramework.LoadConnectionSpecs(LocalPersistentStore.CreateDefaultStorage(true), "BSDX");
     372                login = this.WinFramework.CreateLoginProcess();
     373                login.AttemptUserInputLogin("Clincal Scheduling Log-in", 3, true, firstSplash);
     374                goto DoneTrying;
     375            }
     376
     377            // If server,port,ac,vc are supplied on command line, then try to connect...
     378            else if (!String.IsNullOrEmpty(m_Server) && m_Port != 0 && !String.IsNullOrEmpty(m_AccessCode) && !String.IsNullOrEmpty(m_VerifyCode))
     379            {
     380                RpmsConnectionSpec spec = new RpmsConnectionSpec();
     381                spec.IsDefault = true;
     382                spec.Name = "Command Line Server";
     383                spec.Port = m_Port;
     384                spec.Server = m_Server;
     385                spec.UseWindowsAuthentication = false; //for now
     386                spec.UseDefaultNamespace = true; //for now
     387                login = this.WinFramework.CreateLoginProcess();
     388                login.AutoSetDivisionToLastLookup = false;
     389                login.AttemptAccessVerifyLogin(spec, m_AccessCode, m_VerifyCode);
     390                goto DoneTrying;
     391            }
     392           
     393            // if only server, port is supplied, then use these instead
     394            else if (!String.IsNullOrEmpty(m_Server) && m_Port != 0)
     395            {
     396                RpmsConnectionSpec spec = new RpmsConnectionSpec();
     397                spec.IsDefault = true;
     398                spec.Name = "Command Line Server";
     399                spec.Port = m_Port;
     400                spec.Server = m_Server;
     401                spec.UseWindowsAuthentication = false; //for now
     402                spec.UseDefaultNamespace = true; //for now
     403
     404                RpmsConnectionSettings cxnSettings = new RpmsConnectionSettings
     405                {
     406                    CommandLineConnectionSpec = spec
     407                };
     408
     409                this.WinFramework.ConnectionSettings = cxnSettings;
     410
     411                login = this.WinFramework.CreateLoginProcess();
     412                login.AutoSetDivisionToLastLookup = false;
     413                login.AttemptUserInputLogin("Clinical Scheduling Log-in", 3, false, firstSplash);
     414                goto DoneTrying;
     415            }
     416
     417            // if nothing is supplied, fall back on the original dialog
     418            else
     419            {
     420                this.WinFramework.LoadConnectionSpecs(LocalPersistentStore.CreateDefaultStorage(true), "BSDX");
     421                login = this.WinFramework.CreateLoginProcess();
     422                login.AutoSetDivisionToLastLookup = false;
     423                login.AttemptUserInputLogin("Clincal Scheduling Log-in", 3, true, firstSplash);
     424
     425                goto DoneTrying;
     426            }
     427
     428DoneTrying:
     429            if (!login.WasSuccessful)
     430            {
     431                return false;
     432            }
     433
     434            LocalSession local = this.WinFramework.LocalSession;
     435
     436            if ((this.WinFramework.Context.User.Division == null) && !this.WinFramework.AttemptUserInputSetDivision("Set Initial Division", firstSplash))
     437            {
     438                return false;
     439            }
     440
     441           
     442
     443            this.RemoteSession = this.WinFramework.PrimaryRemoteSession;
     444
    362445            //Tie delegate to Events generated by BMX.
    363             m_ConnectInfo.BMXNetEvent += CDocMgrEventDelegate;
    364             //Disable polling (But does this really work???? I don't see how it gets disabled)
    365             m_ConnectInfo.EventPollingEnabled = false;
    366 
     446            this.RemoteSession.EventServices.RpmsEvent += this.CDocMgrEventHandler;
     447            //Disable polling
     448            this.RemoteSession.EventServices.IsEventPollingEnabled = false;
     449
     450            //Second splash screens
    367451            //Show a splash screen while initializing; define delegates to remote thread
    368             DSplash m_ds = new DSplash();
    369             DSplash.dSetStatus setStatusDelegate = new DSplash.dSetStatus(m_ds.SetStatus);
    370             DSplash.dAny closeSplashDelegate = new DSplash.dAny(m_ds.RemoteClose);
    371             DSplash.dProgressBarSet setMaxProgressDelegate = new DSplash.dProgressBarSet(m_ds.RemoteProgressBarMaxSet);
    372             DSplash.dProgressBarSet setProgressDelegate = new DSplash.dProgressBarSet(m_ds.RemoteProgressBarValueSet);
     452            DSplash secondSplash = new DSplash();
     453            DSplash.dSetStatus setStatusDelegate = new DSplash.dSetStatus(secondSplash.SetStatus);
     454            DSplash.dAny closeSplashDelegate = new DSplash.dAny(secondSplash.RemoteClose);
     455            DSplash.dProgressBarSet setMaxProgressDelegate = new DSplash.dProgressBarSet(secondSplash.RemoteProgressBarMaxSet);
     456            DSplash.dProgressBarSet setProgressDelegate = new DSplash.dProgressBarSet(secondSplash.RemoteProgressBarValueSet);
    373457
    374458            //Start new thread for the Splash screen.
     
    376460            threadSplash.IsBackground = true; //expendable thread -- exit even if still running.
    377461            threadSplash.Name = "Splash Thread";
    378             threadSplash.Start(m_ds); // pass form as parameter.
     462            threadSplash.Start(secondSplash);
     463
     464            firstSplash.Close(); // close temporary splash now that the new one is up and running
    379465
    380466            //There are 21 steps to load the application. That's max for the progress bar.
    381467            setMaxProgressDelegate(21);
     468
     469            // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings");
     470            setStatusDelegate("Connecting to VISTA");
     471
    382472           
    383             // smh--not used: System.Configuration.ConfigurationManager.GetSection("appSettings");
    384            
    385             setStatusDelegate("Connecting to VISTA");
    386            
     473            /*
    387474            //Try to connect using supplied values for Server and Port
    388475            //Why am I doing this? The library BMX net uses prompts for access and verify code
     
    462549                }
    463550                        }while (bRetry == true);
    464            
    465             //Printing
    466 
     551            */
     552
     553            //Printing Custom DLL. Perfect place for code injection!!!
     554            //*************************************************
    467555            string DllLocation = string.Empty;
    468556            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Application.StartupPath + @"\Printing\");
     
    495583                this.m_PrintingObject = Creator.PrintFactory();
    496584            }
    497            
     585           //************************************************
    498586           
    499587            //User Interface Culture (m_CultureName is set from the command line flag /culture)
     
    512600            }
    513601
     602            _dal = new DAL(RemoteSession);   // Data access layer
     603           
    514604            //Create global dataset
    515605                        _current.m_dsGlobal = new DataSet("GlobalDataSet");
     
    553643            setProgressDelegate(2);
    554644            setStatusDelegate("Setting encoding...");
    555 
     645            //PORT TODO: Set encoding
    556646            if (m_Encoding == String.Empty)
    557647            {
    558                 string utf8_server_support = m_ConnectInfo.bmxNetLib.TransmitRPC("BMX UTF-8", "");
     648                string utf8_server_support = RemoteSession.TransmitRPC("BMX UTF-8", "");
     649               
    559650                if (utf8_server_support == "1")
    560                     m_ConnectInfo.bmxNetLib.Encoder = System.Text.UTF8Encoding.UTF8;
     651                    RemoteSession.ConnectionEncoding = System.Text.UTF8Encoding.UTF8;
     652               
    561653            }
    562654                       
     
    565657            setProgressDelegate(3);
    566658                        setStatusDelegate("Setting Application Context to BSDXRPC...");
    567                         m_ConnectInfo.AppContext = "BSDXRPC";
     659                        RemoteSession.AppContext = "BSDXRPC";
    568660
    569661            //User Preferences Object
     
    571663            setStatusDelegate("Getting User Preferences from the Server...");
    572664
    573             _current.UserPreferences = new UserPreferences(); // Does the calling to do that...
     665            _current.UserPreferences = new UserPreferences(); // Constructor Does the calling to do that...
    574666           
    575667            //Load global recordsets
     
    583675            setProgressDelegate(6);
    584676            setStatusDelegate(statusConst + " Schedule User");
    585             DataTable dtUser = _dal.GetUserInfo(m_ConnectInfo.DUZ);
     677            DataTable dtUser = _dal.GetUserInfo(RemoteSession.User.Duz);
    586678            dtUser.TableName = "SchedulingUser";
    587679            m_dsGlobal.Tables.Add(dtUser);
     
    598690            setProgressDelegate(7);
    599691            setStatusDelegate(statusConst + " Access Types");
    600             DataTable dtAccessTypes = _dal.GetAccessTypes();
    601             dtAccessTypes.TableName = "AccessTypes";
    602             m_dsGlobal.Tables.Add(dtAccessTypes);
     692            DataTable dtAccessTypes = _dal.GetAccessTypes(m_dsGlobal, "AccessTypes");
    603693
    604694            //Get Access Groups
     
    680770            //cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
    681771            sCommandText = "BSDX HOSPITAL LOCATION";
    682             ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal);
     772            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "HospitalLocation");
    683773            Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n");
    684774
     
    732822            setStatusDelegate(statusConst + " Providers");
    733823            sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = '' AND BMXIEN > 1";
    734             ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal);
     824            RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "Provider");
    735825            Debug.Write("LoadGlobalRecordsets -- Provider loaded\n");
    736826
     
    740830            setStatusDelegate(statusConst + " Holiday");
    741831            sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE INTERNAL[DATE] > '" + FMDateTime.Create(DateTime.Today).DateOnly.FMDateString + "'";
    742             ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal);
     832            RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "HOLIDAY");
    743833            Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n");
    744834
     
    749839
    750840            setStatusDelegate("Setting Receive Timeout");
    751             _current.m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout
     841            _current.RemoteSession.ReceiveTimeout = 30000; //30-second timeout
    752842
    753843#if DEBUG
    754             _current.m_ConnectInfo.ReceiveTimeout = 600000; //longer timeout for debugging
     844            _current.RemoteSession.ReceiveTimeout = 600000; //longer timeout for debugging
    755845#endif
    756846                        // Event Subsriptions
     
    758848            //Table #16
    759849            setProgressDelegate(18);
    760             _current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE");
     850            _current.RemoteSession.EventServices.Subscribe("BSDX SCHEDULE");
    761851                        //Table #17
    762852            setProgressDelegate(19);
    763             _current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS");
     853            _current.RemoteSession.EventServices.Subscribe("BSDX CALL WORKSTATIONS");
    764854                        //Table #18
    765855            setProgressDelegate(20);
    766             _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE");
     856            _current.RemoteSession.EventServices.Subscribe("BSDX ADMIN MESSAGE");
    767857                        //Table #19
    768858            setProgressDelegate(21);
    769             _current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN");
    770 
    771                         _current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds
    772                         _current.m_ConnectInfo.EventPollingEnabled = true;
    773                         _current.m_ConnectInfo.AutoFire = 12; //AutoFire every 12*5 seconds
     859            _current.RemoteSession.EventServices.Subscribe("BSDX ADMIN SHUTDOWN");
     860
     861                        _current.RemoteSession.EventServices.EventPollingInterval = 5000; //in milliseconds
     862                        _current.RemoteSession.EventServices.IsEventPollingEnabled = true;
     863                       
     864            //PORT TODO: No Autofire in BMX 4.0
     865            //_current.RemoteSession.EventServices. = 12; //AutoFire every 12*5 seconds
    774866
    775867            //Close Splash Screen
     
    785877                {
    786878                        string sCommandText = "SELECT * FROM BSDX_ACCESS_GROUP";
    787                         ConnectInfo.RPMSDataTable(sCommandText, "AccessGroup", m_dsGlobal);
     879                        RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "AccessGroup");
    788880                        Debug.Write("LoadGlobalRecordsets -- AccessGroups loaded\n");
    789881                }
     
    792884                {
    793885                        string sCommandText = "BSDX GET ACCESS GROUP TYPES";
    794                         ConnectInfo.RPMSDataTable(sCommandText, "AccessGroupType", m_dsGlobal);
     886            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "AccessGroupType");
    795887                        Debug.Write("LoadGlobalRecordsets -- AccessGroupTypes loaded\n");
    796888                }
     
    798890                public void LoadBSDXResourcesTable()
    799891                {
    800                         string sCommandText = "BSDX RESOURCES^" + m_ConnectInfo.DUZ;
    801                         ConnectInfo.RPMSDataTable(sCommandText, "Resources", m_dsGlobal);
     892                        string sCommandText = "BSDX RESOURCES^" + RemoteSession.User.Duz;
     893            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "Resources");
    802894                        Debug.Write("LoadGlobalRecordsets -- Resources loaded\n");
    803895                }
     
    809901                        //to which user has access
    810902                        //Fields are: RESOURCE_GROUPID, RESOURCE_GROUP
    811                         string sCommandText = "BSDX RESOURCE GROUPS BY USER^" + m_ConnectInfo.DUZ;
    812                         ConnectInfo.RPMSDataTable(sCommandText, "ResourceGroup", m_dsGlobal);
     903                        string sCommandText = "BSDX RESOURCE GROUPS BY USER^" + RemoteSession.User.Duz;
     904            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "ResourceGroup");
    813905                        Debug.Write("LoadGlobalRecordsets -- ResourceGroup loaded\n");
    814906                }
     
    821913                        //are returned.
    822914                        //Fields are: RESOURCE_GROUPID, RESOURCE_GROUP, RESOURCE_GROUP_ITEMID, RESOURCE_NAME, RESOURCE_ID
    823                         string sCommandText = "BSDX GROUP RESOURCE^" + m_ConnectInfo.DUZ;
    824                         ConnectInfo.RPMSDataTable(sCommandText, "GroupResources", m_dsGlobal);
     915                        string sCommandText = "BSDX GROUP RESOURCE^" + RemoteSession.User.Duz;
     916            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "GroupResources");
    825917                        Debug.Write("LoadGlobalRecordsets -- GroupResources loaded\n");
    826918                }
     
    831923                        //who possesses the BSDXZMENU security key.
    832924                        string sCommandText = "BSDX SCHEDULE USER";
    833                         ConnectInfo.RPMSDataTable(sCommandText, "ScheduleUser", m_dsGlobal);
     925            RemoteSession.TableFromCommand(sCommandText, m_dsGlobal, "ScheduleUser");
    834926                        Debug.Write("LoadGlobalRecordsets -- ScheduleUser loaded\n");
    835927                }
     
    850942            if (!bAllUsers)
    851943            {
    852                 sCommandText += String.Format(" WHERE INTERNAL[USERNAME] = {0}", m_ConnectInfo.DUZ);
    853             }
    854 
    855                         ConnectInfo.RPMSDataTable(sCommandText, "ResourceUser", m_dsGlobal);
     944                sCommandText += String.Format(" WHERE INTERNAL[USERNAME] = {0}", RemoteSession.User.Duz);
     945            }
     946
     947            RemoteSession.TableFromSQL(sCommandText, m_dsGlobal, "ResourceUser");
    856948                        Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n");
    857949                }
     
    9681060                        if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
    9691061                        {
    970                                 m_ConnectInfo.EventPollingEnabled = false;
    971                                 m_ConnectInfo.UnSubscribeEvent("BSDX SCHEDULE");
    972                                 m_ConnectInfo.CloseConnection();
     1062                                RemoteSession.EventServices.IsEventPollingEnabled = false;
     1063                                RemoteSession.EventServices.Unsubscribe("BSDX SCHEDULE");
     1064                RemoteSession.Close();
    9731065                                Application.Exit();
    9741066                        }
     
    9831075                        if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
    9841076                        {
    985                                 m_ConnectInfo.bmxNetLib.CloseConnection();
     1077                RemoteSession.Close();
    9861078                                Application.Exit();
    9871079                        }
     
    11231215               
    11241216                //Used in Do loop
    1125                 bool bRetry = true;
     1217                //bool bRetry = true;
    11261218                               
    1127                 // Do Loop to deal with changing the server and the vagaries of user choices.
     1219                /*// Do Loop to deal with changing the server and the vagaries of user choices.
    11281220                                do
    11291221                                {
     
    11341226                        //so it can be re-used when BMX tries to log in again.
    11351227                        //Access and Verify code are prompted for in InitializeApp
    1136                                                 m_ConnectInfo.ChangeServerInfo();
     1228                        LoginProcess login = this.WinFramework.CreateLoginProcess();
     1229                        login.AttemptUserInputLogin("ReLog-in", 3, true, null);
    11371230                                                bRetry = false;
    11381231                                        }
     
    11571250                                        }
    11581251                                } while (bRetry == true);
    1159 
     1252                */
     1253               
    11601254                //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code.
    11611255                bool isEverythingOkay = this.InitializeApp(true);
     
    11941288                private void mnuRPMSLogin_Click(object sender, EventArgs e)
    11951289                {
    1196                         //Warn that changing login will close all schedules
     1290            mnuRPMSServer_Click(sender, e);
     1291           
     1292            /* v 1.7 to support BMX 4 -- commented out -- smh
     1293            //Warn that changing login will close all schedules
    11971294                        if (MessageBox.Show("Are you sure you want to close all schedules and login to VistA?", "Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
    11981295                                return;
     
    12061303                                CloseAll();
    12071304                                m_bExitOK = true;
     1305
     1306                LoginProcess login = this.WinFramework.CreateLoginProcess();
     1307                login.AttemptUserInputLogin("Clincal Scheduling", 3, true, null);
     1308                //m_ConnectInfo.bmxNetLib.StartLog();    //This line turns on logging of messages
     1309
     1310                if (!login.WasSuccessful)
     1311                {
     1312                    return;
     1313                }
     1314
     1315                LocalSession local = this.WinFramework.LocalSession;
     1316
     1317                if ((this.WinFramework.Context.User.Division == null) && !this.WinFramework.AttemptUserInputSetDivision("Set Initial Division", null))
     1318                {
     1319                    return;
     1320                }
     1321
     1322                this.RemoteSession = this.WinFramework.PrimaryRemoteSession;
    12081323
    12091324                //Parameter for initialize app tells it that this is a re-login and forces a new access and verify code.
     
    12331348                                throw ex;
    12341349                        }
    1235        
     1350                */
    12361351                }
    12371352
     
    12901405                        {
    12911406                                //System.IntPtr pHandle = this.Handle;
    1292                                 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable);
     1407                                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(RemoteSession.TableFromCommand);
    12931408                                //dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName});
    1294                 dtOut = rdtd.Invoke(sSQL, sTableName);
     1409                dtOut = RemoteSession.TableFromCommand(sSQL);
     1410                dtOut.TableName = sTableName;
     1411
    12951412                        }
    12961413
     
    13071424                public void ChangeDivision(System.Windows.Forms.Form frmCaller)
    13081425                {
    1309                         this.ConnectInfo.ChangeDivision(frmCaller);
     1426            WinFramework.AttemptUserInputSetDivision("Change Division", frmCaller);
     1427
     1428            RemoteSession = WinFramework.PrimaryRemoteSession;
     1429
    13101430                        foreach (CGView v in _views.Keys)
    13111431                        {
  • Scheduling/branches/BMX4Support/CGView.cs

    r1174 r1194  
    114114        private MenuItem sepApptMenu3;
    115115        private MenuItem mnuReprintApptSlip;
     116        private MenuItem mnuViewBrokerLog;
    116117        private IContainer components;
    117118
     
    132133                public void InitializeDocView(string sText)
    133134                {
    134                         this.Text = this.DocManager.ConnectInfo.UserName;
     135            this.Text = CGDocumentManager.Current.RemoteSession.User.Name;
    135136                        if (sText != null)
    136137                                this.Text += " - " + sText;
    137                         if (DocManager.ConnectInfo.DivisionName != null)
    138                                 this.Text += " - " + DocManager.ConnectInfo.DivisionName;
     138            if (CGDocumentManager.Current.RemoteSession.User.Division.Name != null)
     139                this.Text += " - " + CGDocumentManager.Current.RemoteSession.User.Division.Name;
    139140                }
    140141
     
    157158
    158159            // Set username and division up top
    159             this.Text = this.DocManager.ConnectInfo.UserName;
     160            this.Text = CGDocumentManager.Current.RemoteSession.User.Name;
    160161                        if (sText != null)
    161162                                this.Text += " - " + sText;
    162                         if (DocManager.ConnectInfo.DivisionName != null)
    163                                 this.Text += " - " + DocManager.ConnectInfo.DivisionName;
    164 
    165                         this.m_ConnectInfo = m_DocManager.ConnectInfo;
    166                         m_bmxDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(BMXNetEventHandler);
    167                         m_ConnectInfo.BMXNetEvent += m_bmxDelegate;
    168                 }
    169 
    170                 private BMXNetConnectInfo.BMXNetEventDelegate m_bmxDelegate;
     163                        if (CGDocumentManager.Current.RemoteSession.User.Division.Name != null)
     164                this.Text += " - " + CGDocumentManager.Current.RemoteSession.User.Division.Name;
     165
     166            CGDocumentManager.Current.RemoteSession.EventServices.RpmsEvent += BMXNetEventHandler;
     167                }
    171168               
    172169
     
    235232            this.mnuHelp = new System.Windows.Forms.MenuItem();
    236233            this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
     234            this.mnuViewBrokerLog = new System.Windows.Forms.MenuItem();
    237235            this.mnuTest = new System.Windows.Forms.MenuItem();
    238236            this.mnuTest1 = new System.Windows.Forms.MenuItem();
     
    680678            this.mnuHelp.Index = 3;
    681679            this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
    682             this.mnuHelpAbout});
     680            this.mnuHelpAbout,
     681            this.mnuViewBrokerLog});
    683682            this.mnuHelp.Text = "&Help";
    684683            //
     
    688687            this.mnuHelpAbout.Text = "&About";
    689688            this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
     689            //
     690            // mnuViewBrokerLog
     691            //
     692            this.mnuViewBrokerLog.Index = 1;
     693            this.mnuViewBrokerLog.Text = "&View Broker Log";
     694            this.mnuViewBrokerLog.Click += new System.EventHandler(this.mnuViewBrokerLog_Click);
    690695            //
    691696            // mnuTest
     
    702707            this.mnuTest1.Index = 0;
    703708            this.mnuTest1.Text = "Test1";
    704             this.mnuTest1.Click += new System.EventHandler(this.mnuTest1_Click);
    705709            //
    706710            // tvSchedules
     
    712716            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
    713717            this.tvSchedules.Name = "tvSchedules";
    714             this.tvSchedules.Size = new System.Drawing.Size(128, 392);
     718            this.tvSchedules.Size = new System.Drawing.Size(128, 389);
    715719            this.tvSchedules.Sorted = true;
    716720            this.tvSchedules.TabIndex = 1;
     
    781785            this.panelRight.Location = new System.Drawing.Point(996, 0);
    782786            this.panelRight.Name = "panelRight";
    783             this.panelRight.Size = new System.Drawing.Size(128, 392);
     787            this.panelRight.Size = new System.Drawing.Size(128, 389);
    784788            this.panelRight.TabIndex = 3;
    785789            this.panelRight.Visible = false;
     
    877881            this.panelCenter.Location = new System.Drawing.Point(136, 24);
    878882            this.panelCenter.Name = "panelCenter";
    879             this.panelCenter.Size = new System.Drawing.Size(857, 344);
     883            this.panelCenter.Size = new System.Drawing.Size(857, 341);
    880884            this.panelCenter.TabIndex = 7;
    881885            //
     
    984988            this.panelBottom.Controls.Add(this.statusBar1);
    985989            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
    986             this.panelBottom.Location = new System.Drawing.Point(136, 368);
     990            this.panelBottom.Location = new System.Drawing.Point(136, 365);
    987991            this.panelBottom.Name = "panelBottom";
    988992            this.panelBottom.Size = new System.Drawing.Size(857, 24);
     
    10021006            this.splitter1.Location = new System.Drawing.Point(128, 24);
    10031007            this.splitter1.Name = "splitter1";
    1004             this.splitter1.Size = new System.Drawing.Size(8, 368);
     1008            this.splitter1.Size = new System.Drawing.Size(8, 365);
    10051009            this.splitter1.TabIndex = 9;
    10061010            this.splitter1.TabStop = false;
     
    10111015            this.splitter2.Location = new System.Drawing.Point(993, 24);
    10121016            this.splitter2.Name = "splitter2";
    1013             this.splitter2.Size = new System.Drawing.Size(3, 368);
     1017            this.splitter2.Size = new System.Drawing.Size(3, 365);
    10141018            this.splitter2.TabIndex = 10;
    10151019            this.splitter2.TabStop = false;
     
    10341038            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
    10351039            this.calendarGrid1.SelectedAppointment = 0;
    1036             this.calendarGrid1.Size = new System.Drawing.Size(857, 344);
     1040            this.calendarGrid1.Size = new System.Drawing.Size(857, 341);
    10371041            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
    10381042            this.calendarGrid1.TabIndex = 0;
     
    10471051            //
    10481052            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    1049             this.ClientSize = new System.Drawing.Size(1124, 392);
     1053            this.ClientSize = new System.Drawing.Size(1124, 389);
    10501054            this.Controls.Add(this.panelCenter);
    10511055            this.Controls.Add(this.panelBottom);
     
    10861090                private Hashtable                       m_htModifySchedule;
    10871091                private Hashtable                       m_htChangeAppts;
    1088                 private BMXNetConnectInfo       m_ConnectInfo = null;
    1089                 public BMXNetConnectInfo.BMXNetEventDelegate    BMXNetEvent;
    10901092
    10911093                #endregion Fields
     
    13081310                        DataTable dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
    13091311                        DataView dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
    1310                         string sDuz = this.DocManager.ConnectInfo.DUZ;
     1312            string sDuz = CGDocumentManager.Current.RemoteSession.User.Duz;
    13111313                        bool bModSchedule = false;
    13121314                        DataRowView[] drvA = dv.FindRows(sResource);
     
    17561758                                        doc.ResourceID = Convert.ToInt32(sResourceID);
    17571759
    1758                                         bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + sResourceID + ")", "+");
     1760                    bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXRES(" + sResourceID + ")", "+");
    17591761                                        if (bLock == false)
    17601762                                        {
     
    19291931                        dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
    19301932                        dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
    1931                         dv.RowFilter = "USERNAME = '" + this.DocManager.ConnectInfo.UserName + "'";
     1933            dv.RowFilter = "USERNAME = '" + CGDocumentManager.Current.RemoteSession.User.Name + "'";
    19321934                        for (int j=0; j < dv.Count; j++)
    19331935                        {
     
    25042506                        {
    25052507                string msg;
    2506                 if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
    2507                     msg = BMXNetLib.Piece(ex.Message, "~", 4);
     2508                if (M.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
     2509                    msg = M.Piece(ex.Message, "~", 4);
    25082510                else
    25092511                    msg = ex.Message;
     
    26152617                        {   
    26162618                string msg;
    2617                 if (BMXNetLib.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
    2618                     msg = BMXNetLib.Piece(ex.Message, "~", 4);
     2619                if (M.Piece(ex.Message, "~", 1) == "-10") // -10 means that BSDXAPI reported an error.
     2620                    msg = M.Piece(ex.Message, "~", 4);
    26192621                else
    26202622                    msg = ex.Message;
     
    27162718        /// <param name="e">BMXEvent Args:
    27172719        /// e.BMXEvent is free text for Event Type; e.BMXParam is free text for Event Arguments</param>
    2718         private void BMXNetEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
     2720        private void BMXNetEventHandler(Object obj, RemoteEventArgs e)
    27192721        {
    27202722            try
     
    27242726
    27252727                // if event is Autofire event
    2726                 if (e.BMXEvent == "BMXNet AutoFire")
     2728                if (e.EventType == "BMXNet AutoFire")
    27272729                {
    27282730                    Debug.Write("CGView caught AutoFire event.\n");
     
    27372739
    27382740                // if event is BSDX SCHEDULE
    2739                 else if (e.BMXEvent == "BSDX SCHEDULE")
     2741                else if (e.EventType == "BSDX SCHEDULE")
    27402742                {
    27412743                    //See if any of the resources in the event argument matches BSDX Schedule.
     
    27452747                    {
    27462748                        sResourceName = m_Document.m_sResourcesArray[j].ToString();
    2747                         if (e.BMXParam == sResourceName)
     2749                        if (e.Details == sResourceName)
    27482750                        {
    27492751                            Debug.Write("CGView caught BSDX SCHEDULE event.\n");
     
    28132815            {
    28142816                //Signal RPMS to raise an event
    2815                 m_ConnectInfo.RaiseEvent(sEvent, sParams, false);
     2817                CGDocumentManager.Current.RemoteSession.EventServices.TriggerEvent(sEvent, sParams, false);
    28162818            }
    28172819            catch (Exception ex)
     
    28592861            try
    28602862            {
    2861                 bool bLock = DocManager.ConnectInfo.Lock("^BSDXMGR", "+", "");
     2863                bool bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "+");
    28622864                if (bLock == false)
    28632865                {
     
    28742876                m_DocManager.GlobalDataSet.Tables["ResourceUser"].Clear();
    28752877                m_DocManager.LoadResourceUserTable(false);
    2876                 bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
     2878                bLock = CGDocumentManager.Current.RemoteSession.Lock("^BSDXMGR", "-");
    28772879            }
    28782880            catch (ApplicationException aex)
     
    31403142        }
    31413143
    3142         /// <summary>
    3143         /// Useless code now... Good place to test something.
    3144         /// </summary>
    3145         /// <param name="sender"></param>
    3146         /// <param name="e"></param>
    3147                 private void mnuTest1_Click(object sender, System.EventArgs e)
    3148                 {
    3149                         ReaderWriterLock m_rwl = this.DocManager.ConnectInfo.bmxNetLib.BMXRWL;
     3144                private void CGView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
     3145                {
    31503146                        try
    31513147                        {
    3152                                 m_rwl.AcquireWriterLock(50);
    3153                                 Debug.Write("\nTest Button 1 Acquired first lock\n");
    3154                                 m_rwl.AcquireWriterLock(50);
    3155                                 Debug.Write("Test Button 1 Acquired second lock\n");
    3156                                 this.DocManager.ViewRefresh();
    3157                                 Thread.Sleep(5000);
    3158                                 try
    3159                                 {
    3160                                 }
    3161                                 catch
    3162                                 {
    3163                                 }
    3164                                 finally
    3165                                 {
    3166                                         m_rwl.ReleaseWriterLock();
    3167                                         Debug.Write ("Test Button 1 released first lock.\n");
    3168                                         m_rwl.ReleaseWriterLock();
    3169                                         Debug.Write ("Test Button 1 released second lock.\n");
    3170                                 }
    3171 
    3172                                 return;
    3173                         }
    3174                         catch (Exception ex)
    3175                         {
    3176                                 Debug.Write("Test Button 1 exception: " + ex.Message + "\n");
    3177                         }
    3178                 }
    3179 
    3180                 private void CGView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    3181                 {
    3182                         try
    3183                         {
    3184                                 m_ConnectInfo.BMXNetEvent -= m_bmxDelegate;
     3148                                CGDocumentManager.Current.RemoteSession.EventServices.RpmsEvent -= BMXNetEventHandler;
    31853149                                this.calendarGrid1.CloseGrid();
    31863150                        }
     
    39043868        }
    39053869
     3870        private void mnuViewBrokerLog_Click(object sender, EventArgs e)
     3871        {
     3872            var view = new RPCLoggerView();
     3873            view.Show();
     3874        }
     3875
    39063876
    39073877    }//End class
  • Scheduling/branches/BMX4Support/ClinicalScheduling.csproj

    r1174 r1194  
    148148    <Compile Include="Provider.cs" />
    149149    <Compile Include="RadiologyExam.cs" />
     150    <Compile Include="RPCLogger.cs" />
     151    <Compile Include="RPCLoggerView.cs">
     152      <SubType>Form</SubType>
     153    </Compile>
     154    <Compile Include="RPCLoggerView.Designer.cs">
     155      <DependentUpon>RPCLoggerView.cs</DependentUpon>
     156    </Compile>
    150157    <Compile Include="strings.ar.Designer.cs">
    151158      <AutoGen>True</AutoGen>
     
    431438    <EmbeddedResource Include="LoadingSplash.resx">
    432439      <DependentUpon>LoadingSplash.cs</DependentUpon>
     440    </EmbeddedResource>
     441    <EmbeddedResource Include="RPCLoggerView.resx">
     442      <DependentUpon>RPCLoggerView.cs</DependentUpon>
    433443    </EmbeddedResource>
    434444    <EmbeddedResource Include="strings.ar.resx">
     
    479489  </ItemGroup>
    480490  <ItemGroup>
    481     <ProjectReference Include="..\bmx\BMXNet\BMXNet.csproj">
     491    <ProjectReference Include="..\BMX4\IHS BMX Framework\IndianHealthService.BMXNet.WinForm\IndianHealthService.BMXNet.WinForm.csproj">
     492      <Project>{3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}</Project>
     493      <Name>IndianHealthService.BMXNet.WinForm</Name>
     494    </ProjectReference>
     495    <ProjectReference Include="..\BMX4\IHS BMX Framework\IndianHealthService.BMXNet\IndianHealthService.BMXNet.csproj">
    482496      <Project>{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}</Project>
    483       <Name>BMXNet</Name>
     497      <Name>IndianHealthService.BMXNet</Name>
    484498    </ProjectReference>
    485499  </ItemGroup>
  • Scheduling/branches/BMX4Support/ClinicalScheduling.csproj.user

    r1159 r1194  
    3737    </RemoteDebugMachine>
    3838    <StartAction>Project</StartAction>
    39     <StartArguments>/s=172.16.16.108 /p=9250 /a=s.habiel /v=catdog.77</StartArguments>
     39    <StartArguments>/s=172.16.16.142 /p=9260 /a=shabiel12 /v=catdog.77</StartArguments>
    4040    <StartPage>
    4141    </StartPage>
  • Scheduling/branches/BMX4Support/ClinicalScheduling.sln

    r1122 r1194  
    33Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClinicalScheduling", "ClinicalScheduling.csproj", "{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}"
    44EndProject
    5 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMXNet", "..\bmx\BMXNet\BMXNet.csproj", "{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}"
     5Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IndianHealthService.BMXNet", "..\BMX4\IHS BMX Framework\IndianHealthService.BMXNet\IndianHealthService.BMXNet.csproj", "{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}"
     6EndProject
     7Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IndianHealthService.BMXNet.WinForm", "..\BMX4\IHS BMX Framework\IndianHealthService.BMXNet.WinForm\IndianHealthService.BMXNet.WinForm.csproj", "{3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}"
    68EndProject
    79Global
     
    1921                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2022                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
     23                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     24                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
     25                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
     26                {3B9011B5-59F4-4F6B-ADC7-54ADC6948F4D}.Release|Any CPU.Build.0 = Release|Any CPU
    2127        EndGlobalSection
    2228        GlobalSection(SolutionProperties) = preSolution
  • Scheduling/branches/BMX4Support/DAL.cs

    r1174 r1194  
    1616    public class DAL
    1717    {
    18         private BMXNetConnectInfo _thisConnection; // set in constructor
     18        private RemoteSession _thisConnection; // set in constructor
    1919       
    2020        delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName); // for use in calling (Sync and Async)
     
    2525        /// </summary>
    2626        /// <param name="conn">The current connection to use</param>
    27         public DAL(BMXNetConnectInfo conn)
     27        public DAL(RemoteSession conn)
    2828        {
    2929            this._thisConnection = conn;
     
    3939        {
    4040            string cmd = String.Format("BMX VERSION INFO^{0}", nmsp);
    41             return RPMSDataTable(cmd, "");
     41            return _thisConnection.TableFromCommand(cmd);
    4242        }
    4343
     
    5050        {
    5151            string cmd = String.Format("BSDX SCHEDULING USER INFO^{0}", DUZ);
    52             return RPMSDataTable(cmd, "");
     52            return _thisConnection.TableFromCommand(cmd);
    5353        }
    5454
     
    6565        /// BLUE (NJ3,0), [0;7]
    6666        ///</returns>
    67         public DataTable GetAccessTypes()
     67        public DataTable GetAccessTypes(DataSet dataSetToTakeTable, string tablename)
    6868        {
    6969            string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE";
    70             DataTable table = RPMSDataTable(sCommandText, "");
     70            DataTable table = _thisConnection.TableFromSQL(sCommandText, dataSetToTakeTable, tablename);
    7171            DataColumn dcKey = table.Columns["BMXIEN"];
    7272            DataColumn[] dcKeys = new DataColumn[1];
     
    9393            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    9494            string cmd = String.Format("BSDX CLINIC LETTERS^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    95             return RPMSDataTable(cmd, "");
     95            return _thisConnection.TableFromCommand(cmd);
    9696        }
    9797
     
    107107        {
    108108            string cmd = String.Format("BSDX RESOURCE LETTERS^{0}", sClinicList);
    109             return RPMSDataTable(cmd, "");
     109            return _thisConnection.TableFromCommand(cmd);
    110110        }
    111111
     
    126126            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    127127            string cmd = String.Format("BSDX REBOOK CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    128             return RPMSDataTable(cmd, "");
     128            return _thisConnection.TableFromCommand(cmd);
    129129        }
    130130
     
    139139        {
    140140            string cmd = String.Format("BSDX REBOOK LIST^{0}", sApptList);
    141             return RPMSDataTable(cmd, "");
     141            return _thisConnection.TableFromCommand(cmd);
    142142        }
    143143
     
    157157            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    158158            string cmd = String.Format("BSDX CANCEL CLINIC LIST^{0}^{1}^{2}", sClinicList, sBegin, sEnd);
    159             return RPMSDataTable(cmd, "");
     159            return _thisConnection.TableFromCommand(cmd);
    160160        }
    161161
     
    173173            string sEnd = FMDateTime.Create(EndDate).DateOnly.FMDateString;
    174174            string cmd = String.Format("BSDX CANCEL AV BY DATE^{0}^{1}^{2}", sResourceID, sBegin, sEnd);
    175             return RPMSDataTable(cmd, "Cancelled");
     175            return _thisConnection.TableFromCommand(cmd);
    176176        }
    177177
     
    185185        {
    186186            string cmd = string.Format("BSDX REMOVE CHECK-IN^{0}", ApptID);
    187             return RPMSDataTable(cmd, "");
     187            return _thisConnection.TableFromCommand(cmd);
    188188        }
    189189
     
    197197        {
    198198            string cmd = string.Format("BSDX GET RAD EXAM FOR PT^{0}^{1}", DFN, SCIEN);
    199             DataTable tbl = RPMSDataTable(cmd, "");
     199            DataTable tbl = _thisConnection.TableFromCommand(cmd);
    200200            return (from row in tbl.AsEnumerable()
    201201                    select new RadiologyExam
     
    218218        {
    219219            string fmStartDate = FMDateTime.Create(dStart).FMDateString;
    220             string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));
     220            string result = _thisConnection.TransmitRPC("BSDX SCHEDULE RAD EXAM", string.Format("{0}^{1}^{2}", DFN, examIEN, fmStartDate));
    221221            return result == "1" ? true : false;
    222222        }
     
    230230        public bool CancelRadiologyExam(int DFN, int examIEN)
    231231        {
    232             string result = _thisConnection.bmxNetLib.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));
     232            string result = _thisConnection.TransmitRPC("BSDX HOLD RAD EXAM", string.Format("{0}^{1}", DFN, examIEN));
    233233            return result == "1" ? true : false;
    234234        }
     
    245245            get
    246246            {
    247                 string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
     247                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT RS");  //1 = true; 0 = false; "" = not set
    248248                return val == "1" ? true : false;
    249249            }
    250250            set
    251251            {
    252                 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     252                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
    253253                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
    254254                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT RS", value ? "1" : "0"), null, null);
     
    267267            get
    268268            {
    269                 string val = _thisConnection.bmxNetLib.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
     269                string val = _thisConnection.TransmitRPC("BSDX GET PARAM", "BSDX AUTO PRINT AS");  //1 = true; 0 = false; "" = not set
    270270                return val == "1" ? true : false;
    271271            }
    272272            set
    273273            {
    274                 TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.bmxNetLib.TransmitRPC);
     274                TransmitRPCAsync _asyncTransmitter = new TransmitRPCAsync(_thisConnection.TransmitRPC);
    275275                // 0 = success; anything else is wrong. Not being tested here as its success is not critical to application use.
    276276                _asyncTransmitter.BeginInvoke("BSDX SET PARAM", String.Format("{0}^{1}", "BSDX AUTO PRINT AS", value ? "1" : "0"), null, null);
     
    292292            DataTable dtOut;
    293293
    294 #if TRACE
    295             DateTime sendTime = DateTime.Now;
    296 #endif
    297294            try
    298295            {
    299                 RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.RPMSDataTable);
     296                RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(_thisConnection.TableFromSQL);
    300297                dtOut = (DataTable)rdtd.Invoke(sSQL, sTableName);
    301298            }
     
    306303                throw ex;
    307304            }
    308 
    309 #if TRACE
    310             DateTime receiveTime = DateTime.Now;
    311             TimeSpan executionTime = receiveTime - sendTime;
    312             Debug.Write("RPMSDataTable Execution Time: " + executionTime.Milliseconds + " ms.\n");
    313 #endif
    314305
    315306            return dtOut;
  • Scheduling/branches/BMX4Support/DManagement.cs

    r1075 r1194  
    140140                        this.m_dsGlobal = m_DocManager.GlobalDataSet;
    141141
    142                         MgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(MgrEventHandler);
    143                         m_DocManager.ConnectInfo.BMXNetEvent += MgrEventDelegate;
    144                         m_DocManager.ConnectInfo.SubscribeEvent("BSDX WORKSTATION REPORT");
     142            m_DocManager.RemoteSession.EventServices.RpmsEvent += MgrEventHandler;
     143                        m_DocManager.RemoteSession.EventServices.Subscribe("BSDX WORKSTATION REPORT");
    145144                        m_dtWSGrid = new DataTable("WSGrid");
    146145                        m_dtWSGrid.Columns.Add("UserName", typeof(System.String));
     
    18991898            m_dsGlobal.Tables["AccessTypes"].Clear();
    19001899            m_dsGlobal.Tables["AccessGroupType"].Clear();
    1901             DataTable dt1 = m_DocManager.DAL.GetAccessTypes();
    1902             m_dsGlobal.Tables["AccessTypes"].Merge(dt1);
    1903             m_dsGlobal.Tables.Add(dt1);
     1900            //PORT TODO: This may fail.
     1901            DataTable dt1 = m_DocManager.DAL.GetAccessTypes(m_dsGlobal, "AccessTypes");
     1902            //m_dsGlobal.Tables["AccessTypes"].Merge(dt1); //smh -commented out for BMX4
     1903            //m_dsGlobal.Tables.Add(dt1);                  //smh -commented out for BMX4
    19041904            //Fix Groups
    19051905            //m_DocManager.LoadAccessTypesTable();
     
    23292329                {
    23302330                        this.m_dtWSGrid.Clear();
    2331                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX CALL WORKSTATIONS", "A", true);
    2332                 }
    2333 
    2334                 private BMXNetConnectInfo.BMXNetEventDelegate   MgrEventDelegate;
     2331                        this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX CALL WORKSTATIONS", "A", true);
     2332                }
     2333
    23352334                delegate void UpdateWorkstationGridDelegate(string sParam);
    23362335
    2337                 private void MgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
     2336                private void MgrEventHandler(Object obj, RemoteEventArgs e)
    23382337                {
    23392338                        try
    23402339                        {
    2341                                 if (e.BMXEvent == "BSDX WORKSTATION REPORT")
     2340                                if (e.EventType == "BSDX WORKSTATION REPORT")
    23422341                                {
    23432342                                        Debug.Write("DManagement Got Workstation Report\n");
     
    23452344                    if (this.InvokeRequired == true) //ensures that handle is created
    23462345                    {
    2347                         this.Invoke(uWSGd, new object[] { e.BMXParam });
     2346                        this.Invoke(uWSGd, new object[] { e.Details });
    23482347                    }
    23492348                    else
    23502349                    {
    2351                         UpdateWorkstationGrid(e.BMXParam);
     2350                        UpdateWorkstationGrid(e.Details);
    23522351                    }
    23532352                                }
     
    23632362                        string sDelim = "~";
    23642363                        DataRow dr = this.m_dtWSGrid.NewRow();
    2365                         dr["UserName"] = BMXNetLib.Piece(sParam,sDelim,1);
    2366                         dr["Handle"] = BMXNetLib.Piece(sParam,sDelim,2);
    2367                         dr["Version"] = BMXNetLib.Piece(sParam,sDelim,3);               
    2368                         dr["Views"] = BMXNetLib.Piece(sParam,sDelim,4);
     2364                        dr["UserName"] = M.Piece(sParam,sDelim,1);
     2365                        dr["Handle"] = M.Piece(sParam,sDelim,2);
     2366                        dr["Version"] = M.Piece(sParam,sDelim,3);               
     2367                        dr["Views"] = M.Piece(sParam,sDelim,4);
    23692368                        m_dtWSGrid.Rows.Add(dr);
    23702369                }
     
    23722371                private void DManagement_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    23732372                {
    2374                         m_DocManager.ConnectInfo.UnSubscribeEvent("BSDX WORKSTATION REPORT");
     2373                        CGDocumentManager.Current.RemoteSession.EventServices.Unsubscribe("BSDX WORKSTATION REPORT");
    23752374                }
    23762375
     
    23892388                                return;
    23902389
    2391                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN MESSAGE", sMessage, false);
     2390            this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN MESSAGE", sMessage, false);
    23922391                }
    23932392
     
    23982397                                return;
    23992398                        }
    2400                         this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
     2399            this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
    24012400        }
    24022401        #endregion Workstations
  • Scheduling/branches/BMX4Support/Printing.cs

    r1159 r1194  
    181181           
    182182            // Draw Header
    183             string division = CGDocumentManager.Current.ConnectInfo.DivisionName;
     183            string division = CGDocumentManager.Current.RemoteSession.User.Division.Name;
    184184            g.DrawString(division, fBody, Brushes.Black, headerArea, sfCenterCenter);
    185185
     
    591591
    592592            // Draw Header
    593             string division = CGDocumentManager.Current.ConnectInfo.DivisionName;
     593            string division = CGDocumentManager.Current.RemoteSession.User.Division.Name;
    594594            g.DrawString(division, fBody, Brushes.Black, headerArea, sf0);
    595595
Note: See TracChangeset for help on using the changeset viewer.