Example #1
0
        public static List <PatientBE> SearchByParams(string nombre, string apellido)
        {
            List <PatientBE> wPatientsBEList = new List <PatientBE>();
            List <Patient>   wPatients       = null;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                if (String.IsNullOrEmpty(nombre) || String.IsNullOrEmpty(apellido))
                {
                    wPatients = dc.Patients.ToList <Patient>();
                }
                else
                {
                    var Patients = from p in dc.Patients
                                   where
                                   (String.IsNullOrEmpty(nombre) || p.Persona.Nombre.Contains(nombre) ||
                                    (String.IsNullOrEmpty(apellido) || p.Persona.Apellido.Contains(apellido)))
                                   select p;

                    wPatients = Patients.ToList <Patient>();
                }

                PatientBE wPatientBE = null;

                foreach (Patient p in wPatients)
                {
                    wPatientBE           = (PatientBE)p;
                    wPatientBE.IdPersona = p.Persona.IdPersona;
                    wPatientBE.Persona   = (PersonaBE)p.Persona;
                    wPatientsBEList.Add(wPatientBE);
                }
            }
            return(wPatientsBEList);
        }
Example #2
0
        public override void Refresh()
        {
            this.mutualListBindingSource.DataSource = Controller.RetriveAllObraSocial();
            this.MutualPorPacienteBEBindingSource.DataSource = MutualList;

            gridView2.RefreshData();
            if (State == Fwk.Bases.EntityUpdateEnum.NEW)
            {
                lblTitulo.Text = "Alta de paciente";
                Patient = new PatientBE();
                Patient.Persona = new PersonaBE();
                MutualList = new MutualPorPacienteList();
                MutualListAux = new MutualPorPacienteList();
                uc_Persona1.Populate(Patient.Persona, State);
            }
            if (State == Fwk.Bases.EntityUpdateEnum.UPDATED)
            {
                lblTitulo.Text = "Actualización de paciente";
                GetPatientRes res = Controller.GetPatient(Patient.PatientId);
                MutualList = (MutualPorPacienteList)res.BusinessData.Mutuales;
                MutualListAux = (MutualPorPacienteList)res.BusinessData.Mutuales.Clone();

                uc_Persona1.Populate(Patient.Persona, State);

            }
            this.MutualPorPacienteBEBindingSource.DataSource = MutualListAux;

            uc_MedioContacto1.Persona = Patient.Persona;
            uc_Persona1.Refresh();
            uc_MedioContacto1.Init();
            gridControl_MutualXPatient.RefreshDataSource();
            InitSecurity();
            base.Refresh();
        }
        private void btnFindPatient_Click(object sender, EventArgs e)
        {
            ///Busca Patient
            using (frmGridPatients form = new frmGridPatients())
            {
                form.Refresh();
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    SelectedPatientBE = form.SelectedPatientBE;
                    txtPatient.Text   = SelectedPatientBE.Persona.ApellidoNombre;
                    txSubject.Text    = String.Concat("Reservado para ", SelectedPatientBE.Persona.ApellidoNombre);
                    currentApt.ProfesionalAppointment.PatientId   = SelectedPatientBE.PatientId;
                    currentApt.ProfesionalAppointment.PatientName = SelectedPatientBE.Persona.ApellidoNombre;
                    cmbMutual.Properties.DataSource = form.Mutuales;

                    if (form.Mutuales == null || form.Mutuales.Count == 0)
                    {
                        cmbMutual.Properties.NullText = "No existen mutuales para este paciente";
                        chkPresentaOrden.Enabled      = txtNroAfiliado.Enabled = false;
                    }
                    else
                    {
                        cmbMutual.Properties.NullText = "Seleccione uan opción";
                        chkPresentaOrden.Enabled      = txtNroAfiliado.Enabled = true;
                    }

                    cmbMutual.Refresh();
                }
            }
        }
