Esempio n. 1
0
        public static List <BasicDataPoint> GetCitizensRequiredEmergency()
        {
            if (requiredEmergencyDataPoints != null)
            {
                return(requiredEmergencyDataPoints);
            }

            requiredEmergencyDataPoints = new List <BasicDataPoint>();
            var citizens           = new MockCitizen().Get();
            var countries          = MockCountries.Get();
            var citizensPerCountry = new Dictionary <string, int>();

            foreach (var country in countries)
            {
                if (!citizensPerCountry.Keys.Contains(country))
                {
                    var citizensFromCountry = citizens.Where(c => c.CitizenDetails.Country == country && c.MedicalServices.RequiredEmergency).Count();
                    citizensPerCountry.Add(country, citizensFromCountry);

                    if (citizensFromCountry > 0)
                    {
                        var requiredEmergencyDataPoint = new BasicDataPoint()
                        {
                            Y     = (double)citizensFromCountry,
                            Label = country
                        };

                        requiredEmergencyDataPoints.Add(requiredEmergencyDataPoint);
                    }
                }
            }

            return(requiredEmergencyDataPoints);
        }
Esempio n. 2
0
        public static MedicalServicesByCountry GetMedicalServicesByCountry(string country)
        {
            if (medicalServicesByCountry.Keys.Contains(country))
            {
                return(medicalServicesByCountry[country]);
            }

            var mockCitizens       = new MockCitizen();
            var citizens           = mockCitizens.Get();
            var countries          = MockCountries.Get();
            var citizensPerCountry = new Dictionary <string, int>();

            var medicalServicesByCountryOneCitizen = new MedicalServicesByCountry();

            var citizensFromCountry = citizens.Where(c => c.CitizenDetails.Country == country);

            if (citizensFromCountry.Count() > 0)
            {
                medicalServicesByCountryOneCitizen.FamilyDoctor               = GetFamilyDoctorForCitizens(citizensFromCountry);
                medicalServicesByCountryOneCitizen.SpecialisedMedicalCare     = GetSpecialisedMedicatCareForCitizens(citizensFromCountry);
                medicalServicesByCountryOneCitizen.AccessEmergencyMedicalCare = GetAccessEmergencyMedicalCare(citizensFromCountry);
                medicalServicesByCountryOneCitizen.FinancialPerspectiveAccess = GetFinancialPerspectiveAccess(citizensFromCountry);
            }

            return(medicalServicesByCountryOneCitizen);
        }
Esempio n. 3
0
        public static List <BasicDataPoint> GetCitizensByCountryDataPoints()
        {
            if (countryDataPoints != null)
            {
                return(countryDataPoints);
            }

            var mockCitizens       = new MockCitizenDetails();
            var citizens           = mockCitizens.Get();
            var countries          = MockCountries.Get();
            var citizensPerCountry = new Dictionary <string, int>();

            countryDataPoints = new List <BasicDataPoint>();
            foreach (var country in countries)
            {
                if (!citizensPerCountry.Keys.Contains(country))
                {
                    var citizensFromCountry = citizens.Where(c => c.Country == country).Count();
                    citizensPerCountry.Add(country, citizensFromCountry);

                    if (citizensFromCountry > 0)
                    {
                        var countryDataPoint = new BasicDataPoint()
                        {
                            Label      = country,
                            LegendText = country,
                            Y          = (double)citizensFromCountry * 100 / (double)citizens.Count
                        };

                        countryDataPoints.Add(countryDataPoint);
                    }
                }
            }

            return(countryDataPoints);
        }