Пример #1
0
        private void updatePatientsMsg(String strPatientCardNum)
        {
            var vm = this.DataContext as HISGUIFeeVM;

            CommContracts.Patient patient = new CommContracts.Patient();
            string strAge = "";

            if (string.IsNullOrEmpty(strPatientCardNum))
            {
                vm.CurrentPatient = patient;
                this.AgeBox.Text  = strAge;
                return;
            }

            CommClient.Patient patientClient = new CommClient.Patient();

            string ErrorMsg = "";

            patient = patientClient.ReadCurrentPatientByPatientCardNum(strPatientCardNum, ref ErrorMsg);

            if (patient == null)
            {
                MessageBox.Show(ErrorMsg);
            }
            else
            {
                vm.CurrentPatient = patient;

                strAge           = IDCardHellper.GetAge(patient.BirthDay.Value.Year, patient.BirthDay.Value.Month, patient.BirthDay.Value.Day);
                this.AgeBox.Text = strAge;
            }
        }
Пример #2
0
        private void ReNewBtn_Click(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as HISGUIPatientCardVM;

            CommClient.Patient client = new CommClient.Patient();
            vm.CurrentPatient.PatientCardNo     = client.getNewPatientCardNum();
            vm.CurrentPatient.PatientCardStatus = CommContracts.PatientCardStatusEnum.补办;

            CommContracts.PatientCardManage manage = new CommContracts.PatientCardManage();
            manage.Patient        = vm.CurrentPatient;
            manage.PatientID      = vm.CurrentPatient.ID;
            manage.CardNo         = vm.CurrentPatient.PatientCardNo;
            manage.CardManageEnum = CommContracts.CardManageEnum.补办卡;
            manage.UserID         = vm.CurrentUser.ID;

            string strMsg = "";

            if (vm.SavePatientCardManage(manage, ref strMsg))
            {
                MessageBox.Show("补办卡完成!");
                newPatientCard();
            }
            else
            {
                MessageBox.Show(strMsg);
            }
        }
Пример #3
0
        private void CallBtn_Click(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as HISGUIDoctorVM;

            vm.IsClinicOrInHospital = true;
            String strPatientCardNum = Interaction.InputBox("请输入就诊卡卡号", "读卡", "", 100, 100);

            if (string.IsNullOrEmpty(strPatientCardNum))
            {
                return;
            }
            CommClient.Patient patientClient = new CommClient.Patient();
            string             ErrorMsg      = "";

            CommContracts.Patient patient = patientClient.ReadCurrentPatientByPatientCardNum(strPatientCardNum, ref ErrorMsg);



            CommClient.Registration           registrationClient = new CommClient.Registration();
            List <CommContracts.Registration> list = registrationClient.GetPatientRegistrations(patient.ID, DateTime.Now);

            if (list == null || list.Count() <= 0)
            {
                return;
            }
            vm.CurrentRegistration = list.ElementAt(0);
        }
Пример #4
0
        //// 得到所有的号源种类
        //public List<CommContracts.SignalType> GetAllSignalItem(string strName = "")
        //{
        //    CommClient.SignalItem myd = new CommClient.SignalItem();

        //    List<CommContracts.SignalType> list = new List<CommContracts.SignalType>();
        //    list = myd.GetAllSignalItem(strName);
        //    return list;
        //}

        //// 删除供号源种类
        //public bool DeleteSignalItem(int SignalItemID)
        //{
        //    CommClient.SignalItem myd = new CommClient.SignalItem();
        //    if (myd.DeleteSignalItem(SignalItemID))
        //    {
        //        return true;
        //    }

        //    return false;
        //}

        // 得到所有的患者
        public List <CommContracts.Patient> GetAllPatient(string strName = "")
        {
            CommClient.Patient myd = new CommClient.Patient();

            List <CommContracts.Patient> list = new List <CommContracts.Patient>();

            list = myd.GetAllPatient(strName);
            return(list);
        }
Пример #5
0
        // 删除供患者
        public bool DeletePatient(int PatientID)
        {
            CommClient.Patient myd = new CommClient.Patient();
            if (myd.DeletePatient(PatientID))
            {
                return(true);
            }

            return(false);
        }
