/// <summary>Initializes an instance of PercentageSplitter.</summary>
        /// <param name="conn">The database connection to retreive the rule details from.</param>
        /// <param name="splitRuleID">The database ID of the rule this Splitter represents.</param>
        /// <param name="procedureCode">The ADA procedure code this splitter operates on.</param>
        /// <param name="carrier">The insurance carrier this splitter is for.</param>
        public PercentageSplitter(int splitRuleID, string procedureCode, string carrier)
            : base(procedureCode, carrier)
        {
            C_DentalClaimTracker.splitter_rule_details srd = new C_DentalClaimTracker.splitter_rule_details();

            DataTable details = srd.Search("SELECT rd.PROCEDURE_CODE, " +
                                           "       rd.Description AS DESCRIPTION, " +
                                           "       rd.RULE_VALUE " +
                                           "FROM SPLITTER_RULE_DETAILS rd " +
                                           "WHERE (SPLIT_RULE = " + splitRuleID.ToString() + ")");
            DataTableReader reader = details.CreateDataReader();

            SplitRuleDetail d;

            while (reader.Read())
            {
                d = new SplitRuleDetail();
                d.ProcedureCode = reader.GetString(reader.GetOrdinal("PROCEDURE_CODE"));
                d.Description   = reader.GetString(reader.GetOrdinal("DESCRIPTION"));
                d.Value         = reader.GetInt32(reader.GetOrdinal("RULE_VALUE"));
                ruleDetails.Add(d);
            }
            reader.Close();

            // Didn't get any details -- this is worthless.
            if (ruleDetails.Count < 1)
            {
                throw new Exception("No details were found for rule " + splitRuleID.ToString() + ".");
            }
        }
		/// <summary>Initializes an instance of RemainderSplitter.</summary>
		/// <param name="conn">The database connection to retreive the rule details from.</param>
		/// <param name="splitRuleID">The database ID of the rule this Splitter represents.</param>
		/// <param name="procedureCode">The ADA procedure code this splitter operates on.</param>
		/// <param name="carrier">The insurance carrier this splitter is for.</param>
        public RemainderSplitter(int splitRuleID, string procedureCode, string carrier)
            : base(procedureCode, carrier)
        {
            C_DentalClaimTracker.splitter_rule_details srd = new C_DentalClaimTracker.splitter_rule_details();

            DataTable details = srd.Search("SELECT rd.PROCEDURE_CODE, " +
                                            "       rd.PRIORITY, " +
                                            "       rd.DESCRIPTION, " +
                                            "       rd.RULE_VALUE " +
                                            "FROM SPLITTER_RULE_DETAILS rd " +                             
                                            "WHERE (SPLIT_RULE = " + splitRuleID.ToString() + ") " +
                                            "ORDER BY rd.PRIORITY DESC");

            // "       ISNULL(code.DESCRIPTION, ' ') AS DESCRIPTION, " +
            // "     LEFT OUTER JOIN DDB_PROC_CODE_BASE code ON (rd.PROCEDURE_CODE = code.ADACODE) " +
            DataTableReader reader = details.CreateDataReader();

            SplitRuleDetail d;
            while (reader.Read())
            {
                d = new SplitRuleDetail();
                d.ProcedureCode = reader.GetString(reader.GetOrdinal("PROCEDURE_CODE"));
                d.Description = reader.GetString(reader.GetOrdinal("DESCRIPTION"));
                d.Value = reader.GetInt32(reader.GetOrdinal("RULE_VALUE"));
                d.Priority = (Int16) reader.GetInt32(reader.GetOrdinal("PRIORITY"));
                ruleDetails.Add(d);
            }
            reader.Close();

            // Didn't get any details -- this is worthless.
            if (ruleDetails.Count < 1)
            {
                throw new Exception("No details were found for rule " + splitRuleID.ToString() + ".");
            }
        }