コード例 #1
0
ファイル: uc_event_01.cs プロジェクト: Br3nda/sfdocsamples
        public override void Populate(object filter)
        {
            _Evento = frmPatientAtencion.GetInstance(this).MedicalEvent;

            cmbTipoConsulta.Properties.DataSource = ServiceCalls.TipoEventoMedicoList;
            cmbTipoConsulta.Refresh();

            //this.cEI10ComboBindingSource.DataSource = Controller.CEI_10ComboList;

            //this.pMOFileListBindingSource.DataSource = Controller.PMOFileList.Where(p =>
            //    (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //    p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //    p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) &&
            //    p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //var pmo = Controller.PMOFileList.Where(p =>
            //      (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //      p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //      p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) &&
            //      p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //Int32 c = pmo.Count();
            //this.pMOFileListBindingSource.DataSource = pmo;


            this.pMOFileListBindingSource_Quirurgico.DataSource = ServiceCalls.PMOFileList.Where(p =>
                                                                                                 p.Type.Equals((int)PMOEnum.Quirurgicas) && p.HasChild.Equals(false)).OrderBy(p => p.Id);


            _Evento.PatientMedicaments = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, null);

            //Nunca traera del evento _Event dado que es recientemente creado y no posee aun Detalles

            if (_Evento.DetailView_Diagnosis == null)
            {
                _Evento.DetailView_Diagnosis = new MedicalEventDetail_ViewList();
            }

            if (_Evento.DetailView_MetodosComplementarios == null)
            {
                _Evento.DetailView_MetodosComplementarios = new MedicalEventDetail_ViewList();
            }

            //Medicamentos
            patientMedicamentViewListBindingSource.DataSource = _Evento.PatientMedicaments;
            gridView_Medicaments.RefreshData();

            //Diagnosis
            uC_EventDetailsGrid_Diagnosis.Populate(_Evento);
            //MetComplementario
            uC_EventDetailsGrid_MetComplementario.Populate(_Evento);

            base.Populate(filter);
        }
コード例 #2
0
        public override void Refresh()
        {
            includeHistory = Convert.ToBoolean(this.Tag);
            patientMedicamentViewListBindingSource.DataSource = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, null, includeHistory);

            if (includeHistory)
            {
                gridView_Medicaments.OptionsCustomization.AllowGroup = true;
                gridView_Medicaments.OptionsFind.AllowFindPanel      = true;
                gridView_Medicaments.OptionsFind.AlwaysVisible       = true;
                gridView_Medicaments.OptionsView.ShowGroupedColumns  = false;
                gridView_Medicaments.OptionsView.ShowGroupPanel      = true;
            }
            gridControl_Medicaments.RefreshDataSource();
        }
コード例 #3
0
ファイル: uc_event_01.cs プロジェクト: Br3nda/sfdocsamples
        /// <summary>
        ///
        /// </summary>
        public override void AceptChanges(bool this_will_close)
        {
            //_Evento.IsDefinitive = chkDefinitivo.Checked;
            _Evento.Motivo    = txtMotivo.Text;
            _Evento.Evolucion = txtEvolution.Text;
            _Evento.Motivo    = txtMotivo.Text;


            if (cmbTipoConsulta.EditValue != null)
            {
                if ((int)cmbTipoConsulta.EditValue != (int)CommonValuesEnum.SeleccioneUnaOpcion)
                {
                    _Evento.IdTipoConsulta = Convert.ToInt32(cmbTipoConsulta.EditValue);
                }
            }

            //No enviar los medicamentos que no sufrieron modificaciones
            var medList = _Evento.PatientMedicaments.Where(p => p.EntityState != Fwk.Bases.EntityState.Unchanged).ToList();

            _Evento.PatientMedicaments.Clear();
            _Evento.PatientMedicaments.AddRange(medList);

            #region   Mapeo de details view a DetailView_Diagnosis
            _Evento.MedicalEventDetailList.Clear();
            var medDetails = _Evento.DetailView_Diagnosis.Where(p => p.EntityState != Fwk.Bases.EntityState.Unchanged).ToList();



            foreach (MedicalEventDetail_ViewBE det_view in medDetails)
            {
                MedicalEventDetailBE det = new MedicalEventDetailBE(det_view);
                det.ActiveRelevance = true;
                _Evento.MedicalEventDetailList.Add(det);
            }
            #endregion

            #region   Mapeo de details view a DetailView_Diagnosis
            medDetails = _Evento.DetailView_MetodosComplementarios.Where(p => p.EntityState != Fwk.Bases.EntityState.Unchanged).ToList();

            foreach (MedicalEventDetail_ViewBE det_view in medDetails)
            {
                MedicalEventDetailBE det = new MedicalEventDetailBE(det_view);
                det.ActiveRelevance = true;
                _Evento.MedicalEventDetailList.Add(det);
            }
            #endregion

            try
            {
                ServiceCalls.UpdateMedicalEvent(_Evento);

                if (this_will_close == false)
                {
                    MessageBox.Show("Datos actualizados con éxito", "Atención de pacientes", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    _Evento.MedicalEventDetailList.Clear();
                    _Evento.PatientMedicaments.Clear();

                    Selected_PatientMedicament = null;

                    _Evento.PatientMedicaments = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, _Evento.MedicalEventId);


                    MedicalEventDetail_ViewList details = ServiceCalls.RetriveMedicalEventDetails(ServiceCalls.CurrentPatient.PatientId, _Evento.MedicalEventId);

                    _Evento.DetailView_Diagnosis = details.Get_Diagnosis();
                    _Evento.DetailView_MetodosComplementarios = details.Get_Metodo_Complementarios();

                    patientMedicamentViewListBindingSource.DataSource = _Evento.PatientMedicaments;
                    gridControl_Medicaments.RefreshDataSource();
                    gridView_Medicaments.RefreshData();
                    uC_EventDetailsGrid_Diagnosis.Populate(_Evento);
                    uC_EventDetailsGrid_MetComplementario.Populate(_Evento);
                    this.State = Fwk.Bases.EntityUpdateEnum.UPDATED;
                    frmPatientAtencion.PopulateAsync(this);
                }
            }
            catch (Exception ex2)
            {
                ExceptionViewer.Show(ex2);
            }
        }