예제 #1
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);
            }
        }
    }
예제 #2
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);
			}
		}