Ejemplo n.º 1
0
        public static IDicomServiceNode ToServiceNode(this IApplicationEntity server)
        {
            Platform.CheckForNullReference(server, "server");
            var dicomServiceNode = server as IDicomServiceNode;

            if (dicomServiceNode != null)
            {
                return(dicomServiceNode);
            }

            IDicomServiceNode serviceNode = null;

            if (!String.IsNullOrEmpty(server.Name))
            {
                serviceNode = ServerDirectory.ServerDirectory.GetRemoteServerByName(server.Name);
            }

            if (serviceNode == null)
            {
                serviceNode = ServerDirectory.ServerDirectory.GetRemoteServersByAETitle(server.AETitle).FirstOrDefault();
            }

            if (serviceNode == null)
            {
                return(new DicomServiceNode(server));
            }

            return(serviceNode);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
        /// </summary>
        /// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
        /// <param name="server">The server from which the study should be loaded.</param>
        public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server, StudyLoaderCheckOptions options)
        {
            _studyInstanceUid = studyInstanceUid;
            _server = server;

            StudyCheckOptions = options;
        }
Ejemplo n.º 3
0
        protected override int OnStart(StudyLoaderArgs studyLoaderArgs)
        {
            var serverAe = studyLoaderArgs.Server;

            Platform.CheckForNullReference(serverAe, "Server");
            Platform.CheckMemberIsSet(serverAe.StreamingParameters, "StreamingParameters");
            _serverAe = serverAe;

            EventResult      result          = EventResult.Success;
            AuditedInstances loadedInstances = new AuditedInstances();

            try
            {
                StudyXml studyXml = RetrieveStudyXml(studyLoaderArgs);
                _instances = GetInstances(studyXml).GetEnumerator();

                loadedInstances.AddInstance(studyXml.PatientId, studyXml.PatientsName, studyXml.StudyInstanceUid);

                return(studyXml.NumberOfStudyRelatedInstances);
            }
            finally
            {
                AuditHelper.LogOpenStudies(new string[] { _serverAe.AETitle }, loadedInstances, EventSource.CurrentUser, result);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
        /// </summary>
        /// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
        /// <param name="server">The server from which the study should be loaded.</param>
        /// <param name="options"> </param>
        public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server, StudyLoaderOptions options)
        {
            _studyInstanceUid = studyInstanceUid;
            _server           = server;

            Options = options ?? StudyLoaderOptions.Default;
        }
Ejemplo n.º 5
0
	    /// <summary>
	    /// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
	    /// </summary>
	    /// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
	    /// <param name="server">The server from which the study should be loaded.</param>
	    /// <param name="options"> </param>
	    public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server, StudyLoaderOptions options)
        {
            _studyInstanceUid = studyInstanceUid;
            _server = server;

            Options = options ?? StudyLoaderOptions.Default;
        }
Ejemplo n.º 6
0
 IEnumerable <ISopDataSource> IUnitTestStudyProvider.GetSopDataSources(IApplicationEntity server, string studyInstanceUid)
 {
     if (!Equals(Server, server))
     {
         return(null);
     }
     return(this[studyInstanceUid]);
 }
Ejemplo n.º 7
0
 public WcfStudyRootQuery( )
 {
     var ae = new ApplicationEntity
         {
             AETitle = "UIHPACSSERVER",
             ScpParameters = new ScpParameters("localhost", 3333)
         };
     _remoteServer = ae;
     _real = new DicomStudyRootQuery("lrf", _remoteServer);
 }
        public async Task <byte[]> MessageConversion(IApplicationEntity entity)
        {
            await Task.Run(() =>
            {
                var json = JsonConvert.SerializeObject(entity);
                return(Encoding.UTF8.GetBytes(json));
            });

            return(new byte[0]);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Queries for studies matching a specified set of query parameters.
        /// </summary>
        /// <param name="queryParameters">The search criteria.</param>
        /// <param name="targetServer">The server to query. Can be null
        /// if the <paramref name="studyFinderName"/> does not support the querying
        /// of different servers.</param>
        /// <param name="studyFinderName">The name of the <see cref="IStudyFinder"/> to use, which is specified
        /// by <see cref="IStudyFinder.Name"/>.</param>
        /// <exception cref="StudyFinderNotFoundException">Thrown when a matching <see cref="IStudyFinder"/> does not exist.</exception>
        public static StudyItemList FindStudy(
            QueryParameters queryParameters,
            IApplicationEntity targetServer,
            string studyFinderName)
        {
            Platform.CheckForNullReference(queryParameters, "queryParameters");
            Platform.CheckForEmptyString(studyFinderName, "studyFinderName");

            return(StudyFinders[studyFinderName].Query(queryParameters, targetServer));
        }
Ejemplo n.º 10
0
        public ApplicationEntity(IApplicationEntity other)
        {
            Name        = other.Name;
            AETitle     = other.AETitle;
            Description = other.Description;
            Location    = other.Location;

            if (other.ScpParameters != null)
            {
                ScpParameters = new ScpParameters(other.ScpParameters);
            }
            if (other.StreamingParameters != null)
            {
                StreamingParameters = new StreamingParameters(other.StreamingParameters);
            }
        }
Ejemplo n.º 11
0
        private static IEnumerable <ISopDataSource> GetSopDataSources(IApplicationEntity server, string studyInstanceUid)
        {
            var combinedResults = new List <ISopDataSource>();

            lock (_syncLock)
            {
                foreach (var provider in _providers)
                {
                    var results = provider.GetSopDataSources(server, studyInstanceUid);
                    if (results != null)
                    {
                        combinedResults.AddRange(results);
                    }
                }
            }
            return(combinedResults);
        }
 internal ServerTreeDicomServer(IApplicationEntity entity)
 {
     Platform.CheckMemberIsSet(entity.ScpParameters, "ScpParameters");
     Name        = entity.Name;
     Location    = entity.Location;
     AETitle     = entity.AETitle;
     HostName    = entity.ScpParameters.HostName;
     Port        = entity.ScpParameters.Port;
     IsStreaming = entity.StreamingParameters != null;
     if (IsStreaming)
     {
         HeaderServicePort = entity.StreamingParameters.HeaderServicePort;
         WadoServicePort   = entity.StreamingParameters.WadoServicePort;
     }
     else
     {
         HeaderServicePort = DefaultHeaderServicePort;
         WadoServicePort   = DefaultWadoServicePort;
     }
 }
Ejemplo n.º 13
0
 internal ServerTreeDicomServer(IApplicationEntity entity)
 {
     Platform.CheckMemberIsSet(entity.ScpParameters, "ScpParameters");
     Name = entity.Name;
     Location = entity.Location;
     AETitle = entity.AETitle;
     HostName = entity.ScpParameters.HostName;
     Port = entity.ScpParameters.Port;
     IsStreaming = entity.StreamingParameters != null;
     if (IsStreaming)
     {
         HeaderServicePort = entity.StreamingParameters.HeaderServicePort;
         WadoServicePort = entity.StreamingParameters.WadoServicePort;
     }
     else
     {
         HeaderServicePort = DefaultHeaderServicePort;
         WadoServicePort = DefaultWadoServicePort;
     }
 }
Ejemplo n.º 14
0
        public override StudyItemList Query(QueryParameters queryParams,
                                            IApplicationEntity targetServer)
        {
            var studyItems = new StudyItemList();
            var tmp        = targetServer as MediaFileSet;

            try
            {
                if (tmp != null)
                {
                    studyItems.AddRange(tmp.Studies.Select(study => new StudyItem(study, tmp)));
                }
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Warn, e.Message);
            }


            return(studyItems);
        }
        private async Task <bool> LogRouting(IPayload payload)
        {
            bool isSuccess = false;

            try
            {
                switch (payload.LogType)
                {
                case LogType.Application:
                    IApplicationEntity applicationEntity = (IApplicationEntity)payload.Payload;
                    break;

                case LogType.MessageQueue:
                    IMessageQueueEntity messageQueueEntity = (IMessageQueueEntity)payload.Payload;
                    break;

                case LogType.RelationalDatabase:
                    IRelationalDatabaseEntity relationalDatabaseEntity = (IRelationalDatabaseEntity)payload.Payload;
                    break;

                case LogType.Transaction:
                    ITransactionEntity transactionEntity = (ITransactionEntity)payload.Payload;
                    if (transactionEntity.TrasactionType == TransactionType.External)
                    {
                    }
                    else
                    {
                    }
                    break;
                }

                isSuccess = true;
                return(isSuccess);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(isSuccess);
            }
        }
