public AuditSecurityAlertParticipantObject(ParticipantObjectTypeCodeRoleEnum role, ParticipantObjectIDTypeCode objectIdType, string participantObjectId)
        {
            Platform.CheckForNullReference(participantObjectId, "participantObjectId");

            ParticipantObjectTypeCode         = ParticipantObjectTypeCodeEnum.SystemObject;
            ParticipantObjectTypeCodeRole     = role;
            ParticipantObjectIdTypeCodedValue = objectIdType;
            _participantObjectId = participantObjectId;
        }
        public ParticipantObjectIdentificationContents(ParticipantObjectTypeCodeEnum?type,
                                                       ParticipantObjectTypeCodeRoleEnum?role,
                                                       ParticipantObjectDataLifeCycleEnum?lifeCycle,
                                                       string participantObjectId,
                                                       ParticipantObjectIdTypeCodeEnum typeCode)
        {
            if (type.HasValue)
            {
                ParticipantObjectTypeCode          = (ParticipantObjectIdentificationContentsParticipantObjectTypeCode)type.Value;
                ParticipantObjectTypeCodeSpecified = true;
            }
            else
            {
                ParticipantObjectTypeCodeSpecified = false;
            }

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

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

            ParticipantObjectID = participantObjectId;

            ParticipantObjectIDTypeCode = new ParticipantObjectIDTypeCode(typeCode);
        }
        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);
            }
        }
    }