Пример #6
0
        private void ReturnBtn_Click(object sender, RoutedEventArgs e)
        {
            // 保存退款
            if (string.IsNullOrEmpty(this.FeeNumBox.Text))
            {
                return;
            }

            if (Math.Round(Decimal.Parse(this.FeeNumBox.Text), 2) < 0)
            {
                return;
            }

            if (Math.Round(Decimal.Parse(this.BalanceBox.Text), 2) - Math.Round(Decimal.Parse(this.FeeNumBox.Text), 2) < 0)
            {
                return;
            }

            var vm = this.DataContext as HISGUIPatientCardVM;

            CommContracts.PatientCardPrePay prePay = new CommContracts.PatientCardPrePay();
            prePay.PrePayType    = CommContracts.PrePayTypeEnum.退款;
            prePay.PrePayMoney   = Math.Round(Decimal.Parse(this.FeeNumBox.Text), 2);
            prePay.PrePayWayEnum = (CommContracts.PrePayWayEnum) this.PrePayWayCombo.SelectedItem;
            prePay.PatientID     = vm.CurrentPatient.ID;
            prePay.UserID        = vm.CurrentUser.ID;
            prePay.CurrentTime   = DateTime.Now;

            CommClient.PatientCardPrePay prePayClient = new CommClient.PatientCardPrePay();
            int prePayID = 0; string ErrorMsg = "";

            if (prePayClient.SavePrePay(prePay, ref prePayID, ref ErrorMsg))
            {
                CommClient.Patient patientClient = new CommClient.Patient();
                vm.CurrentPatient.PatientCardBalance -= Math.Round(Decimal.Parse(this.FeeNumBox.Text), 2);

                if (patientClient.UpdatePatient(vm.CurrentPatient, ref ErrorMsg))
                {
                    MessageBox.Show("OK");
                    updatePatientsMsg(vm.CurrentPatient.PatientCardNo);
                }
                else
                {
                    vm.CurrentPatient.PatientCardBalance += Math.Round(Decimal.Parse(this.FeeNumBox.Text), 2);
                    prePayClient.DeletePrePay(prePayID);
                    MessageBox.Show("Error:" + ErrorMsg);
                }
            }
            else
            {
                MessageBox.Show("Error" + ErrorMsg);
            }
        }
        private void ReadCardBtn_Click(object sender, RoutedEventArgs e)
        {
            // 读卡
            //var vm = this.DataContext as HISGUIFeeVM;
            //if (InManageCheck.IsChecked.Value)
            //{
            //    MyCurrentInpatient = vm?.ReadNewInHospital(7);
            //}
            //else if (LeaveManageCheck.IsChecked.Value)
            //{
            //    MyCurrentInpatient = vm?.ReadCurrentInHospital(9);
            //}
            //else if (RecallManageCheck.IsChecked.Value)
            //{
            //    MyCurrentInpatient = vm?.ReadLeavedPatient(9);
            //}

            //updateInDateToView();
            //updateLeaveDateToView();
            String strPatientCardNum = Interaction.InputBox("请输入就诊卡卡号", "读卡", "", 100, 100);

            if (string.IsNullOrEmpty(strPatientCardNum))
            {
                return;
            }

            var vm = this.DataContext as HISGUIFeeVM;

            CommContracts.Patient tempPatient = new CommContracts.Patient();

            CommClient.Patient patientClient = new CommClient.Patient();

            string ErrorMsg = "";

            tempPatient       = patientClient.ReadCurrentPatientByPatientCardNum(strPatientCardNum, ref ErrorMsg);
            vm.CurrentPatient = tempPatient;

            CommClient.InHospital           registrationClient = new CommClient.InHospital();
            List <CommContracts.InHospital> InHospitalList     = registrationClient.GetAllInHospitalList(0, vm.CurrentPatient.Name);

            if (InHospitalList == null || InHospitalList.Count() <= 0)
            {
                return;
            }

            MyCurrentInpatient = InHospitalList.ElementAt(0);


            updateInDateToView();
            updateLeaveDateToView();
        }
Пример #8
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.Name.Text.Trim()))
            {
                return;
            }

            if (this.GenderCombo.SelectedItem == null)
            {
                return;
            }
            if (bIsEdit)
            {
                Patient.Name         = this.Name.Text.Trim();
                Patient.ZhengJianNum = this.IDCardNo.Text;
                Patient.JiGuan_Sheng = this.JiGuan.Text;
                Patient.Tel          = this.Tel.Text;
                Patient.Gender       = (CommContracts.GenderEnum) this.GenderCombo.SelectedItem;
                Patient.Volk         = (CommContracts.VolkEnum) this.VolkEnumCombo.SelectedItem;
                Patient.BirthDay     = this.BirthDay.SelectedDate;


                CommClient.Patient myd   = new CommClient.Patient();
                string             error = "";
                if (myd.UpdatePatient(Patient, ref error))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.Patient patient = new CommContracts.Patient();
                patient.Name         = this.Name.Text.Trim();
                patient.ZhengJianNum = this.IDCardNo.Text.Trim();
                patient.JiGuan_Sheng = this.JiGuan.Text.Trim();
                patient.Tel          = this.Tel.Text.Trim();
                patient.Gender       = (CommContracts.GenderEnum) this.GenderCombo.SelectedItem;
                patient.Volk         = (CommContracts.VolkEnum) this.VolkEnumCombo.SelectedItem;
                patient.BirthDay     = this.BirthDay.SelectedDate;

                CommClient.Patient myd = new CommClient.Patient();
                if (myd.SavePatient(patient))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }
Пример #9
0
        /// <summary>
        /// 新建卡
        /// </summary>
        private void newPatientCard()
        {
            CommClient.Patient patientClient = new CommClient.Patient();

            CommContracts.Patient tempPatient = new CommContracts.Patient();
            tempPatient.PID           = patientClient.getNewPID();
            tempPatient.PatientCardNo = patientClient.getNewPatientCardNum();

            var vm = this.DataContext as HISGUIPatientCardVM;

            vm.CurrentPatient = tempPatient;


            this.PatientMsgGrid.IsEnabled = true;
            this.bIsEdit            = false;
            this.EditBtn.IsEnabled  = false;
            this.LostBtn.IsEnabled  = false;
            this.ReNewBtn.IsEnabled = false;

            this.txt_Name.Focus();
            this.ManageCardRecordsList.SelectedItems.Clear();
            this.ManageCardRecordsList.ItemsSource = null;
        }
Пример #10
0
 // 读取当前患者的余额
 public decimal GetCurrentPatientBalance(int PatientID)
 {
     CommClient.Patient myd = new CommClient.Patient();
     return(myd.GetCurrentPatientBalance(PatientID));
 }
Пример #11
0
 // 读取当前患者信息
 public CommContracts.Patient ReadCurrentPatient(int PatientID)
 {
     CommClient.Patient myd = new CommClient.Patient();
     return(myd.ReadCurrentPatient(PatientID));
 }
Пример #12
0
 /// <summary>
 /// 更新患者登记信息
 /// </summary>
 public bool UpdatePatientMsg(CommContracts.Patient patient, ref string ErrorMsg)
 {
     CommClient.Patient client = new CommClient.Patient();
     return(client.UpdatePatient(patient, ref ErrorMsg));
 }