Example #4
0
        public override void Refresh()
        {
            this.mutualListBindingSource.DataSource          = Controller.RetriveAllObraSocial();
            this.MutualPorPacienteBEBindingSource.DataSource = MutualList;

            gridView2.RefreshData();
            if (State == Fwk.Bases.EntityUpdateEnum.NEW)
            {
                lblTitulo.Text  = "Alta de paciente";
                Patient         = new PatientBE();
                Patient.Persona = new PersonaBE();
                MutualList      = new MutualPorPacienteList();
                MutualListAux   = new MutualPorPacienteList();
                uc_Persona1.Populate(Patient.Persona, State);
            }
            if (State == Fwk.Bases.EntityUpdateEnum.UPDATED)
            {
                lblTitulo.Text = "Actualización de paciente";
                GetPatientRes res = Controller.GetPatient(Patient.PatientId);
                MutualList    = (MutualPorPacienteList)res.BusinessData.Mutuales;
                MutualListAux = (MutualPorPacienteList)res.BusinessData.Mutuales.Clone();

                uc_Persona1.Populate(Patient.Persona, State);
            }
            this.MutualPorPacienteBEBindingSource.DataSource = MutualListAux;

            uc_MedioContacto1.Persona = Patient.Persona;
            uc_Persona1.Refresh();
            uc_MedioContacto1.Init();
            gridControl_MutualXPatient.RefreshDataSource();
            InitSecurity();
            base.Refresh();
        }
Example #5
0
        public static void Update(PatientBE Patient)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient wPatient = dc.Patients.Where(p => p.PatientId.Equals(Patient.PatientId)).FirstOrDefault <Patient>();

                wPatient.Persona.Apellido        = Patient.Persona.Apellido;
                wPatient.Persona.Nombre          = Patient.Persona.Nombre;
                wPatient.Persona.NroDocumento    = Patient.Persona.NroDocumento;
                wPatient.Persona.TipoDocumento   = Patient.Persona.TipoDocumento;
                wPatient.Persona.IdEstadocivil   = Patient.Persona.IdEstadocivil;
                wPatient.Persona.FechaNacimiento = Patient.Persona.FechaNacimiento;
                wPatient.Persona.Sexo            = Patient.Persona.Sexo;

                wPatient.Persona.Calle       = Patient.Persona.Calle;
                wPatient.Persona.CalleNumero = Patient.Persona.CalleNumero;
                wPatient.Persona.Piso        = Patient.Persona.Piso;
                wPatient.Persona.IdPais      = Patient.Persona.IdPais;
                wPatient.Persona.IdProvincia = Patient.Persona.IdProvincia;
                wPatient.Persona.IdLocalidad = Patient.Persona.IdLocalidad;
                wPatient.Persona.Barrio      = Patient.Persona.Barrio;
                wPatient.Persona.mail        = Patient.Persona.mail;
                wPatient.Persona.Telefono1   = Patient.Persona.Telefono1;
                wPatient.Persona.Telefono2   = Patient.Persona.Telefono2;
                wPatient.Persona.Foto        = Patient.Persona.Foto;

                wPatient.LastAccessTime           = System.DateTime.Now;
                wPatient.LastAccessUserId         = Patient.LastAccessUserId;
                wPatient.Persona.LastAccessTime   = wPatient.LastAccessTime.Value;
                wPatient.Persona.LastAccessUserId = Patient.Persona.LastAccessUserId;
                dc.SaveChanges();
            }
        }
