Ejemplo n.º 1
0
        protected virtual object Visit(openehr.openehr.am.openehr_profile.data_types.quantity.Impl.C_DV_ORDINAL o, int depth)
        {
            C_DV_ORDINAL result = new C_DV_ORDINAL();

            CloneC_Object(result, o);

            if (o.assumed_value() != null)
            {
                result.assumed_value = CloneDvOrdinal((openehr.openehr.am.openehr_profile.data_types.quantity.Impl.ORDINAL)o.assumed_value());
            }

            if (!o.any_allowed())
            {
                EiffelStructures.list.LINKED_LIST_REFERENCE adlOrdinals = o.items();
                result.list = new DV_ORDINAL[adlOrdinals.count()];
                adlOrdinals.start();

                for (int i = 0; i < result.list.Length; i++)
                {
                    result.list[i] = CloneDvOrdinal((openehr.openehr.am.openehr_profile.data_types.quantity.Impl.ORDINAL)adlOrdinals.active().item());
                    adlOrdinals.forth();
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        private static COrdinal Map(this C_DV_ORDINAL model)
        {
            var ordinal = new COrdinal
            {
                ReferenceModelTypeName = model.rm_type_name,
                NodeId     = model.node_id,
                Occurences = model.occurrences.Map()
            };

            foreach (DV_ORDINAL dvOrdinal in model.list)
            {
                ordinal.Ordinals.Add(dvOrdinal.Map());
            }

            return(ordinal);
        }
Ejemplo n.º 3
0
        private void AddTerms(ArrayList result, C_OBJECT obj)
        {
            if (obj.GetType() == typeof(C_COMPLEX_OBJECT))
            {
                C_COMPLEX_OBJECT co = (C_COMPLEX_OBJECT)obj;

                //Add the node id
                if (!string.IsNullOrEmpty(obj.node_id) && !result.Contains(obj.node_id))
                {
                    result.Add(obj.node_id);
                }

                if (co.attributes != null)
                {
                    foreach (C_ATTRIBUTE attribute in co.attributes)
                    {
                        if (attribute.children != null)
                        {
                            foreach (C_OBJECT obj_1 in attribute.children)
                            {
                                AddTerms(result, obj_1);
                            }
                        }
                    }
                }
            }
            else if (obj.GetType() == typeof(ARCHETYPE_SLOT))
            {
                if (!string.IsNullOrEmpty(obj.node_id) && !result.Contains(obj.node_id))
                {
                    result.Add(obj.node_id);
                }
            }
            //check for internal codes
            else if (obj.GetType() == typeof(C_CODE_PHRASE))
            {
                C_CODE_PHRASE ct = (C_CODE_PHRASE)obj;

                //Check reference
                if (ct.terminology_id != null)
                {
                    if (ct.terminology_id.value.ToString().ToLowerInvariant() == "local" && ct.code_list != null)
                    {
                        foreach (string code in ct.code_list)
                        {
                            if (!result.Contains(code))
                            {
                                result.Add(code);
                            }
                        }
                    }
                }
            }
            //Ordinals use internal codes
            else if (obj.GetType() == typeof(C_DV_ORDINAL))
            {
                C_DV_ORDINAL co = (C_DV_ORDINAL)obj;

                if (co.list != null && co.list.Length > 0)
                {
                    foreach (DV_ORDINAL o in co.list)
                    {
                        if (o.symbol != null && o.symbol.defining_code != null)
                        {
                            if (!result.Contains(o.symbol.defining_code.code_string))
                            {
                                result.Add(o.symbol.defining_code.code_string);
                            }
                        }
                    }
                }
            }
            //Constraint references us acXXXX codes
            else if (obj.GetType() == typeof(CONSTRAINT_REF))
            {
                CONSTRAINT_REF cr = (CONSTRAINT_REF)obj;

                if (cr.reference != null)
                {
                    if (!result.Contains(cr.reference))
                    {
                        result.Add(cr.reference);
                    }
                }
            }
        }