Ejemplo n.º 1
0
        /// <summary>
        /// 加载部位列表
        /// </summary>
        /// <param name="itemData"></param>
        private void loadBodyPart(ExamItemData itemData)
        {
            try
            {
                _isLoadBodypart = true;
                lstBodyPart.Items.Clear();

                if (itemData == null)
                {
                    return;
                }

                foreach (JExamBodypartSetting bps in itemData.项目信息.可选部位)
                {
                    //根据部位ID,提取部位信息
                    DataTable dtBodypart = _bpModel.GetBodypartInfoByID(bps.部位ID);

                    //显示部位分组和信息
                    if (dtBodypart != null)
                    {
                        BodypartInfoData bodypartData = new BodypartInfoData();
                        bodypartData.BindRowData(dtBodypart.Select()[0]);
                        ListViewGroup lvg = new ListViewGroup(bodypartData.分组标记);
                        if (lstBodyPart.Groups.Contains(lvg) == false)
                        {
                            lstBodyPart.Groups.Add(lvg);
                        }

                        ListViewGroup lvgCur = GetCurGroup(bodypartData.分组标记);

                        ListViewItem itemNew = new ListViewItem(new string[] { bodypartData.部位名称 }, 0, lvgCur);

                        itemNew.Name = bodypartData.部位ID;
                        //itemNew.SubItems.Add("□").Name = "默认选择";//✔☑
                        itemNew.Tag     = bodypartData;
                        itemNew.Checked = (bps.默认选择 == true);
                        lstBodyPart.Items.Add(itemNew);
                    }
                }
                if (itemData.项目信息.可选部位.Count > 0)
                {
                    lstBodyPart.Items[0].Selected = true;
                    lstBodyPart.Select();
                }
                _isLoadBodypart = false;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
            finally
            {
                _isLoadBodypart = false;
            }
        }
Ejemplo n.º 2
0
        private void lstBodyPart_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //初始化方法列表
                lstWays.Clear();
                lstWays.Enabled = false;

                if (lstBodyPart.SelectedItems.Count <= 0)
                {
                    return;
                }

                ExamItemData itemData = trvItems.SelectedNode.Tag as ExamItemData;

                BodypartInfoData bodypartData = lstBodyPart.SelectedItems[0].Tag as BodypartInfoData;
                if (bodypartData == null)
                {
                    return;
                }

                //绑定方法数据
                BindBodypartWay(bodypartData);

                lstWays.Enabled = lstBodyPart.SelectedItems[0].Checked;

                //勾选默认方法
                JExamBodypartSetting bodypartSetting = null;

                if (itemData.项目信息.可选部位.Count > 0)
                {
                    int index = (itemData.项目信息.可选部位 as List <JExamBodypartSetting>).FindIndex(T => T.部位ID == bodypartData.部位ID);

                    if (index >= 0)
                    {
                        bodypartSetting = itemData.项目信息.可选部位[index];
                    }
                }

                ResetWaySetting(bodypartSetting);
                showBodyPartWays();
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 3
0
        private void butDelWay_Click(object sender, EventArgs e)
        {
            try
            {
                if (dataGridView1.SelectedRows.Count <= 0)
                {
                    MessageBox.Show("未选择需要删除的检查方法,不能执行此操作。", "提示");
                    return;
                }


                BodypartInfoData bodypartData = listView1.SelectedItems[0].Tag as BodypartInfoData;

                string wayName = dataGridView1.SelectedRows[0].Cells["检查方法"].Value.ToString();
                //删除弹出提示:
                if (MessageBox.Show("是否删除检查方法:" + wayName + "的数据?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                int delIndex = (bodypartData.部位信息.互斥方法 as List <JBodypartWay>).FindIndex(T => T.方法名称 == wayName);

                if (delIndex >= 0)
                {
                    bodypartData.部位信息.互斥方法.RemoveAt(delIndex);
                }
                else
                {
                    delIndex = (bodypartData.部位信息.共用方法 as List <JBodypartWay>).FindIndex(T => T.方法名称 == wayName);
                    if (delIndex >= 0)
                    {
                        bodypartData.部位信息.共用方法.RemoveAt(delIndex);
                    }
                }

                _bpm.UpdateBodypartWay(bodypartData);

                BindBodypartWay(bodypartData);

                ButtonHint.Start(sender as Button, "OK");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 4
0
        private void NewView(BodypartInfoData bodypartData)
        {
            string gn = (string.IsNullOrEmpty(bodypartData.分组标记)) ? "未分组" : bodypartData.分组标记;

            ListViewGroup lvgCur = GetCurGroup(gn);

            if (lvgCur == null)
            {
                lvgCur = new ListViewGroup(gn);
                listView1.Groups.Add(lvgCur);
            }

            ListViewItem itemNew = new ListViewItem(new string[] { bodypartData.部位名称, gn }, 0, lvgCur);

            //添加部位后需要定位。新增查找项
            itemNew.Name = bodypartData.部位ID;
            itemNew.Tag  = bodypartData;

            listView1.Items.Add(itemNew);

            listView1.View = View.Details;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 应用部位方法
        /// </summary>
        /// <param name="isOnlyToGroup"></param>
        private void ApplyBodypartWay(bool isOnlyToGroup)
        {
            BodypartInfoData bodypartData = listView1.SelectedItems[0].Tag as BodypartInfoData;

            foreach (ListViewItem lvi in listView1.Items)
            {
                if (listView1.SelectedItems[0].Equals(lvi))
                {
                    continue;
                }

                BodypartInfoData curBodypartData = lvi.Tag as BodypartInfoData;

                if (isOnlyToGroup)
                {
                    //未分组对象为null,添加判断
                    if (curBodypartData.分组标记 != bodypartData.分组标记)
                    {
                        continue;
                    }
                }

                curBodypartData.部位信息.互斥方法.Clear();
                foreach (JBodypartWay bw in bodypartData.部位信息.互斥方法)
                {
                    curBodypartData.部位信息.互斥方法.Add(bw.Clone());
                }

                curBodypartData.部位信息.共用方法.Clear();
                foreach (JBodypartWay bw in bodypartData.部位信息.共用方法)
                {
                    curBodypartData.部位信息.共用方法.Add(bw.Clone());
                }

                _bpm.UpdateBodypartWay(curBodypartData);
            }
        }
Ejemplo n.º 6
0
        private void butNew_Click(object sender, EventArgs e)
        {
            try
            {
                if (Verify() == false)
                {
                    return;
                }


                BodypartInfoData bodypartData = new BodypartInfoData();

                bodypartData.部位ID      = SqlHelper.GetCmpUID();
                bodypartData.部位名称      = txtBodypartName.Text;
                bodypartData.分组标记      = cbxBodypartGroup.Text;
                bodypartData.影像类别      = cbxImageKind.Text;
                bodypartData.部位信息.备注描述 = rtbDescription.Text;
                bodypartData.部位信息.适用性别 = cbxApplySex.Text;
                bodypartData.部位信息.创建日期 = DateTime.Now;

                bodypartData.部位信息.CopyBasePro(bodypartData);

                _bpm.NewBodypartInfo(bodypartData);

                NewView(bodypartData);

                UpdateBodypartGroup();

                ButtonHint.Start(sender as Button, "OK");
                //添加部位后,焦点定位
                listView1.Items.Find(bodypartData.部位ID, false)[0].Selected = true;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 7
0
        private void SyncSelRowData()
        {
            try
            {
                ClearData();

                if (listView1.SelectedItems.Count <= 0)
                {
                    return;
                }

                BodypartInfoData bodypartData = listView1.SelectedItems[0].Tag as BodypartInfoData;
                if (bodypartData == null)
                {
                    MessageBox.Show("未获取到对应的部位信息。", "提示");
                    return;
                }

                txtBodypartName.Text = bodypartData.部位名称;
                txtBodypartName.Tag  = bodypartData.部位ID;

                cbxBodypartGroup.Text = bodypartData.分组标记;

                if (bodypartData.部位信息 != null)
                {
                    cbxApplySex.Text    = bodypartData.部位信息.适用性别;
                    rtbDescription.Text = bodypartData.部位信息.备注描述;
                }


                BindBodypartWay(bodypartData);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 8
0
        private void butModify_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtBodypartName.Tag == null)
                {
                    MessageBox.Show("请选择需要修改的部位信息。", "提示");
                    return;
                }


                BodypartInfoData bodypartData = GetSelectBodypartInfo();
                if (bodypartData == null)
                {
                    MessageBox.Show("未获取到有效的部位信息。", "提示");
                    return;
                }

                if (Verify(true) == false)
                {
                    return;
                }


                bool isNewGroup = false;
                if (cbxBodypartGroup.Text.Equals(bodypartData.分组标记) == false)
                {
                    isNewGroup = true;
                }

                bodypartData.部位名称      = txtBodypartName.Text;
                bodypartData.分组标记      = cbxBodypartGroup.Text;
                bodypartData.部位信息.适用性别 = cbxApplySex.Text;
                bodypartData.部位信息.备注描述 = rtbDescription.Text;

                bodypartData.部位信息.CopyBasePro(bodypartData);

                _bpm.UpdateBodypartInfo(bodypartData);

                if (isNewGroup)
                {
                    listView1.Items.Remove(listView1.SelectedItems[0]);
                    NewView(bodypartData);
                }
                else
                {
                    listView1.SelectedItems[0].SubItems[0].Text = txtBodypartName.Text;
                    listView1.SelectedItems[0].SubItems[1].Text = (string.IsNullOrEmpty(cbxBodypartGroup.Text)) ? "未分组" : cbxBodypartGroup.Text;
                }



                UpdateBodypartGroup();

                ButtonHint.Start(sender as Button, "OK");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 9
0
        private void BindBodypartWay(BodypartInfoData bodypartData)
        {
            //显示部位方法信息
            DataTable dtWay = new DataTable("部位方法");

            dtWay.Columns.Add("检查方法", typeof(string));
            dtWay.Columns.Add("关系", typeof(string));
            dtWay.Columns.Add("附加方法", typeof(string));

            foreach (JBodypartWay bw in bodypartData.部位信息.互斥方法)
            {
                DataRow drNew = dtWay.NewRow();

                drNew["检查方法"] = bw.方法名称;
                drNew["关系"]   = "互斥方法";
                //添加方法到下拉框
                if (cbxBodypartWayName.Items.IndexOf(bw.方法名称) < 0)
                {
                    cbxBodypartWayName.Items.Add(bw.方法名称);
                }

                string attachWay = "";
                foreach (string way in bw.附加方法)
                {
                    if (string.IsNullOrEmpty(attachWay) == false)
                    {
                        attachWay = attachWay + ";";
                    }
                    attachWay = attachWay + way;
                    //添加附加方法到下拉框
                    AddAttachWay(way);
                }

                drNew["附加方法"] = attachWay;

                dtWay.Rows.Add(drNew);
            }

            foreach (JBodypartWay bw in bodypartData.部位信息.共用方法)
            {
                DataRow drNew = dtWay.NewRow();

                drNew["检查方法"] = bw.方法名称;
                drNew["关系"]   = "可选方法";
                //添加方法到下拉框
                if (cbxBodypartWayName.Items.IndexOf(bw.方法名称) < 0)
                {
                    cbxBodypartWayName.Items.Add(bw.方法名称);
                }

                string attachWay = "";
                foreach (string way in bw.附加方法)
                {
                    if (string.IsNullOrEmpty(attachWay) == false)
                    {
                        attachWay = attachWay + ";";
                    }
                    attachWay = attachWay + way;
                    //添加附加方法到下拉框
                    AddAttachWay(way);
                }

                drNew["附加方法"] = attachWay;

                dtWay.Rows.Add(drNew);
            }

            dataGridView1.DataSource = dtWay;

            dataGridView1.Columns["附加方法"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
Ejemplo n.º 10
0
        private void BindBodyPartData()
        {
            DataTable dtBodypart = _bpm.GetAllBodypartInfo(cbxImageKind.Text);

            foreach (DataColumn dc in dtBodypart.Columns)
            {
                if (("部位名称,分组标记").IndexOf(dc.Caption) >= 0)
                {
                    ColumnHeader columnHeader = new ColumnHeader();
                    columnHeader.Text  = dc.Caption;
                    columnHeader.Name  = dc.Caption;
                    columnHeader.Width = 200;


                    listView1.Columns.Add(columnHeader);
                }
            }


            DataTable dtGroup = _bpm.GetBodypartGroups(cbxImageKind.Text);

            foreach (DataRow dr in dtGroup.Rows)
            {
                string groupTag  = dr["分组标记"].ToString();
                string groupName = (string.IsNullOrEmpty(groupTag)) ? "未分组" : groupTag;

                ListViewGroup lvg = new ListViewGroup(groupName);
                listView1.Groups.Add(lvg);


                if (cbxBodypartGroup.Items.IndexOf(groupTag) < 0)
                {
                    cbxBodypartGroup.Items.Add(groupTag);
                }
            }


            foreach (DataRow drItem in dtBodypart.Rows)
            {
                BodypartInfoData bodypartData = new BodypartInfoData();
                bodypartData.BindRowData(drItem);

                string gn = (string.IsNullOrEmpty(bodypartData.分组标记)) ? "未分组" : bodypartData.分组标记;

                ListViewGroup lvgCur = GetCurGroup(gn);

                ListViewItem itemNew = new ListViewItem(new string[] { bodypartData.部位名称, gn }, 0, lvgCur);
                //添加部位后需要定位。新增查找项
                itemNew.Name = bodypartData.部位ID;
                itemNew.Tag  = bodypartData;
                //初始化科室内的方法名称,附加方法

                foreach (JBodypartWay jb in bodypartData.部位信息.互斥方法)
                {
                    if (cbxBodypartWayName.Items.IndexOf(jb.方法名称) < 0)
                    {
                        cbxBodypartWayName.Items.Add(jb.方法名称);
                    }
                    foreach (string item in jb.附加方法)
                    {
                        AddAttachWay(item);
                    }
                }
                foreach (JBodypartWay jb in bodypartData.部位信息.共用方法)
                {
                    if (cbxBodypartWayName.Items.IndexOf(jb.方法名称) < 0)
                    {
                        cbxBodypartWayName.Items.Add(jb.方法名称);
                    }
                    foreach (string item in jb.附加方法)
                    {
                        AddAttachWay(item);
                    }
                }

                listView1.Items.Add(itemNew);
            }

            listView1.View = View.Details;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 保存方法表格的数据
        /// 方法存储在一个字段,直接保存表格所以数据
        /// </summary>
        /// <param name=""></param>
        private void saveWays()
        {
            try
            {
                if (listView1.SelectedItems.Count <= 0)
                {
                    return;
                }

                BodypartInfoData bodypartData = listView1.SelectedItems[0].Tag as BodypartInfoData;

                bodypartData.部位信息.互斥方法.Clear();
                bodypartData.部位信息.共用方法.Clear();

                DataTable dT = dataGridView1.DataSource as DataTable;
                string    sCheckWay = "", sRelation = "", sAttach = "";
                for (int i = 0; i < dT.Rows.Count; i++)
                {
                    sCheckWay = dT.Rows[i]["检查方法"].ToString();
                    sRelation = dT.Rows[i]["关系"].ToString();
                    sAttach   = dT.Rows[i]["附加方法"].ToString();

                    if (string.IsNullOrEmpty(sCheckWay) || string.IsNullOrEmpty(sRelation))
                    {
                        MessageBox.Show("第" + (i + 1) + "行检查方法或关系为空,请修改或删除后重新保存", "提示");
                        return;
                    }

                    if (dT.Select("检查方法='" + sCheckWay + "'").Count() > 1)
                    {
                        MessageBox.Show("存在相同的检查方法:" + sCheckWay + "请修改或删除后重新保存", "提示");
                        return;
                    }

                    JBodypartWay bw = new JBodypartWay();
                    bw.方法名称 = sCheckWay;
                    foreach (string item in sAttach.Split(';'))
                    {
                        //判断是否存在相同的附加方法,存在退出保存
                        if (bw.附加方法.IndexOf(item) > -1)
                        {
                            MessageBox.Show("检查方法:" + sCheckWay + "存在相同的附加方法,请修改或删除后重新保存", "提示");
                            return;
                        }
                        if (string.IsNullOrEmpty(item) == false)
                        {
                            bw.附加方法.Add(item);
                        }
                    }
                    if (sRelation == "互斥方法")
                    {
                        bodypartData.部位信息.互斥方法.Add(bw);
                    }
                    else
                    {
                        bodypartData.部位信息.共用方法.Add(bw);
                    }
                }

                _bpm.UpdateBodypartWay(bodypartData);

                int selIndex = dataGridView1.SelectedRows[0].Index;

                BindBodypartWay(bodypartData);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                return;
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 显示部位信息
        /// </summary>
        /// <param name="bodypartData"></param>
        private void BindBodypartWay(BodypartInfoData bodypartData)
        {
            int maxColumn = 0;

            _isLoadWays = true;
            try
            {
                foreach (JBodypartWay bw in bodypartData.部位信息.互斥方法)
                {
                    if (bw.附加方法.Count > maxColumn)
                    {
                        maxColumn = bw.附加方法.Count;
                    }
                }

                foreach (JBodypartWay bw in bodypartData.部位信息.共用方法)
                {
                    if (bw.附加方法.Count > maxColumn)
                    {
                        maxColumn = bw.附加方法.Count;
                    }
                }


                DataTable dtBodypart = _eiModel.GetAllBodypartInfo(cbxModality.Text);

                lstWays.Columns.Clear();

                ColumnHeader columnHeader = new ColumnHeader();
                columnHeader.Text = "默认方法";
                columnHeader.Name = "默认方法";

                columnHeader.Width = 100;

                lstWays.Columns.Add(columnHeader);

                columnHeader      = new ColumnHeader();
                columnHeader.Text = "关系";
                columnHeader.Name = "关系";

                columnHeader.Width = 80;

                lstWays.Columns.Add(columnHeader);

                for (int i = 1; i <= maxColumn; i++)
                {
                    columnHeader      = new ColumnHeader();
                    columnHeader.Text = "附加方法" + i.ToString();
                    columnHeader.Name = "附加方法" + i.ToString();

                    columnHeader.Width = 100;

                    lstWays.Columns.Add(columnHeader);
                }

                foreach (JBodypartWay bw in bodypartData.部位信息.互斥方法)
                {
                    ListViewItem itemNew = new ListViewItem(bw.方法名称);
                    itemNew.Name = bw.方法名称;

                    itemNew.SubItems.Add("互斥");
                    foreach (string attach in bw.附加方法)
                    {
                        itemNew.SubItems.Add("□" + attach).Name = "附加方法";
                    }

                    itemNew.Tag = bw;

                    lstWays.Items.Add(itemNew);
                }

                foreach (JBodypartWay bw in bodypartData.部位信息.共用方法)
                {
                    ListViewItem itemNew = new ListViewItem(bw.方法名称);
                    itemNew.Name = bw.方法名称;

                    itemNew.SubItems.Add("共用");
                    foreach (string attach in bw.附加方法)
                    {
                        itemNew.SubItems.Add("□" + attach).Name = "附加方法"; //■
                    }

                    itemNew.Tag = bw;

                    lstWays.Items.Add(itemNew);
                }

                lstWays.View = View.Details;
            }
            finally
            {
                _isLoadWays = false;
            }
        }