public void EncryptTaxIDs(CCHEncrypt ce)
        {
            ce.Add("TaxID", "");
            List <dynamic> newD = new List <dynamic>();

            foreach (dynamic doc in this.results)
            {
                ce["TaxID"] = doc.TaxID;
                newD.Add(new
                {
                    doc.ServiceName,
                    TaxId = ce.ToString(),
                    doc.NPI,
                    doc.PracticeName,
                    doc.ProviderName,
                    doc.RangeMin,
                    doc.RangeMax,
                    doc.Latitude,
                    doc.Longitude,
                    doc.LocationAddress1,
                    doc.LocationAddress2,
                    doc.LocationCity,
                    doc.LocationState,
                    doc.LocationZip,
                    doc.LocationTelephone,
                    doc.FairPrice,
                    doc.HGRecognized,
                    doc.HGProviderID,
                    doc.OtherKeyItem1,
                    doc.OtherKeyItem1_Text,
                    doc.OtherKeyItem1_LearnMoreTitle,
                    doc.OtherKeyItem1_LearnMoreText
                });
            }

            this.results = newD;
        }
Esempio n. 2
0
        public void GetData(string ConnectionString, CCHEncrypt ce)
        {
            base.GetData(ConnectionString);

            ce.Add("TaxID", "");

            if (this.Tables.Count >= 1 && this.Tables[0].Rows.Count > 0 && FromRow <= this.Tables[0].Rows.Count)
            {                                                //If we got data back, there are rows in that data, and they've specified a result range that exists in the data set
                //The range works as an index and a count, need to transform a starting row index and an ending row index into that format
                int maxRowCount = this.Tables[0].Rows.Count, //The most rows we could possibly get
                    rowCount    = ToRow - FromRow;           //Set rowCount to the difference in order to turn an index into a count
                if (rowCount <= 0)
                {
                    rowCount = 25;                 //If we didn't receive a specific endpoint, set it to 25 as the default
                }
                if (rowCount > (maxRowCount - FromRow))
                {
                    rowCount     = maxRowCount - FromRow; //Cap the rowCount at the most we have available factoring in the starting point
                    endOfResults = true;
                }

                _totalDocs = (this.Tables[0] != null ? this.Tables[0].Rows.Count : 0);  //  lam, 20130730, MOB-33

                doctors = (from docRow in this.Tables[0].AsEnumerable()
                           select new DoctorResult
                {
                    ServiceName = docRow.GetData("ServiceName"),
                    TaxId = docRow.EncryptTaxID(ce),
                    NPI = docRow.GetData("NPI"),
                    PracticeName = docRow.GetData("PracticeName"),
                    OrganizationLocationID = docRow.GetData <int>("OrganizationLocationID"),
                    ProviderName = docRow.GetData("ProviderName"),
                    RangeMin = docRow.GetData <int>("RangeMin"),
                    RangeMax = docRow.GetData <int>("RangeMax"),
                    Latitude = docRow.GetData <double>("Latitude"),
                    Longitude = docRow.GetData <double>("Longitude"),
                    LocationAddress1 = docRow.GetData("LocationAddress1"),
                    YourCostMin = docRow.GetData <int>("YourCostMin"),
                    YourCostMax = docRow.GetData <int>("YourCostMax"),
                    LocationCity = docRow.GetData("LocationCity"),
                    LocationState = docRow.GetData("LocationState"),
                    LocationZip = docRow.GetData("LocationZip"),
                    LocationPhone = docRow.GetData("LocationTelephone"),
                    RowNumber = docRow.GetData <int>("RowNumber"),
                    Distance = docRow.GetData("Distance"),
                    NumericDistance = docRow.GetData <decimal>("NumericDistance"),
                    FairPrice = docRow.GetData <bool>("FairPrice"),
                    HGRecognized = docRow.GetData <int>("HGRecognized"),
                    LatLong = docRow.GetData("LatLong"),
                    HGOverallRating = docRow.GetData <double>("HGOverallRating"),
                    HGPatientCount = docRow.GetData <int>("HGPatientCount"),
                    RowOrderKey = docRow.GetData <int>("RowOrderKey"),
                    AntiTransparency = docRow.GetData <bool>("AntiTransparency")
                }).ToList <DoctorResult>().GetRange(FromRow, rowCount);
            }
            if (this.Tables.Count >= 2 && this.Tables[1].Rows.Count > 0)
            {
                description = (from desc in this.Tables[1].AsEnumerable()
                               select new DescriptionResult
                {
                    Description = desc.GetData("Description")
                }).ToList <DescriptionResult>();
            }
            if (this.Tables.Count >= 3 && this.Tables[2].Rows.Count > 0)
            {
                specialties = (from specs in this.Tables[2].AsEnumerable()
                               select new SpecialtyResult
                {
                    FindADoc = specs.GetData <int>("FindADoc"),
                    Specialty = specs.GetData("Specialty"),
                    Description = specs.GetData("Description"),
                    Title = specs.GetData("Title"),
                    DoctorTitleText = specs.GetData("DoctorTitleText"),
                    LearnMore = specs.GetData("LearnMore")
                }).ToList <SpecialtyResult>();
            }
            if (this.Tables.Count >= 4 && this.Tables[3].Rows.Count > 0)
            {
                thinData = (from td in this.Tables[3].AsEnumerable()
                            select new ThinDataResult
                {
                    ThinData = td.GetData <bool>("ThinData")
                }).ToList <ThinDataResult>();
            }
            if (this.Tables.Count >= 5 && this.Tables[4].Rows.Count > 0)
            {
                if (FromRow == 0)
                {
                    preferredDocs = (from prefDocRow in this.Tables[4].AsEnumerable()
                                     where prefDocRow.GetData("ServiceName") != null
                                     select new DoctorResult
                    {
                        ServiceName = prefDocRow.GetData("ServiceName"),
                        TaxId = prefDocRow.EncryptTaxID(ce),
                        NPI = prefDocRow.GetData("NPI"),
                        PracticeName = prefDocRow.GetData("PracticeName"),
                        OrganizationLocationID = prefDocRow.GetData <int>("OrganizationLocationID"),
                        ProviderName = prefDocRow.GetData("ProviderName"),
                        RangeMin = prefDocRow.GetData <int>("RangeMin"),
                        RangeMax = prefDocRow.GetData <int>("RangeMax"),
                        Latitude = prefDocRow.GetData <double>("Latitude"),
                        Longitude = prefDocRow.GetData <double>("Longitude"),
                        LocationAddress1 = prefDocRow.GetData("LocationAddress1"),
                        YourCostMin = prefDocRow.GetData <int>("YourCostMin"),
                        YourCostMax = prefDocRow.GetData <int>("YourCostMax"),
                        LocationCity = prefDocRow.GetData("LocationCity"),
                        LocationState = prefDocRow.GetData("LocationState"),
                        LocationZip = prefDocRow.GetData("LocationZip"),
                        LocationPhone = prefDocRow.GetData("LocationTelephone"),
                        RowNumber = prefDocRow.GetData <int>("RowNumber"),
                        Distance = prefDocRow.GetData("Distance"),
                        NumericDistance = prefDocRow.GetData <decimal>("NumericDistance"),
                        FairPrice = prefDocRow.GetData <bool>("FairPrice"),
                        HGRecognized = prefDocRow.GetData <int>("HGRecognized"),
                        LatLong = prefDocRow.GetData("LatLong"),
                        HGOverallRating = prefDocRow.GetData <double>("HGOverallRating"),
                        HGPatientCount = prefDocRow.GetData <int>("HGPatientCount"),
                        RowOrderKey = prefDocRow.GetData <int>("RowOrderKey"),
                        AntiTransparency = prefDocRow.GetData <bool>("AntiTransparency")
                    }).ToList <DoctorResult>();
                    _totalDocs += (preferredDocs != null && preferredDocs.Count > 0 ? preferredDocs.Count : 0);
                }
            }
        }
