protected override void Execute() { selectedSopClassesList.Clear(); // // The Query/Retrieve message handler. // this.WriteInformation(string.Format("Creating the QR information model based on data directory : {0}", QREmulator.dataDirectory.ToString())); QueryRetrieveInformationModels queryRetrieveInformationModels = QREmulator.CreateQueryRetrieveInformationModels(true, false, isPatientRoot, isStudyRoot, isPatientStudyRoot, this.sourceQRDicomThread); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CFindHandler cFindHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CFindHandler(); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CMoveHandler cMoveHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CMoveHandler(); cMoveHandler.EnableMultipleMoveDestinations(DicomPeers); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CGetHandler cGetHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CGetHandler(); //Set supported PCs for QR responses selectedSopClassesList.Add("1.2.840.10008.1.1"); if (isPatientRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.PatientRoot.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; cMoveHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; cGetHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.3"); } if (isStudyRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.StudyRoot.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; cMoveHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; cGetHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.3"); } if (isPatientStudyRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.PatientStudyOnly.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; cMoveHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; cGetHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.3"); } // // Create the actual SCP // QRScp qRScp = new QRScp("QR_SCP"); qRScp.Initialize(this); qRScp.Options.DeepCopyFrom(sourceQRDicomThread.Options); qRScp.Options.Identifier = "QR_SCP"; qRScp.setSupportedSopClasses(selectedSopClassesList); qRScp.setSupportedTS(selectedTSList); qRScp.Options.LogThreadStartingAndStoppingInParent = false; qRScp.Options.LogWaitingForCompletionChildThreads = false; // Add the message handlers. qRScp.AddToFront(cFindHandler); qRScp.AddToFront(cMoveHandler); qRScp.AddToFront(cGetHandler); qRScp.Start(); }
protected override void Execute() { selectedSopClassesList.Clear(); // // The Query/Retrieve message handler. // this.WriteInformation(string.Format("Creating the QR information model based on data directory : {0}",QREmulator.dataDirectory.ToString())); QueryRetrieveInformationModels queryRetrieveInformationModels = QREmulator.CreateQueryRetrieveInformationModels(true, false, isPatientRoot, isStudyRoot, isPatientStudyRoot, this.sourceQRDicomThread); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CFindHandler cFindHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CFindHandler(); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CMoveHandler cMoveHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CMoveHandler(); cMoveHandler.EnableMultipleMoveDestinations(DicomPeers); Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CGetHandler cGetHandler = new Dvtk.DvtkDicomEmulators.QueryRetrieveMessageHandlers.CGetHandler(); //Set supported PCs for QR responses selectedSopClassesList.Add("1.2.840.10008.1.1"); if(isPatientRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.PatientRoot.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; cMoveHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; cGetHandler.PatientRootInformationModel = queryRetrieveInformationModels.PatientRoot; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.1.3"); } if(isStudyRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.StudyRoot.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; cMoveHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; cGetHandler.StudyRootInformationModel = queryRetrieveInformationModels.StudyRoot; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.2.3"); } if(isPatientStudyRoot) { // add any additional attribute values to the information models queryRetrieveInformationModels.PatientStudyOnly.AddAdditionalAttributeToInformationModel(true, "0x00080054", VR.AE, sourceQRDicomThread.Options.RemoteAeTitle); cFindHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; cMoveHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; cGetHandler.PatientStudyOnlyInformationModel = queryRetrieveInformationModels.PatientStudyOnly; selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.1"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.2"); selectedSopClassesList.Add("1.2.840.10008.5.1.4.1.2.3.3"); } // // Create the actual SCP // QRScp qRScp = new QRScp("QR_SCP"); qRScp.Initialize(this); qRScp.Options.DeepCopyFrom(sourceQRDicomThread.Options); qRScp.Options.Identifier = "QR_SCP"; qRScp.setSupportedSopClasses(selectedSopClassesList); qRScp.setSupportedTS(selectedTSList); qRScp.Options.LogThreadStartingAndStoppingInParent = false; qRScp.Options.LogWaitingForCompletionChildThreads = false; // Add the message handlers. qRScp.AddToFront(cFindHandler); qRScp.AddToFront(cMoveHandler); qRScp.AddToFront(cGetHandler); qRScp.Start(); }