Ejemplo n.º 16
0
        public override StudyItemList Query(QueryParameters queryParams, IApplicationEntity server)
        {
			Platform.CheckForNullReference(queryParams, "queryParams");

            //.NET strings are unicode, therefore, so is all the query data.
            const string utf8 = "ISO_IR 192";
            var collection = new DicomAttributeCollection {SpecificCharacterSet = utf8};
            collection[DicomTags.SpecificCharacterSet].SetStringValue(utf8);

            collection[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
            collection[DicomTags.PatientId].SetStringValue(queryParams["PatientId"]);
            collection[DicomTags.AccessionNumber].SetStringValue(queryParams["AccessionNumber"]);
            collection[DicomTags.PatientsName].SetStringValue(queryParams["PatientsName"]);
			collection[DicomTags.ReferringPhysiciansName].SetStringValue(queryParams["ReferringPhysiciansName"]);
			collection[DicomTags.StudyDate].SetStringValue(queryParams["StudyDate"]);
			collection[DicomTags.StudyTime].SetStringValue("");
			collection[DicomTags.StudyDescription].SetStringValue(queryParams["StudyDescription"]);
        	collection[DicomTags.PatientsBirthDate].SetStringValue("");
            collection[DicomTags.ModalitiesInStudy].SetStringValue(queryParams["ModalitiesInStudy"]);
			collection[DicomTags.StudyInstanceUid].SetStringValue(queryParams["StudyInstanceUid"]);
			collection[DicomTags.NumberOfStudyRelatedInstances].SetStringValue("");
			collection[DicomTags.InstanceAvailability].SetEmptyValue(); // must not be included in request

			collection[DicomTags.PatientSpeciesDescription].SetStringValue(GetString(queryParams, "PatientSpeciesDescription"));
			var codeValue = GetString(queryParams, "PatientSpeciesCodeSequenceCodeValue");
			var codeMeaning = GetString(queryParams, "PatientSpeciesCodeSequenceCodeMeaning");
			if (codeValue != null || codeMeaning != null)
			{
				var codeSequenceMacro = new CodeSequenceMacro
					{
						CodingSchemeDesignator = "",
						CodeValue = codeValue,
						CodeMeaning = codeMeaning
					};
				collection[DicomTags.PatientSpeciesCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

			collection[DicomTags.PatientBreedDescription].SetStringValue(GetString(queryParams, "PatientBreedDescription"));
			codeValue = GetString(queryParams, "PatientBreedCodeSequenceCodeValue");
			codeMeaning = GetString(queryParams, "PatientBreedCodeSequenceCodeMeaning");
			if (codeValue != null || codeMeaning != null)
			{
				var codeSequenceMacro = new CodeSequenceMacro
					{
						CodingSchemeDesignator = "",
						CodeValue = codeValue,
						CodeMeaning = codeMeaning
					};
				collection[DicomTags.PatientBreedCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

			collection[DicomTags.ResponsiblePerson].SetStringValue(GetString(queryParams, "ResponsiblePerson"));
			collection[DicomTags.ResponsiblePersonRole].SetStringValue("");
			collection[DicomTags.ResponsibleOrganization].SetStringValue(GetString(queryParams, "ResponsibleOrganization"));

            var localServer = ServerDirectory.GetLocalServer();
            var studyItemList = new StudyItemList();
			using (var context = new DataAccessContext())
			{
				foreach (DicomAttributeCollection result in context.GetStudyStoreQuery().Query(collection))
				{
                    var item = new StudyItem(result[DicomTags.StudyInstanceUid].ToString(), localServer);
					item.SpecificCharacterSet = result.SpecificCharacterSet;
					item.PatientId = result[DicomTags.PatientId].ToString();
					item.PatientsName = new PersonName(result[DicomTags.PatientsName].ToString());
					item.ReferringPhysiciansName = new PersonName(result[DicomTags.ReferringPhysiciansName].GetString(0, ""));
					item.PatientsBirthDate = result[DicomTags.PatientsBirthDate].ToString();
					item.StudyDate = result[DicomTags.StudyDate].ToString();
					item.StudyTime = result[DicomTags.StudyTime].ToString();
					item.StudyDescription = result[DicomTags.StudyDescription].ToString();
					item.ModalitiesInStudy = DicomStringHelper.GetStringArray(result[DicomTags.ModalitiesInStudy].ToString());
					item.AccessionNumber = result[DicomTags.AccessionNumber].ToString();
					item.NumberOfStudyRelatedInstances = result[DicomTags.NumberOfStudyRelatedInstances].GetInt32(0, 0);
					item.InstanceAvailability = result[DicomTags.InstanceAvailability].GetString(0, "");
					if (String.IsNullOrEmpty(item.InstanceAvailability))
						item.InstanceAvailability = "ONLINE";

					item.PatientSpeciesDescription = result[DicomTags.PatientSpeciesDescription].GetString(0, "");
					var patientSpeciesCodeSequence = result[DicomTags.PatientSpeciesCodeSequence];
					if (!patientSpeciesCodeSequence.IsNull && patientSpeciesCodeSequence.Count > 0)
					{
						var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[]) result[DicomTags.PatientSpeciesCodeSequence].Values)[0]);
						item.PatientSpeciesCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
						item.PatientSpeciesCodeSequenceCodeValue = codeSequenceMacro.CodeValue;
						item.PatientSpeciesCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
					}

					item.PatientBreedDescription = result[DicomTags.PatientBreedDescription].GetString(0, "");
					var patientBreedCodeSequence = result[DicomTags.PatientBreedCodeSequence];
					if (!patientBreedCodeSequence.IsNull && patientBreedCodeSequence.Count > 0)
					{
						var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientBreedCodeSequence].Values)[0]);
                        item.PatientBreedCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
						item.PatientBreedCodeSequenceCodeValue = codeSequenceMacro.CodeValue;
						item.PatientBreedCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
					}

					item.ResponsiblePerson = new PersonName(result[DicomTags.ResponsiblePerson].GetString(0, ""));
					item.ResponsiblePersonRole = result[DicomTags.ResponsiblePersonRole].GetString(0, "");
					item.ResponsibleOrganization = result[DicomTags.ResponsibleOrganization].GetString(0, "");

					studyItemList.Add(item);
				}
			}

			AuditHelper.LogQueryIssued(null, null, EventSource.CurrentUser, EventResult.Success,
									   SopClass.StudyRootQueryRetrieveInformationModelFindUid, collection);

			return studyItemList;
		}
