Definition
In the "Pharmacy Inventory Synchronization and Offline Resumption" scenario, sensors and business terminals often access the platform via cellular IoT; coverage quality, latency, security, and the full lifecycle of SIM card management need to be considered.
Technical Features
It is recommended to differentiate telemetry, alarms, configuration, and OTA traffic; configure caching and retransmission in weak network environments; include TLS, certificates, and keys in the change and rollback strategy.
Use Cases
Applicable to distributed sites and remote operations. SimtoLink can provide combined capabilities like connection management, data pool, and directed/private networks, supporting large-scale replication.
Key points for cooperation with IoT SIM cards
- Ledger: ICCID / IMEI bound to device number, installation location, and person in charge.
- Network: APN, whitelist, SIM-device binding, and regional/roaming policies.
- Operations & Maintenance: online rate, abnormal traffic, silent SIMs, and alert closure in ITSM.
- Compliance: log desensitization, retention period, and cross-border/subcontracting agreements.
The dispense ledger sitting in the offline queue
Pharmacy inventory sync means each pack that is dispensed reduces central stock once, and the bin, the batch, and the window match. If a dispenser, a handheld, and the central pharmacy are separated by cellular, the site may dispense during an outage, but the queue holds dispense events waiting to be reconciled. It does not hold a stock balance that is already confirmed. The drug identity must be fixed before it is issued, and the event carries a dispense ID generated by the terminal, plus batch, quantity, and bin. Without a dispense ID, after the link returns there is no way to tell a new dispense from a replay. A handheld catch-up and a machine dispense must use one numbering rule. Otherwise the same pack is reduced once on each of two ledgers.
Checking the traceability code on the pack is a separate step. The code answers where this pack came from. Inventory sync answers whether this pack is still in this bin. A failed code write-off must not automatically put stock back. A failed stock deduction must not pretend the code was written off. On a weak link, first keep the dispense action consistent with the local queue, then reconcile with the center after the link returns. A mismatch enters a difference. Do not leave the window in a silent retry. The queue has a length limit. When it is full, stop further offline dispensing and say so. Do not drop the oldest unconfirmed event.
A second deduction after the link returns
The most common mistake is that, after a timeout, the terminal submits again and the center deducts once per receipt. The patient took one pack, stock fell by two, and the count shows a shortage. The idempotency key should be the dispense ID. The same dispense ID arriving again confirms once and returns the original result. Another mistake is to overwrite the dispense time with the server time. A night shift drops offline and backfills the next morning, and the drug is booked as the next day's consumption. Near-expiry statistics for the batch then shift.
A partial success also breaks the books. The center has already deducted, the response is lost on the way, and the terminal thinks it failed, dispenses another pack, or tells the pharmacist to scan again. Until confirmation arrives, the screen should stay on "pending confirmation," not return to a state that can dispense again. If a retry is required, retry with the same dispense ID. For acceptance, pull the antenna and do three steps: dispense one pack offline, do not power off before recovery, and after recovery deliberately send the same event again. Central stock falls by one pack, batch and bin match the window record, and the second request is recognized as a duplicate. That pack should not appear on the difference report.
The pending screen must not dispense again
After a dispense request is sent and before confirmation returns, the window stays on pending confirmation. It must not return to a state that can scan again. If the pharmacist scans again then, a new dispense ID is created, and the center deducts one pack on each ID. A timeout retry must reuse the original dispense ID. The center's second response only returns the first result. Consumption from a night-shift outage that is backfilled the next day is booked on the date and shift of the dispense, not on the morning the backfill succeeded.
A traceability code that was not written off must not automatically put already deducted stock back. A failed stock deduction must not mark the code as written off. List the two differences separately. When the local queue is full, stop offline dispensing. Do not drop the oldest unconfirmed event. Dispense one pack offline, do not restart before recovery, and deliberately replay the same event: stock falls by one pack, and that pack does not appear in the differences. That is when pharmacy sync survives an outage.
If handhelds and dispensers each use their own sequence, convert them to one dispense-ID rule before merging. Otherwise the same pack appears once on each set of books. A physical difference found at stocktake must not be written into the dispense queue. A stocktake is a different adjustment document. Mixed with an outage replay, a duplicate deduction cannot be told from a real loss. A pickup slip printed while the window is pending confirmation should be marked unreconciled, so the patient does not leave the window and only then find that the center has no such record.