コード例 #1
0
ファイル: FilmingUtility.cs プロジェクト: whhub/Filming
        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);
            }
        }
コード例 #2
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");
        }