public int ControlValue(object obj)
 {
     if (obj == null)
     {
         return(-1);
     }
     Neusoft.HISFC.Integrate.RADT radt = new Neusoft.HISFC.Integrate.RADT();
     Neusoft.HISFC.Object.Fee.Inpatient.FeeItemList itemInfo    = (Neusoft.HISFC.Object.Fee.Inpatient.FeeItemList)obj;
     Neusoft.HISFC.Object.RADT.PatientInfo          patientInfo = radt.GetPatientInfoByPatientNO(itemInfo.Patient.ID);
     this.lbName1.Text      = itemInfo.Patient.Name.ToString();
     this.lbPatientNo1.Text = itemInfo.Patient.PID.PatientNO.ToString();
     this.lbDept1.Text      = patientInfo.PVisit.PatientLocation.Dept.Name;
     this.lbItemName1.Text  = itemInfo.Item.Name;
     this.lbExeDept1.Text   = itemInfo.ExecOper.Dept.Name;
     this.lbItemQty1.Text   = itemInfo.Item.Qty.ToString();
     this.lbCost1.Text      = String.Format("{0:N}", (itemInfo.Item.Price * itemInfo.Item.Qty));
     this.lbCostUp1.Text    = Neusoft.NFC.Function.NConvert.ToCapital(itemInfo.Item.Price * itemInfo.Item.Qty).ToString();
     this.lbNo1.Text        = itemInfo.Order.ID;//医嘱流水号
     this.lbOperCode1.Text  = Neusoft.NFC.Management.Connection.Operator.ID;
     this.lbDate1.Text      = this.inpatientManager.GetDateTimeFromSysDateTime().ToString();
     return(1);
 }
        /// <summary>
        /// 根据输入的住院号/门诊号 查询诊断信息
        /// </summary>
        /// <param name="patientInfo"></param>
        /// <param name="Type"></param>
        /// <returns>-1 出错 0 传入的病人信息为空,不作处理,1 不允许有病案,2病案已经封存,不允许医生修改和查阅 3 查询有数据 4查询没有数据  </returns>
        public int LoadInfo(string InpatientNO) //Neusoft.HISFC.Object.RADT.PatientInfo patientInfo, Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes Type)
        {
            try
            {
                if (this.fpEnter1_Sheet1.RowCount > 0)
                {
                    this.fpEnter1_Sheet1.Rows.Remove(0, this.fpEnter1_Sheet1.RowCount);
                }
                if (InpatientNO == null || InpatientNO == "")
                {
                    //没有该病人的信息
                    MessageBox.Show("请选择病人");
                    return(0);
                }
                this.inpatientNo = InpatientNO;
                Neusoft.HISFC.Object.RADT.PatientInfo             patient  = new Neusoft.HISFC.Object.RADT.PatientInfo();
                Neusoft.HISFC.Integrate.RADT                      pa       = new Neusoft.HISFC.Integrate.RADT();// Neusoft.HISFC.Management.RADT.InPatient();
                Neusoft.HISFC.Integrate.Registration.Registration register = new Neusoft.HISFC.Integrate.Registration.Registration();
                //从住院主表中查旬
                patient = pa.GetPatientInfoByPatientNO(InpatientNO);
                if (patient == null)
                {
                    Neusoft.HISFC.Object.Registration.Register obj = register.GetByClinic(InpatientNO);
                    if (obj == null)
                    {
                        MessageBox.Show("查询病人信息出错");
                        return(-1);
                    }
                    patient           = new Neusoft.HISFC.Object.RADT.PatientInfo();
                    patient.ID        = obj.ID;
                    patient.CaseState = "1";
                }

                if (patient.CaseState == "0")
                {
                    //不允许有病案
                    return(1);
                }
                //定义业务层的类

                Neusoft.HISFC.Management.HealthRecord.Diagnose diag = new Neusoft.HISFC.Management.HealthRecord.Diagnose();
                diagList = new ArrayList();

                if (frmType == Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.DOC) // 医生站录入病历

                {
                    #region  医生站录入病历


                    //目前允许有病历 并且目前没有录入病历  或者标志位位空(默认是允许录入病历)
                    // 医生站录入病例


                    if (patient.CaseState == null || patient.CaseState == "1" || patient.CaseState == "2")
                    {
                        //从医生站录入的信息中查询
                        diagList = diag.QueryCaseDiagnose(patient.ID, "%", Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.DOC);
                    }
                    else
                    {
                        // 病案已经封存已经不允许医生修改和查阅
                        return(2);
                    }

                    #endregion
                }
                else if (frmType == Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.CAS)//病案室录入病历

                {
                    #region 病案室录入病历

                    //目前允许有病历 并且目前没有录入病历  或者标志位位空(默认是允许录入病历)
                    if (patient.CaseState == null || patient.CaseState == "1" || patient.CaseState == "2")
                    {
                        //医生站已经录入病案

                        diagList = diag.QueryCaseDiagnose(patient.ID, "%", Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.DOC);
                    }
                    else if (patient.CaseState == "3")
                    {
                        //病案室已经录入病案

                        diagList = diag.QueryCaseDiagnose(patient.ID, "%", Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.CAS);
                    }
                    else if (patient.CaseState == "4")
                    {
                        //病案已经封存 不允许修改。

                        diagList = diag.QueryCaseDiagnose(patient.ID, "%", Neusoft.HISFC.Object.HealthRecord.EnumServer.frmTypes.CAS);
                        this.fpEnter1_Sheet1.OperationMode = FarPoint.Win.Spread.OperationMode.ReadOnly;
                    }

                    #endregion
                }
                else
                {
                    //没有传入参数 不作任何处理
                }

                if (diagList != null)
                {
                    //查询有数据

                    AddInfoToFP(diagList);
                    return(3);
                }
                else
                {//查询没有数据
                    return(4);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(-1);
            }
        }