Esempio n. 1
0
        public Model.Patient GetPatientById(int pid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1 p_name, old, gender from [patient_data] ");
            strSql.Append("where pid  = @pid  ");
            SqlParameter[] parameters = { new SqlParameter("@pid ", SqlDbType.Int) };
            parameters[0].Value = pid;
            Model.Patient model = new Model.Patient();
            DataTable     dt    = SqlDbHelper.ExecuteDataTable(strSql.ToString(), CommandType.Text, parameters);

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["p_name"] != null && dt.Rows[0]["p_name"].ToString() != "")
                {
                    model.P_name = dt.Rows[0]["p_name"].ToString();
                }
                if (dt.Rows[0]["gender"] != null && dt.Rows[0]["gender"].ToString() != "")
                {
                    model.Gender = dt.Rows[0]["gender"].ToString();
                }
                if (dt.Rows[0]["old"] != null && dt.Rows[0]["old"].ToString() != "")
                {
                    model.Old = Convert.ToInt16(dt.Rows[0]["old"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            const string argumentNullError = "Der Patient kann nicht gespeichert werden ohne ";
            const string strBirthday       = "ein gültiges Geburtsdatum.";
            const string strGender         = "ein Geschlecht.";
            const string strAddress        = "gültige Adressdaten.";
            const string strInsurance      = "eine Krankenkasse.";
            const string strDoctor         = "einen Hausarzt.";

            if (dtpBirthday.Text == String.Empty)
            {
                MessageBox.Show(argumentNullError + strBirthday);
            }
            else if (tbGender.Text == String.Empty)
            {
                MessageBox.Show(argumentNullError + strGender);
            }
            else if (selectedAddress == null)
            {
                MessageBox.Show(argumentNullError + strAddress);
            }
            else if (selectedInsurance == null)
            {
                MessageBox.Show(argumentNullError + strInsurance);
            }
            else if (selectedDoctor == null)
            {
                MessageBox.Show(argumentNullError + strDoctor);
            }
            else
            {
                if (int.TryParse(tbInsuranceNr.Text, out var insuranceNr))
                {
                    var birthday = dtpBirthday.Value;
                    var gender   = tbGender.Text;
                    var note     = tbNote.Text;

                    if (patient != null) // edit handover patient
                    {
                        patient.Birthday        = birthday;
                        patient.Gender          = gender;
                        patient.InsuranceNr     = insuranceNr;
                        patient.InsuranceAgency = selectedInsurance;
                        patient.LocalDoctor     = selectedDoctor;
                        patient.Address         = selectedAddress;
                        patient.Note            = tbNote.Text;
                        patient.Update();
                    }
                    else
                    {
                        patient = new Model.Patient(birthday, gender, selectedInsurance, insuranceNr, selectedDoctor, selectedAddress, note); // create new patient
                    }
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("Die Krankenversichertennummer darf nur aus Ziffern bestehen."); //TODO: Maybe not use Integer in the Database? My InsuranceID has letters in it
                }
            }
        }
Esempio n. 3
0
        public virtual List <Model.Patient> Get_unThreeStool()
        {
            List <Model.Patient> listPatient = new List <Model.Patient>();
            string sql = "select Patient_Id as \"PatientID\",VISITID as \"VisitId\",Patient_Name as \"PatientName\",Nurse_Cell_Code as \"NurseCellCode\" from " + Patient + " where 1=1 ";

            //sql += " and  State='在科'";
            sql += " order by Nurse_Cell_Code";
            DataTable dt = dbhelper_Interface.MyExecuteQuery(sql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (Get_isThreeDayUnStool(Convert.ToString(dt.Rows[i]["PatientID"]), Convert.ToString(dt.Rows[i]["VisitId"])))
                {
                    Model.Patient pt = new Model.Patient()
                    {
                        PatientID     = Convert.ToString(dt.Rows[i]["PatientID"]),
                        PatientName   = Convert.ToString(dt.Rows[i]["PatientName"]),
                        VisitID       = new DAL.Common().StrToInt_N(dt.Rows[i]["VisitId"].ToString()),
                        NurseCellCode = Convert.ToString(dt.Rows[i]["NurseCellCode"])
                    };
                    listPatient.Add(pt);
                }
            }
            return(listPatient);
        }
        public async Task <IActionResult> Save([FromBody] Model.Patient model)
        {
            try
            {
                var message = new Message();
                message.BusinessLogic = configuration.GetValue <string>("AppSettings:BusinessLogic:Patient");
                message.Connection    = configuration.GetValue <string>("ConnectionStrings:appointmentControl");
                message.Operation     = Operation.Save;
                message.MessageInfo   = model.SerializeObject();
                using (var businessLgic = new DoWorkService())
                {
                    var result = await businessLgic.DoWork(message);

                    if (result.Status == Status.Failed)
                    {
                        return(BadRequest(result.Result));
                    }
                    var resultModel = result.DeSerializeObject <Model.Patient>();
                    return(Ok(resultModel));
                }
            }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.Ambiguous, new { ex = ex, param = model }));
            }
        }