Example #6
0
        public static void Update(PatientBE Patient)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient wPatient = dc.Patients.Where(p => p.PatientId.Equals(Patient.PatientId)).FirstOrDefault <Patient>();

                wPatient.Persona.Apellido        = Patient.Persona.Apellido;
                wPatient.Persona.Nombre          = Patient.Persona.Nombre;
                wPatient.Persona.NroDocumento    = Patient.Persona.NroDocumento;
                wPatient.Persona.TipoDocumento   = Patient.Persona.TipoDocumento;
                wPatient.Persona.IdEstadocivil   = Patient.Persona.IdEstadocivil;
                wPatient.Persona.FechaNacimiento = Patient.Persona.FechaNacimiento;
                wPatient.Persona.Sexo            = Patient.Persona.Sexo;

                wPatient.Persona.Street       = Patient.Persona.Street;
                wPatient.Persona.StreetNumber = Patient.Persona.StreetNumber;
                wPatient.Persona.Floor        = Patient.Persona.Floor;
                wPatient.Persona.CountryId    = Patient.Persona.CountryId;
                wPatient.Persona.ProvinceId   = Patient.Persona.ProvinceId;
                wPatient.Persona.CityId       = Patient.Persona.CityId;
                wPatient.Persona.Neighborhood = Patient.Persona.Neighborhood;
                wPatient.Persona.mail         = Patient.Persona.mail;
                wPatient.Persona.Telefono1    = Patient.Persona.Telefono1;
                wPatient.Persona.Telefono2    = Patient.Persona.Telefono2;
                wPatient.Persona.Foto         = Patient.Persona.Foto;

                wPatient.LastAccessTime           = System.DateTime.Now;
                wPatient.LastAccessUserId         = Patient.LastAccessUserId;
                wPatient.Persona.LastAccessTime   = wPatient.LastAccessTime.Value;
                wPatient.Persona.LastAccessUserId = Patient.Persona.LastAccessUserId;
                dc.SaveChanges();
            }
        }
        public override void Populate(object filter)
        {
            _SelectedPatientBE = (PatientBE)filter;

            ///Retrive
            appointmentListBindingSource.DataSource = ServiceCalls.RetrivePatientAppoinments(_SelectedPatientBE.PatientId, System.DateTime.Now, null);

            this.uc_PatientCard1.Populate(filter);
        }
        public override void Populate(object filter)
        {
            _SelectedPatientBE = (PatientBE)filter;

            ///Retrive
            appointmentListBindingSource.DataSource = Controller.RetrivePatientAppoinments(_SelectedPatientBE.PatientId, System.DateTime.Now, null);

            this.uc_PatientCard1.Populate(filter);
        }
Example #9
0
        public override void Populate(object filter)
        {
            PatientBE patient = (PatientBE)filter;

            if (ServiceCalls.IsInDesignMode())
            {
                return;
            }

            cmbTipoDoc.Properties.DataSource = ServiceCalls.SearchParametroByParams((int)TipoParametroEnum.TipoDocumento, null);

            cmbTipoDoc.Refresh();

            txtNombres.Text      = patient.Persona.ApellidoNombre;
            txtDocumento.Text    = patient.Persona.NroDocumento;
            cmbTipoDoc.EditValue = patient.Persona.TipoDocumento;
            if (patient.Persona.Foto != null)
            {
                this.pictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Stretch;
                pictureEdit1.Image = Fwk.HelperFunctions.TypeFunctions.ConvertByteArrayToImage(patient.Persona.Foto);
            }

            if (patient.Persona.Foto == null)
            {
                this.pictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Clip;
            }
            if (patient.Persona.Sexo.Equals((Int16)Sexo.Masculino))
            {
                rndSexoM.Checked = true;
                if (patient.Persona.Foto == null)
                {
                    pictureEdit1.Image = Health.Front.Base.Properties.Resource.User_M;
                }
            }
            else
            {
                rndSexoF.Checked = true;
                if (patient.Persona.Foto == null)
                {
                    pictureEdit1.Image = Health.Front.Base.Properties.Resource.User_F;
                }
            }


            int index = 0;

            //txtDocumento.Enabled = false;
            //cmbTipoDoc.Enabled = false;
            dtFechaNac.EditValue = patient.Persona.FechaNacimiento;


            index = cmbTipoDoc.Properties.GetDataSourceRowIndex("IdParametro", patient.Persona.TipoDocumento);
            cmbTipoDoc.ItemIndex = index;
        }
 private void uc_AllShiftGrid1_ChangeStatusEvent(object sender, EventArgs e)
 {
     if (((AppoimantsStatus_SP)sender) == AppoimantsStatus_SP.EnAtencion)
     {
         this.Appointment = this.uc_TimeLine1.SelectedAppointment;
         GetPatientRes res = ServiceCalls.GetPatient(this.Appointment.ProfesionalAppointment.PatientId);
         this.Patient      = res.BusinessData.Patient;
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
 }
        private void uc_AllShiftGrid1_ChangeStatusEvent(object sender, EventArgs e)
        {
            if (((AppoimantsStatus_SP)sender) == AppoimantsStatus_SP.EnAtencion)
            {
                this.Appointment = this.uc_TimeLine1.SelectedAppointment;
                GetPatientRes res = ServiceCalls.GetPatient(this.Appointment.ProfesionalAppointment.PatientId);
                this.Patient = res.BusinessData.Patient;
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }

        }
Example #12
0
        public static PatientBE GetByDoc(int nroDocumento)
        {
            PatientBE wPatient = null;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient Patient = dc.Patients.Where(p => p.Persona.NroDocumento.Equals(nroDocumento)).FirstOrDefault <Patient>();

                wPatient         = (PatientBE)Patient;
                wPatient.Persona = (PersonaBE)Patient.Persona;
            }
            return(wPatient);
        }
