Esempio n. 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="role">Code representing the functional application role of Participant Object being audited</param>
        /// <param name="objectIdType">Describes the identifier that is contained in Participant Object ID.</param>
        /// <param name="participantObjectId">The Identifier for the participant object.</param>
        /// <param name="participantObjectName">The name (type) of object</param>
        /// <param name="participantObjectDetailType">The type of object encoded in <paramref name="participantObjectDetailString"/>.</param>
        /// <param name="participantObjectDetailString">A detailed string describing the object</param>
        public HealthcareDataParticipantObject(ParticipantObjectTypeCodeRoleEnum role,
                                               ParticipantObjectIdTypeCodeEnum objectIdType, string participantObjectId, string participantObjectName, string participantObjectDetailType, string participantObjectDetailString)
        {
            Platform.CheckForNullReference(participantObjectId, "participantObjectId");

            ParticipantObjectTypeCode     = ParticipantObjectTypeCodeEnum.SystemObject;
            ParticipantObjectTypeCodeRole = role;
            ParticipantObjectIdTypeCode   = objectIdType;
            _participantObjectId          = participantObjectId;
            _participantObjectName        = participantObjectName;
            if (!string.IsNullOrEmpty(participantObjectDetailType) && !string.IsNullOrEmpty(participantObjectDetailString))
            {
                var encoding = new ASCIIEncoding();
                ParticipantObjectDetail = new ParticipantObjectDetail()
                {
                    type  = participantObjectDetailType,
                    value = encoding.GetBytes(participantObjectDetailString)
                };
            }
        }
Esempio n. 2
0
        public AuditQueryMessageParticipantObject(string sopClassUid, DicomAttributeCollection msg)
        {
            ParticipantObjectTypeCode         = ParticipantObjectTypeCodeEnum.SystemObject;
            ParticipantObjectTypeCodeRole     = ParticipantObjectTypeCodeRoleEnum.Report;
            ParticipantObjectIdTypeCodedValue = ParticipantObjectIDTypeCode.ClassUID;
            ParticipantObjectId     = sopClassUid;
            ParticipantObjectDetail = new ParticipantObjectDetail()
            {
                type  = "TransferSyntax",
                value = System.Text.Encoding.ASCII.GetBytes(TransferSyntax.ExplicitVrLittleEndianUid)
            };

            MemoryStream      ms     = new MemoryStream();
            DicomStreamWriter writer = new DicomStreamWriter(ms)
            {
                TransferSyntax = TransferSyntax.ExplicitVrLittleEndian
            };

            writer.Write(TransferSyntax.ExplicitVrLittleEndian, msg, DicomWriteOptions.Default);

            ParticipantObjectQuery = ms.ToArray();

            ParticipantObjectDetailString = CreateDetailsString(msg);
        }