Esempio n. 5
0
        public Fiche_PatientViewModel(Model.Patient patient)
        {
            _liveActionCommand = new RelayCommand(LiveAction);
            _addObservation    = new RelayCommand(param => AddObs(), param => true);
            Patient            = patient;
            if (Patient.Obs != null && Patient.Obs.Count() > 0)
            {
                SelectedObservation = Patient.Obs.ElementAt(0);
            }
            else
            {
                SelectedObservation = null;
            }
            View.MainWindow mainwindow  = (View.MainWindow)Application.Current.MainWindow;
            object          datacontext = mainwindow.DataContext;

            ViewModel.MainWindow main = (ViewModel.MainWindow)datacontext;
            if (main.ConnectedUser.Role.Equals("Medecin"))
            {
                this._isAdmin = true;
            }
            else
            {
                this._isAdmin = false;
            }
            ListImages = null;
        }
Esempio n. 6
0
 private void baocun_btn_Click(object sender, EventArgs e)
 {
     //将输入的信息封装成类对象,传入bll层
     Model.Patient patient = new Model.Patient();
     Model.Patient_Tab patient_tab = new Model.Patient_Tab();
     patient.P_name = tb_pname.Text.Trim();
     //年龄信息出错,提醒用户
     try
     {
         patient.Old = Convert.ToInt16(tb_old.Text.Trim());
     }
     catch (Exception exp)
     {
         MessageBoxBuilder.buildbox((exp.Message), "错误!");
         return;
     }
     patient.Tel = tb_tel.Text.Trim();
     patient.Idcard = tb_idcard.Text.Trim();
     patient.D_ID = UserHelper.id;
     //用与得到用户转入的病人照片信息
     if (FileName != null && !"".Equals(FileName))
     {
         if ((pictureBox1.Image != null))
         {
             pictureBox1.Image.Dispose();
             pictureBox1.Image = null;
         }
         patient.Thumb = Common.Util.GetImageByte(FileName);
     }
     if (rb_man.Checked)
     {
         patient.Gender = "男";
     }
     else if (rb_woman.Checked)
     {
         patient.Gender = "女";
     }
     else
     {
         patient.Gender = "不详";
     }
     patient_tab.Chufang_count = Convert.ToInt32(tb_jishu.Text.Trim());
     patient_tab.Xianbingshi = tb_bingshi.Text.Trim();
     patient_tab.Zhengduan = tb_zhenduan.Text.Trim();
     string msg = "";
     //添加处方信息与病人信息
     if (patientInstance.AddPatient(patient, patient_tab, out msg))
     {
         MessageBoxBuilder.buildbox("保存成功!", "ok");
         ShowPhoto();
     }
     else if (!"".Equals(msg))
     {
         MessageBoxBuilder.buildbox(msg,"错误");
     }
     else
     {
         MessageBoxBuilder.buildbox("未知错误!插入失败!","错误");
     }
 }
Esempio n. 7
0
 public Model.Patient GetPatientById(int pid)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select top 1 p_name, old, gender from [patient_data] ");
     strSql.Append("where pid  = @pid  ");
     SqlParameter[] parameters = { new SqlParameter("@pid ", SqlDbType.Int) };
     parameters[0].Value = pid;
     Model.Patient model = new Model.Patient();
     DataTable dt = SqlDbHelper.ExecuteDataTable(strSql.ToString(), CommandType.Text, parameters);
     if (dt.Rows.Count > 0)
     {
         if (dt.Rows[0]["p_name"] != null && dt.Rows[0]["p_name"].ToString() != "")
         {
             model.P_name = dt.Rows[0]["p_name"].ToString();
         }
         if (dt.Rows[0]["gender"] != null && dt.Rows[0]["gender"].ToString() != "")
         {
             model.Gender = dt.Rows[0]["gender"].ToString();
         }
         if (dt.Rows[0]["old"] != null && dt.Rows[0]["old"].ToString() != "")
         {
             model.Old = Convert.ToInt16(dt.Rows[0]["old"].ToString());
         }
         return model;
     }
     else
     {
         return null;
     }
 }
