Barcodes can represent data visually in a machine-readable form using varying widths of parallel lines (linear/1D barcodes) or geometric patterns like rectangles and dots (matrix/2D barcodes). Barcodes on medicines are used in hospitals to prevent errors by electronically validating that the right patient receives the correct medication at the proper time and dose according to the ordered prescription. Barcodes encode identifying information that can be scanned to ensure the five criteria for effective treatment are met.