Esempio n. 3
0
        public ParticipantObjectIdentificationContents(AuditParticipantObject item)
        {
            if (item.ParticipantObjectTypeCode.HasValue)
            {
                ParticipantObjectTypeCode          = (ParticipantObjectIdentificationContentsParticipantObjectTypeCode)item.ParticipantObjectTypeCode.Value;
                ParticipantObjectTypeCodeSpecified = true;
            }
            else
            {
                ParticipantObjectTypeCodeSpecified = false;
            }

            if (item.ParticipantObjectTypeCodeRole.HasValue)
            {
                ParticipantObjectTypeCodeRole          = (ParticipantObjectIdentificationContentsParticipantObjectTypeCodeRole)item.ParticipantObjectTypeCodeRole.Value;
                ParticipantObjectTypeCodeRoleSpecified = true;
            }
            else
            {
                ParticipantObjectTypeCodeRoleSpecified = false;
            }

            if (item.ParticipantObjectDataLifeCycle.HasValue)
            {
                ParticipantObjectDataLifeCycle          = (ParticipantObjectIdentificationContentsParticipantObjectDataLifeCycle)item.ParticipantObjectDataLifeCycle.Value;
                ParticipantObjectDataLifeCycleSpecified = true;
            }
            else
            {
                ParticipantObjectDataLifeCycleSpecified = false;
            }

            if (item.ParticipantObjectIdTypeCode.HasValue)
            {
                ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value);
            }
            else if (item.ParticipantObjectIdTypeCodedValue != null)
            {
                ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue);
            }

            if (item.ParticipantObjectDetail != null)
            {
                ParticipantObjectDetail = new[] { item.ParticipantObjectDetail }
            }
            ;

            if (!string.IsNullOrEmpty(item.ParticipantObjectDetailString))
            {
                ParticipantObjectDetail = new ParticipantObjectDetail[] { new ParticipantObjectDetail()
                                                                          {
                                                                              type = item.ParticipantObjectDetailString
                                                                          } };
            }

            if (!string.IsNullOrEmpty(item.ParticipantObjectId))
            {
                ParticipantObjectID = item.ParticipantObjectId;
            }

            if (!string.IsNullOrEmpty(item.ParticipantObjectName))
            {
                Item = item.ParticipantObjectName;
            }

            if (item.ParticipantObjectQuery != null)
            {
                Item = item.ParticipantObjectQuery;
            }

            if (!String.IsNullOrEmpty(item.AccessionNumber))
            {
                Accession = new[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) }
            }
            ;
            if (!String.IsNullOrEmpty(item.MppsUid))
            {
                MPPS = new[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) }
            }
            ;

            if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0)
            {
                // TODO: right now the schema only allows one SOP Class. It nees to be fixed.
                var sopClass = CollectionUtils.FirstElement(item.SopClassDictionary.Values);
                SOPClass = new ParticipantObjectDescriptionTypeSOPClass(sopClass.UID, sopClass.NumberOfInstances);
            }
        }
    }
        public ParticipantObjectIdentificationContents(AuditParticipantObject item)
        {
            if (item.ParticipantObjectTypeCode.HasValue)
            {
                ParticipantObjectTypeCode          = (ParticipantObjectIdentificationContentsParticipantObjectTypeCode)item.ParticipantObjectTypeCode.Value;
                ParticipantObjectTypeCodeSpecified = true;
            }
            else
            {
                ParticipantObjectTypeCodeSpecified = false;
            }

            if (item.ParticipantObjectTypeCodeRole.HasValue)
            {
                ParticipantObjectTypeCodeRole          = (ParticipantObjectIdentificationContentsParticipantObjectTypeCodeRole)item.ParticipantObjectTypeCodeRole.Value;
                ParticipantObjectTypeCodeRoleSpecified = true;
            }
            else
            {
                ParticipantObjectTypeCodeRoleSpecified = false;
            }

            if (item.ParticipantObjectDataLifeCycle.HasValue)
            {
                ParticipantObjectDataLifeCycle          = (ParticipantObjectIdentificationContentsParticipantObjectDataLifeCycle)item.ParticipantObjectDataLifeCycle.Value;
                ParticipantObjectDataLifeCycleSpecified = true;
            }
            else
            {
                ParticipantObjectDataLifeCycleSpecified = false;
            }

            if (item.ParticipantObjectIdTypeCode.HasValue)
            {
                ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value);
            }
            else if (item.ParticipantObjectIdTypeCodedValue != null)
            {
                ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue);
            }

            if (item.ParticipantObjectDetail != null)
            {
                ParticipantObjectDetail = new[] { item.ParticipantObjectDetail }
            }
            ;

            if (!string.IsNullOrEmpty(item.ParticipantObjectDetailString))
            {
                ParticipantObjectDetail = new ParticipantObjectDetail[] { new ParticipantObjectDetail()
                                                                          {
                                                                              type = item.ParticipantObjectDetailString
                                                                          } };
            }

            if (!string.IsNullOrEmpty(item.ParticipantObjectId))
            {
                ParticipantObjectID = item.ParticipantObjectId;
            }

            if (!string.IsNullOrEmpty(item.ParticipantObjectName))
            {
                Item = item.ParticipantObjectName;
            }

            if (item.ParticipantObjectQuery != null)
            {
                Item = item.ParticipantObjectQuery;
            }

            if (!String.IsNullOrEmpty(item.AccessionNumber))
            {
                Accession = new[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) }
            }
            ;
            if (!String.IsNullOrEmpty(item.MppsUid))
            {
                MPPS = new[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) }
            }
            ;

            if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0)
            {
                SOPClass = item.SopClassDictionary.Values.Select(sopClass => new ParticipantObjectDescriptionTypeSOPClass(sopClass.UID, sopClass.NumberOfInstances)).ToArray();
            }
        }
    }