Ejemplo n.º 17
0
		/// <summary>
		/// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
		/// </summary>
		/// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
		/// <param name="server">The server from which the study should be loaded.</param>
		public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server)
		{
			_studyInstanceUid = studyInstanceUid;
			_server = server;
		}
Ejemplo n.º 18
0
 public RemoteStudyRootQuery(IApplicationEntity remoteServer)
 {
     _remoteServer = remoteServer;
     _real = new DicomStudyRootQuery(DicomServer.DicomServer.AETitle, remoteServer);
 }
 public DicomStudyRootQuery(string localAETitle, IApplicationEntity remoteAE)
 {
     _localAE  = localAETitle;
     _remoteAE = remoteAE;
 }
Ejemplo n.º 20
0
        public override StudyItemList Query(QueryParameters queryParams, IApplicationEntity targetServer)
        {
            Platform.CheckForNullReference(queryParams, "queryParams");
            Platform.CheckForNullReference(targetServer, "targetServer");

            var selectedServer = targetServer.ToServiceNode();

            //.NET strings are unicode, therefore, so is all the query data.
            const string utf8 = "ISO_IR 192";
            var requestCollection = new DicomAttributeCollection { SpecificCharacterSet = utf8 };
            requestCollection[DicomTags.SpecificCharacterSet].SetStringValue(utf8);

			requestCollection[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
			requestCollection[DicomTags.StudyInstanceUid].SetStringValue("");

			requestCollection[DicomTags.PatientId].SetStringValue(queryParams["PatientId"]);
			requestCollection[DicomTags.AccessionNumber].SetStringValue(queryParams["AccessionNumber"]);
			requestCollection[DicomTags.PatientsName].SetStringValue(queryParams["PatientsName"]);
			requestCollection[DicomTags.ReferringPhysiciansName].SetStringValue(queryParams["ReferringPhysiciansName"]);
			requestCollection[DicomTags.StudyDate].SetStringValue(queryParams["StudyDate"]);
			requestCollection[DicomTags.StudyTime].SetStringValue("");
			requestCollection[DicomTags.StudyDescription].SetStringValue(queryParams["StudyDescription"]);
			requestCollection[DicomTags.PatientsBirthDate].SetStringValue("");
			requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(queryParams["ModalitiesInStudy"]);
			requestCollection[DicomTags.NumberOfStudyRelatedInstances].SetStringValue("");
			requestCollection[DicomTags.InstanceAvailability].SetEmptyValue(); // must not be included in request

			requestCollection[DicomTags.PatientSpeciesDescription].SetStringValue(GetString(queryParams, "PatientSpeciesDescription"));
			var codeValue = GetString(queryParams, "PatientSpeciesCodeSequenceCodeValue");
			var codeMeaning = GetString(queryParams, "PatientSpeciesCodeSequenceCodeMeaning");
			if (codeValue != null || codeMeaning != null)
			{
				var codeSequenceMacro = new CodeSequenceMacro
				{
					CodingSchemeDesignator = "",
					CodeValue = codeValue,
					CodeMeaning = codeMeaning
				};
				requestCollection[DicomTags.PatientSpeciesCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
			}

			requestCollection[DicomTags.PatientBreedDescription].SetStringValue(GetString(queryParams, "PatientBreedDescription"));
			codeValue = GetString(queryParams, "PatientBreedCodeSequenceCodeValue");
			codeMeaning = GetString(queryParams, "PatientBreedCodeSequenceCodeMeaning");
			if (codeValue != null || codeMeaning != null)
			{
				var codeSequenceMacro = new CodeSequenceMacro
				{
					CodingSchemeDesignator = "",
					CodeValue = codeValue,
					CodeMeaning = codeMeaning
				};
				requestCollection[DicomTags.PatientBreedCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
			}

			requestCollection[DicomTags.ResponsiblePerson].SetStringValue(GetString(queryParams, "ResponsiblePerson"));
			requestCollection[DicomTags.ResponsiblePersonRole].SetStringValue("");
			requestCollection[DicomTags.ResponsibleOrganization].SetStringValue(GetString(queryParams,"ResponsibleOrganization"));

			IList<DicomAttributeCollection> results = Query(selectedServer, requestCollection);
			
			StudyItemList studyItemList = new StudyItemList();
			foreach (DicomAttributeCollection result in results)
			{
				StudyItem item = new StudyItem(result[DicomTags.StudyInstanceUid].GetString(0, ""), selectedServer);

				//TODO: add DicomField attributes to the StudyItem class (implement typeconverter for PersonName class).
				item.PatientsBirthDate = result[DicomTags.PatientsBirthDate].GetString(0, "");
				item.AccessionNumber = result[DicomTags.AccessionNumber].GetString(0, "");
				item.StudyDescription = result[DicomTags.StudyDescription].GetString(0, "");
				item.StudyDate = result[DicomTags.StudyDate].GetString(0, "");
				item.StudyTime = result[DicomTags.StudyTime].GetString(0, "");
				item.PatientId = result[DicomTags.PatientId].GetString(0, "");
				item.PatientsName = new PersonName(result[DicomTags.PatientsName].GetString(0, ""));
				item.ReferringPhysiciansName = new PersonName(result[DicomTags.ReferringPhysiciansName].GetString(0, ""));
				item.ModalitiesInStudy = DicomStringHelper.GetStringArray(result[DicomTags.ModalitiesInStudy].ToString());
				DicomAttribute attribute = result[DicomTags.NumberOfStudyRelatedInstances];
				if (!attribute.IsEmpty && !attribute.IsNull)
					item.NumberOfStudyRelatedInstances = attribute.GetInt32(0, 0);

				item.SpecificCharacterSet = result.SpecificCharacterSet;
				item.InstanceAvailability = result[DicomTags.InstanceAvailability].GetString(0, "");
				if (String.IsNullOrEmpty(item.InstanceAvailability))
					item.InstanceAvailability = "ONLINE";

				item.PatientSpeciesDescription = result[DicomTags.PatientSpeciesDescription].GetString(0, "");
				var patientSpeciesCodeSequence = result[DicomTags.PatientSpeciesCodeSequence];
				if (!patientSpeciesCodeSequence.IsNull && patientSpeciesCodeSequence.Count > 0)
				{
					var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientSpeciesCodeSequence].Values)[0]);
					item.PatientSpeciesCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
					item.PatientSpeciesCodeSequenceCodeValue = codeSequenceMacro.CodeValue;
					item.PatientSpeciesCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
				}

				item.PatientBreedDescription = result[DicomTags.PatientBreedDescription].GetString(0, "");
				var patientBreedCodeSequence = result[DicomTags.PatientBreedCodeSequence];
				if (!patientBreedCodeSequence.IsNull && patientBreedCodeSequence.Count > 0)
				{
					var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientBreedCodeSequence].Values)[0]);
					item.PatientBreedCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
					item.PatientBreedCodeSequenceCodeValue = codeSequenceMacro.CodeValue;
					item.PatientBreedCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
				}

				item.ResponsiblePerson = new PersonName(result[DicomTags.ResponsiblePerson].GetString(0, ""));
				item.ResponsiblePersonRole = result[DicomTags.ResponsiblePersonRole].GetString(0, "");
				item.ResponsibleOrganization = result[DicomTags.ResponsibleOrganization].GetString(0, "");
				studyItemList.Add(item);
			}

        	AuditHelper.LogQueryIssued(selectedServer.AETitle, selectedServer.ScpParameters.HostName, EventSource.CurrentUser,
        	                           EventResult.Success, SopClass.StudyRootQueryRetrieveInformationModelFindUid,
        	                           requestCollection);

			return studyItemList;
        }
