示例#1
0
        /// <summary>
        ///
        /// </summary>
        public void CreateDefaultTagValues()
        {
            // Create a default value list that is the combination of the user defined
            // default values and the in-built default values. The user defined values
            // take precedence.
            _defaultDicomTagValues = new TagValueCollection();

            // Add all the user defined default values provided
            foreach (BaseDicomTagValue userDefinedTagValue in _userDefinedDefaultTagValues)
            {
                if (userDefinedTagValue is DicomTagValueDelete)
                {
                    // Do not add this to the list as the default should be deleted
                }
                else
                {
                    _defaultDicomTagValues.Add(userDefinedTagValue);
                }
            }

            // Generate all the in-built default values
            InBuiltDefaultTagValues inBuiltDefaultTagValues = new InBuiltDefaultTagValues();

            // Add the in-built default values - but only if not defined by the user
            foreach (BaseDicomTagValue inBuiltTagValue in inBuiltDefaultTagValues.TagValueDefaults)
            {
                BaseDicomTagValue userDefinedTagValue = _userDefinedDefaultTagValues.Find(inBuiltTagValue.Tag);
                if ((userDefinedTagValue != null) &&
                    (userDefinedTagValue is DicomTagValueDelete))
                {
                    // Do not add this to the list as the default should be deleted
                }
                else if (_defaultDicomTagValues.Find(inBuiltTagValue.Tag) == null)
                {
                    _defaultDicomTagValues.Add(inBuiltTagValue);
                }
            }

            // Now instantiate the default tag value list
            _instantiatedDefaultTagValues = new TagValueCollection();
            foreach (BaseDicomTagValue defaultTagValue in _defaultDicomTagValues)
            {
                // The Value property of defaultTagValue returns the next instantiated value based on the
                // how the default value was defined at setup.
                _instantiatedDefaultTagValues.Add(new DicomTagValue(defaultTagValue.Tag, defaultTagValue.Value));
            }
        }
示例#2
0
        /// <summary>
        /// Send the Storage Commitment message - use the storage commitment details
        /// built up during any previous SendModalityImagesStored() operations.
        /// The N-ACTION-RQ will be sent to the Image Manager.
        /// 
        /// If the configured ActorOption1 for the DicomPeerToPeerConfiguration from the
        /// AcquisitionModalityActor to the ImageManagerActor is set to the string
        /// "DO_STORAGE_COMMITMENT_ON_SINGLE_ASSOCIATION" then the framework expects the
        /// Image Manager to return the N-EVENT-REPORT details over the same association
        /// as the N-ACTION details were sent. If the ActorOption1 configuration parameter
        /// is not set as above then the framework will expect the Image Manger to return
        /// the N-EVENT-REPORT details over a different association than the one used for the
        /// N-ACTION details.
        /// </summary>
        /// <param name="awaitNEventReport">Boolean indicating whether to wait for the
        /// N-EVENT-REPORT - either over the same or different association before returning
        /// to the caller.</param>
        /// <param name="timeOut">Time (in Seconds) to wait for the N-EVENT-REPORT to be sent
        /// from the Image Manager - only used if "awaitNEventReport" is set true.</param>
        /// <returns>Boolean indicating success or failure.</returns>
        public bool SendStorageCommitment(bool awaitNEventReport, int timeOut)
        {
            // Check if we need to wait for the Event Report
            if (awaitNEventReport == true)
            {
                // Subscribe to the event
                SubscribeStorageCommitmentNEventReportResponseEvent();
            }

            // Generate a new Storage Commitment Transaction UID
            InBuiltDefaultTagValues inbuiltDefaultTagValues = new InBuiltDefaultTagValues();
            System.String uidRoot = inbuiltDefaultTagValues.UidRoot;
            DicomTagValueAutoSetUid tagValueUid = new DicomTagValueAutoSetUid(AffectedEntityEnum.AnyEntity,
                Tag.TRANSACTION_UID, uidRoot, 1);
            _storageCommitTransactionUid = tagValueUid.Value;

            DvtkHighLevelInterface.Dicom.Messages.DicomMessage nActionStorageCommitment = new DvtkHighLevelInterface.Dicom.Messages.DicomMessage(DvtkData.Dimse.DimseCommand.NACTIONRQ);
            GenerateTriggers.MakeNActionStorageCommitment(_storageCommitItems, nActionStorageCommitment, _storageCommitTransactionUid, _mppsInstanceUid);

            // Trigger the N-ACTION-RQ Storage Commitment
            DicomTrigger trigger = new DicomTrigger(TransactionNameEnum.RAD_10);
            trigger.AddItem(nActionStorageCommitment,
                            "1.2.840.10008.1.20.1",
                            "1.2.840.10008.1.2");

            // RAD-10 - trigger the ImageManager
            bool result = TriggerActorInstances(ActorTypeEnum.ImageManager, trigger, true);
            if (result == true)
            {
                // Check if we need to wait for the Event Report
                if (awaitNEventReport == true)
                {
                    // Wait for the N-Event-Report response
                    // for the given timeout
                    result = WaitStorageCommitmentNEventReportResponse(timeOut);

                    // Unsubscribe to the event
                    UnsubscribeStorageCommitmentNEventReportResponseEvent();
                }
            }
            return result;
        }