Esempio n. 8
0
        private void CreatePatientMethod()
        {
            if (Firstname == null || Firstname.Equals("") || Name == null || Name.Equals(""))
            {
                MaterialMessageBox.ShowError("Le patient doit avoir un nom/prénom !");
                return;
            }
            Model.Patient patient = new Model.Patient()
            {
                birthday  = Birthdate,
                firstname = Firstname,
                name      = Name
            };

            if (Patients.CreatePatient(patient))
            {
                lastWindow.UpdatePatientList();
                CloseCurrentWindow();
                var msg = Utils.Utils.createMessageBox("Patient crée avec succés");
                msg.Show();
            }
            else
            {
                MaterialMessageBox.ShowError("Impossible de créer un nouveau patient !");
            }
        }
        public bool UpdatePatient(Model.Patient entity)
        {
            var validation = new PatientValidation.PatientEntityValidate().Validate(entity);

            if (!validation.IsValid)
            {
                throw new ValidationException(validation.Errors);
            }

            using (var db = new Model.PhysicManagementEntities())
            {
                var Entity = db.Patient.Find(entity.Id);
                Entity.FirstName    = entity.FirstName;
                Entity.LastName     = entity.LastName;
                Entity.Mobile       = entity.Mobile;
                Entity.NationalCode = entity.NationalCode;
                Entity.Code         = entity.Code;
                Entity.Province     = entity.Province;
                Entity.City         = entity.City;
                Entity.Address      = entity.Address;
                Entity.RegisterDate = entity.RegisterDate;
                Entity.GenderIsMale = entity.GenderIsMale;

                return(db.SaveChanges() == 1);
            }
        }
        public CashRegisterWindow(Model.User userLoggedIn, Model.Statement statement, Model.Patient patient)
		{
			this.InitializeComponent();

            FillPatients();

            _userLoggedIn = userLoggedIn;
            _statement = statement;
            _selectedPatient = patient;
            _isStatement = _statement != null;

            if (_statement != null)
            {
                this.Title = "Abonar/Liquidar estado de cuenta";
                lblAccountStatusNumber.ToolTip = lblAccountStatusNumber.Content = _statement.StatementId.ToString();
                gbAccountStatusNumber.Visibility = System.Windows.Visibility.Visible;
                btnClearForm.Visibility = System.Windows.Visibility.Hidden;
                cbPatients.IsEnabled = false;
                FillTreatments();
                FillPayments();

                SelectPatient();
            }
            else
            {
                gbAccountStatusNumber.Header = "Estado de cuenta activo";
            }

            UpdateTotals();
        }
Esempio n. 11
0
        public bool AddPatient(Model.Patient patient, Model.Patient_Tab patient_tab, out string msg)
        {
            msg = "";
            if (!CheckPatientData(patient, out msg))
            {
                return(false);
            }
            int id = pa.AddPatientRetId(patient);

            if (id != -1)
            {
                patient_tab.Pid = id;
                if (!CheckPatientTabData(patient_tab, out msg))
                {
                    return(false);
                }
                if ((paT.AddPatientTab(patient_tab)))
                {
                    return(true);
                }
                else
                {
                    pa.DeletePatientById(id);
                    msg = "插入病人诊断信息失败!";
                    return(false);
                }
            }
            msg = "插入病人信息失败!";
            return(false);
        }
        public ManageProgressNotesWindow(Model.Patient patient)
		{
			this.InitializeComponent();

            _patient = patient;
            UpdateGrid();
		}
        public AppointmentsList(Model.Patient patient, Model.Hospital hospitalIn)
        {
            InitializeComponent();

            using (SqlConnection connection = new SqlConnection())
            {
                connection.Open();

                using (SqlCommand command = new SqlCommand())
                {
                    command.Connection  = connection;
                    command.CommandText = "SELECT apptTime, apptDate, importance, reason FROM Hospital.dbo.Appointments" +
                                          "\n WHERE patientID = @patientID AND hospitalID = @hospitalID;";

                    SqlDataReader cursor = command.ExecuteReader();

                    if (cursor.Read())
                    {
                        object[] tuple = new object[cursor.FieldCount];

                        cursor.GetValues(tuple);
                        DateTime date     = (DateTime)tuple[0];
                        DateTime time     = (DateTime)tuple[1];
                        DateTime schedule = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second, DateTimeKind.Local);

                        Model.Triage    importance = (Model.Triage)Enum.Parse(typeof(Model.Triage), (string)tuple[2]);
                        Model.Specialty specialty  = (Model.Specialty)Enum.Parse(typeof(Model.Specialty), (string)tuple[3]);
                    }
                }
            }
        }
        public StatementExpirationDateModal(Model.Statement statement, Model.Patient patient, Model.User user)
		{
			this.InitializeComponent();

            _statement = statement;
            _patient = patient;
            _user = user;
		}
Esempio n. 15
0
 public void CreatePatientInformation(Model.Patient _objPatient)
 {
     using (var _dbPatient = new PatientDemographicsContext())
     {
         _dbPatient.Patient.Add(_objPatient);
         _dbPatient.SaveChanges();
     }
 }
