Understanding Tag Data
All commands return some degree of low-level data from the tag. Therefore it's important to understand this data so that you can handle it correctly in your apps.
Use this page as a reference as you continue to read through the documentation (we will put links back to the sections as appropriate).
Tag States
- Reset
- Failed QA
- Passed QA
- Started
- Stopped
We recommend that you always check the tag message on each scan, to verify that the tag is in the expected Started state (in other words, verify that started
is true
). Otherwise, show your users an error message.
Dose Events
Tag Timekeeping System
All doses are returned as Unix UTC timestamps.
Resolution
Timestamp resolution is down to the minute.
Do not be alarmed if multiple doses all end with the same seconds value and if several doses taken at once all seem to happen instantly at the same time. This is due to the one-minute resolution of the tag's clock.
Accuracy
The tag clock may drift by at most +/- 2 minutes per month. If a trustworthy internet timesource is accessible, the SDK will automatically run a correction algorithm to ensure that all returned timestamps are accurate. Within the tag_message
, the key of clock_coefficient_correction
will be true
if the SDK has corrected the timestamps to a high level of accuracy. It will be false
if the timestamps could not be corrected.
Med-ic Dose Types
This section only applies to Med-ic packages. You can ignore it if you are developing apps for eCAP.
Med-ic packages have two components: the tag and a grid. The grid is a thin printed electronic circuit, composed of a pattern of many lines, that aligns perfectly with a blister cavity layout in a package. When a dose is removed, the circuit is broken for that cavity, on that line.
A dose type is an integer that indicates which cavity in the blister pack the dose was taken from. It is used to map dose events to positional characteristics such as "Day 1, Morning Dose".
Refer to the below illustration for an example Med-ic package annotated with type-cavity map. Notice how the lines are not completely sequential, i.e. "gaps" exist between some integers. This is normal and depends on the package design, because not all pins in the tag's connector will be used for detecting current.
Every package's "line map" will be different, so contact IMC to obtain the map(s) for your specific packages.
Tag Lifecycle
In Clinical Use
Med-ic
QA and provisioning steps are done centrally at a facility (IMC or manufacturing partner). Buffers are set to values according to the needs of the project (pre-arranged with the customer). Neither patients nor providers need to worry about state or buffers.
eCAP
eCAPs are delivered to sites off-the-shelf. They need to be filled with medication, started, and have their buffers set correctly at the site.
In Development and Testing
Your sample tags will ship not started. Some default buffers may already be set.
If you need to Start/Stop/Reset your sample tags, or change the buffer values, you can write your own app to command the tags, or you can use the IMC Debugger app (available on iOS through TestFlight only). Reach out to your IMC contact person to arrange an invite.