Ejemplo n.º 21
0
		public DicomStudyRootQuery(string localAETitle, IApplicationEntity remoteAE)
		{
		    _localAE = localAETitle;
		    _remoteAE = remoteAE;
		}
Ejemplo n.º 22
0
		private static IEnumerable<ISopDataSource> GetSopDataSources(IApplicationEntity server, string studyInstanceUid)
		{
			var combinedResults = new List<ISopDataSource>();
			lock (_syncLock)
			{
				foreach (var provider in _providers)
				{
					var results = provider.GetSopDataSources(server, studyInstanceUid);
					if (results != null)
						combinedResults.AddRange(results);
				}
			}
			return combinedResults;
		}
Ejemplo n.º 23
0
        public override StudyItemList Query(QueryParameters queryParams, IApplicationEntity server)
        {
            Platform.CheckForNullReference(queryParams, "queryParams");

            //.NET strings are unicode, therefore, so is all the query data.
            const string utf8       = "ISO_IR 192";
            var          collection = new DicomAttributeCollection {
                SpecificCharacterSet = utf8
            };

            collection[DicomTags.SpecificCharacterSet].SetStringValue(utf8);

            collection[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
            collection[DicomTags.PatientId].SetStringValue(queryParams["PatientId"]);
            collection[DicomTags.AccessionNumber].SetStringValue(queryParams["AccessionNumber"]);
            collection[DicomTags.PatientsName].SetStringValue(queryParams["PatientsName"]);
            collection[DicomTags.ReferringPhysiciansName].SetStringValue(queryParams["ReferringPhysiciansName"]);
            collection[DicomTags.StudyDate].SetStringValue(queryParams["StudyDate"]);
            collection[DicomTags.StudyTime].SetStringValue("");
            collection[DicomTags.StudyDescription].SetStringValue(queryParams["StudyDescription"]);
            collection[DicomTags.PatientsBirthDate].SetStringValue("");
            collection[DicomTags.ModalitiesInStudy].SetStringValue(queryParams["ModalitiesInStudy"]);
            collection[DicomTags.StudyInstanceUid].SetStringValue(queryParams["StudyInstanceUid"]);
            collection[DicomTags.NumberOfStudyRelatedInstances].SetStringValue("");
            collection[DicomTags.InstanceAvailability].SetEmptyValue();             // must not be included in request

            collection[DicomTags.PatientSpeciesDescription].SetStringValue(GetString(queryParams, "PatientSpeciesDescription"));
            var codeValue   = GetString(queryParams, "PatientSpeciesCodeSequenceCodeValue");
            var codeMeaning = GetString(queryParams, "PatientSpeciesCodeSequenceCodeMeaning");

            if (codeValue != null || codeMeaning != null)
            {
                var codeSequenceMacro = new CodeSequenceMacro
                {
                    CodingSchemeDesignator = "",
                    CodeValue   = codeValue,
                    CodeMeaning = codeMeaning
                };
                collection[DicomTags.PatientSpeciesCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

            collection[DicomTags.PatientBreedDescription].SetStringValue(GetString(queryParams, "PatientBreedDescription"));
            codeValue   = GetString(queryParams, "PatientBreedCodeSequenceCodeValue");
            codeMeaning = GetString(queryParams, "PatientBreedCodeSequenceCodeMeaning");
            if (codeValue != null || codeMeaning != null)
            {
                var codeSequenceMacro = new CodeSequenceMacro
                {
                    CodingSchemeDesignator = "",
                    CodeValue   = codeValue,
                    CodeMeaning = codeMeaning
                };
                collection[DicomTags.PatientBreedCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

            collection[DicomTags.ResponsiblePerson].SetStringValue(GetString(queryParams, "ResponsiblePerson"));
            collection[DicomTags.ResponsiblePersonRole].SetStringValue("");
            collection[DicomTags.ResponsibleOrganization].SetStringValue(GetString(queryParams, "ResponsibleOrganization"));

            var localServer   = ServerDirectory.GetLocalServer();
            var studyItemList = new StudyItemList();

            using (var context = new DataAccessContext())
            {
                foreach (DicomAttributeCollection result in context.GetStudyStoreQuery().Query(collection))
                {
                    var item = new StudyItem(result[DicomTags.StudyInstanceUid].ToString(), localServer);
                    item.SpecificCharacterSet          = result.SpecificCharacterSet;
                    item.PatientId                     = result[DicomTags.PatientId].ToString();
                    item.PatientsName                  = new PersonName(result[DicomTags.PatientsName].ToString());
                    item.ReferringPhysiciansName       = new PersonName(result[DicomTags.ReferringPhysiciansName].GetString(0, ""));
                    item.PatientsBirthDate             = result[DicomTags.PatientsBirthDate].ToString();
                    item.StudyDate                     = result[DicomTags.StudyDate].ToString();
                    item.StudyTime                     = result[DicomTags.StudyTime].ToString();
                    item.StudyDescription              = result[DicomTags.StudyDescription].ToString();
                    item.ModalitiesInStudy             = DicomStringHelper.GetStringArray(result[DicomTags.ModalitiesInStudy].ToString());
                    item.AccessionNumber               = result[DicomTags.AccessionNumber].ToString();
                    item.NumberOfStudyRelatedInstances = result[DicomTags.NumberOfStudyRelatedInstances].GetInt32(0, 0);
                    item.InstanceAvailability          = result[DicomTags.InstanceAvailability].GetString(0, "");
                    if (String.IsNullOrEmpty(item.InstanceAvailability))
                    {
                        item.InstanceAvailability = "ONLINE";
                    }

                    item.PatientSpeciesDescription = result[DicomTags.PatientSpeciesDescription].GetString(0, "");
                    var patientSpeciesCodeSequence = result[DicomTags.PatientSpeciesCodeSequence];
                    if (!patientSpeciesCodeSequence.IsNull && patientSpeciesCodeSequence.Count > 0)
                    {
                        var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientSpeciesCodeSequence].Values)[0]);
                        item.PatientSpeciesCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
                        item.PatientSpeciesCodeSequenceCodeValue   = codeSequenceMacro.CodeValue;
                        item.PatientSpeciesCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
                    }

                    item.PatientBreedDescription = result[DicomTags.PatientBreedDescription].GetString(0, "");
                    var patientBreedCodeSequence = result[DicomTags.PatientBreedCodeSequence];
                    if (!patientBreedCodeSequence.IsNull && patientBreedCodeSequence.Count > 0)
                    {
                        var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientBreedCodeSequence].Values)[0]);
                        item.PatientBreedCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
                        item.PatientBreedCodeSequenceCodeValue   = codeSequenceMacro.CodeValue;
                        item.PatientBreedCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
                    }

                    item.ResponsiblePerson       = new PersonName(result[DicomTags.ResponsiblePerson].GetString(0, ""));
                    item.ResponsiblePersonRole   = result[DicomTags.ResponsiblePersonRole].GetString(0, "");
                    item.ResponsibleOrganization = result[DicomTags.ResponsibleOrganization].GetString(0, "");

                    studyItemList.Add(item);
                }
            }

            AuditHelper.LogQueryIssued(null, null, EventSource.CurrentUser, EventResult.Success,
                                       SopClass.StudyRootQueryRetrieveInformationModelFindUid, collection);

            return(studyItemList);
        }
