public ParticipantObjectIdentificationType(AuditParticipantObject item) { if (item.ParticipantObjectTypeCode.HasValue) { ParticipantObjectTypeCode = (byte) item.ParticipantObjectTypeCode.Value; ParticipantObjectTypeCodeSpecified = true; } else ParticipantObjectTypeCodeSpecified = false; if (item.ParticipantObjectTypeCodeRole.HasValue) { ParticipantObjectTypeCodeRole = (byte) item.ParticipantObjectTypeCodeRole.Value; ParticipantObjectTypeCodeRoleSpecified = true; } else ParticipantObjectTypeCodeRoleSpecified = false; if (item.ParticipantObjectDataLifeCycle.HasValue) { ParticipantObjectDataLifeCycle = (byte) item.ParticipantObjectDataLifeCycle.Value; ParticipantObjectDataLifeCycleSpecified = true; } else ParticipantObjectDataLifeCycleSpecified = false; if (item.ParticipantObjectIdTypeCode.HasValue) { ParticipantObjectIDTypeCode = new ParticipantObjectIdentificationTypeParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value); } else if (item.ParticipantObjectIdTypeCodedValue != null) { ParticipantObjectIDTypeCode = new ParticipantObjectIdentificationTypeParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue); } if (!string.IsNullOrEmpty(item.ParticipantObjectDetail)) { ParticipantObjectDetailString = new string[] {item.ParticipantObjectDetail}; } if (!string.IsNullOrEmpty(item.ParticipantObjectId)) ParticipantObjectID = item.ParticipantObjectId; if (!string.IsNullOrEmpty(item.ParticipantObjectName)) Item = item.ParticipantObjectName; ParticipantObjectDescriptionType description = new ParticipantObjectDescriptionType(); if (!String.IsNullOrEmpty(item.AccessionNumber)) description.Accession = new ParticipantObjectDescriptionTypeAccession[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) }; if (!String.IsNullOrEmpty(item.MppsUid)) description.MPPS = new ParticipantObjectDescriptionTypeMPPS[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) }; if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0) { description.SOPClass = new ParticipantObjectDescriptionTypeSOPClass[item.SopClassDictionary.Count]; List<AuditSopClass> list = new List<AuditSopClass>(item.SopClassDictionary.Values); for (int i = 0; i < item.SopClassDictionary.Count; i++) { description.SOPClass[i] = new ParticipantObjectDescriptionTypeSOPClass(list[i].UID, list[i].NumberOfInstances); } } ParticipantObjectDescription = new ParticipantObjectDescriptionType[] { description }; }
public ParticipantObjectIdentificationType(AuditParticipantObject item) { if (item.ParticipantObjectTypeCode.HasValue) { ParticipantObjectTypeCode = (byte)item.ParticipantObjectTypeCode.Value; ParticipantObjectTypeCodeSpecified = true; } else { ParticipantObjectTypeCodeSpecified = false; } if (item.ParticipantObjectTypeCodeRole.HasValue) { ParticipantObjectTypeCodeRole = (byte)item.ParticipantObjectTypeCodeRole.Value; ParticipantObjectTypeCodeRoleSpecified = true; } else { ParticipantObjectTypeCodeRoleSpecified = false; } if (item.ParticipantObjectDataLifeCycle.HasValue) { ParticipantObjectDataLifeCycle = (byte)item.ParticipantObjectDataLifeCycle.Value; ParticipantObjectDataLifeCycleSpecified = true; } else { ParticipantObjectDataLifeCycleSpecified = false; } if (item.ParticipantObjectIdTypeCode.HasValue) { ParticipantObjectIDTypeCode = new ParticipantObjectIdentificationTypeParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCode.Value); } else if (item.ParticipantObjectIdTypeCodedValue != null) { ParticipantObjectIDTypeCode = new ParticipantObjectIdentificationTypeParticipantObjectIDTypeCode(item.ParticipantObjectIdTypeCodedValue); } if (!string.IsNullOrEmpty(item.ParticipantObjectDetail)) { ParticipantObjectDetailString = new string[] { item.ParticipantObjectDetail }; } if (!string.IsNullOrEmpty(item.ParticipantObjectId)) { ParticipantObjectID = item.ParticipantObjectId; } if (!string.IsNullOrEmpty(item.ParticipantObjectName)) { Item = item.ParticipantObjectName; } ParticipantObjectDescriptionType description = new ParticipantObjectDescriptionType(); if (!String.IsNullOrEmpty(item.AccessionNumber)) { description.Accession = new ParticipantObjectDescriptionTypeAccession[] { new ParticipantObjectDescriptionTypeAccession(item.AccessionNumber) } } ; if (!String.IsNullOrEmpty(item.MppsUid)) { description.MPPS = new ParticipantObjectDescriptionTypeMPPS[] { new ParticipantObjectDescriptionTypeMPPS(item.MppsUid) } } ; if (item.SopClassDictionary != null && item.SopClassDictionary.Count > 0) { description.SOPClass = new ParticipantObjectDescriptionTypeSOPClass[item.SopClassDictionary.Count]; List <AuditSopClass> list = new List <AuditSopClass>(item.SopClassDictionary.Values); for (int i = 0; i < item.SopClassDictionary.Count; i++) { description.SOPClass[i] = new ParticipantObjectDescriptionTypeSOPClass(list[i].UID, list[i].NumberOfInstances); } } ParticipantObjectDescription = new ParticipantObjectDescriptionType[] { description }; } }