예제 #1
0
        /// <summary>
        /// Inserts a MoveSopInstance work queue entry
        /// </summary>
        /// <param name="context"></param>
        /// <param name="location"></param>
        /// <param name="seriesInstanceUid"></param>
        /// <param name="sopInstanceUids"></param>
        /// <param name="deviceKey"></param>
        /// <param name="externalRequest"></param>
        /// <exception cref="ApplicationException">If the "DeleteSeries" Work Queue entry cannot be inserted.</exception>
        private static WorkQueue InsertMoveInstanceRequest(IUpdateContext context, StudyStorageLocation location, string seriesInstanceUid, IEnumerable <string> sopInstanceUids, ServerEntityKey deviceKey, ExternalRequestQueue externalRequest)
        {
            // Create a work queue entry and append the series instance uid into the WorkQueueUid table

            WorkQueue moveSopInstance = null;
            var       broker          = context.GetBroker <IInsertWorkQueue>();

            foreach (string sop in sopInstanceUids)
            {
                InsertWorkQueueParameters criteria = new MoveInstanceWorkQueueParameters(location, seriesInstanceUid, sop, deviceKey);
                if (externalRequest != null)
                {
                    criteria.ExternalRequestQueueKey = externalRequest.Key;
                }

                moveSopInstance = broker.FindOne(criteria);
                if (moveSopInstance == null)
                {
                    throw new ApplicationException(
                              String.Format("Unable to insert a Move Sop Instance request for study {0}", location.StudyInstanceUid));
                }
            }

            return(moveSopInstance);
        }
예제 #2
0
        /// <summary>
        /// Inserts a MoveSopInstance work queue entry
        /// </summary>
        /// <param name="context"></param>
        /// <param name="location"></param>
        /// <param name="seriesInstanceUid"></param>
        /// <param name="sopInstanceUids"></param>
        /// <param name="deviceKey"></param>
        /// <param name="externalRequest"></param>
        /// <exception cref="ApplicationException">If the "DeleteSeries" Work Queue entry cannot be inserted.</exception>
        private static WorkQueue InsertMoveInstanceRequest(IUpdateContext context, StudyStorageLocation location, string seriesInstanceUid, IEnumerable<string> sopInstanceUids, ServerEntityKey deviceKey, ExternalRequestQueue externalRequest)
        {
            // Create a work queue entry and append the series instance uid into the WorkQueueUid table

            WorkQueue moveSopInstance = null;
            var broker = context.GetBroker<IInsertWorkQueue>();
            foreach (string sop in sopInstanceUids)
            {
                InsertWorkQueueParameters criteria = new MoveInstanceWorkQueueParameters(location, seriesInstanceUid, sop, deviceKey);
                if (externalRequest != null)
                    criteria.ExternalRequestQueueKey = externalRequest.Key;

                moveSopInstance = broker.FindOne(criteria);
                if (moveSopInstance == null)
                {
                    throw new ApplicationException(
                        String.Format("Unable to insert a Move Sop Instance request for study {0}", location.StudyInstanceUid));
                }
            }

            return moveSopInstance;
        }