Exemplo n.º 1
0
        public static Turno CreateSobreTurno(DateTime fechaTurno, TimeSpan duracionTurno, Paciente paciente, Profesional profesional, Especialidad especialidad, Secretaria secretariaReservadoraTurno, Consultorio consultorio, Plan plan,String numeroAfiliado,Decimal coseguro, bool esTelefonico)
        {
            if (paciente == null) throw new ArgumentNullException("paciente");
            if (profesional == null) throw new ArgumentNullException("profesional");
            if (especialidad == null) throw new ArgumentNullException("especialidad");
            if (secretariaReservadoraTurno == null) throw new ArgumentNullException("secretariaReservadoraTurno");

            if (!profesional.Especialidades.Contains(especialidad))
                throw new ArgumentException(@"El Profesional seleccionado para el turno no atiende la Especialidad seleccionada", "especialidad");

            var turno = new Turno(secretariaReservadoraTurno.Persona)
            {
                FechaTurno = fechaTurno,
                DuracionTurno = duracionTurno,
                Paciente = paciente,
                Profesional = profesional,
                Especialidad = especialidad,
            //RM SE AGREGA DATOS DE LA FORMA DE PAGO AL TURNO
                Consultorio=consultorio,
                Plan = plan,
                NumeroAfiliado = numeroAfiliado,
                Coseguro = coseguro,
                EsTelefonico = esTelefonico,
                EsSobreTurno = true,
                EsObtenidoWeb = false
            };

            return turno;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Crea un turno que es obtenido directamente por el cliente desde el browser.
        /// </summary>
        /// <returns></returns>
        public static Turno Create(
            DateTime fechaTurno,
            TimeSpan duracionTurno,
            Paciente paciente,
            Profesional profesional,
            Especialidad especialidad,
            Consultorio consultorio,
            //RM SE AGREGA DATOS DE LA FORMA DE PAGO AL TURNO
            Plan plan,
            String numeroAfiliado,
            Decimal coseguro,
            string ipPaciente)
        {
            if (paciente == null) throw new ArgumentNullException("paciente");
            if (profesional == null) throw new ArgumentNullException("profesional");
            if (especialidad == null) throw new ArgumentNullException("especialidad");

            if (!profesional.Especialidades.Contains(especialidad))
                throw new ArgumentException(@"El Profesional seleccionado para el turno no atiende la Especialidad seleccionada", "especialidad");

            var turno = new Turno(paciente.Persona)
            {
                FechaTurno = fechaTurno,
                Paciente = paciente,
                Profesional = profesional,
                Especialidad = especialidad,
                IpPaciente = ipPaciente,
                Consultorio = consultorio,
                DuracionTurno=duracionTurno,
            //RM SE AGREGA DATOS DE LA FORMA DE PAGO AL TURNO
                Plan=plan,
                NumeroAfiliado=numeroAfiliado,
                Coseguro=coseguro,
                EsObtenidoWeb = true
            };

            return turno;
        }