Example #13
0
 private void btnFindPatient_Click(object sender, EventArgs e)
 {
     ///Busca paciente
     using (frmGridPatients form = new frmGridPatients())
     {
         form.Refresh();
         if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             SelectedPatientBE = form.SelectedPatientBE;
             txtPatient.Text   = SelectedPatientBE.Persona.ApellidoNombre;
             txSubject.Text    = String.Concat("Reservado para ", SelectedPatientBE.Persona.ApellidoNombre);
         }
     }
 }
Example #14
0
        /// <summary>
        /// crea un Patient asociandolo a una persona existente
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Asociar(PatientBE PatientBE)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient p = new Patient();
                p.IdPersona        = PatientBE.Persona.IdPersona;
                p.FechaAlta        = System.DateTime.Now;
                p.LastAccessTime   = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
            }
        }
        public override RetrivePatientsRes Execute(RetrivePatientsReq pServiceRequest)
        {
            RetrivePatientsRes wRes = new RetrivePatientsRes();

            if (String.IsNullOrEmpty(pServiceRequest.BusinessData.Nombre) && String.IsNullOrEmpty(pServiceRequest.BusinessData.Apellido) && pServiceRequest.BusinessData.Id.HasValue)
            {
                PatientBE p = PatientsDAC.GetById(pServiceRequest.BusinessData.Id.Value);
                wRes.BusinessData.Add(p);
            }
            else
            {
                wRes.BusinessData.AddRange(PatientsDAC.SearchByParams(pServiceRequest.BusinessData.Nombre, pServiceRequest.BusinessData.Apellido));
            }
            return(wRes);
        }
Example #16
0
        /// <summary>
        /// Crea Patient y persona
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Create(PatientBE PatientBE)
        {
            PersonasDAC.Create(PatientBE.Persona);

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient p = new Patient();
                p.IdPersona        = PatientBE.Persona.IdPersona;
                p.FechaAlta        = PatientBE.Persona.FechaAlta;
                p.LastAccessTime   = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
                PatientBE.IdPersona = p.IdPersona;
            }
        }
Example #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Patient"></param>
        /// <param name="mutualList"></param>
        public static void AsociarPatientAPersona(PatientBE Patient, MutualPorPacienteList mutualList)
        {
            AsociarPatientAPersonaReq req = new AsociarPatientAPersonaReq();

            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales = mutualList;
            //req.BusinessData.AnteriorFechaNacimiento = anteriorFechaNacimiento;
            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            AsociarPatientAPersonaRes res = req.ExecuteService <AsociarPatientAPersonaReq, AsociarPatientAPersonaRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
        }
Example #18
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static int CrearPatient(PatientBE Patient, MutualPorPacienteList mutualList)
        {
            CrearPatientReq req = new CrearPatientReq();

            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales     = mutualList;
            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            CrearPatientRes res = req.ExecuteService <CrearPatientReq, CrearPatientRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
            return(res.BusinessData.IdPatient);
        }
Example #19
0
        static void Create_PlanVacunacion(PatientBE PatientBE)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                PlanVacunacion plan;

                foreach (Vacuna v in dc.Vacunas.ToArray())
                {
                    //{"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_PlanVacunación_Vacunas\".
                    //The conflict occurred in database \"Health\", table \"dbo.Vacunas\", column 'IdVacuna'.
                    plan               = new PlanVacunacion();
                    plan.PatientId     = PatientBE.PatientId;
                    plan.Codigo        = v.Codigo;
                    plan.FechaPlaneada = PatientBE.Persona.FechaNacimiento.AddDays(Convert.ToInt16(v.Cantidad));
                    //plan.ProfesionalColocadorUserID = PatientBE.LastAccessUserId;
                    dc.PlanVacunacions.AddObject(plan);
                }
                dc.SaveChanges();
            }
        }