Ejemplo n.º 24
0
		/// <summary>
		/// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
		/// </summary>
		/// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
		/// <param name="server">The server from which the study should be loaded.</param>
		public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server)
            :this(studyInstanceUid, server, null)
		{
		}
Ejemplo n.º 25
0
		/// <summary>
		/// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
		/// </summary>
		/// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
		/// <param name="server">The server from which the study should be loaded.</param>
		public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server)
            :this(studyInstanceUid, server, StudyLoaderCheckOptions.Default)
		{
		    
		}
Ejemplo n.º 26
0
 public RemoteStudyRootQuery(IApplicationEntity remoteServer)
 {
     _remoteServer = remoteServer;
     _real = new DicomStudyRootQuery("lrf", remoteServer);
 }
Ejemplo n.º 27
0
        protected override int OnStart(StudyLoaderArgs studyLoaderArgs)
        {
            var serverAe = studyLoaderArgs.Server;
            Platform.CheckForNullReference(serverAe, "Server");
            Platform.CheckMemberIsSet(serverAe.StreamingParameters, "StreamingParameters");
            _serverAe = serverAe;

            EventResult result = EventResult.Success;
            AuditedInstances loadedInstances = new AuditedInstances();
            try
            {

                StudyXml studyXml = RetrieveStudyXml(studyLoaderArgs);
                _instances = GetInstances(studyXml).GetEnumerator();

                loadedInstances.AddInstance(studyXml.PatientId, studyXml.PatientsName, studyXml.StudyInstanceUid);

                return studyXml.NumberOfStudyRelatedInstances;

            }
            finally
            {
                AuditHelper.LogOpenStudies(new string[] { _serverAe.AETitle }, loadedInstances, EventSource.CurrentUser, result);
            }
        }
