Skip to content

Commit

Permalink
Add support for new Trividia Health devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Darin Krauss committed Mar 27, 2018
1 parent 2fb9d95 commit 4c038a7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 15 deletions.
7 changes: 4 additions & 3 deletions data/deduplicator/hash_deactivate_old.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ const _HashDeactivateOldDeduplicatorName = "org.tidepool.hash-deactivate-old"
const _HashDeactivateOldDeduplicatorVersion = "1.1.0"

var _HashDeactivateOldExpectedDeviceManufacturerModels = map[string][]string{
"Medtronic": {"523", "723", "551", "751", "554", "754", "1510", "1511", "1512", "1710", "1711", "1712", "1715", "1780"},
"LifeScan": {"OneTouch Ultra 2", "OneTouch UltraMini", "Verio", "Verio Flex"},
"Abbott": {"FreeStyle Libre"},
"Abbott": {"FreeStyle Libre"},
"LifeScan": {"OneTouch Ultra 2", "OneTouch UltraMini", "Verio", "Verio Flex"},
"Medtronic": {"523", "551", "554", "723", "751", "754", "1510", "1511", "1512", "1710", "1711", "1712", "1715", "1780"},
"Trividia Health": {"TRUE METRIX", "TRUE METRIX AIR", "TRUE METRIX GO"},
}

func NewHashDeactivateOldFactory() (Factory, error) {
Expand Down
48 changes: 36 additions & 12 deletions data/deduplicator/hash_deactivate_old_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,28 @@ var _ = Describe("HashDeactivateOld", func() {
testDataset.DeviceModel = pointer.String(deviceModel)
Expect(testFactory.CanDeduplicateDataset(testDataset)).To(BeTrue())
},
Entry("is Medtronic 523", "Medtronic", "523"),
Entry("is Medtronic 723", "Medtronic", "723"),
Entry("is Medtronic 551", "Medtronic", "551"),
Entry("is Medtronic 751", "Medtronic", "751"),
Entry("is Medtronic 554", "Medtronic", "554"),
Entry("is Medtronic 754", "Medtronic", "754"),
Entry("is Abbott FreeStyle Libre", "Abbott", "FreeStyle Libre"),
Entry("is LifeScan OneTouch Ultra 2", "LifeScan", "OneTouch Ultra 2"),
Entry("is LifeScan OneTouch UltraMini", "LifeScan", "OneTouch UltraMini"),
Entry("is LifeScan Verio", "LifeScan", "Verio"),
Entry("is LifeScan Verio Flex", "LifeScan", "Verio Flex"),
Entry("is Abbott FreeStyle Libre", "Abbott", "FreeStyle Libre"),
Entry("is Medtronic 523", "Medtronic", "523"),
Entry("is Medtronic 551", "Medtronic", "551"),
Entry("is Medtronic 554", "Medtronic", "554"),
Entry("is Medtronic 723", "Medtronic", "723"),
Entry("is Medtronic 751", "Medtronic", "751"),
Entry("is Medtronic 754", "Medtronic", "754"),
Entry("is Medtronic 1510", "Medtronic", "1510"),
Entry("is Medtronic 1511", "Medtronic", "1511"),
Entry("is Medtronic 1512", "Medtronic", "1512"),
Entry("is Medtronic 1710", "Medtronic", "1710"),
Entry("is Medtronic 1711", "Medtronic", "1711"),
Entry("is Medtronic 1712", "Medtronic", "1712"),
Entry("is Medtronic 1715", "Medtronic", "1715"),
Entry("is Medtronic 1780", "Medtronic", "1780"),
Entry("is Trividia Health TRUE METRIX", "Trividia Health", "TRUE METRIX"),
Entry("is Trividia Health TRUE METRIX AIR", "Trividia Health", "TRUE METRIX AIR"),
Entry("is Trividia Health TRUE METRIX GO", "Trividia Health", "TRUE METRIX GO"),
)
})

Expand Down Expand Up @@ -279,15 +290,28 @@ var _ = Describe("HashDeactivateOld", func() {
testDataset.DeviceModel = pointer.String(deviceModel)
Expect(testFactory.NewDeduplicatorForDataset(testLogger, testDataSession, testDataset)).ToNot(BeNil())
},
Entry("is Abbott FreeStyle Libre", "Abbott", "FreeStyle Libre"),
Entry("is LifeScan OneTouch Ultra 2", "LifeScan", "OneTouch Ultra 2"),
Entry("is LifeScan OneTouch UltraMini", "LifeScan", "OneTouch UltraMini"),
Entry("is LifeScan Verio", "LifeScan", "Verio"),
Entry("is LifeScan Verio Flex", "LifeScan", "Verio Flex"),
Entry("is Medtronic 523", "Medtronic", "523"),
Entry("is Medtronic 723", "Medtronic", "723"),
Entry("is Medtronic 551", "Medtronic", "551"),
Entry("is Medtronic 751", "Medtronic", "751"),
Entry("is Medtronic 554", "Medtronic", "554"),
Entry("is Medtronic 723", "Medtronic", "723"),
Entry("is Medtronic 751", "Medtronic", "751"),
Entry("is Medtronic 754", "Medtronic", "754"),
Entry("is LifeScan OneTouch Ultra 2", "LifeScan", "OneTouch Ultra 2"),
Entry("is LifeScan OneTouch UltraMini", "LifeScan", "OneTouch UltraMini"),
Entry("is Abbott FreeStyle Libre", "Abbott", "FreeStyle Libre"),
Entry("is Medtronic 1510", "Medtronic", "1510"),
Entry("is Medtronic 1511", "Medtronic", "1511"),
Entry("is Medtronic 1512", "Medtronic", "1512"),
Entry("is Medtronic 1710", "Medtronic", "1710"),
Entry("is Medtronic 1711", "Medtronic", "1711"),
Entry("is Medtronic 1712", "Medtronic", "1712"),
Entry("is Medtronic 1715", "Medtronic", "1715"),
Entry("is Medtronic 1780", "Medtronic", "1780"),
Entry("is Trividia Health TRUE METRIX", "Trividia Health", "TRUE METRIX"),
Entry("is Trividia Health TRUE METRIX AIR", "Trividia Health", "TRUE METRIX AIR"),
Entry("is Trividia Health TRUE METRIX GO", "Trividia Health", "TRUE METRIX GO"),
)
})

Expand Down

0 comments on commit 4c038a7

Please sign in to comment.