4 * interface/patient_file/label.php Displaying a PDF file of Labels for printing.
6 * Program for displaying Chart Labels
7 * via the popups on the left nav screen
9 * Used the program example supplied with the Avery Label Print Class to produce 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
19 require_once("../globals.php");
21 //Get the data to place on labels
23 $patdata = sqlQuery("SELECT " .
24 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
25 "p.street, p.city, p.state, p.postal_code, p.pid " .
26 "FROM patient_data AS p " .
27 "WHERE p.pid = ? LIMIT 1", array($pid));
32 $today = oeFormatShortDate($date = 'today');
33 $dob = oeFormatShortDate($patdata['DOB']);
35 //get label type and number of labels on sheet
38 if ($GLOBALS['chart_label_type'] == '1') {
39 $pdf = new PDF_Label('5160');
43 if ($GLOBALS['chart_label_type'] == '2') {
44 $pdf = new PDF_Label('5161');
48 if ($GLOBALS['chart_label_type'] == '3') {
49 $pdf = new PDF_Label('5162');
55 // Added spaces to the sprintf for Fire Fox it was having a problem with alignment
56 $text = sprintf(" %s %s\n %s\n %s\n %s", $patdata['fname'], $patdata['lname'], $dob, $today, $patdata['pid']);
58 // For loop for printing the labels
61 for ($i = 1; $i <= $last; $i++
) {
62 $pdf->Add_Label($text);