Personal tools
You are here: Home / OSCAR EMR 12.x / 2.0 Clinical Functions / 2.2 Prescription / QR Codes Administrative Notes

QR Codes Administrative Notes

This section is for System Administrators setting up Oscar

A QR code is a specific matrix barcode (or two-dimensional code), readable by dedicated QR barcode readers and camera phones. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be text, URL or other data.  For Oscar the information is the prescription data as a "OMP_O09" message in HL7 V2.6 format. 

There are a couple of Oscar properties for configuring QR Codes. In general you should not change these parameters unless you understand the ramifications of changing these parameters before doing so.

QR_CODE_ERROR_CORRECTION_LEVEL : This changes the level of error correction ability of the QR image. This changes the ability to read data out properly even if part of the image is damaged, i.e. some one folds the prescription or scratches part of the prescription image.  By default Oscar should be set to use Level H

Level L 7% of codewords can be restored.
Level M 15% of codewords can be restored.
Level Q 25% of codewords can be restored.
Level H 30% of codewords can be restored.


QR_CODE_IMAGE_SCALE_FACTOR : A standard (scale=1) QR Code image is pixel based for it's block sizes. So, the smallest dot on the QR Code image would be 1 pixel. This can lead to problems if a print out is used where the printer is printing very small dots, it would mean damage may easily occur due to any number of reasons including printer smudges or scanner smudges or damage from the client to the physical print out etc. By scaling the image larger, each dot may become larger so that the chance of damage to each dot on the image is less as more physical paper would have to be damaged to destroy the entire dot. You can not just make the image huge as it still needs to fit on the paper the prescription is being printed on. You may have to experiment with your printer and scanner to find the optimum scale, i.e. it maybe entirely possible that on a high quality printer/paper/scanner than scale=1 is fine, or you may find that on a home-quality ink jet printer and home quality scanner, you need a larger scale for the image to appear and scan back in properly.  The scale factor has to be an integer.  The Rx will accommodate scale of 1 and 2.  3 is probably too large.  For Oscar a scale of 2 is optimal

The intent of the QR Code feature is to allow third party systems to read in the prescription information automatically. As a result, you will need to tell the other party about the nature of the data encoded in the QR Code. The information you need to tell the third part is as follows :

There maybe one or more QR Code images on the prescription. If there is more than one QR Code image, you must convert each QR Code image into it's text data, concatenate the resulting text data together in the same order as the images are found. Each qr code image will contain at most 2953 characters of data. Although the 2953 size standard is for binary data, the data contained with in is only text, it is an hl7 message as described below. (Note that text and alphanumeric are not the same thing.)

The QR Code contains the prescription data in HL7 V2.6 format, specifically an "OMP_O09" message. Below is an example of a QR code image along with it's HL7 text.

QR Codes example

MSH|^~\&|OSCAR|McMaster Hospital|||20100910224657||OMP^O09^OMP_O09|||2.6
SFT|OSCARMcMaster|${env.JOB_NAME}-${env.BUILD_NUMBER}|OSCAR|2010/09/10 22:45, branch : trunk
ORC|NW|2||||||||||999998^oscardoc^doctor|||20100827000000||||||McMaster Hospital|Hamilton^^Hamilton^Ontario^L0R 4K3^^O|^^^^^^^^^^^555-555-5555

The PID contains the patient information.

The ORC is the prescriber information.

An NTE segment may follow the PID as per the HL7 specification (although not shown in this example). All NTE's may contain a "text" entry which the prescriber has added as plain text and used like a subject for the NTE message. Each NTE may contain one or more "comment" sections. The contents of each "comment" section is base 64 encoded Text (base 64 encode so the text can include hl7 special characters like \n \r and symbols like | and ^. If there are more than one NTE segments, you should concatenate each of the segments before decoding the data.

The segments ORC/TQ1/RXO/NTE(the last nte) segments will be repeated for each drug prescribed as per the Hl7 specification. In Oscar though, a single provider prescribes a list of drugs so the ORC is the same for each drug, you only really need to read it once. The NTE associated with each drug entry is special notes for each drug (if the provider has made a special note). This drug NTE follows the same rules as the prescription NTE above for the "text" section data as well as the "comment" section data (base 64, and multiple comment sections).

Document Actions