In setups where breath alcohol test results are checked on the device and then collected on a server through a smartphone app, the actual order of tests and the order shown on the server screen can differ. This is because if communication dropped on site or the app connects to the device later, results stored on the device are sent to the server all at once. If you assume that the last result received by the server is the one tested last on site, the test history can get reversed.
The DATECH AF-40BT is described as storing 10,000 test results and connecting to a smartphone over Bluetooth 5.0 LE. However, how much information, such as the test time, result number, and storage order, the device actually passes to the app or server differs by product and integration method. So when handling offline results, you need to keep the fact that a test was generated separate from the fact that the server received it, and choose the timestamp that fits the purpose of ordering.
Test time and receipt time are different records
The test time means the moment a result was generated when a person blew into the device. The server receipt time is when the smartphone or relay program sent the result and the server accepted it. When the connection is normal, the gap between the two may be small, but when offline, a gap can arise.
When reviewing test history, it is appropriate to use the test time recorded by the device as the primary basis. When looking into communication failures, app launch delays, or sync delays, on the other hand, you need the server receipt time. If you overwrite one with the other, you lose the evidence for explaining either the actual test order or the transfer path.
If the device does not pass on a test time, or there is no data to confirm that the device's date and time are correct, mark that limitation as well. In that case, it is better not to label the server receipt time as the test time, and to distinguish it, for example as "only server receipt time confirmed," so as not to overstate what the data means.
Set the ordering basis according to the purpose of each view
A screen for reviewing test results in time order and a screen for finding periods when transfers were delayed ask different questions, even when they show the same data. If you sort every screen by server receipt time alone, people looking at test history get confused. If you sort every screen by test time alone, transfer problems become hard to find.
There may be several results with the same test time, or the device may store time only with limited precision, such as to the minute. In that case, if the device actually provides a result number or internal storage order, you can use it as a secondary basis. However, you must not create new numbers in the order the server received results and then interpret them as the original test order.
| Purpose | Information to look at first | Information to keep with it |
|---|---|---|
| Viewing test result history | Test time recorded by the device | Device identification and the device's result number or storage order |
| Checking sync delays | Time the server received the result | Test time recorded by the device |
| Identifying resends of the same result | Identifier that points to an individual result | Time first received and time received again |
| Supplementing totals after cutoff | Time the report was closed and time of additional receipt | Test time of the added results |
The criteria in the table are not a list of features that a particular device must have. They are items to confirm in the integration design. For example, official AF-40BT information describes result storage and smartphone connectivity, but it does not set out what individual fields are passed to the server. In an actual implementation, you have to set the ordering basis within the original information the app and server can receive.
Put results that arrived together back in place in the test history
As a hypothetical example, suppose one device generated two results at 8:10 a.m. and 8:20 a.m., but the smartphone connection was down. When the connection is restored at 9:05 a.m., the two stored results may be sent to the server together. If you use only the server receipt time, both look as if they were tested at 9:05 a.m.
The facts to observe in this case are that the two results arrived at the server at the same time and that the test times recorded by the device are different. You can interpret this as a delayed server transfer, but it is no basis for thinking two new tests were taken at 9:05 a.m. A possible action is to keep the order 8:10 a.m. and 8:20 a.m. in the test history view, and record the 9:05 a.m. receipt separately in the transfer history.
The standard for considering this handling complete is a state in which the two results are listed in the order they were tested, and the fact that they were later synced together can also be confirmed. This keeps what each piece of time information describes without changing the meaning of the readings.
Do not tell resends from new tests by time gap alone
When communication is unstable, a result already received by the server may be sent again. If you count every result as a new test just because the receipt times differ, the test count gets inflated. Conversely, if you automatically merge results because the receipt interval is short, you risk deleting different results from tests actually taken one after another.
So it is better to judge duplicates, as far as possible, by information that points to an individual result. Candidates are values actually passed in the integration process, such as the device identification, the result number the device provides, and the original storage location. If result numbers may be reused after a device reset or restart, you need to keep the device identification and the original information received together rather than comparing numbers alone.
If the integration does not have enough of this identifying information, an operating option is to set such results aside as "possible duplicates" for review rather than deleting them automatically. The key point is that arriving late is not the same as a new test having taken place.
Record how late results were added to closed reports
After daily or per-shift totals are closed, results tested during that period but sent late may come in. If you just change the numbers in the existing report, it becomes hard to tell results included in the first report from those added later. Recording the time the original report was created separately from the time additions were made lets you trace why the totals changed.
Operationally, you can decide in advance how to handle this, such as the cutoff time for closing a report and whether results arriving after it are kept as supplementary records or shown in the next report. This is not re-judging the accuracy of readings or anyone's condition. It is managing the fact that the scope of totals changed because of transfer delays. If you keep the test time, server receipt time, information that distinguishes individual results, and the result of checking whether the device's clock can be trusted separately, even late-arriving records can be placed in order within the original history.