Example #20
0
        /// <summary>
        /// Crea Patient y persona
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Create(PatientBE PatientBE)
        {

            PersonasDAC.Create(PatientBE.Persona);

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {

                Patient p = new Patient();
                p.IdPersona = PatientBE.Persona.IdPersona;
                p.FechaAlta = PatientBE.Persona.FechaAlta;
                p.LastAccessTime = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
                PatientBE.IdPersona = p.IdPersona;
            }
            Create_PlanVacunacion(PatientBE);
        }
Example #21
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Patient"></param>
        /// <param name="mutualList"></param>
        public static void AsociarPatientAPersona(PatientBE Patient, MutualPorPacienteList mutualList)
        {
            AsociarPatientAPersonaReq req = new AsociarPatientAPersonaReq();

            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales = mutualList;
            //req.BusinessData.AnteriorFechaNacimiento = anteriorFechaNacimiento;
            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            AsociarPatientAPersonaRes res = req.ExecuteService<AsociarPatientAPersonaReq, AsociarPatientAPersonaRes>(req);
            if (res.Error != null)
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);

        }
Example #22
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static int CrearPatient(PatientBE Patient, MutualPorPacienteList mutualList)
        {
            CrearPatientReq req = new CrearPatientReq();

            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales = mutualList;
            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            CrearPatientRes res = req.ExecuteService<CrearPatientReq, CrearPatientRes>(req);
            if (res.Error != null)
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            return res.BusinessData.IdPatient;
        }
Example #23
0
        public static void Update(PatientBE Patient)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient wPatient = dc.Patients.Where(p => p.PatientId.Equals(Patient.PatientId)).FirstOrDefault<Patient>();

                wPatient.Persona.Apellido = Patient.Persona.Apellido;
                wPatient.Persona.Nombre = Patient.Persona.Nombre;
                wPatient.Persona.NroDocumento = Patient.Persona.NroDocumento;
                wPatient.Persona.TipoDocumento = Patient.Persona.TipoDocumento;
                wPatient.Persona.IdEstadocivil = Patient.Persona.IdEstadocivil;
                wPatient.Persona.FechaNacimiento = Patient.Persona.FechaNacimiento;
                wPatient.Persona.Sexo = Patient.Persona.Sexo;

                wPatient.Persona.Street = Patient.Persona.Street;
                wPatient.Persona.StreetNumber = Patient.Persona.StreetNumber;
                wPatient.Persona.Floor = Patient.Persona.Floor;
                wPatient.Persona.CountryId = Patient.Persona.CountryId;
                wPatient.Persona.ProvinceId = Patient.Persona.ProvinceId;
                wPatient.Persona.CityId = Patient.Persona.CityId;
                wPatient.Persona.Neighborhood = Patient.Persona.Neighborhood;
                wPatient.Persona.mail = Patient.Persona.mail;
                wPatient.Persona.Telefono1 = Patient.Persona.Telefono1;
                wPatient.Persona.Telefono2 = Patient.Persona.Telefono2;
                wPatient.Persona.Foto = Patient.Persona.Foto;

                wPatient.LastAccessTime = System.DateTime.Now;
                wPatient.LastAccessUserId = Patient.LastAccessUserId;
                wPatient.Persona.LastAccessTime = wPatient.LastAccessTime.Value;
                wPatient.Persona.LastAccessUserId = Patient.Persona.LastAccessUserId;
                dc.SaveChanges();
            }
        }
