///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="OrganisationSchemeMapCore"/> class.
        /// </summary>
        /// <param name="organisation">
        /// The organisation. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        public OrganisationSchemeMapCore(OrganisationSchemeMapType organisation, IStructureSetObject parent)
            : base(organisation, SdmxStructureType.GetFromEnum(SdmxStructureEnumType.OrganisationSchemeMap), parent)
        {
            this.SourceRef = RefUtil.CreateReference(this, organisation.Source);
            this.TargetRef = RefUtil.CreateReference(this, organisation.Target);

            // get list of code maps
            if (organisation.ItemAssociation != null)
            {
                foreach (OrganisationMap orgMap in organisation.ItemAssociation)
                {
                    IItemMap item = new ItemMapCore(orgMap.Source.GetTypedRef<LocalOrganisationRefType>().id, organisation.Target.GetTypedRef<LocalOrganisationRefType>().id, this);
                    this.AddInternalItem(item);
                }
            }

            try
            {
                this.Validate();
            }
            catch (SdmxSemmanticException e)
            {
                throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this);
            }
        }
        /// <summary>
        /// The process organisation scheme map.
        /// </summary>
        /// <param name="structureSetType">
        /// The structure set type.
        /// </param>
        /// <param name="buildFrom">
        /// The build from.
        /// </param>
        private void ProcessOrganisationSchemeMap(StructureSetType structureSetType, IItemSchemeMapObject buildFrom)
        {
            var orgSchemeMap = new OrganisationSchemeMapType();
            structureSetType.OrganisationSchemeMap = orgSchemeMap;

            string str0 = buildFrom.Id;
            if (!string.IsNullOrWhiteSpace(str0))
            {
                orgSchemeMap.id = buildFrom.Id;
            }

            IList<ITextTypeWrapper> names = buildFrom.Names;
            if (ObjectUtil.ValidCollection(names))
            {
                orgSchemeMap.Name = this.GetTextType(names);
            }

            IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions;
            if (ObjectUtil.ValidCollection(descriptions))
            {
                orgSchemeMap.Description = this.GetTextType(descriptions);
            }

            if (buildFrom.SourceRef != null)
            {
                var refType = new OrganisationSchemeRefType();
                orgSchemeMap.OrganisationSchemeRef = refType;
                SetOrganisationSchemeRefAttributes(refType, buildFrom.SourceRef);
            }

            if (buildFrom.TargetRef != null)
            {
                var refType0 = new OrganisationSchemeRefType();
                orgSchemeMap.TargetOrganisationSchemeRef = refType0;
                SetOrganisationSchemeRefAttributes(refType0, buildFrom.TargetRef);
            }

            IList<IItemMap> itemMapBeans = buildFrom.Items;
            if (ObjectUtil.ValidCollection(itemMapBeans))
            {
                /* foreach */
                foreach (IItemMap itemMapBean in itemMapBeans)
                {
                    var orgMaptype = new OrganisationMapType();
                    orgSchemeMap.OrganisationMap.Add(orgMaptype);
                    string str1 = itemMapBean.SourceId;
                    if (!string.IsNullOrWhiteSpace(str1))
                    {
                        orgMaptype.OrganisationID = itemMapBean.SourceId;
                    }

                    string str2 = itemMapBean.TargetId;
                    if (!string.IsNullOrWhiteSpace(str2))
                    {
                        orgMaptype.TargetOrganisationID = itemMapBean.TargetId;
                    }
                }
            }

            if (this.HasAnnotations(buildFrom))
            {
                orgSchemeMap.Annotations = this.GetAnnotationsType(buildFrom);
            }
        }