protected virtual C_REAL CloneReal(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_REAL o)
        {
            C_REAL result = new C_REAL();

            if (o.interval() != null)
                result.range = CloneIntervalOfReal(o.interval());

            if (o.has_assumed_value())
            {
                result.assumed_valueSpecified = true;
                result.assumed_value = ((EiffelKernel.dotnet.REAL_32_REF)o.assumed_value()).item();
            }

            if (o.list() != null && o.list().count() > 0)
            {
                result.list = new float[o.list().count()];

                for (int i = 1; i <= result.list.Length; i++)
                    result.list[i - 1] = (float)o.list().i_th(i);
            }

            return result;
        }
        protected virtual object Visit(openehr.openehr.am.openehr_profile.data_types.text.Impl.C_CODE_PHRASE o, int depth)
        {
            C_CODE_PHRASE result = new C_CODE_PHRASE();
            CloneC_Object(result, o);

            if (o.terminology_id() != null)
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value = o.terminology_id().value().ToString();
                result.terminology_id = terminologyId;
            }

            if (o.code_list() != null)
            {
                result.code_list = new string[o.code_list().count()];

                for (int i = 1; i <= result.code_list.Length; i++)
                    result.code_list[i - 1] = o.code_list().i_th(i).ToString();
            }

            if (o.has_assumed_value())
                result.assumed_value = CloneCodePhrase((openehr.openehr.rm.data_types.text.Impl.CODE_PHRASE)o.assumed_value());

            return result;
        }
        protected virtual C_INTEGER CloneInteger(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_INTEGER o)
        {
            C_INTEGER result = new C_INTEGER();

            if (o.interval() != null)
                result.range = CloneIntervalOfInteger(o.interval());

            if (o.has_assumed_value())
            {
                result.assumed_valueSpecified = true;
                result.assumed_value = ((EiffelKernel.INTEGER_32_REF)o.assumed_value()).item();
            }

            if (o.list() != null && o.list().count() > 0)
            {
                result.list = new int[o.list().count()];

                for (int i = 1; i <= o.list().count(); i++)
                    result.list[i - 1] = o.list().i_th(i);
            }

            return result;
        }
        protected virtual C_STRING CloneString(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_STRING o)
        {
            C_STRING result = new C_STRING();

            if (o.regexp() != null)
                result.pattern = o.regexp().to_cil();

            if (o.has_assumed_value())
                result.assumed_value = o.assumed_value().ToString();

            if (o.strings() != null && o.strings().count() > 0)
            {
                result.list = new string[o.strings().count()];

                for (int i = 1; i <= result.list.Length; i++)
                    result.list[i - 1] = o.strings().i_th(i).ToString();
            }

            if (o.is_open())
            {
                result.list_open = true;
                result.list_openSpecified = true;
            }

            return result;
        }
        protected virtual C_BOOLEAN CloneBoolean(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_BOOLEAN o)
        {
            C_BOOLEAN result = new C_BOOLEAN();
            result.true_valid = o.true_valid();
            result.false_valid = o.false_valid();

            if (o.has_assumed_value())
            {
                result.assumed_valueSpecified = true;
                result.assumed_value = ((EiffelKernel.BOOLEAN_REF)o.assumed_value()).item();
            }

            return result;
        }
        protected virtual C_DURATION CloneDuration(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_DURATION o)
        {
            C_DURATION result = new C_DURATION();

            if (o.has_assumed_value())
                result.assumed_value = o.assumed_value().ToString();

            if (o.pattern() != null)
                result.pattern = o.pattern().ToString();

            result.range = cloneDurationRange(o.interval());

            return result;
        }
        protected virtual C_TIME CloneTime(openehr.openehr.am.archetype.constraint_model.primitive.Impl.C_TIME o)
        {
            C_TIME result = new C_TIME();

            if (o.has_assumed_value())
                result.assumed_value = o.assumed_value().ToString();

            if (o.pattern() != null)
                result.pattern = o.pattern().ToString();

            result.range = CloneIntervalOfTime(o.interval());

            return result;
        }