Ejemplo n.º 28
0
 public RemoteStudyRootQuery(IApplicationEntity remoteServer)
 {
     _remoteServer = remoteServer;
     _real         = new DicomStudyRootQuery(DicomServer.DicomServer.AETitle, remoteServer);
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Queries for studies on a target server matching the specified query parameters.
 /// </summary>
 public abstract StudyItemList Query(QueryParameters queryParams, IApplicationEntity targetServer);
Ejemplo n.º 30
0
        protected static IList<DicomAttributeCollection> Query(IApplicationEntity server, DicomAttributeCollection requestCollection)
		{
			//special case code for ModalitiesInStudy.  An IStudyFinder must accept a multi-valued
			//string for ModalitiesInStudy (e.g. "MR\\CT") and process it appropriately for the 
			//datasource that is being queried.  In this case (Dicom) does not allow multiple
			//query keys, so we have to execute one query per modality specified in the 
			//ModalitiesInStudy query item.

			List<string> modalityFilters = new List<string>();
			if (requestCollection.Contains(DicomTags.ModalitiesInStudy))
			{
				string modalityFilterString = requestCollection[DicomTags.ModalitiesInStudy].ToString();
				if (!String.IsNullOrEmpty(modalityFilterString))
					modalityFilters.AddRange(modalityFilterString.Split(new char[] { '\\' }, StringSplitOptions.RemoveEmptyEntries));

				if (modalityFilters.Count == 0)
					modalityFilters.Add(""); //make sure there is at least one filter, the default.
			}

			SortedList<string, DicomAttributeCollection> resultsByStudy = new SortedList<string, DicomAttributeCollection>();

			string combinedFilter = requestCollection[DicomTags.ModalitiesInStudy];

			try 
			{
				foreach (string modalityFilter in modalityFilters) 
				{
					using (StudyRootFindScu scu = new StudyRootFindScu())
					{
						requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(modalityFilter);

                        IList<DicomAttributeCollection> results = scu.Find(
                            DicomServer.AETitle, server.AETitle, server.ScpParameters.HostName, server.ScpParameters.Port, requestCollection);

						scu.Join(new TimeSpan(0, 0, 0, 0, 1000));

						if(scu.Status == ScuOperationStatus.Canceled)
						{
							String message = String.Format(SR.MessageFormatRemoteServerCancelledFind, 
								scu.FailureDescription ?? "no failure description provided");
							throw new DicomException(message);
						}
						if (scu.Status == ScuOperationStatus.ConnectFailed)
						{
							String message = String.Format(SR.MessageFormatConnectionFailed,
								scu.FailureDescription ?? "no failure description provided");
							throw new DicomException(message);
						}
						else if (scu.Status == ScuOperationStatus.AssociationRejected)
						{
							String message = String.Format(SR.MessageFormatAssociationRejected,
								scu.FailureDescription ?? "no failure description provided");
							throw new DicomException(message);
						}
						if (scu.Status == ScuOperationStatus.Failed)
						{
							String message = String.Format(SR.MessageFormatQueryOperationFailed,
								scu.FailureDescription ?? "no failure description provided");
							throw new DicomException(message);
						}
						if (scu.Status == ScuOperationStatus.TimeoutExpired)
						{
							String message = String.Format(SR.MessageFormatConnectTimeoutExpired,
								scu.FailureDescription ?? "no failure description provided");
							throw new DicomException(message);
						}
						if (scu.Status == ScuOperationStatus.NetworkError)
						{
							throw new DicomException(SR.MessageUnexpectedNetworkError);
						}
						if (scu.Status == ScuOperationStatus.UnexpectedMessage)
						{
							throw new DicomException(SR.MessageUnexpectedMessage);
						}

						//if this function returns true, it means that studies came back whose 
						//modalities did not match the filter, meaning that filtering on
						//ModalitiesInStudy is not supported by that server.
						if (FilterResultsByModality(results, resultsByStudy, modalityFilter))
							break;
					}
				}

				return new List<DicomAttributeCollection>(resultsByStudy.Values);
			}
			finally
			{
				//for consistencies sake, put the original filter back.
				requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(combinedFilter);
			}
		}
Ejemplo n.º 31
0
 /// <summary>
 /// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
 /// </summary>
 /// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
 /// <param name="server">The server from which the study should be loaded.</param>
 public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server)
 {
     _studyInstanceUid = studyInstanceUid;
     _server           = server;
 }
Ejemplo n.º 32
0
 internal DicomServiceNode(IApplicationEntity applicationEntity)
     : this(new ServerDirectoryEntry(new ApplicationEntity(applicationEntity)))
 {
 }
Ejemplo n.º 33
0
	    /// <summary>
		/// Queries for studies on a target server matching the specified query parameters.
		/// </summary>
        public abstract StudyItemList Query(QueryParameters queryParams, IApplicationEntity targetServer);
