Example #1
0
            private List <DicomAttributeCollection> SeriesQuery(QueryCriteria queryCriteria)
            {
                string studyUid = queryCriteria[DicomTags.StudyInstanceUid];

                if (String.IsNullOrEmpty(studyUid))
                {
                    throw new ArgumentException("The study uid must be specified for a series level query.");
                }

                IStudy study = GetStudy(studyUid);

                if (study == null)
                {
                    throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));
                }

                try
                {
                    QueryResultFilter <Series> filter =
                        new QueryResultFilter <Series>(queryCriteria, Convert.Cast <Series>(study.GetSeries()), GetSpecificCharacterSet);
                    return(filter.GetResults());
                }
                catch (DataStoreException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new DataStoreException("An error occurred while performing the series query.", e);
                }
            }
Example #2
0
            private List <DicomAttributeCollection> ImageQuery(QueryCriteria queryCriteria)
            {
                string studyUid  = queryCriteria[DicomTags.StudyInstanceUid];
                string seriesUid = queryCriteria[DicomTags.SeriesInstanceUid];

                if (String.IsNullOrEmpty(studyUid) || String.IsNullOrEmpty(seriesUid))
                {
                    throw new ArgumentException("The study and series uids must be specified for an image level query.");
                }

                IStudy study = GetStudy(studyUid);

                if (study == null)
                {
                    throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));
                }

                ISeries series = CollectionUtils.SelectFirst(study.GetSeries(),
                                                             delegate(ISeries test) { return(test.SeriesInstanceUid == seriesUid); });

                if (series == null)
                {
                    string message = String.Format("No series exists with the given study and series uids ({0}, {1})", studyUid, seriesUid);
                    throw new ArgumentException(message);
                }

                try
                {
                    QueryResultFilter <SopInstance> filter =
                        new QueryResultFilter <SopInstance>(queryCriteria, Convert.Cast <SopInstance>(series.GetSopInstances()), GetSpecificCharacterSet);
                    return(filter.GetResults());
                }
                catch (DataStoreException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new DataStoreException("An error occurred while performing the image query.", e);
                }
            }
Example #3
0
            private List <DicomAttributeCollection> StudyQuery(QueryCriteria queryCriteria)
            {
                try
                {
                    string hqlQuery = QueryBuilder.BuildHqlQuery <Study>(queryCriteria);
                    SessionManager.BeginReadTransaction();
                    IList studiesFound = Session.CreateQuery(hqlQuery).List();

                    QueryResultFilter <Study> filter =
                        new QueryResultFilter <Study>(queryCriteria, Convert.Cast <Study>(studiesFound), GetSpecificCharacterSet);
                    return(filter.GetResults());
                }
                catch (DataStoreException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new DataStoreException("An error occurred while performing the study root query.", e);
                }
            }
Example #4
0
			private List<DicomAttributeCollection> ImageQuery(QueryCriteria queryCriteria)
			{
				string studyUid = queryCriteria[DicomTags.StudyInstanceUid];
				string seriesUid = queryCriteria[DicomTags.SeriesInstanceUid];

				if (String.IsNullOrEmpty(studyUid) || String.IsNullOrEmpty(seriesUid))
					throw new ArgumentException("The study and series uids must be specified for an image level query.");

				IStudy study = GetStudy(studyUid);
				if (study == null)
					throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));
					
				ISeries series = CollectionUtils.SelectFirst(study.GetSeries(),
									delegate(ISeries test) { return test.SeriesInstanceUid == seriesUid; });

				if (series == null)
				{
					string message = String.Format("No series exists with the given study and series uids ({0}, {1})", studyUid, seriesUid);
					throw new ArgumentException(message);
				}

				try
				{
					QueryResultFilter<SopInstance> filter =
						new QueryResultFilter<SopInstance>(queryCriteria, Convert.Cast<SopInstance>(series.GetSopInstances()), GetSpecificCharacterSet);
					return filter.GetResults();
				}
				catch (DataStoreException)
				{
					throw;
				}
				catch (Exception e)
				{
					throw new DataStoreException("An error occurred while performing the image query.", e);
				}
			}
Example #5
0
			private List<DicomAttributeCollection> SeriesQuery(QueryCriteria queryCriteria)
			{
				string studyUid = queryCriteria[DicomTags.StudyInstanceUid];
				if (String.IsNullOrEmpty(studyUid))
					throw new ArgumentException("The study uid must be specified for a series level query.");

				IStudy study = GetStudy(studyUid);
				if (study == null)
					throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));

				try
				{
					QueryResultFilter<Series> filter =
						new QueryResultFilter<Series>(queryCriteria, Convert.Cast<Series>(study.GetSeries()), GetSpecificCharacterSet);
					return filter.GetResults();
				}
				catch(DataStoreException)
				{
					throw;
				}
				catch(Exception e)
				{
					throw new DataStoreException("An error occurred while performing the series query.", e);
				}
			}
Example #6
0
			private List<DicomAttributeCollection> StudyQuery(QueryCriteria queryCriteria)
			{
				try
				{
					string hqlQuery = QueryBuilder.BuildHqlQuery<Study>(queryCriteria);
					SessionManager.BeginReadTransaction();
					IList studiesFound = Session.CreateQuery(hqlQuery).List();

					QueryResultFilter<Study> filter =
						new QueryResultFilter<Study>(queryCriteria, Convert.Cast<Study>(studiesFound), GetSpecificCharacterSet);
					return filter.GetResults();
				}
				catch(DataStoreException)
				{
					throw;
				}
				catch (Exception e)
				{
					throw new DataStoreException("An error occurred while performing the study root query.", e);
				}
			}