async void View_OnAddDutyPatientList(object sender, Views.DutyPatientListEventArgs e)
 {
     try
     {
         iDB.IsDataInitComplete = false;
         await AddDutyPatient(e.SelectedPatient);
     }
     finally
     {
         iDB.IsDataInitComplete = true;
     }
 }
示例#2
0
        private void btnAddPatient_Click(object sender, RoutedEventArgs e)
        {
            if (listDutyPatient.SelectedItems.Count == 0)
            {
                return;
            }
            this.BottomAppBar.IsOpen = false;
            List <Data.Patient> patientList = new List <Data.Patient>();

            foreach (object op in listDutyPatient.SelectedItems)
            {
                patientList.Add(op as Data.Patient);
            }
            Views.DutyPatientListEventArgs dtArgs = new Views.DutyPatientListEventArgs("");
            dtArgs.SelectedPatient = patientList;
            OnAddDutyPatientList(null, dtArgs);
        }
        async void View_OnAddDutyPatientList(object sender, Views.DutyPatientListEventArgs e)
        {
            Models.SyncFromServerModel ServerSync = new Models.SyncFromServerModel();
            int maxValue = e.SelectedPatient.Count * 6 + 1;
            int i = 1, pCount = 1;

            View.ExeShowSyncProgress(i, maxValue, "正在同步选择的病人至本地 ... ");
            //1.同步病人至本地库
            ServerSync.SyncDevicePatientsToLocal(e.SelectedPatient);
            foreach (Patient patient in e.SelectedPatient)
            {
                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人医嘱至本地库 ... ");
                //2.同步病人医嘱至本地库
                await ServerSync.SyncDevicePatientAdvice(patient.InhosID);

                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人检查报告 ... ");
                //3.同步病人检查报告
                await ServerSync.SyncDevicePatientCheckReport(patient.InhosID);

                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人病历文书 ... ");
                //4.同步病人病历文书
                await ServerSync.SyncDevicePatientEmrDoc(patient.InhosID);

                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人化验报告 ... ");
                //5.同步病人化验报告
                await ServerSync.SyncDevicePatientLisAdviceResult(patient.IllcaseNo);

                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人的医生查房日志 ... ");
                //6.同步医生查房日志
                await ServerSync.SyncDeviceDoctorCheckLog(patient.InhosID);

                i++;
                View.ExeShowSyncProgress(i, maxValue, "正在同步第 " + pCount.ToString() + " 个病人费用信息 ... ");
                //7.同步病人费用信息
                await ServerSync.SyncDevicePatientFee(patient.InhosID);

                pCount++;
            }
            Model.SaveDutyPatientToLocal(iCommon.DoctorID, e.SelectedPatient);
            View.ExeGoBack();
        }
        async void View_OnShowDutyPatientList(object sender, Views.DutyPatientListEventArgs e)
        {
            List <Data.Patient> patientList = await Model.QueryIllfieldPatientList(e.IllfieldID);

            View.ExeShowDutyPatientList(patientList);
        }