Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Creating Objects...");

            //Relationship Hospital-Speciality
            Hospital   hosp  = new Hospital("Av Sur 48", 22.3, 21.4, "La Fe");
            Speciality speci = new Speciality("Cardiología");
            Deployment dep   = new Deployment(3, 24, hosp, speci);

            hosp.supported_specialities.Add(dep);
            speci.supportedbyHospital.Add(dep);

            //Relationship EmergencyCall->Patient


            Patient       pat  = new Patient("Camino de Vera s/n", 46, "11111111A", 'H', "Javier", "+34666555444", "Jaen");
            EmergencyCall call = new EmergencyCall(new DateTime(2016, 3, 4), 23.5, 22.5, new TimeSpan(12, 12, 45), pat);


            //Relationship Symptom - Speciality
            //Relationship Symptom -> EmergencyCall
            Symptom sy = new Symptom("Taquicardia", 69.5, 3, call, speci);

            speci.belongs_to.Add(sy);

            //Relationship EmergencyCall ->Symptom
            call.symptoms.Add(sy);


            //Relationship HospitalBased - Hospital
            Private       private_ambulance  = new Private("Ambulancias ISW", "full equiped", 23.5, 22.1, 12345);
            HospitalBased hospital_ambulance = new HospitalBased("full equiped", 20.1, 10.6, 5555, hosp);

            hosp.owned_ambulances.Add(hospital_ambulance);


            //Relationship Hospital - EmergencyCall
            hosp.assigned_calls.Add(call);
            call.hospital = hosp;

            //Relationship EmergencyCall - Ambulance
            call.ambulance = hospital_ambulance;
            hospital_ambulance.assigned_calls.Add(call);

            //Relationship EmergencyCallService -> Ambulance
            //Relationship EmergencyCallService -> Hospital
            //Relationship EmergencyCallService -> EmergencyCall
            EmergencyCallService emergencyService = new EmergencyCallService(private_ambulance, hosp);

            emergencyService.ambulances.Add(hospital_ambulance);
            emergencyService.calls.Add(call);
            Console.WriteLine("Objects Created...");
        }
Пример #2
0
    public static int Main(string[] args)
    {
        EmergencyCallService ecs = new EmergencyCallService();

        Hospital hospital = new Hospital();

        hospital.Name      = "9 Octubre";
        hospital.Address   = "Avenida 9 Octubre";
        hospital.Latitude  = 39.4;
        hospital.Longitude = -0.4;
        ecs.addHospital(hospital);

        Speciality speciality = new Speciality();

        speciality.Name = "Cirujia";

        Deployment deployment = new Deployment(hospital, speciality, 1, 15);

        speciality.addDeployment(deployment);
        hospital.addDeployment(deployment);

        Symptom symptom = new Symptom();

        symptom.StageOfGravity = 4;
        symptom.Duration       = 5;
        symptom.Description    = "Costillas rotas - Mafia";
        symptom.Speciality     = speciality;
        speciality.addSymptom(symptom);

        Patient patient = new Patient(121241, "Carlos", "Galindo", true, 25, 643328918, "Calle Street");

        Ambulance ambulance = new HospitalBased(10931, "Muletas", 40, 0);

        hospital.addHospitalBased(ambulance);
        ecs.addAmbulance(ambulance);

        EmergencyCall emergencyCall = new EmergencyCall(39.4, -0.5, new DateTime(), patient, ambulance, hospital, symptom);

        symptom.addEmergencyCall(emergencyCall);
        ambulance.addEmergencyCall(emergencyCall);
        hospital.addEmergencyCall(emergencyCall);
        ecs.addEmergencyCall(emergencyCall);

        PrivateAmbulance privateAmbulance = new PrivateAmbulance(1231513, "Mas muletas", 40, -20, "Company Inc.");

        return(0);
    }
Пример #3
0
 public void removeHospitalBased(HospitalBased h);
Пример #4
0
 public void addHospitalBased(HospitalBased h);