Esempio n. 16
0
        public void FillListPatient()
        {
            ServicePatient.ServicePatientClient service = new ServicePatient.ServicePatientClient();
            try
            {
                ServicePatient.Patient[] listPatient = service.GetListPatient();
                this._allPatient = new List <Model.Patient>();
                List <Model.Observation> listObs = new List <Model.Observation>();

                foreach (ServicePatient.Patient pat in listPatient)
                {
                    Model.Patient patient = new Model.Patient
                    {
                        Birth     = pat.Birthday,
                        Firstname = pat.Firstname,
                        Name      = pat.Name,
                        Id        = pat.Id
                    };

                    if (pat.Observations != null)
                    {
                        foreach (ServicePatient.Observation obs in pat.Observations)
                        {
                            Model.Observation observation = new Model.Observation
                            {
                                Comments      = obs.Comment,
                                Date          = obs.Date,
                                Pic           = obs.Pictures ?? new List <byte[]>().ToArray(),
                                Prescriptions = obs.Prescription.ToList() ?? new List <string>(),
                                Pressure      = obs.BloodPressure,
                                Weight        = obs.Weight
                            };
                            listObs.Add(observation);
                        }
                        patient.Obs = listObs;
                    }

                    patient.Name      = FirstUpper(patient.Name);
                    patient.Firstname = FirstUpper(patient.Firstname);
                    patient.Birthday  = pat.Birthday.ToString("dd/MM/yyyy");

                    this._allPatient.Add(patient);
                }
                ListPatient = new ObservableCollection <Model.Patient>(this._allPatient);
            }
            catch
            {
                MainWindow      main       = new MainWindow();
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                View.Patients view             = new colle_tMedecine.View.Patients();
                ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
                view.DataContext = vm;

                main.navigate((UserControl)mainwindow.contentcontrol.Content, view);
            }
        }
        public ManageUserDentegraAuthorizationsWindow(Model.Patient selectedPatient)
		{
            this.InitializeComponent();

            _selectedPatient = selectedPatient;
            lblExpNumber.ToolTip = lblExpNumber.Content = selectedPatient.AssignedId;
            lblPatientName.ToolTip = lblPatientName.Content = selectedPatient.FirstName + " " + selectedPatient.LastName;

            UpdateGrid();
		}
Esempio n. 18
0
        private void baocun_btn_Click(object sender, EventArgs e)
        {
            Model.Patient     patient     = new Model.Patient();
            Model.Patient_Tab patient_tab = new Model.Patient_Tab();
            patient.P_name = tb_pname.Text.Trim();
            try
            {
                patient.Old = Convert.ToInt16(tb_old.Text.Trim());
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
                return;
            }
            patient.Tel    = tb_tel.Text.Trim();
            patient.Idcard = tb_idcard.Text.Trim();
            patient.D_ID   = 10000;
            if (FileName != null && !"".Equals(FileName))
            {
                if ((pictureBox1.Image != null))
                {
                    pictureBox1.Image.Dispose();
                }
                patient.Thumb = Common.Util.GetImageByte(FileName);
            }
            if (rb_man.Checked)
            {
                patient.Gender = "男";
            }
            else if (rb_woman.Checked)
            {
                patient.Gender = "女";
            }
            else
            {
                patient.Gender = "不详";
            }
            patient_tab.Chufang_count = Convert.ToInt32(tb_jishu.Text.Trim());
            patient_tab.Xianbingshi   = tb_bingshi.Text.Trim();
            patient_tab.Zhengduan     = tb_zhenduan.Text.Trim();
            string msg = "";

            if (patientInstance.AddPatient(patient, patient_tab, out msg))
            {
                MessageBox.Show("保存成功!");
            }
            else if (!"".Equals(msg))
            {
                MessageBox.Show(msg);
            }
            else
            {
                MessageBox.Show("未知错误!插入失败!");
            }
        }
        public AddEditProgressNoteModal(Model.ProgressNote selectedProgressNote, Model.Patient patient)
		{
			this.InitializeComponent();

            _patient = patient;
            _selectedProgressNote = selectedProgressNote;
            _isUpdateProgressNote = selectedProgressNote != null;

            if (_isUpdateProgressNote)
                PrepareWindowForUpdates();
		}
 public NewObservationViewModel(Model.Patient patient)
 {
     _addCommand   = new RelayCommand(param => AddObservation(), param => true);
     _addPresc     = new RelayCommand(param => AddPrescription(), param => true);
     _addImage     = new RelayCommand(param => AddImageAction(), param => true);
     PatientName   = String.Format("{0} {1}", patient.Name, patient.Firstname);
     Patient       = patient;
     Pictures      = new ObservableCollection <Image>();
     Date          = DateTime.Now;
     Prescriptions = new List <string>();
 }
        public AddEditInitialDentalNoteWindow(Model.Patient patientToUpdate)
		{
			this.InitializeComponent();

            FillTreatments();
            AddEmptyItemToComboBoxes();

            _patientToUpdate = patientToUpdate;
            _isUpdateDentalInitialNote = patientToUpdate != null;

            if (_isUpdateDentalInitialNote)
                PrepareWindowForUpdates();
		}
        public UpdateClinicHistoryWindow(Model.Patient patient)
		{
			this.InitializeComponent();

            _patient = patient;
            _isUpdate = patient.ClinicHistoryId != null;

            FillGeneralInfo();

            if (_isUpdate)
            {
                FillAllClinicHistoryInfo();
            }
        }
