Beispiel #1
0
        /// <summary>
        /// Creates template for specified drugtype and rule.
        /// </summary>
        /// <param name="drugType">Drug Type of row.</param>
        /// <param name="ruleID">Rule ID to execute.</param>
        private void CreateTemplate(string drugType, string ruleID)
        {
            this.templates = new List <CfhRuleOutput>();

            using (XmlReader reader = GetReader("Microsoft.Cui.Data.Template.xml"))
            {
                bool found = false;
                reader.MoveToContent();
                while (reader.ReadToFollowing("DrugType"))
                {
                    if (string.Compare(reader.ReadInnerXml(), drugType, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        found = true;
                        if (reader.ReadToFollowing("RuleID") && string.Compare(reader.ReadInnerXml(), ruleID, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            CfhRuleOutput output = new CfhRuleOutput();
                            reader.ReadToFollowing("LevelName");
                            output.LevelName = reader.ReadInnerXml();
                            reader.ReadToFollowing("TemplateName");
                            output.TemplateName = reader.ReadInnerXml();
                            this.templates.Add(output);
                        }
                    }
                    else if (found)
                    {
                        return;
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Creates template for specified drugtype and rule.
        /// </summary>
        /// <param name="drugType">Drug Type of row.</param>
        /// <param name="ruleID">Rule ID to execute.</param>
        private void CreateTemplate(string drugType, string ruleID)
        {
            this.templates = new List<CfhRuleOutput>();

            using (XmlReader reader = GetReader("Microsoft.Cui.Data.Template.xml"))
            {
                bool found = false;
                reader.MoveToContent();
                while (reader.ReadToFollowing("DrugType"))
                {
                    if (string.Compare(reader.ReadInnerXml(), drugType, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        found = true;
                        if (reader.ReadToFollowing("RuleID") && string.Compare(reader.ReadInnerXml(), ruleID, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            CfhRuleOutput output = new CfhRuleOutput();
                            reader.ReadToFollowing("LevelName");
                            output.LevelName = reader.ReadInnerXml();
                            reader.ReadToFollowing("TemplateName");
                            output.TemplateName = reader.ReadInnerXml();
                            this.templates.Add(output);
                        }
                    }
                    else if (found)
                    {
                        return;
                    }
                }
            }
        }