Esempio n. 5
0
        public ParticipantObjectIdentificationContents(AuditParticipantObject item)
		{
			if (item.ParticipantObjectTypeCode.HasValue)
			{
                ParticipantObjectTypeCode = (ParticipantObjectIdentificationContentsParticipantObjectTypeCode)item.ParticipantObjectTypeCode.Value;
				ParticipantObjectTypeCodeSpecified = true;
			}
			else ParticipantObjectTypeCodeSpecified = false;

			if (item.ParticipantObjectTypeCodeRole.HasValue)
			{
                ParticipantObjectTypeCodeRole = (ParticipantObjectIdentificationContentsParticipantObjectTypeCodeRole)item.ParticipantObjectTypeCodeRole.Value;
				ParticipantObjectTypeCodeRoleSpecified = true;
			}
			else
				ParticipantObjectTypeCodeRoleSpecified = false;

			if (item.ParticipantObjectDataLifeCycle.HasValue)
			{
                ParticipantObjectDataLifeCycle = (ParticipantObjectIdentificationContentsParticipantObjectDataLifeCycle)item.ParticipantObjectDataLifeCycle.Value;
				ParticipantObjectDataLifeCycleSpecified = true;
			}
			else
				ParticipantObjectDataLifeCycleSpecified = false;

			if (item.ParticipantObjectIdTypeCode.HasValue)
			{
				ParticipantObjectIDTypeCode =
					new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value);
			}
			else if (item.ParticipantObjectIdTypeCodedValue != null)
			{
				ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue);
			}

			if (item.ParticipantObjectDetail != null)
				ParticipantObjectDetail = new[] {item.ParticipantObjectDetail};

			if (!string.IsNullOrEmpty(item.ParticipantObjectDetailString))
			{
                ParticipantObjectDetail = new ParticipantObjectDetail[] { new ParticipantObjectDetail() {type = item.ParticipantObjectDetailString }};
			}

			if (!string.IsNullOrEmpty(item.ParticipantObjectId))
				ParticipantObjectID = item.ParticipantObjectId;

			if (!string.IsNullOrEmpty(item.ParticipantObjectName))
				Item = item.ParticipantObjectName;

			if (item.ParticipantObjectQuery != null)
				Item = item.ParticipantObjectQuery;

			if (!String.IsNullOrEmpty(item.AccessionNumber))
				Accession = new[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) };
			if (!String.IsNullOrEmpty(item.MppsUid))
                MPPS = new[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) };

			if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0)
			{
                // TODO: right now the schema only allows one SOP Class. It nees to be fixed.
                var sopClass = CollectionUtils.FirstElement(item.SopClassDictionary.Values);
                SOPClass = new ParticipantObjectDescriptionTypeSOPClass(sopClass.UID,sopClass.NumberOfInstances);
			}
		}