Ejemplo n.º 34
0
        protected static IList <DicomAttributeCollection> Query(IApplicationEntity server, DicomAttributeCollection requestCollection)
        {
            //special case code for ModalitiesInStudy.  An IStudyFinder must accept a multi-valued
            //string for ModalitiesInStudy (e.g. "MR\\CT") and process it appropriately for the
            //datasource that is being queried.  In this case (Dicom) does not allow multiple
            //query keys, so we have to execute one query per modality specified in the
            //ModalitiesInStudy query item.

            List <string> modalityFilters = new List <string>();

            if (requestCollection.Contains(DicomTags.ModalitiesInStudy))
            {
                string modalityFilterString = requestCollection[DicomTags.ModalitiesInStudy].ToString();
                if (!String.IsNullOrEmpty(modalityFilterString))
                {
                    modalityFilters.AddRange(modalityFilterString.Split(new char[] { '\\' }, StringSplitOptions.RemoveEmptyEntries));
                }

                if (modalityFilters.Count == 0)
                {
                    modalityFilters.Add("");                     //make sure there is at least one filter, the default.
                }
            }

            SortedList <string, DicomAttributeCollection> resultsByStudy = new SortedList <string, DicomAttributeCollection>();

            string combinedFilter = requestCollection[DicomTags.ModalitiesInStudy];

            try
            {
                foreach (string modalityFilter in modalityFilters)
                {
                    using (StudyRootFindScu scu = new StudyRootFindScu())
                    {
                        requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(modalityFilter);

                        IList <DicomAttributeCollection> results = scu.Find(
                            DicomServer.AETitle, server.AETitle, server.ScpParameters.HostName, server.ScpParameters.Port, requestCollection);

                        scu.Join(new TimeSpan(0, 0, 0, 0, 1000));

                        if (scu.Status == ScuOperationStatus.Canceled)
                        {
                            String message = String.Format(SR.MessageFormatRemoteServerCancelledFind,
                                                           scu.FailureDescription ?? "no failure description provided");
                            throw new DicomException(message);
                        }
                        if (scu.Status == ScuOperationStatus.ConnectFailed)
                        {
                            String message = String.Format(SR.MessageFormatConnectionFailed,
                                                           scu.FailureDescription ?? "no failure description provided");
                            throw new DicomException(message);
                        }
                        else if (scu.Status == ScuOperationStatus.AssociationRejected)
                        {
                            String message = String.Format(SR.MessageFormatAssociationRejected,
                                                           scu.FailureDescription ?? "no failure description provided");
                            throw new DicomException(message);
                        }
                        if (scu.Status == ScuOperationStatus.Failed)
                        {
                            String message = String.Format(SR.MessageFormatQueryOperationFailed,
                                                           scu.FailureDescription ?? "no failure description provided");
                            throw new DicomException(message);
                        }
                        if (scu.Status == ScuOperationStatus.TimeoutExpired)
                        {
                            String message = String.Format(SR.MessageFormatConnectTimeoutExpired,
                                                           scu.FailureDescription ?? "no failure description provided");
                            throw new DicomException(message);
                        }
                        if (scu.Status == ScuOperationStatus.NetworkError)
                        {
                            throw new DicomException(SR.MessageUnexpectedNetworkError);
                        }
                        if (scu.Status == ScuOperationStatus.UnexpectedMessage)
                        {
                            throw new DicomException(SR.MessageUnexpectedMessage);
                        }

                        //if this function returns true, it means that studies came back whose
                        //modalities did not match the filter, meaning that filtering on
                        //ModalitiesInStudy is not supported by that server.
                        if (FilterResultsByModality(results, resultsByStudy, modalityFilter))
                        {
                            break;
                        }
                    }
                }

                return(new List <DicomAttributeCollection>(resultsByStudy.Values));
            }
            finally
            {
                //for consistencies sake, put the original filter back.
                requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(combinedFilter);
            }
        }
