UDI on medical devices: GS1 DataMatrix and GS1 Digital Link
Medical devices sold in the United States and the European Union carry a Unique Device Identification (UDI) code on the label and often on the device itself. The rules come from the FDA UDI rule in the US and from the Medical Device Regulation (MDR) and In Vitro Diagnostic Regulation (IVDR) in the EU. The code can follow the standard of one of the accredited issuing agencies; the most common one is GS1, and on small items the carrier is usually a GS1 DataMatrix.
UDI-DI and UDI-PI
A UDI has two parts:
- UDI-DI — the device identifier: the model or version of the device. In GS1 format it is the GTIN, AI 01.
- UDI-PI — the production identifiers, which ones depend on how the device is controlled:
| GS1 AI | Production identifier | Format |
|---|---|---|
| 11 | Manufacturing date | YYMMDD |
| 17 | Expiry date | YYMMDD |
| 10 | Lot or batch | Up to 20 characters |
| 21 | Serial number | Up to 20 characters |
An implant may carry all four, a box of syringes only a lot and an expiry date. So a UDI reader cannot expect a fixed set or order of fields — it has to parse whatever GS1 fields the symbol contains. The GS separator rules are the same as for any GS1 code: after a lot or serial number that is followed by another field (see The GS separator in GS1 codes).
Codes issued under the other agencies' standards look different: HIBCC codes start with +, ICCBBA (ISBT 128) codes are used for blood and tissue products. A DataMatrix reader returns their text as it is; parsing it is up to the program.
GS1 Digital Link
GS1 Digital Link puts the same identifiers into a web address, for example:
https://id.gs1.org/01/09506000134352/10/ABC123/21/SN12345XYZ?17=271231A phone camera opens it as a link, while a system that knows the syntax extracts the GTIN, lot, serial and expiry from the path and the query string. The address can be carried by a QR code or by a DataMatrix. The libscanner readers read DataMatrix — the address comes back as plain text — but not QR codes.
Checking UDI labels on the line
- The code reads at the line speed and resolution — see camera resolution for DataMatrix.
- The GTIN is the one registered for this device version, with a valid check digit.
- The production identifiers match the job: lot, dates in YYMMDD, serial numbers not repeated.
- The human-readable text on the label matches the code.
Whether the device identifier is registered in the FDA GUDID or the EU EUDAMED database is checked against those databases, not by the camera.
Test codes
The dmgen generator validates GS1 fields before encoding and writes PNG or JPEG — handy for label templates and line commissioning:
dmgen --gs1 "(01)00844588003288(11)250115(17)271130(10)LOT-7(21)S000123" -o udi.png
dmgen "https://id.gs1.org/01/09506000134352/10/ABC123/21/SN12345XYZ?17=271231" -o digital-link.pngTry it
Read a label photo in the online scanner or create a test code in the online generator. For your own software: pip install libscanner-dmr reads DataMatrix, pip install libscanner-unir also reads GS1-128, Code 128 and EAN/UPC on the same label, pip install libscanner-dmgen creates codes. Headers and examples are on GitHub; a parsing example in Python is in GS1 DataMatrix for EU FMD and US DSCSA.
Chestny ZNAK is a trademark of CRPT LLC (ООО «Оператор-ЦРПТ»); GS1 is a trademark of GS1 AISBL. The product is not affiliated with or certified by their owners.