From 16c8c8e52cd68b736fd5dc849a9d7bac8aeab117 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Tue, 7 Jul 2009 21:59:24 +0000 Subject: [PATCH] migrated the immunization table to the list_options table along with applicable internationalization support --- interface/patient_file/encounter/cash_receipt.php | 7 +- interface/patient_file/report/custom_report.php | 6 +- interface/patient_file/report/full_report.php | 7 +- interface/patient_file/summary/immunizations.php | 32 ++++---- interface/patient_file/summary/shot_record.php | 30 +++++--- interface/patient_file/summary/stats.php | 13 ++-- sql/3_0_1-to-3_0_2_upgrade.sql | 6 ++ sql/database.sql | 91 +++++++++-------------- 8 files changed, 95 insertions(+), 97 deletions(-) diff --git a/interface/patient_file/encounter/cash_receipt.php b/interface/patient_file/encounter/cash_receipt.php index 99766dad7..1a005dcba 100644 --- a/interface/patient_file/encounter/cash_receipt.php +++ b/interface/patient_file/encounter/cash_receipt.php @@ -7,6 +7,7 @@ include_once("$srcdir/report.inc"); include_once(dirname(__file__) . "/../../../library/classes/Document.class.php"); include_once(dirname(__file__) . "/../../../library/classes/Note.class.php"); + include_once("$srcdir/options.inc.php"); $N = 6; $first_issue = 1; @@ -200,10 +201,12 @@ $encounter . "' and pid='$pid'")) } elseif ($val == "immunizations") { print "".xl('Patient Immunization').":
"; - $sql = "select if(i1.administered_date,concat(i1.administered_date,' - ',i2.name) ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 left join immunization i2 on i1.immunization_id = i2.id where i1.patient_id = $pid order by administered_date desc"; + $sql = "select i1.immunization_id as immunization_id, if(i1.administered_date,concat(i1.administered_date,' - ') ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 where i1.patient_id = $pid order by administered_date desc"; $result = sqlStatement($sql); while ($row=sqlFetchArray($result)) { - echo " " . $row{'immunization_data'} . "
\n"; + echo " " . $row{'immunization_data'} . + generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) . + "
\n"; } } elseif ($val == "notes") { diff --git a/interface/patient_file/report/custom_report.php b/interface/patient_file/report/custom_report.php index bc297ac54..3aecdcf5c 100644 --- a/interface/patient_file/report/custom_report.php +++ b/interface/patient_file/report/custom_report.php @@ -223,10 +223,12 @@ foreach ($ar as $key => $val) { echo "
"; echo "
\n"; print "

".xl('Patient Immunization').":

"; - $sql = "select if(i1.administered_date,concat(i1.administered_date,' - ',i2.name) ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 left join immunization i2 on i1.immunization_id = i2.id where i1.patient_id = $pid order by administered_date desc"; + $sql = "select i1.immunization_id as immunization_id, if(i1.administered_date,concat(i1.administered_date,' - ') ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 where i1.patient_id = $pid order by administered_date desc"; $result = sqlStatement($sql); while ($row=sqlFetchArray($result)) { - echo $row{'immunization_data'} . "
\n"; + echo $row{'immunization_data'} . + generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) . + "
\n"; } echo "
\n"; } diff --git a/interface/patient_file/report/full_report.php b/interface/patient_file/report/full_report.php index f3317dda6..e014581b4 100644 --- a/interface/patient_file/report/full_report.php +++ b/interface/patient_file/report/full_report.php @@ -7,6 +7,7 @@ include_once("$srcdir/pnotes.inc"); include_once("$srcdir/patient.inc"); include_once("$srcdir/report.inc"); include_once("$srcdir/acl.inc"); +include_once("$srcdir/options.inc.php"); // get various authorization levels $auth_notes_a = acl_check('encounters', 'notes_a'); @@ -112,11 +113,13 @@ printRecData($insurance_data_array, getRecInsuranceData ($pid,"tertiary"), $N);

:

" . $row{'immunization_data'} . "
\n"; + echo " " . $row{'immunization_data'} . + generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) . + "
\n"; } ?>
diff --git a/interface/patient_file/summary/immunizations.php b/interface/patient_file/summary/immunizations.php index 158fc95bf..f560a1c71 100644 --- a/interface/patient_file/summary/immunizations.php +++ b/interface/patient_file/summary/immunizations.php @@ -1,13 +1,14 @@ '; - @@ -168,7 +162,7 @@ var mypcc = ''; - or choose + "; + echo ""; echo ""; } @@ -337,7 +331,7 @@ var EditImm = function(imm) { } var DeleteImm = function(imm) { - if (confirm("This action cannot be undone.\nDo you wish to PERMANENTLY delete this immunization record?")) { + if (confirm("" + "\n" +"")) { top.restoreSession(); location.href='immunizations.php?mode=delete&id='+imm.id; } diff --git a/interface/patient_file/summary/shot_record.php b/interface/patient_file/summary/shot_record.php index bb233702a..80c068c71 100644 --- a/interface/patient_file/summary/shot_record.php +++ b/interface/patient_file/summary/shot_record.php @@ -1,6 +1,7 @@ ezText("\n" . $res['patient_name'] . "\nDate of Birth: " . $res['patient_DOB'] . "\n" . $res['patient_address']); +$pdf->ezText("\n" . $res['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res['patient_DOB'] . "\n" . $res['patient_address']); $pdf->ezText("\n"); -$title = 'Shot Record as of: ' . date('m/d/Y h:i:s a'); +$title = xl('Shot Record as of:','','',' ') . date('m/d/Y h:i:s a'); -$sqlstmt = "select date_format(i1.administered_date,'%Y-%m-%d') as 'Date\nAdministered' ". - ",i2.name as 'Vaccine' ". - ",i1.manufacturer as 'Manufacturer' ". - ",i1.lot_number as 'Lot\nNumber' ". - ",concat(u.lname,', ',u.fname) as 'Administered By' ". - ",date_format(i1.education_date,'%Y-%m-%d') as 'Patient\nEducation\nDate' ". - ",i1.note as 'Comments'". +$sqlstmt = "select date_format(i1.administered_date,'%Y-%m-%d') as '" . xl('Date') . "\n" . xl('Administered') . "' ". + ",i1.immunization_id as '" . xl('Vaccine') . "' ". + ",i1.manufacturer as '" . xl('Manufacturer') . "' ". + ",i1.lot_number as '" . xl('Lot') . "\n" . xl('Number') . "' ". + ",concat(u.lname,', ',u.fname) as '" . xl('Administered By') . "' ". + ",date_format(i1.education_date,'%Y-%m-%d') as '" . xl('Patient') . "\n" . xl('Education') . "\n " . xl('Date') . "' ". + ",i1.note as '" . xl('Comments') . "'". " from immunizations i1 ". - " left join immunization i2 on i1.immunization_id = i2.id ". " left join users u on i1.administered_by_id = u.id ". " left join patient_data p on i1.patient_id = p.pid ". " where p.pid = " . $pid; // sort the results, as they are on the user's screen $sqlstmt .= " order by "; -if ($_GET['sortby'] == "vacc") { $sqlstmt .= " i2.name, i1.administered_date DESC"; } +if ($_GET['sortby'] == "vacc") { $sqlstmt .= " i1.immunization_id, i1.administered_date DESC"; } else { $sqlstmt .= " i1.administered_date desc"; } $res = sqlStatement($sqlstmt); + while ($data[] = sqlFetchArray($res)) {} +// added 7-2009 by BM to support immunization list in list_options +for ($i=0;$i'1','list_id'=>'immunizations'), $data[$i][xl('Vaccine')]); +} + $opts = array('maxWidth' => 504, 'fontSize' => 8); $pdf->ezTable($data, "", $title, $opts); -$pdf->ezText("\n\n\n\nSignature:________________________________","",array('justification' => 'right')); +$pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________","",array('justification' => 'right')); $pdf->ezStream(); diff --git a/interface/patient_file/summary/stats.php b/interface/patient_file/summary/stats.php index a57503663..4683e57be 100644 --- a/interface/patient_file/summary/stats.php +++ b/interface/patient_file/summary/stats.php @@ -2,6 +2,7 @@ include_once("../../globals.php"); include_once("$srcdir/lists.inc"); include_once("$srcdir/acl.inc"); +include_once("$srcdir/options.inc.php"); // We used to present a more complex list for "medical problem" issues // for athletic teams. However we decided in May 2008 to stop that. @@ -172,13 +173,11 @@ foreach (array('treatment_protocols','injury_log') as $formname) { " . - $row{'immunization_data'} . "
\n"; + $row{'immunization_data'} . + generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) . + "
\n"; } ?> diff --git a/sql/3_0_1-to-3_0_2_upgrade.sql b/sql/3_0_1-to-3_0_2_upgrade.sql index faaa41351..be5420b88 100644 --- a/sql/3_0_1-to-3_0_2_upgrade.sql +++ b/sql/3_0_1-to-3_0_2_upgrade.sql @@ -68,6 +68,12 @@ INSERT INTO list_options VALUES ('note_type','Bill/Collect' ,'Bill/Collect' INSERT INTO list_options VALUES ('note_type','Other' ,'Other' ,10,0,0); #EndIf +#IfNotRow list_options list_id immunizations +INSERT INTO list_options VALUES ('lists','immunizations','Immunizations',8,0,0); +INSERT INTO list_options (list_id,option_id,title) SELECT 'immunizations',id,name FROM immunization ORDER BY name; +DROP TABLE immunization; +#EndIf + UPDATE `layout_options` SET data_type = 26 WHERE form_id = 'DEM' and field_id = 'state'; UPDATE `layout_options` diff --git a/sql/database.sql b/sql/database.sql index ba6cd3260..ec62f0531 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -1343,60 +1343,6 @@ CREATE TABLE `history_data` ( -- -------------------------------------------------------- -- --- Table structure for table `immunization` --- - -DROP TABLE IF EXISTS `immunization`; -CREATE TABLE `immunization` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(255) default NULL, - PRIMARY KEY (`id`), - KEY `immunization_name` (`name`) -) ENGINE=MyISAM AUTO_INCREMENT=36 ; - --- --- Dumping data for table `immunization` --- - -INSERT INTO `immunization` VALUES (1, 'DTaP 1'); -INSERT INTO `immunization` VALUES (2, 'DTaP 2'); -INSERT INTO `immunization` VALUES (3, 'DTaP 3'); -INSERT INTO `immunization` VALUES (4, 'DTaP 4'); -INSERT INTO `immunization` VALUES (5, 'DTaP 5'); -INSERT INTO `immunization` VALUES (6, 'DT 1'); -INSERT INTO `immunization` VALUES (7, 'DT 2'); -INSERT INTO `immunization` VALUES (8, 'DT 3'); -INSERT INTO `immunization` VALUES (9, 'DT 4'); -INSERT INTO `immunization` VALUES (10, 'DT 5'); -INSERT INTO `immunization` VALUES (11, 'IPV 1'); -INSERT INTO `immunization` VALUES (12, 'IPV 2'); -INSERT INTO `immunization` VALUES (13, 'IPV 3'); -INSERT INTO `immunization` VALUES (14, 'IPV 4'); -INSERT INTO `immunization` VALUES (15, 'Hib 1'); -INSERT INTO `immunization` VALUES (16, 'Hib 2'); -INSERT INTO `immunization` VALUES (17, 'Hib 3'); -INSERT INTO `immunization` VALUES (18, 'Hib 4'); -INSERT INTO `immunization` VALUES (19, 'Pneumococcal Conjugate 1'); -INSERT INTO `immunization` VALUES (20, 'Pneumococcal Conjugate 2'); -INSERT INTO `immunization` VALUES (21, 'Pneumococcal Conjugate 3'); -INSERT INTO `immunization` VALUES (22, 'Pneumococcal Conjugate 4'); -INSERT INTO `immunization` VALUES (23, 'MMR 1'); -INSERT INTO `immunization` VALUES (24, 'MMR 2'); -INSERT INTO `immunization` VALUES (25, 'Varicella 1'); -INSERT INTO `immunization` VALUES (26, 'Varicella 2'); -INSERT INTO `immunization` VALUES (27, 'Hepatitis B 1'); -INSERT INTO `immunization` VALUES (28, 'Hepatitis B 2'); -INSERT INTO `immunization` VALUES (29, 'Hepatitis B 3'); -INSERT INTO `immunization` VALUES (30, 'Influenza 1'); -INSERT INTO `immunization` VALUES (31, 'Influenza 2'); -INSERT INTO `immunization` VALUES (32, 'Td'); -INSERT INTO `immunization` VALUES (33, 'Hepatitis A 1'); -INSERT INTO `immunization` VALUES (34, 'Hepatitis A 2'); -INSERT INTO `immunization` VALUES (35, 'Other'); - --- -------------------------------------------------------- - --- -- Table structure for table `immunizations` -- @@ -1955,6 +1901,43 @@ INSERT INTO list_options VALUES ('note_type','Test Scheduling','Test Scheduling' INSERT INTO list_options VALUES ('note_type','Bill/Collect' ,'Bill/Collect' , 9,0,0); INSERT INTO list_options VALUES ('note_type','Other' ,'Other' ,10,0,0); +INSERT INTO list_options VALUES ('lists' ,'immunizations','Immunizations' , 8,0,0); +INSERT INTO list_options VALUES ('immunizations','1' ,'DTaP 1' , 30,0,0); +INSERT INTO list_options VALUES ('immunizations','2' ,'DTaP 2' , 35,0,0); +INSERT INTO list_options VALUES ('immunizations','3' ,'DTaP 3' , 40,0,0); +INSERT INTO list_options VALUES ('immunizations','4' ,'DTaP 4' , 45,0,0); +INSERT INTO list_options VALUES ('immunizations','5' ,'DTaP 5' , 50,0,0); +INSERT INTO list_options VALUES ('immunizations','6' ,'DT 1' , 5,0,0); +INSERT INTO list_options VALUES ('immunizations','7' ,'DT 2' , 10,0,0); +INSERT INTO list_options VALUES ('immunizations','8' ,'DT 3' , 15,0,0); +INSERT INTO list_options VALUES ('immunizations','9' ,'DT 4' , 20,0,0); +INSERT INTO list_options VALUES ('immunizations','10' ,'DT 5' , 25,0,0); +INSERT INTO list_options VALUES ('immunizations','11' ,'IPV 1' ,110,0,0); +INSERT INTO list_options VALUES ('immunizations','12' ,'IPV 2' ,115,0,0); +INSERT INTO list_options VALUES ('immunizations','13' ,'IPV 3' ,120,0,0); +INSERT INTO list_options VALUES ('immunizations','14' ,'IPV 4' ,125,0,0); +INSERT INTO list_options VALUES ('immunizations','15' ,'Hib 1' , 80,0,0); +INSERT INTO list_options VALUES ('immunizations','16' ,'Hib 2' , 85,0,0); +INSERT INTO list_options VALUES ('immunizations','17' ,'Hib 3' , 90,0,0); +INSERT INTO list_options VALUES ('immunizations','18' ,'Hib 4' , 95,0,0); +INSERT INTO list_options VALUES ('immunizations','19' ,'Pneumococcal Conjugate 1',140,0,0); +INSERT INTO list_options VALUES ('immunizations','20' ,'Pneumococcal Conjugate 2',145,0,0); +INSERT INTO list_options VALUES ('immunizations','21' ,'Pneumococcal Conjugate 3',150,0,0); +INSERT INTO list_options VALUES ('immunizations','22' ,'Pneumococcal Conjugate 4',155,0,0); +INSERT INTO list_options VALUES ('immunizations','23' ,'MMR 1' ,130,0,0); +INSERT INTO list_options VALUES ('immunizations','24' ,'MMR 2' ,135,0,0); +INSERT INTO list_options VALUES ('immunizations','25' ,'Varicella 1' ,165,0,0); +INSERT INTO list_options VALUES ('immunizations','26' ,'Varicella 2' ,170,0,0); +INSERT INTO list_options VALUES ('immunizations','27' ,'Hepatitis B 1' , 65,0,0); +INSERT INTO list_options VALUES ('immunizations','28' ,'Hepatitis B 2' , 70,0,0); +INSERT INTO list_options VALUES ('immunizations','29' ,'Hepatitis B 3' , 75,0,0); +INSERT INTO list_options VALUES ('immunizations','30' ,'Influenza 1' ,100,0,0); +INSERT INTO list_options VALUES ('immunizations','31' ,'Influenza 2' ,105,0,0); +INSERT INTO list_options VALUES ('immunizations','32' ,'Td' ,160,0,0); +INSERT INTO list_options VALUES ('immunizations','33' ,'Hepatitis A 1' , 55,0,0); +INSERT INTO list_options VALUES ('immunizations','34' ,'Hepatitis A 2' , 60,0,0); +INSERT INTO list_options VALUES ('immunizations','35' ,'Other' ,175,0,0); + -- -------------------------------------------------------- -- -- 2.11.4.GIT