//public override List<Mercury.Server.Services.Responses.ConfigurationImportResponse> XmlImport (System.Xml.XmlNode objectNode) {

        //    List<Mercury.Server.Services.Responses.ConfigurationImportResponse> response = new List<Mercury.Server.Services.Responses.ConfigurationImportResponse> ();

        //    Services.Responses.ConfigurationImportResponse importResponse = new Mercury.Server.Services.Responses.ConfigurationImportResponse ();


        //    importResponse.ObjectType = objectNode.Name;

        //    importResponse.ObjectName = "RoutingRuleDefinition";

        //    importResponse.Success = true;


        //    if (importResponse.ObjectType == "RoutingRuleDefinition") {

        //        foreach (System.Xml.XmlNode currentNode in objectNode.ChildNodes) {

        //            switch (currentNode.Name) {

        //                case "Properties":

        //                    foreach (System.Xml.XmlNode currentProperty in currentNode.ChildNodes) {

        //                        switch (currentProperty.Attributes["Name"].InnerText) {

        //                            case "InsurerName": insurerId = application.InsurerReferenceIdByName (currentProperty.InnerText); break;

        //                            case "ProgramName": programId = application.ProgramReferenceIdByName (currentProperty.InnerText); break;

        //                            case "BenefitPlanName": benefitPlanId = application.BenefitPlanReferenceIdByName (currentProperty.InnerText); break;

        //                            case "Gender": gender = (Mercury.Server.Core.Enumerations.Gender) Convert.ToInt32 (currentProperty.InnerText); break;

        //                            case "UseAgeCriteria": useAgeCriteria = Convert.ToBoolean (currentProperty.InnerText); break;

        //                            case "AgeMinimum": ageMinimum = Convert.ToInt32 (currentProperty.InnerText); break;

        //                            case "AgeMaximum": ageMaximum = Convert.ToInt32 (currentProperty.InnerText); break;

        //                            case "AgeInMonths": ageInMonths = Convert.ToBoolean (currentProperty.InnerText); break;

        //                            case "EthnicityName": ethnicityId = application.EthnicityReferenceIdByName (currentProperty.InnerText); break;

        //                            case "LanguageName": languageId = application.LanguageReferenceIdByName (currentProperty.InnerText); break;

        //                            case "State": state = currentProperty.InnerText; break;

        //                            case "City": city = currentProperty.InnerText; break;

        //                            case "ZipCode": zipCode = currentProperty.InnerText; break;

        //                            case "County": county = currentProperty.InnerText; break;

        //                            case "WorkQueue":

        //                                String WorkQueueName = currentProperty.FirstChild.Attributes["Name"].InnerText;

        //                                WorkQueueId = application.WorkQueueGetIdByName (WorkQueueName);

        //                                if (WorkQueueId == 0) {

        //                                    workQueue = new WorkQueue (application);

        //                                    response.AddRange (workQueue.XmlImport (currentProperty.FirstChild));

        //                                    WorkQueueId = application.WorkQueueGetIdByName (workQueue.Name);

        //                                }

        //                                break;

        //                        }

        //                    }

        //                    break;

        //            }

        //        }

        //        importResponse.Success = Save ();

        //        importResponse.Id = Id;

        //        if (!importResponse.Success) { importResponse.SetException (base.application.LastException); }

        //    }

        //    else { importResponse.SetException (new ApplicationException ("Invalid Object Type Parsed as Routing Rule Definition.")); }

        //    response.Add (importResponse);

        //    return response;

        //}

        #endregion


        #region Database Functions

        public override void MapDataFields(System.Data.DataRow currentRow)
        {
            routingRuleId = Convert.ToInt64(currentRow["RoutingRuleId"]);

            sequence = Convert.ToInt32(currentRow["Sequence"]);


            Int64.TryParse(currentRow["InsurerId"].ToString(), out insurerId);

            Int64.TryParse(currentRow["ProgramId"].ToString(), out programId);

            Int64.TryParse(currentRow["BenefitPlanId"].ToString(), out benefitPlanId);


            gender = (Mercury.Server.Core.Enumerations.Gender)Convert.ToInt32(currentRow["Gender"]);

            useAgeCriteria = (Boolean)currentRow["UseAgeCriteria"];

            ageMinimum = (Int32)currentRow["AgeMinimum"];

            ageMaximum = (Int32)currentRow["AgeMaximum"];

            IsAgeInMonths = (Boolean)currentRow["IsAgeInMonths"];

            Int64.TryParse(currentRow["EthnicityId"].ToString(), out ethnicityId);

            Int64.TryParse(currentRow["LanguageId"].ToString(), out languageId);


            state = ((String)currentRow["State"]).Trim();

            city = (String)currentRow["City"];

            county = (String)currentRow["County"];

            zipCode = ((String)currentRow["ZipCode"]).Trim();


            workQueueId = Convert.ToInt64(currentRow["WorkQueueId"]);

            return;
        }
        public override void MapDataFields(System.Data.DataRow currentRow)
        {
            base.MapDataFields(currentRow);


            conditionId = (Int64)currentRow["ConditionId"];

            gender = (Mercury.Server.Core.Enumerations.Gender)(Int32) currentRow["Gender"];

            useAgeCriteria = (Boolean)currentRow["UseAgeCriteria"];

            ageMinimum = (Int32)currentRow["AgeMinimum"];

            ageMaximum = (Int32)currentRow["AgeMaximum"];

            Int64.TryParse(currentRow["EthnicityId"].ToString(), out ethnicityId);


            return;
        }