Ejemplo n.º 35
0
 /// <summary>
 /// Constructs a new <see cref="StudyLoaderArgs"/> using the specified parameters.
 /// </summary>
 /// <param name="studyInstanceUid">The Study Instance UID of the study to be loaded.</param>
 /// <param name="server">The server from which the study should be loaded.</param>
 public StudyLoaderArgs(string studyInstanceUid, IApplicationEntity server)
     : this(studyInstanceUid, server, null)
 {
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Convert application object to json
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public byte[] MessageConversion(IApplicationEntity entity)
        {
            var json = JsonConvert.SerializeObject(entity);

            return(MessageFormatting(json));
        }
Ejemplo n.º 37
0
        public override StudyItemList Query(QueryParameters queryParams, IApplicationEntity targetServer)
        {
            Platform.CheckForNullReference(queryParams, "queryParams");
            Platform.CheckForNullReference(targetServer, "targetServer");

            var selectedServer = targetServer.ToServiceNode();

            //.NET strings are unicode, therefore, so is all the query data.
            const string utf8 = "ISO_IR 192";
            var          requestCollection = new DicomAttributeCollection {
                SpecificCharacterSet = utf8
            };

            requestCollection[DicomTags.SpecificCharacterSet].SetStringValue(utf8);

            requestCollection[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
            requestCollection[DicomTags.StudyInstanceUid].SetStringValue("");

            requestCollection[DicomTags.PatientId].SetStringValue(queryParams["PatientId"]);
            requestCollection[DicomTags.AccessionNumber].SetStringValue(queryParams["AccessionNumber"]);
            requestCollection[DicomTags.PatientsName].SetStringValue(queryParams["PatientsName"]);
            requestCollection[DicomTags.ReferringPhysiciansName].SetStringValue(queryParams["ReferringPhysiciansName"]);
            requestCollection[DicomTags.StudyDate].SetStringValue(queryParams["StudyDate"]);
            requestCollection[DicomTags.StudyTime].SetStringValue("");
            requestCollection[DicomTags.StudyDescription].SetStringValue(queryParams["StudyDescription"]);
            requestCollection[DicomTags.PatientsBirthDate].SetStringValue("");
            requestCollection[DicomTags.ModalitiesInStudy].SetStringValue(queryParams["ModalitiesInStudy"]);
            requestCollection[DicomTags.NumberOfStudyRelatedInstances].SetStringValue("");
            requestCollection[DicomTags.InstanceAvailability].SetEmptyValue();             // must not be included in request

            requestCollection[DicomTags.PatientSpeciesDescription].SetStringValue(GetString(queryParams, "PatientSpeciesDescription"));
            var codeValue   = GetString(queryParams, "PatientSpeciesCodeSequenceCodeValue");
            var codeMeaning = GetString(queryParams, "PatientSpeciesCodeSequenceCodeMeaning");

            if (codeValue != null || codeMeaning != null)
            {
                var codeSequenceMacro = new CodeSequenceMacro
                {
                    CodingSchemeDesignator = "",
                    CodeValue   = codeValue,
                    CodeMeaning = codeMeaning
                };
                requestCollection[DicomTags.PatientSpeciesCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

            requestCollection[DicomTags.PatientBreedDescription].SetStringValue(GetString(queryParams, "PatientBreedDescription"));
            codeValue   = GetString(queryParams, "PatientBreedCodeSequenceCodeValue");
            codeMeaning = GetString(queryParams, "PatientBreedCodeSequenceCodeMeaning");
            if (codeValue != null || codeMeaning != null)
            {
                var codeSequenceMacro = new CodeSequenceMacro
                {
                    CodingSchemeDesignator = "",
                    CodeValue   = codeValue,
                    CodeMeaning = codeMeaning
                };
                requestCollection[DicomTags.PatientBreedCodeSequence].AddSequenceItem(codeSequenceMacro.DicomSequenceItem);
            }

            requestCollection[DicomTags.ResponsiblePerson].SetStringValue(GetString(queryParams, "ResponsiblePerson"));
            requestCollection[DicomTags.ResponsiblePersonRole].SetStringValue("");
            requestCollection[DicomTags.ResponsibleOrganization].SetStringValue(GetString(queryParams, "ResponsibleOrganization"));

            IList <DicomAttributeCollection> results = Query(selectedServer, requestCollection);

            StudyItemList studyItemList = new StudyItemList();

            foreach (DicomAttributeCollection result in results)
            {
                StudyItem item = new StudyItem(result[DicomTags.StudyInstanceUid].GetString(0, ""), selectedServer);

                //TODO: add DicomField attributes to the StudyItem class (implement typeconverter for PersonName class).
                item.PatientsBirthDate       = result[DicomTags.PatientsBirthDate].GetString(0, "");
                item.AccessionNumber         = result[DicomTags.AccessionNumber].GetString(0, "");
                item.StudyDescription        = result[DicomTags.StudyDescription].GetString(0, "");
                item.StudyDate               = result[DicomTags.StudyDate].GetString(0, "");
                item.StudyTime               = result[DicomTags.StudyTime].GetString(0, "");
                item.PatientId               = result[DicomTags.PatientId].GetString(0, "");
                item.PatientsName            = new PersonName(result[DicomTags.PatientsName].GetString(0, ""));
                item.ReferringPhysiciansName = new PersonName(result[DicomTags.ReferringPhysiciansName].GetString(0, ""));
                item.ModalitiesInStudy       = DicomStringHelper.GetStringArray(result[DicomTags.ModalitiesInStudy].ToString());
                DicomAttribute attribute = result[DicomTags.NumberOfStudyRelatedInstances];
                if (!attribute.IsEmpty && !attribute.IsNull)
                {
                    item.NumberOfStudyRelatedInstances = attribute.GetInt32(0, 0);
                }

                item.SpecificCharacterSet = result.SpecificCharacterSet;
                item.InstanceAvailability = result[DicomTags.InstanceAvailability].GetString(0, "");
                if (String.IsNullOrEmpty(item.InstanceAvailability))
                {
                    item.InstanceAvailability = "ONLINE";
                }

                item.PatientSpeciesDescription = result[DicomTags.PatientSpeciesDescription].GetString(0, "");
                var patientSpeciesCodeSequence = result[DicomTags.PatientSpeciesCodeSequence];
                if (!patientSpeciesCodeSequence.IsNull && patientSpeciesCodeSequence.Count > 0)
                {
                    var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientSpeciesCodeSequence].Values)[0]);
                    item.PatientSpeciesCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
                    item.PatientSpeciesCodeSequenceCodeValue   = codeSequenceMacro.CodeValue;
                    item.PatientSpeciesCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
                }

                item.PatientBreedDescription = result[DicomTags.PatientBreedDescription].GetString(0, "");
                var patientBreedCodeSequence = result[DicomTags.PatientBreedCodeSequence];
                if (!patientBreedCodeSequence.IsNull && patientBreedCodeSequence.Count > 0)
                {
                    var codeSequenceMacro = new CodeSequenceMacro(((DicomSequenceItem[])result[DicomTags.PatientBreedCodeSequence].Values)[0]);
                    item.PatientBreedCodeSequenceCodingSchemeDesignator = codeSequenceMacro.CodingSchemeDesignator;
                    item.PatientBreedCodeSequenceCodeValue   = codeSequenceMacro.CodeValue;
                    item.PatientBreedCodeSequenceCodeMeaning = codeSequenceMacro.CodeMeaning;
                }

                item.ResponsiblePerson       = new PersonName(result[DicomTags.ResponsiblePerson].GetString(0, ""));
                item.ResponsiblePersonRole   = result[DicomTags.ResponsiblePersonRole].GetString(0, "");
                item.ResponsibleOrganization = result[DicomTags.ResponsibleOrganization].GetString(0, "");
                studyItemList.Add(item);
            }

            AuditHelper.LogQueryIssued(selectedServer.AETitle, selectedServer.ScpParameters.HostName, EventSource.CurrentUser,
                                       EventResult.Success, SopClass.StudyRootQueryRetrieveInformationModelFindUid,
                                       requestCollection);

            return(studyItemList);
        }
Ejemplo n.º 38
0
            IEnumerable<ISopDataSource> IUnitTestStudyProvider.GetSopDataSources(IApplicationEntity server, string studyInstanceUid)
			{
				if (!Equals(Server, server))
					return null;
				return this[studyInstanceUid];
			}
Ejemplo n.º 39
0
 public Task <bool> InsertApplicationError(IApplicationEntity applicationEntity)
 {
     throw new System.NotImplementedException();
 }