Ejemplo n.º 1
0
        public static void UpdatePrintStatus(List <string> uids, DBWrapper db, ICommunicationProxy proxy)
        {
            try
            {
                Logger.LogFuncUp();

                uids.RemoveAll(uid => string.IsNullOrWhiteSpace(uid));
                if (uids.Count == 0)
                {
                    return;
                }

                //var db = FilmingDbOperation.Instance.FilmingDbWrapper;

                //var proxy = FilmingViewerContainee.Main.GetCommunicationProxy();

                db.SetAutoNotifyOn(proxy);
                foreach (var uid in uids)
                {
                    db.Update("studytable", "StudyInstanceUID='" + uid + "'", "StudyPrintStatus='1'");
                }
                //send db update notification

                IMcsfDBInfoModal dbInfoModal = new IMcsfDBInfoModal();
                dbInfoModal.EventItems = new List <IMcsfDBInfoModalItem>();
                IMcsfDBInfoModalItem item;
                //add event for itself
                foreach (var uid in uids)
                {
                    item         = new IMcsfDBInfoModalItem();
                    item.Type    = DBEventType.EventStudyUpdate;
                    item.UID     = uid;
                    item.SubType = DBEventSubType.EventAll;
                    item.SubUID  = "";
                    dbInfoModal.EventItems.Add(item);
                }
                var DBCommProxy = McsfDatabaseProxyFactory.Instance().CreateDatabaseProxy(proxy);
                DBCommProxy.SendEventInfo(dbInfoModal);


                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }
        }
Ejemplo n.º 2
0
        private string NoticeEventHandlerFromDatabase(CommandContext param)
        {
            try
            {
                GlobalDefinition.LoggerWrapper.LogDevInfo(
                    "enter function --- CommunicationSender.NoticeEventHandlerFromDatabase(CommandContext param)");

                if (null == param)
                {
                    GlobalDefinition.LoggerWrapper.LogDevWarning("param is null");
                    return(string.Empty);
                }

                if (null == param.sSerializeObject)
                {
                    GlobalDefinition.LoggerWrapper.LogDevWarning("param.sSerializeObject is null");
                    return(string.Empty);
                }

                IMcsfDBInfoModal dbInfoModel = null;

                var databaseProxy =
                    McsfDatabaseProxyFactory.Instance().CreateDatabaseProxy(ContaineeUtility._feCommProxy);
                dbInfoModel = databaseProxy.ParseFromStringToEventInfo(param.sSerializeObject);

                var handler = AsynDbCommandHandler;
                if (handler != null)
                {
                    handler.BeginInvoke(dbInfoModel, null, null);
                }
            }
            catch (Exception ex)
            {
                GlobalDefinition.LoggerWrapper.LogDevError(ex.Message);
                GlobalDefinition.LoggerWrapper.LogDevError(ex.StackTrace);
            }

            GlobalDefinition.LoggerWrapper.LogDevInfo(
                "exit function --- CommunicationSender.NoticeEventHandlerFromDatabase(CommandContext param)");
            return(string.Empty);
        }
Ejemplo n.º 3
0
        private void RegisteredDBNotification()
        {
            //Create DatabaseProxy
            IDatabaseProxy databaseProxy =
                McsfDatabaseProxyFactory.Instance().CreateDatabaseProxy(ContaineeUtility._feCommProxy);

            //setup some register info
            IMcsfDBInfoModal dbInfoModal = new IMcsfDBInfoModal();

            dbInfoModal.EventItems = new List <IMcsfDBInfoModalItem>();

            IMcsfDBInfoModalItem item;

            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventPatientUpdate;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventPatientDelete;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventPatientStudyChange;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventStudyUpdate;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventStudyDelete;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventStudyInsert;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventStudySeriesChange;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventSeriesUpdate;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventSeriesComplete;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //-----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventSeriesDelete;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //----------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventSeriesInsert;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //----------------------------------------
            item = new IMcsfDBInfoModalItem
            {
                Type    = DBEventType.EventStudyImported,
                UID     = "",
                SubType = DBEventSubType.EventAll,
                SubUID  = ""
            };
            dbInfoModal.EventItems.Add(item);
            //---------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventImageDelete;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            //---------------------------------------
            item         = new IMcsfDBInfoModalItem();
            item.Type    = DBEventType.EventStudyWithSubItemsChanged;
            item.UID     = "";
            item.SubType = DBEventSubType.EventAll;
            item.SubUID  = "";
            dbInfoModal.EventItems.Add(item);
            if (null != databaseProxy)
            {
                GlobalDefinition.LoggerWrapper.LogTraceInfo("param databaseProxy is not null");
                databaseProxy.RegisterEventInfo(dbInfoModal);
            }
            GlobalDefinition.LoggerWrapper.LogTraceInfo("Now we exit RegisteredDBNotification method");
        }