The ability to scan a patient record into the system greatly improves workflow and reduces errors. Did you know that it's easy to use barcodes on reports from Data Repository?
As technology grows and as more developers create cool free stuff, it allows us to utilize new technologies at a fraction of the original price. Hospital information systems have used barcodes in the workplace for some time, most notably, in the lab. As security and patient safety protocols have evolved, hospitals have started using patient identifiers that are scanned into the system with barcodes to make look up functions and document retrieval easier and faster. You may have seen this applied with bedside medication verification (BMV), for example.
For many years, you had to actually pay for a barcode font, at a ridiculous price, but because it was needed, people either paid full price or went without. Fortunately, now there are free TrueType and Google fonts which have incredible portability across various systems.
Where can I get one?
If you search Google for barcode fonts, they are easy to find. Code 128 and Code 39 are typically the most common bar codes we see. Code 128 is often used on armbands and various registration forms, or medical documents. Code 39 is often seen in the lab. They will print this on labels typically printed from thermal printers, like Datamax or Zebra.
We suggest downloading the fonts from Google directly, though there will be other sources too.
Libre Barcode 128 - Google Fonts
Libre Barcode 39 - Google Fonts
Once you’ve downloaded them, how do you install the fonts?
Installing the fonts
First off, unzip the file to a location you can find easily. If you downloaded the font from Google, you’ll see two files: an open font license text file, and the font itself.
To install the font on the machine you’ll use it from (for example, on your SQL Server Reporting Services machine), right-click on the font file:
Install for all users is the one to go with. When installing on a multi-user system such as Windows 10/11 or Windows Server, you want to install fonts for all users. Otherwise, you may discover some processes cannot utilize the newly installed font.
***Note: when you install a new font to the SSRS server, the Report Server service must be stopped and restarted before it can use the font.
Follow the same installation procedure on any workstations that will use the font – that it, end users that will view or print reports with barcodes, and of course developers who are designing the reports (using Visual Studio SSDT or Power BI Report Builder, for SSRS or paginated reports). After installation, most applications will need to be restarted to recognize it and have it appear in a drop-down list.
Also keep in mind that regardless of your final report output (.pdf, .docx, etc.) successful rendering of the barcode is dependent on all the devices (servers, laptops, etc.) involved in producing, viewing and using the file.
Using the barcode
As an example of how to use the barcode, let's use a report written with Power BI Report Builder, what Microsoft calls a "paginated" report. The report format uses the .rdl extension, which for years has also been used (and still is) by SQL Server Reporting Services when you develop with Visual Studio SSDT. First, let's look at the finished report:
You can see the barcode, in this case representing the patient name, on the right in the page header. (A realistic example would be to use the patient account number, but this is fictional, so no worries).
Now let's see how that looks in the report designer (this will be nearly identical in both Report Builder or Visual Studio):
Note that "PatientName" text box on the right is selected, and the default font is set to Segoe UI. (The duplicate "PatientName" texbox on the left is of course where we want to see the actual patient's name.) To change our textbox to a barcode, simply select the font drop-down box, and find your newly installed barcode font:
Voila! The change is immediate. You'll likely need to increase the font size and resize the text box to get the barcode right where you want it.
Now when this report is run from SSRS, whether by a user directly, or saved to a .pdf file via a subscription or report snapshot, it will have the barcode. This will be great for those reports that need to be printed for every day use, or even during a downtime situation.
Thanks for reading! And happy barcoding!