Esempio n. 1
0
 public virtual HttpResponseMessage SearchForInstances(IQidoRequestModel request)
 {
     return(SearchForDicomEntity(request,
                                 DefaultDicomQueryElements.GetDefaultInstanceQuery( ),
                                 delegate
                                 (
                                     IObjectArchieveQueryService queryService,
                                     DicomDataset dicomRequest,
                                     IQidoRequestModel qidoResult
                                 )
     {
         return queryService.FindObjectInstancesPaged(dicomRequest, GetQueryOptions(qidoResult));
     }));
 }
Esempio n. 2
0
        private void AddPreviewInstanceHeader(IEnumerable <DicomDataset> results, HttpResponseMessage response)
        {
            response.Headers.Add("Access-Control-Expose-Headers", Instance_Header_Name);

            foreach (var result in results)
            {
                var    queryDs      = DefaultDicomQueryElements.GetDefaultInstanceQuery();
                string studyUid     = result.Get <string> (DicomTag.StudyInstanceUID, "");
                string seriesUid    = result.Get <string> (DicomTag.SeriesInstanceUID, "");
                var    queryOptions = CreateNewQueryOptions( );

                queryDs.AddOrUpdate(DicomTag.StudyInstanceUID, studyUid);
                queryDs.AddOrUpdate(DicomTag.SeriesInstanceUID, seriesUid);
                queryOptions.Limit  = 1;
                queryOptions.Offset = 0;

                var    instances = QueryService.FindObjectInstances(queryDs, queryOptions);
                string queryStudyUid = null, querySeriesUid = null, queryInstanceUid = null;

                foreach (var instance in instances)
                {
                    queryStudyUid    = instance.Get <string> (DicomTag.StudyInstanceUID, "");
                    querySeriesUid   = instance.Get <string> (DicomTag.SeriesInstanceUID, "");
                    queryInstanceUid = instance.Get <string> (DicomTag.SOPInstanceUID, "");

                    break;
                }

                if (string.IsNullOrWhiteSpace(queryStudyUid) || string.IsNullOrWhiteSpace(querySeriesUid) || string.IsNullOrWhiteSpace(queryInstanceUid))
                {
                    response.Headers.Add(Instance_Header_Name, "");
                }
                else
                {
                    response.Headers.Add(Instance_Header_Name, string.Format("{0}:{1}:{2}", queryStudyUid, querySeriesUid, queryInstanceUid));
                }
            }
        }