Esempio n. 23
0
        public void ShowPatientSheet(object param)
        {
            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            Model.Patient pat = (Model.Patient)param;

            View.Fiche_Patient view = new colle_tMedecine.View.Fiche_Patient();

            ViewModel.Fiche_PatientViewModel vm = new colle_tMedecine.ViewModel.Fiche_PatientViewModel(pat);
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
Esempio n. 24
0
        public bool AddPatient(Model.Patient entity)
        {
            var validation = new PatientValidation.PatientEntityValidate().Validate(entity);

            if (!validation.IsValid)
            {
                throw new ValidationException(validation.Errors);
            }

            using (var db = new Model.PhysicManagementEntities())
            {
                db.Patient.Add(entity);
                return(db.SaveChanges() == 1);
            }
        }
        public AddEditDentegraAuthorizationsModal(Model.Patient selectedPatient, Model.DentegraAuthorization selectedElegibility)
		{
			this.InitializeComponent();

            _selectedPatient = selectedPatient;
            _selectedElegibility = selectedElegibility;
            _isUpdateElegibility = selectedElegibility != null;

            lblExpNumber.ToolTip = lblExpNumber.Content = selectedPatient.AssignedId;
            lblPatientName.ToolTip = lblPatientName.Content = selectedPatient.FirstName + " " + selectedPatient.LastName;

            if (_isUpdateElegibility)
            {
                PrepareWindowForUpdates();
            }
		}
Esempio n. 26
0
        public void DeletePatient(object param)
        {
            Model.Patient patient = (Model.Patient)param;

            ServicePatient.ServicePatientClient service = new ServicePatient.ServicePatientClient();
            try
            {
                service.DeletePatient(patient.Id);
                this._allPatient.Remove(patient);
                ListPatient = new ObservableCollection <Model.Patient>(_allPatient);
            }
            catch
            {
                ListPatient = new ObservableCollection <Model.Patient>(_allPatient);
            }
        }
 public async Task <Model.Patient> Get(Model.Patient model)
 {
     using (var connection = new SqlConnection(ConnectionString))
     {
         var result = connection.Query <
             appointmentControl.Backend.Model.Patient>
                          ("SP_PATIENT_GET",
                          param: new
         {
             P_PK_PATIENT = model.Pk_Patient,
             P_NAME       = model.Name,
             P_IDENTITY   = model.Identity,
         },
                          commandType: CommandType.StoredProcedure).FirstOrDefault();
         return(await Task.FromResult <Model.Patient>(result));
     }
 }
        public CanceledEventsSendEmailModal(List<Model.Event> canceledEventsInARow, List<Model.Event> canceledEventsOfSameTreatment, Model.Patient patient, Model.Treatment treatment)
        {
            this.InitializeComponent();

            _canceledEventsInARow = canceledEventsInARow;
            _canceledEventsOfSameTreatment = canceledEventsOfSameTreatment;
            _patient = patient;
            _treatment = treatment;

            lblEmailLogMessage.Content = string.Format("Enviando correo(s) al paciente {1} {2} (Exp. No. {0})\npor los siguientes motivos:\n", _patient.AssignedId, _patient.FirstName, _patient.LastName);
            lblEmailLogMessage.Content += _canceledEventsInARow == null 
                                                ? string.Empty 
                                                : "\n- 3 citas canceladas consecutivas.";
            lblEmailLogMessage.Content += _canceledEventsOfSameTreatment == null 
                                                ? string.Empty
                                                : string.Format("\n- 3 citas canceladas para el tratamiento de '{0}'.", _treatment.Name);
        }
Esempio n. 29
0
        public async Task SignInAsync(IPlatformParameters context)
        {
            if (Settings.SecurityEnabled)
            {
                await MicrosoftGraphService.SignInAsync(context);

                Model.Patient currentPatient = await GetPatientInfo();

                if (currentPatient != null)
                {
                    AppSettings.CurrentPatientId          = currentPatient.PatientId;
                    MicrosoftGraphService.LoggedUserPhoto = currentPatient.Picture;
                }

                PublishChanges();
                LoadUserPhoto();
            }
        }
Esempio n. 30
0
        public bool UpdatePatient(Model.Patient patient)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update [patient_data] set");
            strSql.Append("p_name=@p_name,gender=@gender,old=@old," +
                          "tel=@tel,idcard=@idcard,d_id=@d_id,thumb=@thumb where pid=@pid");
            int row = SqlDbHelper.ExecuteNonQuery(strSql.ToString(), CommandType.Text, ParsePara(patient));

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 31
0
 private Model.Patient ParseData()
 {
     Model.Patient patient = new Model.Patient();
     patient.D_ID   = UserHelper.id;
     patient.Pid    = Convert.ToInt32(id_tb.Text);
     patient.P_name = name_tb.Text;
     patient.Tel    = phone_tb.Text;
     if (FileName != null && !"".Equals(FileName))
     {
         if ((pb_patient.Image != null))
         {
             pb_patient.Image.Dispose();
         }
         patient.Thumb = Common.Util.GetImageByte(FileName);
     }
     patient.P_name = name_tb.Text;
     patient.Gender = gender_tb.Text;
     return(patient);
 }
Esempio n. 32
0
        public static ObservableCollection <Model.Patient> GetAllPatients()
        {
            ServicePatientClient servicePatient         = new ServicePatientClient();
            ObservableCollection <Model.Patient> result = new ObservableCollection <Model.Patient>();

            try
            {
                var response = servicePatient.GetListPatient();
                foreach (var patient in response)
                {
                    ObservableCollection <Model.Observation> observations = new ObservableCollection <Model.Observation>();
                    Model.Patient newP = new Model.Patient()
                    {
                        birthday  = patient.Birthday,
                        firstname = patient.Firstname,
                        id        = patient.Id,
                        name      = patient.Name
                    };
                    if (patient.Observations != null)
                    {
                        foreach (var observation in patient.Observations)
                        {
                            Model.Observation newOb = new Model.Observation()
                            {
                                bloodPressure = observation.BloodPressure,
                                comment       = observation.Comment,
                                date          = observation.Date,
                                pictures      = observation.Pictures,
                                prescription  = observation.Prescription,
                                weight        = observation.Weight
                            };
                            observations.Add(newOb);
                        }
                    }
                    newP.observations = observations;
                    result.Add(newP);
                }
            }
            catch (Exception e) { System.Console.WriteLine(e.Message); }
            finally { servicePatient.Close(); }
            return(result);
        }
Esempio n. 33
0
        public static bool CreatePatient(Model.Patient patient)
        {
            ServicePatientClient servicePatient = new ServicePatientClient();
            bool result = false;

            try
            {
                ServicePatient.Patient patientS = new ServicePatient.Patient()
                {
                    Birthday     = patient.birthday,
                    Firstname    = patient.firstname,
                    Name         = patient.name,
                    Observations = null
                };
                result = servicePatient.AddPatient(patientS);
            }
            catch (Exception) { }
            finally { servicePatient.Close(); }
            return(result);
        }
Esempio n. 34
0
        public bool AddPatient(Model.Patient patient)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [patient_data](p_name,d_id,gender,old," +
                          "tel,idcard,thumb) values");
            strSql.Append("(@p_name,@d_id,@gender,@old,@tel,@idcard,@thumb)");


            int row = SqlDbHelper.ExecuteNonQuery(strSql.ToString(), CommandType.Text, ParsePara(patient));

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public AddEditPatientsModal(Model.Patient patientToUpdate, bool hasHealthInsurance, bool isDiverse, bool isDentegra, Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _userLoggedIn = userLoggedIn;
            _hasHealthInsurance = hasHealthInsurance;
            _isDiverse = isDiverse;
            _isDentegra = isDentegra;
            _patientToUpdate = patientToUpdate;
            _isUpdatePatientInfo = patientToUpdate != null;

            if (_isUpdatePatientInfo)
            {
                PrepareWindowForUpdates();
            }
            else
            {
                txtExpNumber.Text = Controllers.BusinessController.Instance.GetNextPatientAssignedId().ToString();
            }
        }
Esempio n. 36
0
        public int AddPatientRetId(Model.Patient patient)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [patient_data](p_name,d_id,gender,old," +
                          "tel,idcard,thumb) output inserted.pid values");
            strSql.Append("(@p_name,@d_id,@gender,@old,@tel,@idcard,@thumb)");


            SqlDataReader reader = SqlDbHelper.ExecuteReader(strSql.ToString(), CommandType.Text, ParsePara(patient));

            if (reader.Read())
            {
                return(Int16.Parse(reader[0].ToString()));
            }
            else
            {
                return(-1);
            }
        }