Esempio n. 6
0
		public AuditQueryMessageParticipantObject(string sopClassUid, DicomAttributeCollection msg)
		{
			ParticipantObjectTypeCode = ParticipantObjectTypeCodeEnum.SystemObject;
			ParticipantObjectTypeCodeRole = ParticipantObjectTypeCodeRoleEnum.Report;
            ParticipantObjectIdTypeCodedValue = ParticipantObjectIDTypeCode.ClassUID;
			ParticipantObjectId = sopClassUid;
			ParticipantObjectDetail = new ParticipantObjectDetail()
			                          	{
			                          		type = "TransferSyntax",
			                          		value = System.Text.Encoding.ASCII.GetBytes(TransferSyntax.ExplicitVrLittleEndianUid)
			                          	};

			MemoryStream ms = new MemoryStream();
			DicomStreamWriter writer = new DicomStreamWriter(ms)
			                           	{
			                           		TransferSyntax = TransferSyntax.ExplicitVrLittleEndian
			                           	};
			writer.Write(TransferSyntax.ExplicitVrLittleEndian, msg, DicomWriteOptions.Default);

			ParticipantObjectQuery = ms.ToArray();

			ParticipantObjectDetailString = CreateDetailsString(msg);
		}
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="role">Code representing the functional application role of Participant Object being audited</param>
		/// <param name="objectIdType">Describes the identifier that is contained in Participant Object ID.</param>
		/// <param name="participantObjectId">The Identifier for the participant object.</param>
		/// <param name="participantObjectName">The name (type) of object</param>
		/// <param name="participantObjectDetailType">The type of object encoded in <paramref name="participantObjectDetailString"/>.</param>
		/// <param name="participantObjectDetailString">A detailed string describing the object</param>
		public HealthcareDataParticipantObject(ParticipantObjectTypeCodeRoleEnum role, 
			ParticipantObjectIdTypeCodeEnum objectIdType, string participantObjectId, string participantObjectName, string participantObjectDetailType, string participantObjectDetailString)
		{
			Platform.CheckForNullReference(participantObjectId, "participantObjectId");

			ParticipantObjectTypeCode = ParticipantObjectTypeCodeEnum.SystemObject;
			ParticipantObjectTypeCodeRole = role;
			ParticipantObjectIdTypeCode = objectIdType;
			_participantObjectId = participantObjectId;
			_participantObjectName = participantObjectName;
			if (!string.IsNullOrEmpty(participantObjectDetailType) && !string.IsNullOrEmpty(participantObjectDetailString))
			{
				var encoding = new ASCIIEncoding();
				ParticipantObjectDetail = new ParticipantObjectDetail()
					{
						type = participantObjectDetailType,
						value = encoding.GetBytes(participantObjectDetailString)
					};
			}
		}
        public ParticipantObjectIdentificationContents(AuditParticipantObject item)
		{
			if (item.ParticipantObjectTypeCode.HasValue)
			{
                ParticipantObjectTypeCode = (ParticipantObjectIdentificationContentsParticipantObjectTypeCode)item.ParticipantObjectTypeCode.Value;
				ParticipantObjectTypeCodeSpecified = true;
			}
			else ParticipantObjectTypeCodeSpecified = false;

			if (item.ParticipantObjectTypeCodeRole.HasValue)
			{
                ParticipantObjectTypeCodeRole = (ParticipantObjectIdentificationContentsParticipantObjectTypeCodeRole)item.ParticipantObjectTypeCodeRole.Value;
				ParticipantObjectTypeCodeRoleSpecified = true;
			}
			else
				ParticipantObjectTypeCodeRoleSpecified = false;

			if (item.ParticipantObjectDataLifeCycle.HasValue)
			{
                ParticipantObjectDataLifeCycle = (ParticipantObjectIdentificationContentsParticipantObjectDataLifeCycle)item.ParticipantObjectDataLifeCycle.Value;
				ParticipantObjectDataLifeCycleSpecified = true;
			}
			else
				ParticipantObjectDataLifeCycleSpecified = false;

			if (item.ParticipantObjectIdTypeCode.HasValue)
			{
				ParticipantObjectIDTypeCode =
					new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value);
			}
			else if (item.ParticipantObjectIdTypeCodedValue != null)
			{
				ParticipantObjectIDTypeCode =
                    new ParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue);
			}

			if (item.ParticipantObjectDetail != null)
				ParticipantObjectDetail = new[] {item.ParticipantObjectDetail};

			if (!string.IsNullOrEmpty(item.ParticipantObjectDetailString))
			{
                ParticipantObjectDetail = new ParticipantObjectDetail[] { new ParticipantObjectDetail() {type = item.ParticipantObjectDetailString }};
			}

			if (!string.IsNullOrEmpty(item.ParticipantObjectId))
				ParticipantObjectID = item.ParticipantObjectId;

			if (!string.IsNullOrEmpty(item.ParticipantObjectName))
				Item = item.ParticipantObjectName;

			if (item.ParticipantObjectQuery != null)
				Item = item.ParticipantObjectQuery;

			if (!String.IsNullOrEmpty(item.AccessionNumber))
				Accession = new[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) };
			if (!String.IsNullOrEmpty(item.MppsUid))
                MPPS = new[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) };

			if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0)
			{
				SOPClass = item.SopClassDictionary.Values.Select(sopClass => new ParticipantObjectDescriptionTypeSOPClass(sopClass.UID, sopClass.NumberOfInstances)).ToArray();
			}
		}