Пример #1
0
        private static void SummarizePatient(ResidentPatient registeredResidentPatient)
        {
            var gender = registeredResidentPatient.Gender == "M" ? "Mr" : "Ms";
            var status = registeredResidentPatient.Married == "Y" ? "Married" : "Single";
            var result = $"{gender} {registeredResidentPatient.LastName}, {registeredResidentPatient.FirstName}, Resident, {status}, Age: {DateTime.Now.Year - registeredResidentPatient.DateOfBirth.Year}, {Environment.NewLine}" +
                         $"Expenses : ${registeredResidentPatient.Expenses}, Copay: ${registeredResidentPatient.Copay}, Coverage: ${registeredResidentPatient.Expenses - registeredResidentPatient.Copay}, {registeredResidentPatient.StreetAddress} " +
                         $"{registeredResidentPatient.City} {registeredResidentPatient.State.ToUpper()}. {registeredResidentPatient.HomePhone}/{registeredResidentPatient.MobilePhone}. {Environment.NewLine} Hospital: {registeredResidentPatient.HospitalName} " +
                         $"/ {registeredResidentPatient.HospitalNumber} ";

            Console.WriteLine(result);
        }
Пример #2
0
        private static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Welcome to the CCHI Insurance Coverage System!");
                Console.WriteLine("Enter data about a patient");

                bool shouldContinue = true;
                while (shouldContinue)
                {
                    var patient = RequestPatientType();
                    if (patient is OutPatient)
                    {
                        OutPatient registeredOutPatient = (OutPatient)patient.RequestInformation();
                        Console.WriteLine($"{Environment.NewLine}");
                        Console.WriteLine($"{Environment.NewLine}");
                        SummarizePatient(registeredOutPatient);
                    }
                    else
                    {
                        ResidentPatient registeredResidentPatient = (ResidentPatient)patient.RequestInformation();
                        Console.WriteLine($"{Environment.NewLine}");
                        Console.WriteLine($"{Environment.NewLine}");
                        SummarizePatient(registeredResidentPatient);
                    }
                    shouldContinue = RequestContinuation();
                }
                Console.WriteLine("Thank you for using the CCHI Coverage System!");
                Thread.Sleep(2000);
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong. Please restart application!");
                Console.ReadKey();
            }
        }