/// <summary> /// Send a C-MOVE-RQ Information Model Retrieve. /// Retrieve based on the informationModel provided and the query/retrieve level. Take /// the retrieve tags from the retrieveTags provided. The retrieve is done to the move /// destination. /// /// The C-MOVE-RSP messages returned are stored in a DicomQueryItemCollection named RetrieveItems. /// </summary> /// <param name="informationModel">Q/R Information Model to be used in the retrieve operation.</param> /// <param name="level">Query / retrieve level.</param> /// <param name="moveDestination">AE Title of the "move" destination.</param> /// <param name="retrieveTags">List of Retrieve Tags.</param> /// <returns>Boolean indicating success or failure.</returns> public bool SendRetrieveImages(QueryRetrieveInformationModelEnum informationModel, QueryRetrieveLevelEnum level, System.String moveDestination, TagValueCollection retrieveTags) { System.String queryRetrieveLevel = System.String.Empty; switch(level) { case QueryRetrieveLevelEnum.PatientQueryRetrieveLevel: queryRetrieveLevel = "PATIENT"; break; case QueryRetrieveLevelEnum.StudyQueryRetrieveLevel: queryRetrieveLevel = "STUDY"; break; case QueryRetrieveLevelEnum.SeriesQueryRetrieveLevel: queryRetrieveLevel = "SERIES"; break; case QueryRetrieveLevelEnum.InstanceQueryRetrieveLevel: queryRetrieveLevel = "IMAGE"; break; default: return false; } if (retrieveTags.Find(Tag.QUERY_RETRIEVE_LEVEL) == null) { retrieveTags.Add(new DicomTagValue(Tag.QUERY_RETRIEVE_LEVEL, queryRetrieveLevel)); } _retrieveItems = new DicomQueryItemCollection(); DicomTrigger trigger = new DicomTrigger(TransactionNameEnum.RAD_16); System.String sopClassUid = System.String.Empty; switch(informationModel) { case QueryRetrieveInformationModelEnum.PatientRootQueryRetrieveInformationModel: sopClassUid = "1.2.840.10008.5.1.4.1.2.1.2"; break; case QueryRetrieveInformationModelEnum.StudyRootQueryRetrieveInformationModel: sopClassUid = "1.2.840.10008.5.1.4.1.2.2.2"; break; case QueryRetrieveInformationModelEnum.PatientStudyOnlyQueryRetrieveInformationModel: sopClassUid = "1.2.840.10008.5.1.4.1.2.3.2"; break; default: return false; } trigger.AddItem(GenerateTriggers.MakeCMoveRetrieve(informationModel, moveDestination, retrieveTags), sopClassUid, "1.2.840.10008.1.2"); // RAD-16 - trigger the ImageArchive bool triggerResult = TriggerActorInstances(ActorTypeEnum.ImageArchive, trigger, true); // Get the retrieve items returned if (triggerResult == true) { foreach (ActorsTransaction actorsTransaction in ActorsTransactionLog) { if (actorsTransaction.FromActorName.Type == ActorTypeEnum.ImageArchive) { BaseTransaction baseTransaction = actorsTransaction.Transaction; if (baseTransaction is DicomTransaction) { DicomTransaction dicomTransaction = (DicomTransaction)baseTransaction; if (dicomTransaction.Processed == false) { DicomMessageCollection cMoveResponses = dicomTransaction.DicomMessages.CMoveResponses; int index = 0; foreach (DvtkHighLevelInterface.Dicom.Messages.DicomMessage dicomMessage in cMoveResponses) { // store all C-MOVE-RSP messages // - use DicomQueryItem.GetValue(Tag.NUMBER_OF_COMPLETED_SUBOPERATIONS) to get completed count // - use DicomQueryItem.GetValue(Tag.NUMBER_OF_FAILED_SUBOPERATIONS) to get failed count // - use DicomQueryItem.GetValue(Tag.NUMBER_OF_REMAINING_SUBOPERATIONS) to get remaining count // - use DicomQueryItem.GetValue(Tag.NUMBER_OF_WARNING_SUBOPERATIONS) to get warning count DicomQueryItem dicomRetriveItem = new DicomQueryItem(index++, dicomMessage); _retrieveItems.Add(dicomRetriveItem); } dicomTransaction.Processed = true; } } } } } return triggerResult; }
private bool TriggerModalityWorklistQuery(DicomTrigger trigger) { // Start with empty worklist and storage commit items _modalityWorklistItems = new DicomQueryItemCollection(); _storageCommitItems = new ReferencedSopItemCollection(); _nCreateSetMppsInProgress = null; // RAD-5 - trigger the DssOrderFiller bool triggerResult = TriggerActorInstances(ActorTypeEnum.DssOrderFiller, trigger, true); // Get the worklist items returned if (triggerResult == true) { foreach (ActorsTransaction actorsTransaction in ActorsTransactionLog) { if (actorsTransaction.FromActorName.Type == ActorTypeEnum.DssOrderFiller) { BaseTransaction baseTransaction = actorsTransaction.Transaction; if (baseTransaction is DicomTransaction) { DicomTransaction dicomTransaction = (DicomTransaction)baseTransaction; if (dicomTransaction.Processed == false) { DicomMessageCollection cFindResponses = dicomTransaction.DicomMessages.CFindResponses; int index = 0; foreach (DvtkHighLevelInterface.Dicom.Messages.DicomMessage dicomMessage in cFindResponses) { if (dicomMessage.DataSet.Count != 0) { DicomQueryItem dicomWorklistItem = new DicomQueryItem(index++, dicomMessage); _modalityWorklistItems.Add(dicomWorklistItem); } } dicomTransaction.Processed = true; } } } } } return triggerResult; }