Esempio n. 3
0
        public void GetData(string ConnectionString, CCHEncrypt ce)
        {
            base.GetData(ConnectionString);

            ce.Add("TaxID", "");

            if (this.Tables.Count >= 1 && this.Tables[0].Rows.Count > 0)
            {
                _totalDocs = (this.Tables[0] != null ? this.Tables[0].Rows.Count : 0);  //  lam, 20130730, MOB-33

                doctors = (from docRow in this.Tables[0].AsEnumerable()
                           select new DoctorResult
                {
                    ServiceName = docRow.GetData("ServiceName"),
                    TaxId = docRow.EncryptTaxID(ce),
                    NPI = docRow.GetData("NPI"),
                    PracticeName = docRow.GetData("PracticeName"),
                    OrganizationLocationID = docRow.GetData("OrganizationLocationID"),
                    ProviderName = docRow.GetData("ProviderName"),
                    RangeMin = docRow.GetData <int>("RangeMin"),
                    RangeMax = docRow.GetData <int>("RangeMax"),
                    Latitude = docRow.GetData <double>("Latitude"),
                    Longitude = docRow.GetData <double>("Longitude"),
                    LocationAddress1 = docRow.GetData("LocationAddress1"),
                    YourCostMin = docRow.GetData <int>("YourCostMin"),
                    YourCostMax = docRow.GetData <int>("YourCostMax"),
                    LocationCity = docRow.GetData("LocationCity"),
                    LocationState = docRow.GetData("LocationState"),
                    LocationZip = docRow.GetData("LocationZip"),
                    LocationPhone = docRow.GetData("LocationTelephone"),
                    RowNumber = docRow.GetData <int>("RowNumber"),
                    Distance = docRow.GetData("Distance"),
                    NumericDistance = docRow.GetData <decimal>("NumericDistance"),
                    FairPrice = docRow.GetData <bool>("FairPrice"),
                    HGRecognized = docRow.GetData <int>("HGRecognized"),
                    LatLong = docRow.GetData("LatLong"),
                    HGOverallRating = docRow.GetData <double>("HGOverallRating"),
                    HGPatientCount = docRow.GetData <int>("HGPatientCount"),
                    RowOrderKey = docRow.GetData <int>("RowOrderKey"),
                    AntiTransparency = docRow.GetData <bool>("AntiTransparency")
                }).ToList <DoctorResult>();
            }
            if (this.Tables.Count >= 2 && this.Tables[1].Rows.Count > 0)
            {
                description = (from desc in this.Tables[1].AsEnumerable()
                               select new DescriptionResult
                {
                    Description = desc.GetData("Description")
                }).ToList <DescriptionResult>();
            }
            if (this.Tables.Count >= 3 && this.Tables[2].Rows.Count > 0)
            {
                specialties = (from specs in this.Tables[2].AsEnumerable()
                               select new SpecialtyResult
                {
                    FindADoc = specs.GetData <int>("FindADoc"),
                    Specialty = specs.GetData("Specialty"),
                    Description = specs.GetData("Description"),
                    Title = specs.GetData("Title"),
                    DoctorTitleText = specs.GetData("DoctorTitleText"),
                    LearnMore = specs.GetData("LearnMore")
                }).ToList <SpecialtyResult>();
            }
            if (this.Tables.Count >= 4 && this.Tables[3].Rows.Count > 0)
            {
                thinData = (from td in this.Tables[3].AsEnumerable()
                            select new ThinDataResult
                {
                    ThinData = td.GetData <bool>("ThinData")
                }).ToList <ThinDataResult>();

                alternateProviderResult = (from specs in this.Tables[3].AsEnumerable()
                                           select new AlternateProviderResult
                {
                    AlternateProviderData = specs.GetData <bool>("AltFlg")
                }).First <AlternateProviderResult>();
            }
            if (this.Tables.Count >= 5 && this.Tables[4].Rows.Count > 0)
            {
                if (fromRow == 0)
                {
                    preferredDocs = (from prefDocRow in this.Tables[4].AsEnumerable()
                                     where prefDocRow.GetData("ServiceName") != null
                                     select new DoctorResult
                    {
                        ServiceName = prefDocRow.GetData("ServiceName"),
                        TaxId = prefDocRow.EncryptTaxID(ce),
                        NPI = prefDocRow.GetData("NPI"),
                        PracticeName = prefDocRow.GetData("PracticeName"),
                        OrganizationLocationID = prefDocRow.GetData("OrganizationLocationID"),
                        ProviderName = prefDocRow.GetData("ProviderName"),
                        RangeMin = prefDocRow.GetData <int>("RangeMin"),
                        RangeMax = prefDocRow.GetData <int>("RangeMax"),
                        Latitude = prefDocRow.GetData <double>("Latitude"),
                        Longitude = prefDocRow.GetData <double>("Longitude"),
                        LocationAddress1 = prefDocRow.GetData("LocationAddress1"),
                        YourCostMin = prefDocRow.GetData <int>("YourCostMin"),
                        YourCostMax = prefDocRow.GetData <int>("YourCostMax"),
                        LocationCity = prefDocRow.GetData("LocationCity"),
                        LocationState = prefDocRow.GetData("LocationState"),
                        LocationZip = prefDocRow.GetData("LocationZip"),
                        LocationPhone = prefDocRow.GetData("LocationTelephone"),
                        RowNumber = prefDocRow.GetData <int>("RowNumber"),
                        Distance = prefDocRow.GetData("Distance"),
                        NumericDistance = prefDocRow.GetData <decimal>("NumericDistance"),
                        FairPrice = prefDocRow.GetData <bool>("FairPrice"),
                        HGRecognized = prefDocRow.GetData <int>("HGRecognized"),
                        LatLong = prefDocRow.GetData("LatLong"),
                        HGOverallRating = prefDocRow.GetData <double>("HGOverallRating"),
                        HGPatientCount = prefDocRow.GetData <int>("HGPatientCount"),
                        RowOrderKey = prefDocRow.GetData <int>("RowOrderKey"),
                        AntiTransparency = prefDocRow.GetData <bool>("AntiTransparency")
                    }).ToList <DoctorResult>();
                    _totalDocs += (preferredDocs != null && preferredDocs.Count > 0 ? preferredDocs.Count : 0);
                }
            }
        }
        public void GetData(string ConnectionString, CCHEncrypt ce)
        {
            base.GetData(ConnectionString);

            ce.Add("TaxID", "");

            //Regular results
            if (this.Tables.Count >= 1 && this.Tables[0].Rows.Count > 0)
            {
                Int32 rangeStart = 0, rangeCount = this.Tables[0].Rows.Count;
                if (ToRow - FromRow <= rangeCount)
                {
                    if (FromRow > 0)
                    {
                        rangeStart = FromRow;
                    }
                    if (ToRow > 0 && ToRow < rangeCount)
                    {
                        rangeCount = ToRow - FromRow + 1;
                    }
                }

                resultData = (from result in this.Tables[0].AsEnumerable()
                              select new FacilityResult
                {
                    ServiceName = result.GetData("ServiceName"),
                    TaxId = result.EncryptTaxID(ce),
                    NPI = result.GetData("NPI"),
                    PracticeName = result.GetData("PracticeName"),
                    OrganizationLocationID = result.GetData <int>("OrganizationLocationID"),
                    ProviderName = result.GetData("ProviderName"),
                    RangeMin = result.GetData <int>("RangeMin"),
                    RangeMax = result.GetData <int>("RangeMax"),
                    Latitude = result.GetData <double>("Latitude"),
                    Longitude = result.GetData <double>("Longitude"),
                    LocationAddress1 = result.GetData("LocationAddress1"),
                    YourCostMin = result.GetData <int>("YourCostMin"),
                    YourCostMax = result.GetData <int>("YourCostMax"),
                    LocationCity = result.GetData("LocationCity"),
                    LocationState = result.GetData("LocationState"),
                    LocationZip = result.GetData("LocationZip"),
                    LocationPhone = result.GetData("LocationTelephone"),
                    RowNumber = result.GetData <int>("RowNumber"),
                    Distance = result.GetData("Distance"),
                    NumericDistance = result.GetData <decimal>("NumericDistance"),
                    FairPrice = result.GetData <bool>("FairPrice"),
                    HGRecognized = result.GetData <int>("HGRecognized"),
                    LatLong = result.GetData("LatLong"),
                    HGOverallRating = result.GetData <double>("HGOverallRating"),
                    HGPatientCount = result.GetData <int>("HGPatientCount"),
                    RowOrderKey = result.GetData <int>("RowOrderKey"),
                    HGRecognizedDocCount = result.GetData <int>("HGRecognizedDocCount"),
                    HGDocCount = result.GetData <int>("HGDocCount"),
                    HGOfficeID = result.GetData("HGOfficeID"),
                    AntiTransparency = result.GetData <bool>("AntiTransparency")
                }).ToList <FacilityResult>();             //.GetRange(rangeStart, rangeCount);
            }

            // Description Info
            if (this.Tables.Count >= 2 && this.Tables[1].Rows.Count > 0)
            {
                learnMoreData = (from desc in this.Tables[1].AsEnumerable()
                                 select new DescriptionResult
                {
                    Description = desc.GetData("Description")
                }).ToList <DescriptionResult>();
            }

            // Thin Data Info
            if (this.Tables.Count >= 3 && this.Tables[2].Rows.Count > 0)
            {
                thinDataData = (from specs in this.Tables[2].AsEnumerable()
                                select new ThinDataResult
                {
                    ThinData = specs.GetData <bool>("ThinData")
                }).ToList <ThinDataResult>();
            }

            // Preferred Providers
            if (this.Tables.Count >= 5 && this.Tables[4].Rows.Count > 0)
            {
                if (FromRow == 0)
                {
                    preferredData = (from result in this.Tables[4].AsEnumerable()
                                     select new FacilityResult
                    {
                        ServiceName = result.GetData("ServiceName"),
                        TaxId = result.EncryptTaxID(ce),
                        NPI = result.GetData("NPI"),
                        PracticeName = result.GetData("PracticeName"),
                        OrganizationLocationID = result.GetData <int>("OrganizationLocationID"),
                        ProviderName = result.GetData("ProviderName"),
                        RangeMin = result.GetData <int>("RangeMin"),
                        RangeMax = result.GetData <int>("RangeMax"),
                        Latitude = result.GetData <double>("Latitude"),
                        Longitude = result.GetData <double>("Longitude"),
                        LocationAddress1 = result.GetData("LocationAddress1"),
                        YourCostMin = result.GetData <int>("YourCostMin"),
                        YourCostMax = result.GetData <int>("YourCostMax"),
                        LocationCity = result.GetData("LocationCity"),
                        LocationState = result.GetData("LocationState"),
                        LocationZip = result.GetData("LocationZip"),
                        LocationPhone = result.GetData("LocationTelephone"),
                        RowNumber = result.GetData <int>("RowNumber"),
                        Distance = result.GetData("Distance"),
                        NumericDistance = result.GetData <decimal>("NumericDistance"),
                        FairPrice = result.GetData <bool>("FairPrice"),
                        HGRecognized = result.GetData <int>("HGRecognized"),
                        LatLong = result.GetData("LatLong"),
                        HGOverallRating = result.GetData <double>("HGOverallRating"),
                        HGPatientCount = result.GetData <int>("HGPatientCount"),
                        RowOrderKey = result.GetData <int>("RowOrderKey"),
                        HGRecognizedDocCount = result.GetData <int>("HGRecognizedDocCount"),
                        HGDocCount = result.GetData <int>("HGDocCount"),
                        HGOfficeID = result.GetData("HGOfficeID"),
                        AntiTransparency = result.GetData <bool>("AntiTransparency")
                    }).ToList <FacilityResult>();
                }
            }
        }
