Esempio n. 1
0
 private static void D90Egfr(TSDataPoint tsdp)
 {
     if (tsdp != null)
     {
         Console.WriteLine("--D90 >{0}", tsdp.ToString());
     }
 }
Esempio n. 2
0
 private static void LasteGFR(TSDataPoint tsdp)
 {
     if (tsdp != null)
     {
         Console.WriteLine("--------------->{0}", tsdp.ToString());
     }
 }
Esempio n. 3
0
        public TSDataPoint GetLastTimeSeriesDataPoint(string component)
        {
            TSDataPoint _t = new TSDataPoint();

            if (TSDataPoints.Count > 0)
            {
                var c = TSDataPoints.Where(o => o.Component == component).LastOrDefault();

                if (c != null)
                {
                    _t = c;
                }
            }
            return(_t);
        }
Esempio n. 4
0
        public override void Define()
        {
            Patient patient = null;

            TSDataPoint tsdp = null;

            When()

            .Match(() => patient, o => o.IsValid == true, o => o.Status.Alive == true, o => o.HasComponent("eGFR"))
            .Let(() => tsdp, () => patient.GetNthTimeSeriesDataPointWithOffset("eGFR", 90, 1))
            ;

            Then()

            .Do(ctx => D90Egfr(tsdp))
            ;
        }
Esempio n. 5
0
        public override void Define()
        {
            Patient patient = null;

            TSDataPoint tsdp = null;

            When()
            //.Match(() => patient, o => o.Status.Alive == true, o => o.HasComponent("eGFR"))
            .Match(() => patient, o => o.IsValid == true, o => o.Status.Alive == true, o => o.HasComponent("eGFR"))
            .Let(() => tsdp, () => patient.GetLastTimeSeriesDataPoint("eGFR"))
            ;

            Then()

            .Do(ctx => LasteGFR(tsdp))
            ;
        }
Esempio n. 6
0
        public TSDataPoint GetNthTimeSeriesDataPointWithOffset(string component, int dayoffset, int rank)
        {
            TSDataPoint _t = new TSDataPoint();

            IList <TSDataPoint> _tsdps = TSDataPoints.Where(o => o.Component == component).ToList();

            if (_tsdps.Count > 0)
            {
                int _lastIndex = _tsdps.Count - 1;

                for (int i = 0; i < _lastIndex; i++)
                {
                    int _ts = ((TimeSpan)(_tsdps[_lastIndex].Date - _tsdps[i].Date)).Days;
                    if (_ts > dayoffset)
                    {
                        _t = _tsdps[i];
                        break;
                    }
                }
            }

            return(_t);
        }