protected virtual object Visit(openehr.openehr.am.archetype.constraint_model.Impl.CONSTRAINT_REF o, int depth) { CONSTRAINT_REF result = new CONSTRAINT_REF(); CloneC_Object(result, o); result.reference = o.target().ToString(); return(result); }
private static ConstraintRef Map(this CONSTRAINT_REF model) { var constraintRef = new ConstraintRef { NodeId = model.node_id, Occurences = model.occurrences.Map(), Reference = model.reference, ReferenceModelTypeName = model.rm_type_name }; return(constraintRef); }
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); } } } }