Beispiel #1
0
        private void BuildHL7Components(Segment parentSegment, IField parentField,
			TreeNode parentNode, TreeView tv)
        {
            var newNodes = new List<TreeNode>(parentField.Components.Length);

            foreach (SimpleHL7.IComponent c in parentField.Components)
            {
                TreeNode node = new TreeNode(c.Value);
                newNodes.Add(node);
            }
            parentNode.Nodes.AddRange(newNodes.ToArray());
        }
Beispiel #2
0
        private void BuildHL7Fields(Segment parentSegment, IField parentField, 
			TreeNode parentNode, TreeView tv)
        {
            IField[] fields;
            int i;

            if (parentField == null && parentSegment.Fields.Any())
            {
                fields = parentSegment.Fields;
                i = 0;
            }
            else if (parentField is RepeatingField)
            {
                fields = parentField.Fields;
                i = 1;
            }
            else
                return;

            var newNodes = new List<TreeNode>(fields.Length);

            foreach (IField f in fields)
            {
                TreeNode node = new TreeNode();
                if (f is RepeatingField)
                {
                    BuildHL7Fields(parentSegment, f, node, tv);

                }
                else if (f.Components.Length > 1)
                    BuildHL7Components(parentSegment, f, node, tv);

                if (parentField == null)
                    node.Text = String.Concat(parentSegment, "-", i, ": ", f.Value);
                else
                    node.Text = f.Value;

                if (i > 0)
                    newNodes.Add(node);

                i++;
            }

            parentNode.Nodes.AddRange(newNodes.ToArray());
        }