Skip to content

Commit

Permalink
"iob" is overloaded in NS, rename back to activeInsulin
Browse files Browse the repository at this point in the history
  • Loading branch information
mddub committed Oct 21, 2015
1 parent 643e93d commit 28edc5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ describe('integration test: missingLastSgv', function() {
expect(_.uniq(_.pluck(sgvs, 'direction'))).to.eql([undefined]);
});

it('should include pump status data, including iob', function() {
it('should include pump status data, including active insulin', function() {
_.forEach({
activeInsulin: 4.85,
calibStatus: 'LESS_THAN_TWELVE_HRS',
conduitBatteryLevel: 29,
conduitInRange: true,
conduitMedicalDeviceInRange: true,
conduitSensorInRange: true,
device: 'connect://paradigm',
iob: 4.85,
medicalDeviceBatteryLevelPercent: 75,
reservoirAmount: 60,
reservoirLevelPercent: 25,
Expand Down Expand Up @@ -95,15 +95,15 @@ describe('integration test: withTrend', function() {
expect(sgvs[sgvs.length - 1]['trend']).to.be(6);
});

it('should include pump status data, including iob', function() {
it('should include pump status data, including active insulin', function() {
_.forEach({
activeInsulin: 1.35,
calibStatus: 'LESS_THAN_NINE_HRS',
conduitBatteryLevel: 86,
conduitInRange: true,
conduitMedicalDeviceInRange: true,
conduitSensorInRange: true,
device: 'connect://paradigm',
iob: 1.35,
medicalDeviceBatteryLevelPercent: 50,
reservoirAmount: 67,
reservoirLevelPercent: 50,
Expand Down
6 changes: 3 additions & 3 deletions test/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('transform()', function() {
});

describe('active insulin', function() {
it('should include active insulin as "iob"', function() {
it('should include active insulin', function() {
var pumpStatus = _.filter(
transform(
f.data({'activeInsulin': {
Expand All @@ -60,7 +60,7 @@ describe('transform()', function() {
{type: 'pump_status'}
)[0];

expect(pumpStatus['iob']).to.be(1.275);
expect(pumpStatus['activeInsulin']).to.be(1.275);
});

it('should ignore activeInsulin values of -1', function() {
Expand All @@ -76,7 +76,7 @@ describe('transform()', function() {
{type: 'pump_status'}
)[0];

expect(pumpStatus['iob']).to.be(undefined);
expect(pumpStatus['activeInsulin']).to.be(undefined);
});
});

Expand Down
2 changes: 1 addition & 1 deletion transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function pumpStatusEntry(data) {
});

if(data['activeInsulin'] && data['activeInsulin']['amount'] >= 0) {
entry['iob'] = data['activeInsulin']['amount'];
entry['activeInsulin'] = data['activeInsulin']['amount'];
}

return addTimeToEntry(data['lastMedicalDeviceDataUpdateServerTime'], entry);
Expand Down

0 comments on commit 28edc5f

Please sign in to comment.