Esempio n. 37
0
 public SqlParameter[] ParsePara(Model.Patient patient)
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@p_name", SqlDbType.VarChar,  6),
         new SqlParameter("@gender", SqlDbType.VarChar,  4),
         new SqlParameter("@old",    SqlDbType.Int),
         new SqlParameter("@tel",    SqlDbType.VarChar, 15),
         new SqlParameter("@idcard", SqlDbType.VarChar, 18),
         new SqlParameter("@d_id",   SqlDbType.Int),
         new SqlParameter("@thumb",  SqlDbType.Image)
     };
     parameters[0].Value = patient.P_name;
     parameters[1].Value = patient.Gender;
     parameters[2].Value = patient.Old;
     parameters[3].Value = patient.Tel;
     parameters[4].Value = patient.Idcard;
     parameters[5].Value = patient.D_ID;
     parameters[6].Value = patient.Thumb;
     return(parameters);
 }
Esempio n. 38
0
        public FrmPatient(Model.Patient editPatient)
        {
            InitializeComponent();
            InitializeAdditionalComponents();

            patient           = editPatient;
            selectedAddress   = editPatient.Address;
            selectedInsurance = editPatient.InsuranceAgency;
            selectedDoctor    = editPatient.LocalDoctor;

            tbGender.Text      = editPatient.Gender;
            dtpBirthday.Value  = editPatient.Birthday;
            tbInsuranceNr.Text = Convert.ToString(editPatient.InsuranceNr);
            tbNote.Text        = editPatient.Note;

            InitializeAddresses();
            cbInsurance.SelectedIndex = insuranceAgencies.Select(o => o.Id).ToList().IndexOf(selectedInsurance.Id);
            cbDoctor.SelectedIndex    = doctors.Select(o => o.Id).ToList().IndexOf(selectedDoctor.Id);

            InitializeAddresses();
        }