Esempio n. 5
0
        public void GetData(string ConnectionString, CCHEncrypt ce)
        {
            base.GetData(ConnectionString);

            ce.Add("TaxID", "");

            if (this.Tables.Count >= 1 && this.Tables[0].Rows.Count > 0)
            {
                resultData = (from result in this.Tables[0].AsEnumerable()
                              select new FacilityResult
                {
                    ServiceName = result.GetData("ServiceName"),
                    TaxId = result.EncryptTaxID(ce),
                    NPI = result.GetData("NPI"),
                    PracticeName = result.GetData("PracticeName"),
                    OrganizationLocationID = result.GetData <int>("OrganizationLocationID"),
                    ProviderName = result.GetData("ProviderName"),
                    AllowedAmount = result.GetData <int>("AllowedAmount"),
                    Latitude = result.GetData <double>("Latitude"),
                    Longitude = result.GetData <double>("Longitude"),
                    LocationAddress1 = result.GetData("LocationAddress1"),
                    YourCost = result.GetData <int>("YourCost"),
                    LocationCity = result.GetData("LocationCity"),
                    LocationState = result.GetData("LocationState"),
                    LocationZip = result.GetData("LocationZip"),
                    LocationTelephone = result.GetData("LocationTelephone"),
                    RowNumber = result.GetData <int>("RowNumber"),
                    Distance = result.GetData("Distance"),
                    NumericDistance = result.GetData <decimal>("NumericDistance"),
                    FairPrice = result.GetData <bool>("FairPrice"),
                    HGRecognized = result.GetData <int>("HGRecognized"),
                    LatLong = result.GetData("LatLong"),
                    HGOverallRating = result.GetData <double>("HGOverallRating"),
                    HGPatientCount = result.GetData <int>("HGPatientCount"),
                    FindAService = result.GetData <int>("FindAService"),
                    RowOrderKey = result.GetData <int>("RowOrderKey"),
                    OrganizationID = result.GetData <int>("OrganizationID"),
                    HGRecognizedDocCount = result.GetData <int>("HGRecognizedDocCount"),
                    HGDocCount = result.GetData <int>("HGDocCount"),
                    AntiTransparency = result.GetData <bool>("AntiTransparency")
                }).ToList <FacilityResult>();
            }

            if (this.Tables.Count >= 2 && this.Tables[1].Rows.Count > 0)
            {
                learnMoreData = (from desc in this.Tables[1].AsEnumerable()
                                 select new LearnMoreResult
                {
                    Description = desc.GetData("Description")
                }).ToList <LearnMoreResult>();
            }

            if (this.Tables.Count >= 3 && this.Tables[2].Rows.Count > 0)
            {
                learnMoreSpecialtyData = (from desc in this.Tables[2].AsEnumerable()
                                          select new LearnMoreSpecialtyResult
                {
                    FindADoc = desc.GetData <int>("FindADoc"),
                    Specialty = desc.GetData("Specialty"),
                    Description = desc.GetData("Description"),
                    Title = desc.GetData("Title"),
                    DoctorTitleText = desc.GetData("DoctorTitleText"),
                    LearnMore = desc.GetData("LearnMore")
                }).ToList <LearnMoreSpecialtyResult>();
            }

            if (this.Tables.Count >= 4 && this.Tables[3].Rows.Count > 0)
            {
                savingsData = (from savings in this.Tables[3].AsEnumerable()
                               select new SavingsResult
                {
                    ServiceDate = savings.GetData <DateTime>("ServiceDate"),
                    ProcedureCode = savings.GetData("ProcedureCode"),
                    AllowedAmount = savings.GetData <double>("AllowedAmount"),
                    YouCouldHaveSaved = savings.GetData <double>("YouCouldHaveSaved"),
                    OrganizationID = savings.GetData <int>("OrganizationID"),
                    OrganizationLocationID = savings.GetData <int>("OrganizationLocationID"),
                    SpecialtyID = savings.GetData <int>("SpecialtyID")
                }).ToList <SavingsResult>();
            }
        }