Exemple #1
0
        public EventPoint(DrawingDataColumn parent, EntityEmrTemperatureChartEvent value)
        {
            this.ParentColumn     = parent;
            this.Value            = value;
            this.Index            = 0;
            this.TextFont         = new Font(ThreeItemConstValue.DefaultFontFamilyName, this.ParentColumn.SizePerUnit * 0.75f);
            this.drawed           = false;
            this.OriginValuePoint = null;

            Text = this.Value.eventName;
            if (this.Value.EventType != null)
            {
                Text = this.Value.EventType.eventName;
            }

            if (this.Value.isDrawTime == 1)//如果描绘时间则加上连接线
            {
                DateTime dt = this.Value.recordDate;
                Text += "—" + DateTimeToCHS(dt);
            }
        }
Exemple #2
0
        public void InitColumns()
        {
            try
            {
                //PageIndex = 0;
                //PageCount = 0;

                int emptyColumnsCount = 0;

                this.Columns.Clear();
                if (ColumnsData.Count <= this.ColumnsPerPage)
                {
                    this.PageCount    = 1;
                    emptyColumnsCount = this.ColumnsPerPage - ColumnsData.Count;
                }
                else
                {
                    if (ColumnsData.Count % this.ColumnsPerPage == 0)
                    {
                        this.PageCount = ColumnsData.Count / this.ColumnsPerPage;
                    }
                    else
                    {
                        this.PageCount    = (ColumnsData.Count / this.ColumnsPerPage) + 1;
                        emptyColumnsCount = this.ColumnsPerPage - ColumnsData.Count % this.ColumnsPerPage;
                    }
                }

                if (this.PageCount < this.PageIndex + 1)
                {
                    this.PageIndex = this.PageCount - 1;
                }

                foreach (ThreeItemsColumnData item in this.ColumnsData)
                {
                    DrawingDataColumn col = new DrawingDataColumn(this, item);
                    this.Columns.Add(col);
                    col.Index = this.Columns.Count - 1;
                    //col.InitCells();
                }

                DateTime lastDate = DateTime.Now;
                if (this.Columns.Count > 0)
                {
                    lastDate = this.Columns[this.Columns.Count - 1].Value.RecDate;
                }

                for (int i = 0; i < emptyColumnsCount; i++)
                {
                    DrawingDataColumn emptyCol = new DrawingDataColumn(this, null);
                    emptyCol.Date = lastDate.AddDays(i + 1);
                    this.Columns.Add(emptyCol);
                    emptyCol.Index = this.Columns.Count - 1;
                    //emptyCol.InitCells();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        /// <summary>
        /// 获取鼠标点击数据
        /// </summary>
        /// <param name="X"></param>
        /// <param name="Y"></param>
        /// <returns></returns>
        private ThreeItemsControlClickedEventArgs GetClickObjects(int X, int Y)
        {
            ThreeItemsControlClickedEventArgs args = new ThreeItemsControlClickedEventArgs();

            if (this.grid != null)
            {
                if (this.grid.CellDate != null && this.grid.CellDate.Count > 0)
                {
                    RectangleF recF = RectangleF.Empty;
                    foreach (DrawingGridColumnCell col in this.grid.CellDate)
                    {
                        PointF pfLeftTop     = col.GetLeftTopPosition();
                        PointF pfLeftBottom  = col.GetLeftBottomPosition();
                        PointF pfRightTop    = col.GetRightTopPotision();
                        PointF pfRightBottom = col.GetRightBottomPosition();
                        recF = new RectangleF(pfLeftTop, new SizeF(pfRightTop.X - pfLeftTop.X, pfRightBottom.Y - pfRightTop.Y));
                        if (recF.Contains(X, Y))
                        {
                            args.objColumnCell = col;
                            break;
                        }
                    }
                }

                DrawingDataColumn clickedColumn = null;
                if (this.grid.VisibleColumns != null && this.grid.VisibleColumns.Count > 0)
                {
                    foreach (DrawingDataColumn col in this.grid.VisibleColumns)
                    {
                        if (X > col.X1 && X < col.X2 && Y > col.Y1 && Y < col.Y2)
                        {
                            clickedColumn = col;
                            break;
                        }
                    }

                    //计算坐标获取选中的数据
                    if (clickedColumn != null)
                    {
                        foreach (ValuePoint tPoint in clickedColumn.TempuPoint)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.TempuPoints.Add(tPoint);
                            }

                            foreach (ValuePoint subPoint in tPoint.SubValuePoints)
                            {
                                if (X > subPoint.X1 && X < subPoint.X2 && Y > subPoint.Y1 && Y < subPoint.Y2)
                                {
                                    args.TempuPoints.Add(subPoint);
                                }
                            }
                        }

                        foreach (ValuePoint tPoint in clickedColumn.PulsePoints)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.PulsePoints.Add(tPoint);
                            }

                            //foreach (ValuePoint subPoint in tPoint.SubValuePoints)
                            //{
                            //    if (X > subPoint.X1 && X < subPoint.X2 && Y > subPoint.Y1 && Y < subPoint.Y2)
                            //    {
                            //        args.HeartRatePulsePoints.Add(subPoint);
                            //    }
                            //}
                        }


                        foreach (ValuePoint tPoint in clickedColumn.HeartRatePoints)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.HeartRatePoints.Add(tPoint);
                            }

                            //foreach (ValuePoint subPoint in tPoint.SubValuePoints)
                            //{
                            //    if (X > subPoint.X1 && X < subPoint.X2 && Y > subPoint.Y1 && Y < subPoint.Y2)
                            //    {
                            //        args.HeartRatePulsePoints.Add(subPoint);
                            //    }
                            //}
                        }

                        foreach (ValuePoint tPoint in clickedColumn.BreathPoint)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.BreathPoints.Add(tPoint);
                            }
                        }

                        foreach (ValuePoint tPoint in clickedColumn.BloodPressurePoint)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.BloodPressurePoints.Add(tPoint);
                            }
                        }

                        if (clickedColumn.TotalLiqPoint != null)
                        {
                            if (X > clickedColumn.TotalLiqPoint.X1 && X < clickedColumn.TotalLiqPoint.X2 && Y > clickedColumn.TotalLiqPoint.Y1 && Y < clickedColumn.TotalLiqPoint.Y2)
                            {
                                args.TotalLiqPoint = clickedColumn.TotalLiqPoint;
                            }
                        }

                        if (clickedColumn.ExcrementPoint != null)
                        {
                            if (X > clickedColumn.ExcrementPoint.X1 && X < clickedColumn.ExcrementPoint.X2 && Y > clickedColumn.ExcrementPoint.Y1 && Y < clickedColumn.ExcrementPoint.Y2)
                            {
                                args.ExcrementPoint = clickedColumn.ExcrementPoint;
                            }
                        }

                        if (clickedColumn.UrinePoint != null)
                        {
                            if (X > clickedColumn.UrinePoint.X1 && X < clickedColumn.UrinePoint.X2 && Y > clickedColumn.UrinePoint.Y1 && Y < clickedColumn.UrinePoint.Y2)
                            {
                                args.UrinePoint = clickedColumn.UrinePoint;
                            }
                        }

                        foreach (ValuePoint tPoint in clickedColumn.Other1Point)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.Other1Points.Add(tPoint);
                            }
                        }

                        if (clickedColumn.WeightPoint != null)
                        {
                            if (X > clickedColumn.WeightPoint.X1 && X < clickedColumn.WeightPoint.X2 && Y > clickedColumn.WeightPoint.Y1 && Y < clickedColumn.WeightPoint.Y2)
                            {
                                args.WeightPoint = clickedColumn.WeightPoint;
                            }
                        }

                        foreach (ValuePoint peauTestPoint in clickedColumn.PeauTestPoint)
                        {
                            if (X > peauTestPoint.X1 && X < peauTestPoint.X2 && Y > peauTestPoint.Y1 && Y < peauTestPoint.Y2)
                            {
                                args.PeauTestPoints.Add(peauTestPoint);
                            }
                        }

                        foreach (ValuePoint tPoint in clickedColumn.Other2Point)
                        {
                            if (X > tPoint.X1 && X < tPoint.X2 && Y > tPoint.Y1 && Y < tPoint.Y2)
                            {
                                args.Other2Points.Add(tPoint);
                            }
                        }

                        foreach (EventPoint eventPoint in clickedColumn.EventPoints)
                        {
                            if (X > eventPoint.X1 && X < eventPoint.X2 && Y > eventPoint.Y1 && Y < eventPoint.Y2)
                            {
                                args.EventPoints.Add(eventPoint);
                            }
                        }
                    }
                }
            }

            return(args);
        }