Example #24
0
        static void Create_PlanVacunacion(PatientBE PatientBE)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                PlanVacunacion plan;

                foreach (Vacuna v in dc.Vacunas.ToArray())
                {
                    //{"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_PlanVacunación_Vacunas\". 
                    //The conflict occurred in database \"Health\", table \"dbo.Vacunas\", column 'IdVacuna'.
                    plan = new PlanVacunacion();
                    plan.PatientId = PatientBE.PatientId;
                    plan.Codigo = v.Codigo;
                    plan.FechaPlaneada = PatientBE.Persona.FechaNacimiento.AddDays(Convert.ToInt16(v.Cantidad));
                    //plan.ProfesionalColocadorUserID = PatientBE.LastAccessUserId;
                    dc.PlanVacunacions.AddObject(plan);
                }
                dc.SaveChanges();
            }
        }
        private void btnFindPatient_Click(object sender, EventArgs e)
        {
            ///Busca Patient 
            using (frmGridPatients form = new frmGridPatients())
            {
                form.Refresh();
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    SelectedPatientBE = form.SelectedPatientBE;
                    txtPatient.Text = SelectedPatientBE.Persona.ApellidoNombre;
                    txSubject.Text = String.Concat("Reservado para ", SelectedPatientBE.Persona.ApellidoNombre);
                    currentApt.ProfesionalAppointment.PatientId = SelectedPatientBE.PatientId;
                    currentApt.ProfesionalAppointment.PatientName = SelectedPatientBE.Persona.ApellidoNombre;
                    cmbMutual.Properties.DataSource = form.Mutuales;

                    if (form.Mutuales == null || form.Mutuales.Count==0)
                    {
                        cmbMutual.Properties.NullText = "No existen mutuales para este paciente";
                        chkPresentaOrden.Enabled = txtNroAfiliado.Enabled = false;
                    }
                    else
                    {
                        cmbMutual.Properties.NullText = "Seleccione uan opción";
                        chkPresentaOrden.Enabled=txtNroAfiliado.Enabled = true;
                        
                    }
                    
                    cmbMutual.Refresh();

                }

            }
        }
Example #26
0
        /// <summary>
        /// crea un Patient asociandolo a una persona existente
        /// </summary>
        /// <param name="PatientBE"></param>
        public static void Asociar(PatientBE PatientBE)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient p = new Patient();
                p.IdPersona = PatientBE.Persona.IdPersona;
                p.FechaAlta = System.DateTime.Now;
                p.LastAccessTime = p.FechaAlta;
                p.LastAccessUserId = PatientBE.LastAccessUserId;

                dc.Patients.AddObject(p);
                dc.SaveChanges();
                PatientBE.PatientId = p.PatientId;
            }
            
        }
Example #27
0
        public static void Update(PatientBE Patient)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                Patient wPatient = dc.Patients.Where(p => p.PatientId.Equals(Patient.PatientId)).FirstOrDefault<Patient>();

                wPatient.Persona.Apellido = Patient.Persona.Apellido;
                wPatient.Persona.Nombre = Patient.Persona.Nombre;
                wPatient.Persona.NroDocumento = Patient.Persona.NroDocumento;
                wPatient.Persona.TipoDocumento = Patient.Persona.TipoDocumento;
                wPatient.Persona.IdEstadocivil = Patient.Persona.IdEstadocivil;
                wPatient.Persona.FechaNacimiento = Patient.Persona.FechaNacimiento;
                wPatient.Persona.Sexo = Patient.Persona.Sexo;

                wPatient.Persona.Calle = Patient.Persona.Calle;
                wPatient.Persona.CalleNumero = Patient.Persona.CalleNumero;
                wPatient.Persona.Piso = Patient.Persona.Piso;
                wPatient.Persona.IdPais = Patient.Persona.IdPais;
                wPatient.Persona.IdProvincia = Patient.Persona.IdProvincia;
                wPatient.Persona.IdLocalidad = Patient.Persona.IdLocalidad;
                wPatient.Persona.Barrio = Patient.Persona.Barrio;
                wPatient.Persona.mail = Patient.Persona.mail;
                wPatient.Persona.Telefono1 = Patient.Persona.Telefono1;
                wPatient.Persona.Telefono2 = Patient.Persona.Telefono2;
                wPatient.Persona.Foto = Patient.Persona.Foto;

                wPatient.LastAccessTime = System.DateTime.Now;
                wPatient.LastAccessUserId = Patient.LastAccessUserId;
                wPatient.Persona.LastAccessTime = wPatient.LastAccessTime.Value;
                wPatient.Persona.LastAccessUserId = Patient.Persona.LastAccessUserId;
                dc.SaveChanges();
            }
        }
        private void btnFindPatient_Click(object sender, EventArgs e)
        {
            ///Busca paciente 
            using (frmGridPatients form = new frmGridPatients())
            {
                form.Refresh();
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    SelectedPatientBE = form.SelectedPatientBE;
                    txtPatient.Text = SelectedPatientBE.Persona.ApellidoNombre;
                    txSubject.Text = String.Concat("Reservado para ", SelectedPatientBE.Persona.ApellidoNombre);
                }

            }
        }