Ejemplo n.º 1
0
 private void PopulateTreatmentRoom(PatientRegistrationModel patient, PatientAndRequirements patientRequirements)
 {
     if (patient.Condition == "flu")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => String.IsNullOrEmpty(x.TreatmentMachine))
                                             .Select(n => n.Name)
                                             .ToList();
     }
     else if (patient.Topography == "head_neck")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => _hospitalResource.TreatmentMachines
                                                    .Where(t => t.Capability == "Advanced")
                                                    .Select(n => n.Name)
                                                    .Contains(x.TreatmentMachine))
                                             .Select(name => name.Name)
                                             .ToList();
     }
     else if (patient.Topography == "breast")
     {
         patientRequirements.TreatmentRoom = _hospitalResource.TreatmentRooms
                                             .Where(x => _hospitalResource.TreatmentMachines
                                                    .Where(t => t.Capability == "Advanced" || t.Capability == "Simple")
                                                    .Select(n => n.Name)
                                                    .Contains(x.TreatmentMachine))
                                             .Select(name => name.Name)
                                             .ToList();
     }
     else
     {
         Console.WriteLine($"No matching treatment room found for customer, " +
                           $"ID: {patient.UniqueId}, Condition: {patient.Condition}, Topography: {patient.Topography}");
         patientRequirements.TreatmentRoom = new List <string>()
         {
             "unknown"
         };
     }
 }
Ejemplo n.º 2
0
        public PatientAndRequirements IdentifyResources(PatientRegistrationModel patient)
        {
            var patientRequirements = new PatientAndRequirements();

            patientRequirements.Name     = patient.Name;
            patientRequirements.UniqueId = patient.UniqueId;
            PopulateTreatmentRoom(patient, patientRequirements);
            if (patient.Condition == "cancer")
            {
                patientRequirements.DoctorsSpecialization = "Oncologist";
            }
            else if (patient.Condition == "flu")
            {
                patientRequirements.DoctorsSpecialization = "GeneralPractitioner";
            }
            else
            {
                Console.WriteLine($"Unexpected doctor specialization, {patient.Condition}");
                patientRequirements.DoctorsSpecialization = "unknown";
            }

            return(patientRequirements);
        }