private static void D90Egfr(TSDataPoint tsdp) { if (tsdp != null) { Console.WriteLine("--D90 >{0}", tsdp.ToString()); } }
private static void LasteGFR(TSDataPoint tsdp) { if (tsdp != null) { Console.WriteLine("--------------->{0}", tsdp.ToString()); } }
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); }
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)) ; }
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)) ; }
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); }