3 * interface/patient_file/barcode_label.php Displaying a PDF file of Labels for printing.
5 * Program for displaying Barcode Label
6 * via the popups on the left nav screen
8 * this is from the barcode-coder and FPDF website I used the examples and code snippets
9 * listed on the sites to create this program
13 * @link http://www.open-emr.org
14 * @author Terry Hill <terry@lillysystems.com>
15 * @copyright Copyright (c) 2014 Terry Hill <terry@lillysystems.com>
16 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
20 require_once("../globals.php");
22 //Get the data to place on labels
24 $patdata = sqlQuery("SELECT " .
25 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
26 "p.street, p.city, p.state, p.postal_code, p.pid " .
27 "FROM patient_data AS p " .
28 "WHERE p.pid = ? LIMIT 1", array($pid));
32 $today = date('m/d/Y');
33 $dob = substr($patdata['DOB'], 5, 2) ."/". Substr($patdata['DOB'], 8, 2) ."/". Substr($patdata['DOB'], 0, 4);
37 // -------------------------------------------------- //
38 // BARCODE DATA AND TYPE
39 // -------------------------------------------------- //
41 $code = $patdata['pubpid']; // what is wanted as the barcode
42 $bartype = $GLOBALS['barcode_label_type'] ; // Get barcode type
83 // -------------------------------------------------- //
85 // -------------------------------------------------- //
87 $angle = 90; // rotation in degrees
88 $black = '000000'; // color in hexa
90 if ($GLOBALS['barcode_label_type'] == '12') { // datamatrix
91 $marge = 0; // between barcode and hri in pixel
92 $x = 35; // barcode center
93 $y = 120; // barcode center
94 $height = 40; // barcode height in 1D ; module size in 2D
95 $width = 4; // barcode height in 1D ; not use in 2D
97 $marge = 5; // between barcode and hri in pixel
98 $x = 30; // barcode center
99 $y = 120; // barcode center
100 $height = 40; // barcode height in 1D ; module size in 2D
101 $width = 1; // barcode height in 1D ; not use in 2D
104 // -------------------------------------------------- //
105 // ALLOCATE FPDF RESSOURCE
106 // -------------------------------------------------- //
108 $pdf = new eFPDF('P', 'mm', array(102,252)); // set the orentation, unit of measure and size of the page
111 // -------------------------------------------------- //
113 // -------------------------------------------------- //
115 $data = Barcode
::fpdf($pdf, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
116 $pdf->SetFont('Arial', 'B', $fontSize);
117 $pdf->SetTextColor(0, 0, 0);
118 $len = $pdf->GetStringWidth($data['hri']);
119 Barcode
::rotate(-$len / 2, ($data['height'] / 2) +
$fontSize +
$marge, $angle, $xt, $yt);
121 // -------------------------------------------------- //
123 // -------------------------------------------------- //
125 $pdf->TextWithRotation($x +
$xt, $y +
$yt, $data['hri'], $angle);