示例#3
0
        private void InitializeModalityProcedureStepInProgress(DvtkData.Dimse.DimseCommand command)
        {
            // Generate a new MPPS Instance UID
            InBuiltDefaultTagValues inbuiltDefaultTagValues = new InBuiltDefaultTagValues();
            System.String uidRoot = inbuiltDefaultTagValues.UidRoot;
            DicomTagValueAutoSetUid tagValueUid = new DicomTagValueAutoSetUid(AffectedEntityEnum.PerformedProcedureStepEntity,
                Tag.AFFECTED_SOP_INSTANCE_UID, uidRoot, 1);
            _mppsInstanceUid = tagValueUid.Value;

            // Create the MPPS In-Progress message
            _nCreateSetMppsInProgress = new DvtkHighLevelInterface.Dicom.Messages.DicomMessage(command);
        }
示例#4
0
        /// <summary>
        /// 
        /// </summary>
        public void CreateDefaultTagValues()
        {
            // Create a default value list that is the combination of the user defined
            // default values and the in-built default values. The user defined values
            // take precedence.
            _defaultDicomTagValues = new TagValueCollection();

            // Add all the user defined default values provided
            foreach(BaseDicomTagValue userDefinedTagValue in _userDefinedDefaultTagValues)
            {
                if (userDefinedTagValue is DicomTagValueDelete)
                {
                    // Do not add this to the list as the default should be deleted
                }
                else
                {
                    _defaultDicomTagValues.Add(userDefinedTagValue);
                }
            }

            // Generate all the in-built default values
            InBuiltDefaultTagValues inBuiltDefaultTagValues = new InBuiltDefaultTagValues();

            // Add the in-built default values - but only if not defined by the user
            foreach(BaseDicomTagValue inBuiltTagValue in inBuiltDefaultTagValues.TagValueDefaults)
            {
                BaseDicomTagValue userDefinedTagValue = _userDefinedDefaultTagValues.Find(inBuiltTagValue.Tag);
                if ((userDefinedTagValue != null) &&
                    (userDefinedTagValue is DicomTagValueDelete))
                {
                    // Do not add this to the list as the default should be deleted
                }
                else if (_defaultDicomTagValues.Find(inBuiltTagValue.Tag) == null)
                {
                    _defaultDicomTagValues.Add(inBuiltTagValue);
                }
            }

            // Now instantiate the default tag value list
            _instantiatedDefaultTagValues = new TagValueCollection();
            foreach(BaseDicomTagValue defaultTagValue in _defaultDicomTagValues)
            {
                // The Value property of defaultTagValue returns the next instantiated value based on the
                // how the default value was defined at setup.
                _instantiatedDefaultTagValues.Add(new DicomTagValue(defaultTagValue.Tag, defaultTagValue.Value));
            }
        }