public static void UpdatePatientAllergy(PatientAllergyBE patientAllergyBE, Guid lastAccessUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { PatientAllergy patientAllergy_db = dc.PatientAllergies.Where(p => p.PatientId.Equals(patientAllergyBE.PatientId)).FirstOrDefault <PatientAllergy>(); patientAllergy_db.AnimalAllergy = patientAllergyBE.AnimalAllergy; patientAllergy_db.ChemicalAllergy = patientAllergyBE.ChemicalAllergy; patientAllergy_db.FoodAllergy = patientAllergyBE.FoodAllergy; patientAllergy_db.InsectAllergy = patientAllergyBE.InsectAllergy; patientAllergy_db.MedicamentsAllergy = patientAllergyBE.MedicamentsAllergy; patientAllergy_db.MiteAllergy = patientAllergyBE.MiteAllergy; patientAllergy_db.PollenAllergy = patientAllergyBE.PollenAllergy; patientAllergy_db.SunAllergy = patientAllergyBE.SunAllergy; patientAllergy_db.Observation = patientAllergyBE.Observation; patientAllergy_db.OtherAllergy = patientAllergyBE.OtherAllergy; patientAllergy_db.GeneralDetails = patientAllergyBE.GeneralDetails; patientAllergy_db.Enabled = patientAllergyBE.Enabled; patientAllergy_db.LastAccessTime = System.DateTime.Now; patientAllergy_db.LastAccessUserId = lastAccessUserId; dc.SaveChanges(); } }
public void Init() { if (ServiceCalls.IsInDesignMode()) return; InitializeComboBoxDatasource(TipoAlergia.AnimalAllergy); InitializeComboBoxDatasource(TipoAlergia.ChemicalAllergy); InitializeComboBoxDatasource(TipoAlergia.FoodAllergy); InitializeComboBoxDatasource(TipoAlergia.InsectAllergy); InitializeComboBoxDatasource(TipoAlergia.MedicamentsAllergy); //InitializeComboBoxDatasource(TipoAlergia.MiteAllergy); InitializeComboBoxDatasource(TipoAlergia.PollenAllergy); //InitializeComboBoxDatasource(TipoAlergia.SunAllergy); _PatientAllergy = frmPatientAtencion.GetInstance(this)._PatientAllergy; if (_PatientAllergy.AllergyId == -1) { _PatientAllergy = new PatientAllergyBE(); _PatientAllergy.PatientId = ServiceCalls.CurrentPatient.PatientId; _PatientAllergy.EntityState = Fwk.Bases.EntityState.Added; } else { _PatientAllergy.EntityState = Fwk.Bases.EntityState.Unchanged; } _PatientAllergy_Aux = _PatientAllergy.Clone<PatientAllergyBE>(); PopulateControls(); }
public void Init() { if (Controller.IsInDesignMode()) { return; } InitializeComboBoxDatasource(TipoAlergia.AnimalAllergy); InitializeComboBoxDatasource(TipoAlergia.ChemicalAllergy); InitializeComboBoxDatasource(TipoAlergia.FoodAllergy); InitializeComboBoxDatasource(TipoAlergia.InsectAllergy); InitializeComboBoxDatasource(TipoAlergia.MedicamentsAllergy); //InitializeComboBoxDatasource(TipoAlergia.MiteAllergy); InitializeComboBoxDatasource(TipoAlergia.PollenAllergy); //InitializeComboBoxDatasource(TipoAlergia.SunAllergy); _PatientAllergy = frmPatientAtencion.GetInstance(this)._PatientAllergy; if (_PatientAllergy.AllergyId == -1) { _PatientAllergy = new PatientAllergyBE(); _PatientAllergy.PatientId = Controller.CurrentPatient.PatientId; _PatientAllergy.EntityState = Fwk.Bases.EntityState.Added; } else { _PatientAllergy.EntityState = Fwk.Bases.EntityState.Unchanged; } _PatientAllergy_Aux = _PatientAllergy.Clone <PatientAllergyBE>(); PopulateControls(); }
public static void CreatePatientAllergy(PatientAllergyBE patientAllergyBE, Guid lastAccessUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { PatientAllergy patientAllergy_db = new PatientAllergy(); patientAllergy_db.PatientId = patientAllergyBE.PatientId; patientAllergy_db.AnimalAllergy = patientAllergyBE.AnimalAllergy; patientAllergy_db.ChemicalAllergy = patientAllergyBE.ChemicalAllergy; patientAllergy_db.FoodAllergy = patientAllergyBE.FoodAllergy; patientAllergy_db.InsectAllergy = patientAllergyBE.InsectAllergy; patientAllergy_db.MedicamentsAllergy = patientAllergyBE.MedicamentsAllergy; patientAllergy_db.MiteAllergy = patientAllergyBE.MiteAllergy; patientAllergy_db.PollenAllergy = patientAllergyBE.PollenAllergy; patientAllergy_db.SunAllergy = patientAllergyBE.SunAllergy; patientAllergy_db.Observation = patientAllergyBE.Observation; patientAllergy_db.OtherAllergy = patientAllergyBE.OtherAllergy; patientAllergy_db.GeneralDetails = patientAllergyBE.GeneralDetails; patientAllergy_db.MedicalEventId = patientAllergyBE.MedicalEventId; patientAllergy_db.Enabled = true; patientAllergy_db.LastAccessTime = System.DateTime.Now; patientAllergy_db.LastAccessUserId = lastAccessUserId; dc.PatientAllergies.AddObject(patientAllergy_db); dc.SaveChanges(); } }
void Set_PatientAllergy(PatientAllergyBE patientAllergyBE) { patientAllergyBE.AnimalAllergy = chkPetAllergy.Checked; patientAllergyBE.ChemicalAllergy = chkChemicalAllergy.Checked; patientAllergyBE.FoodAllergy = chkFoodAllergy.Checked; patientAllergyBE.InsectAllergy = chkInsectAllergy.Checked; patientAllergyBE.MedicamentsAllergy = chkMedicamentsAllergy.Checked; patientAllergyBE.MiteAllergy = chkMiteAllergy.Checked; patientAllergyBE.PollenAllergy = chkPollen.Checked; patientAllergyBE.SunAllergy = chkSol.Checked; patientAllergyBE.MedicalEventId = frmPatientAtencion.GetInstance(this).MedicalEvent.MedicalEventId; patientAllergyBE.OtherAllergy = GetComboIds(); patientAllergyBE.Observation = txtObservacion.Text; }
/// <summary> /// /// </summary> /// <param name="patientAllergy"></param> /// <returns></returns> public static void CreateUpdatePatientAllergy(PatientAllergyBE patientAllergy) { CreateUpdatePatientAllergyReq req = new CreateUpdatePatientAllergyReq(); req.BusinessData = patientAllergy; req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString(); req.ContextInformation.AppId = Controller.CurrentHealthInstitution.HealthInstitutionId.ToString(); CreateUpdatePatientAllergyRes res = req.ExecuteService <CreateUpdatePatientAllergyReq, CreateUpdatePatientAllergyRes>(req); if (res.Error != null) { throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error); } }
public static void Create_PatientAllergy_History(PatientAllergyBE patientAllergyBE, Guid lastAccessUserId) { CreatePatientAllergy(patientAllergyBE, lastAccessUserId); using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { PatientAllergy atientAllergy_new = dc.PatientAllergies.Where(p => p.PatientId.Equals(patientAllergyBE.PatientId)).FirstOrDefault <PatientAllergy>(); atientAllergy_new.Enabled = false; atientAllergy_new.LastAccessTime = System.DateTime.Now; atientAllergy_new.LastAccessUserId = lastAccessUserId; dc.SaveChanges(); } }
/// <summary> /// Carga Dominios relacionados entre al objeto _RelatedDomains que esta bindiado a la grilla /// </summary> void Populate(out Exception ex) { ex = null; try { _PatientAllergy = ServiceCalls.GetPatientAllergy(ServiceCalls.CurrentPatient.PatientId); _PatientMedicament_ViewList = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, null); _MedicalEventAlert_ViewList = ServiceCalls.RetriveMedicalEventAlert(ServiceCalls.CurrentPatient.PatientId, null, false); if (MedicalEvent == null) { MedicalEvent = new MedicalEventBE(); MedicalEvent.MedicalEventId = -1; if (this._Appointment != null) { MedicalEvent.AppointmentId = this._Appointment.AppointmentId; } MedicalEvent.ProfesionalId = ServiceCalls.CurrentProfesional.IdProfesional; MedicalEvent.IdEspesialidad = ServiceCalls.CurrentProfesional.IdEspecialidad.Value; MedicalEvent.PatientId = ServiceCalls.CurrentPatient.PatientId; MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList; MedicalEvent.HealthInstitutionId = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId; MedicalEvent.MedicalEventId = ServiceCalls.CreateMedicalEvent(MedicalEvent); } else { MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList; } } catch (Exception err) { err.Source = "Origen de datos"; ex = err; } }
public void GetPatientAllergyRes_SetXml() { string strErrorResut = string.Empty; string xml = Fwk.HelperFunctions.FileFunctions.OpenTextFile(@"D:\Projects\pelsofthealth\trunk\src\Health.Test\GetPatientAllergyRes.txt"); GetPatientAllergyRes res = new GetPatientAllergyRes(); PatientAllergyBE wPatientAllergyBE = new PatientAllergyBE(); //res.BusinessData = new Back.BE.PatientAllergyBE(); res.BusinessData = null; string x = res.GetXml(); try { res = (GetPatientAllergyRes)Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(GetPatientAllergyRes),xml); res.SetXml(x); res.SetXml(xml); } catch (Exception e) { strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e); } Assert.AreEqual<String>(strErrorResut, String.Empty, strErrorResut); }
/// <summary> /// /// </summary> public override void AceptChanges(bool this_will_close) { Set_PatientAllergy(_PatientAllergy_Aux); try { if (_PatientAllergy.EntityState == Fwk.Bases.EntityState.Added) { Set_PatientAllergy(_PatientAllergy); Controller.CreateUpdatePatientAllergy(_PatientAllergy); } else { if (CheckChanges()) { Set_PatientAllergy(_PatientAllergy); Controller.CreateUpdatePatientAllergy(_PatientAllergy); } } if (this_will_close == false) { this.MessageViewer.Show("Las alergias se actualizaron con exito .-"); frmPatientAtencion.PopulateAsync(this); _PatientAllergy.EntityState = Fwk.Bases.EntityState.Unchanged; _PatientAllergy_Aux = null; _PatientAllergy_Aux = _PatientAllergy.Clone <PatientAllergyBE>(); } } catch (Exception ex) { this.ExceptionViewer.Show(ex); } }
public void GetPatientAllergyRes_SetXml() { string strErrorResut = string.Empty; string xml = Fwk.HelperFunctions.FileFunctions.OpenTextFile(@"D:\Projects\pelsofthealth\trunk\src\Health.Test\GetPatientAllergyRes.txt"); GetPatientAllergyRes res = new GetPatientAllergyRes(); PatientAllergyBE wPatientAllergyBE = new PatientAllergyBE(); //res.BusinessData = new Back.BE.PatientAllergyBE(); res.BusinessData = null; string x = res.GetXml(); try { res = (GetPatientAllergyRes)Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(GetPatientAllergyRes), xml); res.SetXml(x); res.SetXml(xml); } catch (Exception e) { strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e); } Assert.AreEqual <String>(strErrorResut, String.Empty, strErrorResut); }
/// <summary> /// /// </summary> /// <param name="patientAllergy"></param> /// <returns></returns> public static void CreateUpdatePatientAllergy(PatientAllergyBE patientAllergy) { CreateUpdatePatientAllergyReq req = new CreateUpdatePatientAllergyReq(); req.BusinessData = patientAllergy; req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString(); req.ContextInformation.AppId = Controller.CurrentHealthInstitution.HealthInstitutionId.ToString(); CreateUpdatePatientAllergyRes res = req.ExecuteService<CreateUpdatePatientAllergyReq, CreateUpdatePatientAllergyRes>(req); if (res.Error != null) throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error); }
public static void UpdatePatientAllergy(PatientAllergyBE patientAllergyBE, Guid lastAccessUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { PatientAllergy patientAllergy_db = dc.PatientAllergies.Where(p => p.PatientId.Equals(patientAllergyBE.PatientId)).FirstOrDefault<PatientAllergy>(); patientAllergy_db.AnimalAllergy = patientAllergyBE.AnimalAllergy; patientAllergy_db.ChemicalAllergy = patientAllergyBE.ChemicalAllergy; patientAllergy_db.FoodAllergy = patientAllergyBE.FoodAllergy; patientAllergy_db.InsectAllergy = patientAllergyBE.InsectAllergy; patientAllergy_db.MedicamentsAllergy = patientAllergyBE.MedicamentsAllergy; patientAllergy_db.MiteAllergy = patientAllergyBE.MiteAllergy; patientAllergy_db.PollenAllergy = patientAllergyBE.PollenAllergy; patientAllergy_db.SunAllergy = patientAllergyBE.SunAllergy; patientAllergy_db.Observation = patientAllergyBE.Observation; patientAllergy_db.OtherAllergy = patientAllergyBE.OtherAllergy; patientAllergy_db.GeneralDetails = patientAllergyBE.GeneralDetails; patientAllergy_db.Enabled = patientAllergyBE.Enabled; patientAllergy_db.LastAccessTime = System.DateTime.Now; patientAllergy_db.LastAccessUserId = lastAccessUserId; dc.SaveChanges(); } }
public static void Create_PatientAllergy_History(PatientAllergyBE patientAllergyBE, Guid lastAccessUserId) { CreatePatientAllergy(patientAllergyBE, lastAccessUserId); using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { PatientAllergy atientAllergy_new = dc.PatientAllergies.Where(p => p.PatientId.Equals(patientAllergyBE.PatientId)).FirstOrDefault<PatientAllergy>(); atientAllergy_new.Enabled = false; atientAllergy_new.LastAccessTime = System.DateTime.Now; atientAllergy_new.LastAccessUserId = lastAccessUserId; dc.SaveChanges(); } }
/// <summary> /// Carga Dominios relacionados entre al objeto _RelatedDomains que esta bindiado a la grilla /// </summary> void Populate(out Exception ex) { ex = null; try { _PatientAllergy = Controller.GetPatientAllergy(Controller.CurrentPatient.PatientId); _PatientMedicament_ViewList = Controller.RetrivePatientMedicaments(Controller.CurrentPatient.PatientId, null); _MedicalEventAlert_ViewList = Controller.RetriveMedicalEventAlert(Controller.CurrentPatient.PatientId,null, false); if (MedicalEvent == null) { MedicalEvent = new MedicalEventBE(); MedicalEvent.MedicalEventId = -1; if (this._Appointment != null) MedicalEvent.AppointmentId = this._Appointment.AppointmentId; MedicalEvent.ProfesionalId = Controller.CurrentProfesional.IdProfesional; MedicalEvent.IdEspesialidad = Controller.CurrentProfesional.IdEspecialidad.Value; MedicalEvent.PatientId = Controller.CurrentPatient.PatientId; MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList; MedicalEvent.HealthInstitutionId = Controller.CurrentHealthInstitution.HealthInstitutionId; MedicalEvent.MedicalEventId = Controller.CreateMedicalEvent(MedicalEvent); } else { MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList; } } catch (Exception err) { err.Source = "Origen de datos"; ex = err; } }
/// <summary> /// /// </summary> public override void AceptChanges(bool this_will_close) { Set_PatientAllergy(_PatientAllergy_Aux); try { if (_PatientAllergy.EntityState == Fwk.Bases.EntityState.Added) { Set_PatientAllergy(_PatientAllergy); ServiceCalls.CreateUpdatePatientAllergy(_PatientAllergy); } else { if (CheckChanges()) { Set_PatientAllergy(_PatientAllergy); ServiceCalls.CreateUpdatePatientAllergy(_PatientAllergy); } } if (this_will_close == false) { this.MessageViewer.Show("Las alergias se actualizaron con exito .-"); frmPatientAtencion.PopulateAsync(this); _PatientAllergy.EntityState = Fwk.Bases.EntityState.Unchanged; _PatientAllergy_Aux = null; _PatientAllergy_Aux = _PatientAllergy.Clone<PatientAllergyBE>(); } } catch (Exception ex) { this.ExceptionViewer.Show(ex); } }