Beispiel #1
0
        /// <summary>
        /// 添加主麻、助手
        /// </summary>
        /// <param name="apply"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        private int AddRole(OperationAppllication apply, int row)
        {
            ArrayList roles = new ArrayList();

            //先清空主麻、助手
            for (int i = 0; i < apply.RoleAl.Count; i++)
            {
                ArrangeRole role = apply.RoleAl[i] as ArrangeRole;
                if (
                    role.RoleType.ID.ToString() != EnumOperationRole.Anaesthetist.ToString() &&
                    role.RoleType.ID.ToString() != EnumOperationRole.AnaesthesiaHelper.ToString() &&
                    role.RoleType.ID.ToString() != EnumOperationRole.AnaeTmpHelper1.ToString() &&
                    role.RoleType.ID.ToString() != EnumOperationRole.AnaeTmpHelper2.ToString()
                    )
                {
                    roles.Add(role.Clone());
                }
            }

            //添加主麻
            NeuObject obj = fpSpread1_Sheet1.GetTag(row, (int)Cols.anaeDoct) as NeuObject;

            if (obj != null)
            {
                ArrangeRole role = new ArrangeRole(obj);
                role.RoleType.ID = EnumOperationRole.Anaesthetist;//角色编码
                if (obj.Memo == "ZL")
                {
                    role.RoleOperKind.ID = EnumRoleOperKind.ZL;
                }
                else if (obj.Memo == "JB")
                {
                    role.RoleOperKind.ID = EnumRoleOperKind.JB;
                }

                role.OperationNo = apply.ID;
                role.ForeFlag    = "0"; //术前安排
                roles.Add(role);        //加入人员角色对象
            }
            //添加助手
            obj = fpSpread1_Sheet1.GetTag(row, (int)Cols.anaeHelper) as NeuObject;
            if (obj != null)
            {
                ArrangeRole role = new ArrangeRole(obj);

                role.RoleType.ID = EnumOperationRole.AnaesthesiaHelper;//角色编码
                if (obj.Memo == "ZL")
                {
                    role.RoleOperKind.ID = EnumRoleOperKind.ZL;
                }
                else if (obj.Memo == "JB")
                {
                    role.RoleOperKind.ID = EnumRoleOperKind.JB;
                }

                role.OperationNo = apply.ID;
                role.ForeFlag    = "0"; //术前安排
                roles.Add(role);        //加入人员角色对象
            }

            //添加临时麻醉助手1
            string tmpHelper1 = fpSpread1_Sheet1.GetText(row, (int)Cols.anaeTmpHelper1);

            if (tmpHelper1 != null && tmpHelper1 != "")
            {
                ArrangeRole role = new ArrangeRole();
                role.ID          = "777777";
                role.RoleType.ID = EnumOperationRole.AnaeTmpHelper1;//角色编码
                role.Name        = tmpHelper1;
                role.OperationNo = apply.ID;
                role.ForeFlag    = "0"; //术前安排
                roles.Add(role);        //加入人员角色对象
            }

            //添加临时麻醉助手2
            string tmpHelper2 = fpSpread1_Sheet1.GetText(row, (int)Cols.anaeTmpHelper2);

            if (tmpHelper2 != null && tmpHelper2 != "")
            {
                ArrangeRole role = new ArrangeRole();
                role.ID          = "777777";
                role.RoleType.ID = EnumOperationRole.AnaeTmpHelper2;//角色编码
                role.Name        = tmpHelper2;
                role.OperationNo = apply.ID;
                role.ForeFlag    = "0"; //术前安排
                roles.Add(role);        //加入人员角色对象
            }


            apply.RoleAl = roles;

            return(0);
        }
        /// <summary>
        /// 将界面中显示的信息传入到m_objAnaeRec成员对象中
        /// </summary>
        /// <return>0 success -1 fail</return>
        private int GetCtrlInfo()
        {
            try
            {
                if (this.txtPatient.Text.Trim() == "")
                {
                    MessageBox.Show("请输入手术患者住院号或门诊号!", "提示",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtPatient.Focus();
                    return(-1);
                }
                //是否记帐
                if (this.cmbCharge.Tag.ToString() != "")
                {
                    this.anaeRecord.IsCharged = Neusoft.FrameWork.Function.NConvert.ToBoolean(int.Parse(this.cmbCharge.Tag.ToString()));
                }
                //麻醉方式
                this.anaeRecord.OperationApplication.AnesType.ID   = this.cmbAnaeType.Tag.ToString();
                this.anaeRecord.OperationApplication.AnesType.Name = this.cmbAnaeType.Text;
                //麻醉时间
                this.anaeRecord.AnaeDate = this.dtpAnaeDate.Value;
                //麻醉效果
                this.anaeRecord.AnaeResult.ID   = this.cmbAnaeResult.Tag.ToString();
                this.anaeRecord.AnaeResult.Name = this.cmbAnaeResult.Text;
                //麻醉医师
                ArrayList alRole = new ArrayList();

                foreach (ListViewItem lviAnae in this.lvAnaeDoct.Items)
                {
                    ArrangeRole role = lviAnae.Tag as ArrangeRole;
                    alRole.Add(lviAnae.Tag);
                }
                //麻醉助手
                foreach (ListViewItem lviAnaeHelper in this.lvAnaeHelper.Items)
                {
                    ArrangeRole role = lviAnaeHelper.Tag as ArrangeRole;
                    alRole.Add(lviAnaeHelper.Tag);
                }

                //添加临时麻醉助手1
                string tmpHelper1 = this.txtTmpHelper1.Text;
                if (tmpHelper1 != null && tmpHelper1 != "")
                {
                    ArrangeRole role = new ArrangeRole();
                    role.ID          = "777777";
                    role.RoleType.ID = EnumOperationRole.AnaeTmpHelper1;//角色编码
                    role.Name        = tmpHelper1;
                    role.OperationNo = this.anaeRecord.OperationApplication.ID;
                    role.ForeFlag    = "0"; //术前安排
                    alRole.Add(role);       //加入人员角色对象
                }

                //添加临时麻醉助手2
                string tmpHelper2 = this.txtTmpHelper2.Text;
                if (tmpHelper2 != null && tmpHelper2 != "")
                {
                    ArrangeRole role = new ArrangeRole();
                    role.ID          = "777777";
                    role.RoleType.ID = EnumOperationRole.AnaeTmpHelper2;//角色编码
                    role.Name        = tmpHelper2;
                    role.OperationNo = this.anaeRecord.OperationApplication.ID;
                    role.ForeFlag    = "0"; //术前安排
                    alRole.Add(role);       //加入人员角色对象
                }

                ArrayList al = new ArrayList();

                //先清空主麻、助手
                for (int i = 0; i < this.anaeRecord.OperationApplication.RoleAl.Count; i++)
                {
                    ArrangeRole role = this.anaeRecord.OperationApplication.RoleAl[i] as ArrangeRole;
                    if (
                        role.RoleType.ID.ToString() != EnumOperationRole.Anaesthetist.ToString() &&
                        role.RoleType.ID.ToString() != EnumOperationRole.AnaesthesiaHelper.ToString() &&
                        role.RoleType.ID.ToString() != EnumOperationRole.AnaeTmpHelper1.ToString() &&
                        role.RoleType.ID.ToString() != EnumOperationRole.AnaeTmpHelper2.ToString()
                        )
                    {
                        al.Add(role.Clone());
                    }
                }

                al.AddRange(alRole);

                this.anaeRecord.OperationApplication.RoleAl = al;


                //是否入PACU
                this.anaeRecord.IsPACU = this.cbxIsPacu.Checked;
                //判断出入PACU室时间的合理性:
                if (this.dtpInPacuDate.Value > this.dtpOutPacuDate.Value)
                {
                    MessageBox.Show("出PACU室时间 不应小于 进PACU室时间", "提示",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.dtpOutPacuDate.Focus();
                    return(-1);
                }
                //入室时间
                this.anaeRecord.InPacuDate = this.dtpInPacuDate.Value;
                //出室时间
                this.anaeRecord.OutPacuDate = this.dtpOutPacuDate.Value;
                //入室状态
                this.anaeRecord.InPacuStatus.ID   = this.cmbInStatus.Tag.ToString();
                this.anaeRecord.InPacuStatus.Name = this.cmbInStatus.Text;
                //出室状态
                this.anaeRecord.OutPacuStatus.ID   = this.cmbOutStatus.Tag.ToString();
                this.anaeRecord.OutPacuStatus.Name = this.cmbOutStatus.Text;
                //是否镇痛
                this.anaeRecord.IsDemulcent = this.cbxIsDemulcent.Checked;
                //镇痛方式
                this.anaeRecord.DemulcentType.ID   = this.cmbDemuKind.Tag.ToString();
                this.anaeRecord.DemulcentType.Name = this.cmbDemuKind.Text;
                //泵型
                this.anaeRecord.DemulcentModel.ID   = this.cmbDemuModel.Tag.ToString();
                this.anaeRecord.DemulcentModel.Name = this.cmbDemuModel.Text;
                //镇痛天数
                if (this.txtDemuDays.Text != "")
                {
                    this.anaeRecord.DemulcentDays = int.Parse(this.txtDemuDays.Text);
                }
                //拔管时间
                this.anaeRecord.PullOutDate = this.dtpPullOutDate.Value;
                //拔管人
                if (this.txtPullOutOpcd.Tag != null)
                {
                    this.anaeRecord.PullOutOperator.ID   = this.txtPullOutOpcd.Tag.ToString();
                    this.anaeRecord.PullOutOperator.Name = this.txtPullOutOpcd.Text;
                }
                //镇痛效果
                this.anaeRecord.DemulcentEffect.ID   = this.cmbDemuResult.Tag.ToString();
                this.anaeRecord.DemulcentEffect.Name = this.cmbDemuResult.Text;
                //备注
                this.anaeRecord.Memo = this.txtRemark.Text;
            }
            catch { return(-1); }
            return(0);
        }