コード例 #1
0
        protected override C_ATTRIBUTE CloneAttribute(openehr.openehr.am.archetype.constraint_model.C_ATTRIBUTE currentObject)
        {
            C_ATTRIBUTE result = base.CloneAttribute(currentObject);

            openehr.openehr.am.archetype.constraint_model.C_COMPLEX_OBJECT parent = currentObject.parent() as openehr.openehr.am.archetype.constraint_model.C_COMPLEX_OBJECT;

            if (parent != null)
            {
                string parentTypeName = parent.rm_type_name().to_cil();
                string attrName = result.rm_attribute_name;

                if ((parentTypeName == "COMPOSITION" && attrName == "context")
                 || (parentTypeName == "COMPOSITION" && attrName == "content")
                 || (parentTypeName == "EVENT_CONTEXT" && attrName == "other_context")
                 || (parentTypeName == "EVENT_CONTEXT" && attrName == "heath_care_facility")
                 || (parentTypeName == "EVENT_CONTEXT" && attrName == "end_time")
                 || (parentTypeName == "EVENT_CONTEXT" && attrName == "participations")
                 || (parentTypeName == "EVENT_CONTEXT" && attrName == "location")
                 || (parentTypeName == "SECTION" && attrName == "items")
                 || (entries.Contains(parentTypeName) && attrName == "other_participations")
                 || (entries.Contains(parentTypeName) && attrName == "provider")
                 || (entries.Contains(parentTypeName) && attrName == "workflow_id")
                 || (careEntries.Contains(parentTypeName) && attrName == "protocol")
                 || (careEntries.Contains(parentTypeName) && attrName == "guideline_id")
                 || (parentTypeName == "OBSERVATION" && attrName == "state")
                 || (parentTypeName == "INSTRUCTION" && attrName == "activities")
                 || (parentTypeName == "INSTRUCTION" && attrName == "expiry_time")
                 || (parentTypeName == "INSTRUCTION" && attrName == "wf_definition")
                 || (parentTypeName == "ACTION" && attrName == "instruction_details")
                 || (parentTypeName == "INSTRUCTION_DETAILS" && attrName == "wf_details")
                 || (parentTypeName == "ISM_TRANSITION" && attrName == "careflow_step")
                 || (parentTypeName == "ITEM_TREE" && attrName == "items")
                 || (parentTypeName == "ITEM_TABLE" && attrName == "rows")
                 || (parentTypeName == "ITEM_LIST" && attrName == "items")
                 || (parentTypeName == "HISTORY" && attrName == "events")
                 || (parentTypeName == "HISTORY" && attrName == "period")
                 || (events.Contains(parentTypeName) && attrName == "state")
                 || (parentTypeName == "ELEMENT" && attrName == "value")
                 || (parentTypeName == "ELEMENT" && attrName == "null_flavour")
                 || (regexDvInterval.IsMatch(parentTypeName) && (attrName == "lower" || attrName == "upper"))
                )
                {
                    result.existence = new IntervalOfInteger();
                    result.existence.lower = 0;
                    result.existence.upper = 1;
                    result.existence.lowerSpecified = true;
                    result.existence.upperSpecified = true;
                    result.existence.lower_included = true;
                    result.existence.upper_included = true;
                    result.existence.lower_includedSpecified = true;
                    result.existence.upper_includedSpecified = true;
                }
            }

            return result;
        }