예제 #1
0
 void AddAdvice()
 {
     Data.PadAdvice padAdvice = new Data.PadAdvice();
     padAdvice.PAID        = Guid.NewGuid().ToString();
     padAdvice.DeviceID    = CJia.iSmartMedical.iCommon.DeviceID;
     padAdvice.InhosID     = iCommon.Patient.InhosID;
     padAdvice.PatientName = iCommon.Patient.PatientName;
     padAdvice.DoctorID    = CJia.iSmartMedical.iCommon.DoctorID;
     padAdvice.DoctorName  = CJia.iSmartMedical.iCommon.DoctorName;
     Data.iCode AdviceType = txtAdviceType.Tag as Data.iCode;
     padAdvice.AdviceTypeCode = AdviceType.Code;
     padAdvice.AdviceTypeName = AdviceType.Name;
     Data.iCode StandingFlag = this.txtStandingFlag.Tag as Data.iCode;
     padAdvice.StandingTypeCode = StandingFlag.Code;
     padAdvice.StandingTypeName = StandingFlag.Name;
     Data.iAdvice Advice = this.txtAdviceName.Tag as Data.iAdvice;
     padAdvice.AdviceID    = Advice.AID;
     padAdvice.HiSAdviceID = Advice.AdviceID;
     padAdvice.AdviceName  = Advice.AdviceName;
     padAdvice.CommonName  = Advice.CommonName;
     padAdvice.Spec        = Advice.Spec;
     padAdvice.GroupIndex  = GroupIndex;
     padAdvice.Dosage      = txtDosage.Text.Trim();
     padAdvice.DosageUnit  = Advice.Unit;
     padAdvice.Amount      = "1";
     padAdvice.AmountUnit  = Advice.Unit;
     Data.iUsage iu = txtUsage.Tag as Data.iUsage;
     if (iu != null)
     {
         padAdvice.UsageID   = iu.UsageID;
         padAdvice.UsageName = iu.UsageName;
     }
     Data.iFrequency iq = txtFrequence.Tag as Data.iFrequency;
     if (iq != null)
     {
         padAdvice.FrequenceID   = iq.FrequencyID;
         padAdvice.FrequenceName = iq.FrequencyName;
     }
     padAdvice.PreStartDate   = "";
     padAdvice.PreStopDate    = "";
     padAdvice.Notes          = txtNotes.Text.Trim();
     padAdvice.AdviceShowName = padAdvice.AdviceName + " (" + padAdvice.Spec + ") " + padAdvice.Dosage + padAdvice.DosageUnit;
     padAdvice.CreateDate     = CJia.iSmartMedical.iCommon.DateNow;
     padAdvice.Status         = "有效";
     padAdvice.SyncStatus     = "未同步";
     padAdvice.SyncDate       = "";
     AdviceList.Add(padAdvice);
     listNewAdvice.ItemsSource = AdviceList;
     ClearAdvice();
     txtAdviceName.Focus(FocusState.Programmatic);
 }
예제 #2
0
 private void ConfirmSelectItem()
 {
     if (ListDict[CurrentInputIndex] != null)
     {
         if (ListDict[CurrentInputIndex].SelectedItem != null)
         {
             InputDict[CurrentInputIndex].Tag  = ListDict[CurrentInputIndex].SelectedItem;
             InputDict[CurrentInputIndex].Text = ListDict[CurrentInputIndex].SelectedItem.ToString();
             if (CurrentInputIndex == 2)
             { //医嘱
                 Data.iAdvice advice = InputDict[CurrentInputIndex].Tag as Data.iAdvice;
                 this.txtSpec.Text = advice.Spec;
                 this.txtUnit.Text = advice.Unit;
                 if (advice.DefaultDosage.Length > 0 && Convert.ToDecimal(advice.DefaultDosage) > 0)
                 {
                     this.txtDosage.Text = advice.DefaultDosage;
                 }
                 if (advice.DefaultUsage.Length > 0)
                 {
                     Data.iUsage iu = this.UsageData.Find(ud => ud.UsageID == advice.DefaultUsage);
                     if (iu != null)
                     {
                         this.txtUsage.Text = iu.UsageName;
                         this.txtUsage.Tag  = iu;
                     }
                 }
                 if (advice.DefaultFrequency.Length > 0)
                 {
                     Data.iFrequency fq = this.FrequenceData.Find(fd => fd.FrequencyID == advice.DefaultFrequency);
                     if (fq != null)
                     {
                         this.txtFrequence.Text = fq.FrequencyName;
                         this.txtUsage.Tag      = fq;
                     }
                 }
             }
             NextInput();
         }
     }
 }