Exemple #4
0
        public override void InitCells(string registerId, int pageIndex)
        {
            base.InitCells(registerId, pageIndex);

            InitColumnData();

            if (this.Value != null)
            {
                //计算手术次数
                if (this.EventPoints.Any(i => i.Value.isOperation == 1))//查找当前列中是否有手术事件
                {
                    this.HasOperation = true;

                    if (this.PrevColumn != null)                                  //当前列不为第一列
                    {
                        this.OperationCount = this.PrevColumn.OperationCount + 1; //有则手术次数+1
                    }
                    else
                    {
                        this.OperationCount = 1;
                    }
                }
                else
                {
                    if (this.PrevVisibleColumn != null)
                    {
                        this.OperationCount = PrevColumn.OperationCount;
                    }
                }

                #region 计算手术后日期
                //计算手术后日期



                if (this.HasOperation)//当前列中是否有手术事件
                {
                    string daysAfOp = string.Empty;
                    if (this.OperationCount == 1)
                    {
                        daysAfOp = "0";
                    }
                    else if (this.OperationCount > 1)
                    {
                        daysAfOp = MakeRomanNum(this.OperationCount) + "-0";
                    }
                    rowDaysAfOperation.TextProperty.Text = daysAfOp;
                }
                else
                {
                    //往前查找上一个手术事件
                    DrawingDataColumn prevCol      = this.PrevColumn; //前一列
                    DateTime?         dtPrevOpDate = null;            //前一个手术时间

                    //递归遍历前一列
                    while (prevCol != null)
                    {
                        if (prevCol.HasOperation)//当有手术事件时记录下手术时间
                        {
                            dtPrevOpDate = prevCol.Date;
                            break;
                        }
                        prevCol = prevCol.PrevColumn;
                    }


                    if (dtPrevOpDate != null)
                    {
                        //当前时间减去上一次手术时间
                        int daysAfOp = (this.Date.Value.Date - dtPrevOpDate.Value.Date).Days;
                        if (daysAfOp <= 10)//如果手术后天数大于10天则不描绘
                        {
                            rowDaysAfOperation.TextProperty.Text = daysAfOp.ToString();
                        }
                    }
                }

                #endregion


                //计算入院天数
                if (this.ParentGrid.PatInfo != null && this.Date != null)
                {
                    //当前时间减去入院日期,天数加1
                    rowInDays.TextProperty.Text = ((this.Date.Value.Date - this.ParentGrid.PatInfo.InDate.Date).Days + 1).ToString();
                }
            }
            //foreach (var item in this.TempuPoint)
            //{
            //    item.Init();
            //}



            //foreach (var hrp in this.HeartRatePulsePoint)
            //{
            //    hrp.Init();

            ////找出位置重合点
            //PointF p1 = hrp.GetCenterPosition();

            //var query2 = from i in this.TempuPoint
            //             where i.TimePeriod == hrp.TimePeriod && (i.PointValueType == 1 || i.PointValueType == 2 || i.PointValueType == 3)
            //             select i;

            //if (query2.Count() > 0)
            //{
            //    ValuePoint tempu = query2.First();

            //    PointF p2 = tempu.GetCenterPosition();

            //    if (p2.X < p1.X + 0.5 && p2.X > p1.X - 0.5
            //        && p2.Y < p1.Y + 0.5 && p2.Y > p1.Y - 0.5
            //        )
            //    {
            //        if (tempu.PointValueType == 1)
            //        {
            //            hrp.OverlapType = PointOverlapType.Type3;
            //            tempu.OverlapType = PointOverlapType.Type3;
            //        }
            //        else if (tempu.PointValueType == 2)
            //        {
            //            hrp.OverlapType = PointOverlapType.Type1;
            //            tempu.OverlapType = PointOverlapType.Type3;
            //        }
            //        else if (tempu.PointValueType == 3)
            //        {
            //            hrp.OverlapType = PointOverlapType.Type2;
            //            tempu.OverlapType = PointOverlapType.Type3;
            //        }
            //    }
            //}
            //}

            //foreach (var item in this.BreathPoint)
            //{
            //    item.Init();
            //}

            //foreach (var item in this.BloodPressurePoint)
            //{
            //    item.Init();
            //}
        }