Esempio n. 1
0
        private void PerformPrinterQueryOrRelease()
        {
            byte pcidPrinterSOPClass, pcidBasicGrayscalePrintManagementMetaSOPClass,
                 pcidBasicColorPrintManagementMetaSOPClass;

            if (_files.Count > 0)
            {
                pcidPrinterSOPClass = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
                pcidBasicGrayscalePrintManagementMetaSOPClass = Associate.FindAbstractSyntax(DicomUID.BasicGrayscalePrintManagementMetaSOPClass);
                pcidBasicColorPrintManagementMetaSOPClass     = Associate.FindAbstractSyntax(DicomUID.BasicColorPrintManagementMetaSOPClass);

                if (Associate.GetPresentationContextResult(pcidPrinterSOPClass) == DcmPresContextResult.Accept)
                {
                    if (Associate.GetPresentationContextResult(pcidBasicGrayscalePrintManagementMetaSOPClass) == DcmPresContextResult.Accept)
                    {
                        _supportsGrayscalePrinting = true;
                        _supportsPrinting          = true;
                    }
                    if (Associate.GetPresentationContextResult(pcidBasicColorPrintManagementMetaSOPClass) == DcmPresContextResult.Accept)
                    {
                        _supportsColorPrinting = true;
                        _supportsPrinting      = true;
                    }
                }
                else
                {
                    _supportsPrinting = false;
                }

                if (_supportsPrinting == false)
                {
                    Log.Info("{0} -> Printing not supported", LogID);
                    SendReleaseRequest();
                    return;
                }

                if (_queryPrinterStatus == true)
                {
                    List <DicomTag> attributes = new List <DicomTag>();
                    attributes.Add(DicomTags.PrinterStatus);
                    attributes.Add(DicomTags.PrinterName);
                    attributes.Add(DicomTags.Manufacturer);
                    attributes.Add(DicomTags.ManufacturersModelName);
                    attributes.Add(DicomTags.DeviceSerialNumber);
                    attributes.Add(DicomTags.SoftwareVersions);
                    attributes.Add(DicomTags.DateOfLastCalibration);
                    attributes.Add(DicomTags.TimeOfLastCalibration);

                    SendNGetRequest(pcidPrinterSOPClass, 1, DicomUID.PrinterSOPClass, DicomUID.PrinterSOPInstance, attributes.ToArray());
                }
                else
                {
                    CreateFilmSession();
                }
            }
            else
            {
                SendReleaseRequest();
            }
        }
Esempio n. 2
0
        private void PerformQueryOrRelease()
        {
            if (_moveQueries.Count > 0)
            {
                byte pcid = Associate.FindAbstractSyntax(MoveSopClassUID);
                if (Associate.GetPresentationContextResult(pcid) == DcmPresContextResult.Accept)
                {
                    CMoveQuery query   = _moveQueries.Dequeue();
                    DcmDataset dataset = new DcmDataset(Associate.GetAcceptedTransferSyntax(pcid));
                    switch (query.QueryRetrieveLevel)
                    {
                    case DcmQueryRetrieveLevel.Patient:
                        dataset.AddElementWithValue(DicomTags.QueryRetrieveLevel, "PATIENT");
                        dataset.AddElementWithValue(DicomTags.PatientID, query.PatientID);
                        break;

                    case DcmQueryRetrieveLevel.Study:
                        dataset.AddElementWithValue(DicomTags.QueryRetrieveLevel, "STUDY");
                        dataset.AddElementWithValue(DicomTags.PatientID, query.PatientID);
                        dataset.AddElementWithValue(DicomTags.StudyInstanceUID, query.StudyInstanceUID);
                        break;

                    case DcmQueryRetrieveLevel.Series:
                        dataset.AddElementWithValue(DicomTags.QueryRetrieveLevel, "SERIES");
                        dataset.AddElementWithValue(DicomTags.PatientID, query.PatientID);
                        dataset.AddElementWithValue(DicomTags.StudyInstanceUID, query.StudyInstanceUID);
                        dataset.AddElementWithValue(DicomTags.SeriesInstanceUID, query.SeriesInstanceUID);
                        break;

                    case DcmQueryRetrieveLevel.Image:
                        dataset.AddElementWithValue(DicomTags.QueryRetrieveLevel, "IMAGE");
                        dataset.AddElementWithValue(DicomTags.PatientID, query.PatientID);
                        dataset.AddElementWithValue(DicomTags.StudyInstanceUID, query.StudyInstanceUID);
                        dataset.AddElementWithValue(DicomTags.SeriesInstanceUID, query.SeriesInstanceUID);
                        dataset.AddElementWithValue(DicomTags.SOPInstanceUID, query.SOPInstanceUID);
                        break;

                    default:
                        break;
                    }
                    _current = query;
                    SendCMoveRequest(pcid, 1, DestinationAE, Priority, dataset);
                }
                else
                {
                    Log.Info("{0} -> Presentation context rejected: {1}", LogID, Associate.GetPresentationContextResult(pcid));
                    SendReleaseRequest();
                }
            }
            else
            {
                SendReleaseRequest();
            }
        }
Esempio n. 3
0
 private void PerformQueryOrRelease()
 {
     if (_getQueries.Count > 0)
     {
         byte pcid = Associate.FindAbstractSyntax(GetSopClassUID);
         if (Associate.GetPresentationContextResult(pcid) == DcmPresContextResult.Accept)
         {
             _current = _getQueries.Dequeue();
             SendCGetRequest(pcid, 1, Priority, _current.ToDataset());
         }
         else
         {
             Log.Info("{0} -> Presentation context rejected: {1}", LogID, Associate.GetPresentationContextResult(pcid));
             SendReleaseRequest();
         }
     }
     else
     {
         SendReleaseRequest();
     }
 }
Esempio n. 4
0
 private void PerformQueryOrRelease()
 {
     if (FindQueries.Count > 0)
     {
         _current = FindQueries.Dequeue();
         byte pcid = Associate.FindAbstractSyntax(FindSopClassUID);
         if (Associate.GetPresentationContextResult(pcid) == DcmPresContextResult.Accept)
         {
             SendCFindRequest(pcid, NextMessageID(), Priority, _current);
         }
         else
         {
             Log.Info("{0} <- Presentation context rejected: {1}", LogID, Associate.GetPresentationContextResult(pcid));
             SendReleaseRequest();
         }
     }
     else
     {
         SendReleaseRequest();
     }
 }