Ejemplo n.º 1
0
        /// <summary>
        /// Inserts a MoveSeries work queue entry
        /// </summary>
        /// <param name="context"></param>
        /// <param name="location"></param>
        /// <param name="seriesInstanceUids"></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 InsertMoveSeriesRequest(IUpdateContext context, StudyStorageLocation location, IEnumerable <string> seriesInstanceUids, ServerEntityKey deviceKey, ExternalRequestQueue externalRequest)
        {
            // Create a work queue entry and append the series instance uid into the WorkQueueUid table

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

            foreach (string series in seriesInstanceUids)
            {
                InsertWorkQueueParameters criteria = new MoveSeriesWorkQueueParameters(location, series, deviceKey);
                if (externalRequest != null)
                {
                    criteria.ExternalRequestQueueKey = externalRequest.Key;
                }

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

            return(moveSeriesEntry);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts a MoveStudy work queue entry
        /// </summary>
        /// <param name="context"></param>
        /// <param name="location"></param>
        /// <param name="seriesInstanceUids"></param>
        /// <param name="deviceKey"></param>
        /// <exception cref="ApplicationException">If the "DeleteSeries" Work Queue entry cannot be inserted.</exception>
        private static WorkQueue InsertMoveSeriesRequest(IUpdateContext context, StudyStorageLocation location, IEnumerable<string> seriesInstanceUids, ServerEntityKey deviceKey)
        {
            // Create a work queue entry and append the series instance uid into the WorkQueueUid table

            WorkQueue moveSeriesEntry = null;
            var broker = context.GetBroker<IInsertWorkQueue>();
			foreach (string series in seriesInstanceUids)
			{
				InsertWorkQueueParameters criteria = new MoveSeriesWorkQueueParameters(location, series, deviceKey);
				moveSeriesEntry = broker.FindOne(criteria);
				if (moveSeriesEntry == null)
				{
					throw new ApplicationException(
						String.Format("Unable to insert a Move Series request for study {0}", location.StudyInstanceUid));
				}
			}

        	return moveSeriesEntry;
        }