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;
            }
        }
        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);
        }
        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();
        }