コード例 #1
0
        private void BGExtractionEventHandler(object sender, CustomEvents.MeterReadingHandlerEventArgs e)
        {
            if (handler != null && e.ExtractionSuccessful)
            {
                CompletedBGMappings.AddRange(handler.BloodGlucoseReadings);
                var fc = MappingStatistics.FailedMappingCollection.Where(w => w.ObjectType == typeof(BloodGlucoseReading)).Count();
                MappingStatistics.LogMappingStat("METERREADING", RecordCount, "BloodGlucoseReadings", CompletedBGMappings.Count, fc);

                BgExtractionComplete = true;
            }
            else
            {
                BgExtractionComplete = true;
                throw new Exception($"Extraction incomplete for {e.ExtractionName}");
            }
        }
コード例 #2
0
        private void PumpDeliveryExtractionEventHandler(object sender, CustomEvents.MeterReadingHandlerEventArgs e)
        {
            if (handler != null && e.ExtractionSuccessful)
            {
                CompletedBolusMappings.AddRange(handler.BolusDeliveries);
                CompletedBasalMappings.AddRange(handler.BasalDeliveries);
                CompletedTDDMappings.AddRange(handler.TotalDailyInsulinDeliveries);

                var fcBol = MappingStatistics.FailedMappingCollection.Where(w => w.ObjectType == typeof(BolusDelivery)).Count();
                var fcBas = MappingStatistics.FailedMappingCollection.Where(w => w.ObjectType == typeof(BasalDelivery)).Count();
                var fcTdd = MappingStatistics.FailedMappingCollection.Where(w => w.ObjectType == typeof(TotalDailyInsulinDelivery)).Count();

                MappingStatistics.LogMappingStat("METERREADING", RecordCount, "BolusDelivery", CompletedBolusMappings.Count, fcBol);
                MappingStatistics.LogMappingStat("METERREADING", RecordCount, "BasalDelivery", CompletedBasalMappings.Count, fcBas);
                MappingStatistics.LogMappingStat("METERREADING", RecordCount, "TotalDailyInsulinDeliveries", CompletedTDDMappings.Count, fcTdd);

                PumpDeliveryExtractionComplete = true;
            }
            else
            {
                PumpDeliveryExtractionComplete = true;
                throw new Exception($"Extraction incomplete for {e.ExtractionName}");
            }
        }