Esempio n. 39
0
 private bool CheckPatientData(Model.Patient patient, out string msg)
 {
     msg = "";
     if (patient == null)
     {
         msg = "未填入用户";
         return(false);
     }
     else if (patient.D_ID < 0)
     {
         msg = "医生信息出错!";
         return(false);
     }
     else if ("".Equals(patient.Gender) || patient.Gender == null)
     {
         msg = "未填入性别信息";
         return(false);
     }
     else if ("".Equals(patient.Idcard) || patient.Idcard == null)
     {
         msg = "未填入身份证信息";
         return(false);
     }
     else if (patient.Old <= 0)
     {
         msg = "未填入年龄信息";
         return(false);
     }
     else if ("".Equals(patient.P_name) || patient.P_name == null)
     {
         msg = "未填入病人姓名";
         return(false);
     }
     else if ("".Equals(patient.Tel) || patient.Tel == null)
     {
         msg = "未填入联系方式";
         return(false);
     }
     return(true);
 }
Esempio n. 40
0
        public bool AddPatient(Model.Patient patient, Model.Patient_Tab patient_tab, out string msg)
        {
            msg = "";
            bool isOK = false;

            if (!CheckPatientData(patient, out msg))
            {
                return(isOK);
            }
            using (TransactionScope tsCope = new TransactionScope())
            {
                try
                {
                    int id = pa.AddPatientRetId(patient);
                    if (id != -1)
                    {
                        patient_tab.Pid = id;
                        if (!CheckPatientTabData(patient_tab, out msg))
                        {
                            return(false);
                        }
                        if ((paT.AddPatientTab(patient_tab)))
                        {
                            isOK = true;
                        }
                    }
                }
                catch (Exception exp)
                {
                    msg = exp.Message;
                    return(false);
                }

                tsCope.Complete();
            }
            msg = "插入病人信息失败!";
            return(isOK);
        }
        public void Load()
        {
            Controller.PatientController PatientController   = new Controller.PatientController();
            Model.Examination            selectedExamination = (Model.Examination)dh.lvDataBinding.SelectedItems[0];
            Model.Patient selectedPatient = PatientController.GetOnePatient(selectedExamination.patient.User.Username);
            lbAddressPatient.Content     = selectedPatient.User.Address;
            lbuUsernamePatient.Content   = selectedPatient.User.Username;
            lbuJMBG.Content              = selectedPatient.User.Jmbg;
            lbNamePatient.Content        = selectedPatient.User.Name;
            lbGender.Content             = selectedPatient.User.Gender;
            lbDateOfBirthPatient.Content = selectedPatient.User.DateOfBirth;
            lbSurnamePatient.Content     = selectedPatient.User.Surname;
            lbNumberPatient.Content      = selectedPatient.User.PhoneNumber;


            List <Model.Anamnesis> anamneses = anamControl.GetAllAnamnesisPatient(selectedPatient.User.Username);

            lvDataBinding.Items.Clear();
            foreach (Model.Anamnesis an in anamneses)
            {
                lvDataBinding.Items.Add(an);
                Console.WriteLine(an.DescriptionAnamnesis);
            }
        }
Esempio n. 42
0
        public List <Model.Patient> LoadPatient()
        {
            List <Model.Patient> patients = new List <Model.Patient>();

            try
            {
                String       line;
                StreamReader sr = new StreamReader(FileLocation);

                while ((line = sr.ReadLine()) != null)
                {
                    Console.WriteLine(line);
                    string[] words = line.Split(',');


                    Model.Patient pa = new Model.Patient(words[0], words[1], words[2], words[3],
                                                         Convert.ToDateTime(words[4]), (Model.Gender)Enum.Parse(typeof(Model.Gender),
                                                                                                                words[5]), long.Parse(words[6]), words[7], words[8], int.Parse(words[9]),
                                                         int.Parse(words[10]));

                    patients.Add(pa);
                }

                sr.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }

            return(patients);
        }
        private void cbPatientName_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            _selectedPatient = (cbPatientName.SelectedValue as Controllers.ComboBoxItem).Value as Model.Patient;

            FillPatientFields(_selectedPatient);
        }
        private void cbPatients_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            _selectedPatient = cbPatients.SelectedValue == null ? null : (cbPatients.SelectedValue as Controllers.ComboBoxItem).Value as Model.Patient;

            FillPatientFields();
            ShowActiveStatement();
            UpdatePositiveBalances();
            UpdateTotals();
        }
Esempio n. 45
0
        public void FillListPatient()
        {
            ServicePatient.ServicePatientClient service = new ServicePatient.ServicePatientClient();
            try
            {
                ServicePatient.Patient[] listPatient = service.GetListPatient();
                this._allPatient = new List<Model.Patient>();
                List<Model.Observation> listObs = new List<Model.Observation>();

                foreach (ServicePatient.Patient pat in listPatient)
                {
                    Model.Patient patient = new Model.Patient
                    {
                        Birth = pat.Birthday,
                        Firstname = pat.Firstname,
                        Name = pat.Name,
                        Id = pat.Id
                    };

                    if (pat.Observations != null)
                    {
                        foreach (ServicePatient.Observation obs in pat.Observations)
                        {
                            Model.Observation observation = new Model.Observation
                            {
                                Comments = obs.Comment,
                                Date = obs.Date,
                                Pic = obs.Pictures ?? new List<byte[]>().ToArray(),
                                Prescriptions = obs.Prescription.ToList() ?? new List<string>(),
                                Pressure = obs.BloodPressure,
                                Weight = obs.Weight
                            };
                            listObs.Add(observation);
                        }
                        patient.Obs = listObs;
                    }

                    patient.Name = FirstUpper(patient.Name);
                    patient.Firstname = FirstUpper(patient.Firstname);
                    patient.Birthday = pat.Birthday.ToString("dd/MM/yyyy");

                    this._allPatient.Add(patient);
                }
                ListPatient = new ObservableCollection<Model.Patient>(this._allPatient);
            }
            catch
            {
                MainWindow main = new MainWindow();
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                View.Patients view = new colle_tMedecine.View.Patients();
                ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
                view.DataContext = vm;

                main.navigate((UserControl)mainwindow.contentcontrol.Content, view);
            }
        }
        public RequestEmailModal(Model.Patient patient)
		{
			this.InitializeComponent();

            _patient = patient;
		}
        private void btnAddUpdate_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (!_isUpdateDentalInitialNote)
            {
                _patientToUpdate = new Model.Patient()
                {
                    FullName = txtFullName.Text.Trim(),
                    IsDCM = false,
                    IsDeleted = false,
                    CreatedDate = DateTime.Now
                };

                if (!Controllers.BusinessController.Instance.Add<Model.Patient>(_patientToUpdate))
                {
                    MessageBox.Show("Error al crear el paciente", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
            }

            if (UpdateInitialDentalNote())
                this.Close();
            else
                MessageBox.Show("Error al guardar la nota inicial dental del paciente", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
        }
        private void btnAddUpdatePatient_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            int expNumber;
            string expNumberText = txtExpNumber.Text.Trim();
            string patientFirstName = txtPatientFirstName.Text.Trim();
            string patientLastName = txtPatientLastName.Text.Trim();
            string homePhone = txtHomePhone.Text.Trim();
            string cellPhone = txtCellPhone.Text.Trim();
            string email = txtEmail.Text.Trim();

            if (AreValidFields(patientFirstName, patientLastName, homePhone, cellPhone, email, expNumberText, out expNumber) == false)
            {
                return;
            }

            if (_isUpdatePatientInfo)
            {
                _patientToUpdate.AssignedId = expNumber;
                _patientToUpdate.FirstName = patientFirstName;
                _patientToUpdate.LastName = patientLastName;
                _patientToUpdate.HomePhone = homePhone;
                _patientToUpdate.CellPhone = cellPhone;
                _patientToUpdate.Email = email;

                UpdateUser(_patientToUpdate);
            }
            else
            {
                Model.Patient patientToAdd = new Model.Patient()
                {
                    AssignedId = expNumber,
                    FirstName = patientFirstName,
                    LastName = patientLastName,
                    HomePhone = homePhone,
                    CellPhone = cellPhone,
                    Email = txtEmail.Text.Trim(),
                    HasHealthInsurance = _hasHealthInsurance,
                    IsDiverse = _isDiverse,
                    IsDentegra = _isDentegra,
                    CaptureDate = DateTime.Now,
                    IsDeleted = false,
                    DataCapturerId = _userLoggedIn.UserId
                };

                AddUser(patientToAdd);
            }
        }
Esempio n. 49
0
 private Model.Patient ParseData()
 {
     Model.Patient patient = new Model.Patient();
     patient.D_ID = UserHelper.id;
     patient.Pid = Convert.ToInt32(id_tb.Text);
     patient.P_name = name_tb.Text;
     patient.Tel = phone_tb.Text;
     if (FileName != null && !"".Equals(FileName))
     {
         if ((pb_patient.Image != null))
             pb_patient.Image.Dispose();
         patient.Thumb = Common.Util.GetImageByte(FileName);
     }
     patient.P_name = name_tb.Text;
     patient.Gender = gender_tb.Text;
     return patient;
 }