4 $sanitize_all_escapes=true;
7 //STOP FAKE REGISTER GLOBALS
8 $fake_register_globals=false;
11 include_once("../../globals.php");
12 include_once("$srcdir/sql.inc");
13 include_once("$srcdir/options.inc.php");
14 include_once("$srcdir/immunization_helper.php");
16 if (isset($_GET['mode'])) {
18 * THIS IS A BUG. IF NEW IMMUN IS ADDED AND USER PRINTS PDF,
19 * WHEN BACK IS CLICKED, ANOTHER ITEM GETS ADDED
22 if ($_GET['mode'] == "add") {
23 $sql = "REPLACE INTO immunizations set
25 administered_date = if(?,?,NULL),
30 administered_by_id = if(?,?,NULL),
31 administered_by = if(?,?,NULL),
32 education_date = if(?,?,NULL),
33 vis_date = if(?,?,NULL),
39 amount_administered = ?,
40 amount_administered_unit = ?,
41 expiration_date = if(?,?,NULL),
43 administration_site = ? ";
44 $sqlBindArray = array(
46 trim($_GET['administered_date']), trim($_GET['administered_date']),
47 trim($_GET['form_immunization_id']),
48 trim($_GET['cvx_code']),
49 trim($_GET['manufacturer']),
50 trim($_GET['lot_number']),
51 trim($_GET['administered_by_id']), trim($_GET['administered_by_id']),
52 trim($_GET['administered_by']), trim($_GET['administered_by']),
53 trim($_GET['education_date']), trim($_GET['education_date']),
54 trim($_GET['vis_date']), trim($_GET['vis_date']),
59 trim($_GET['immuniz_amt_adminstrd']),
60 trim($_GET['form_drug_units']),
61 trim($_GET['immuniz_exp_date']), trim($_GET['immuniz_exp_date']),
62 trim($_GET['immuniz_route']),
63 trim($_GET['immuniz_admin_ste'])
65 sqlStatement($sql,$sqlBindArray);
66 $administered_date=date('Y-m-d H:i');
67 $education_date=date('Y-m-d');
68 $immunization_id=$cvx_code=$manufacturer=$lot_number=$administered_by_id=$note=$id="";
69 $administered_by=$vis_date="";
72 elseif ($_GET['mode'] == "delete" ) {
74 newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "Immunization id ".$_GET['id']." deleted from pid ".$pid);
75 // delete the immunization
76 $sql="DELETE FROM immunizations WHERE id =? LIMIT 1";
77 sqlStatement($sql, array($_GET['id']));
80 elseif ($_GET['mode'] == "added_error" ) {
81 $sql = "UPDATE immunizations " .
82 "SET added_erroneously=? " .
84 $sql_arg_array = array(
85 ($_GET['isError'] === 'true'),
88 sqlStatement($sql, $sql_arg_array);
90 elseif ($_GET['mode'] == "edit" ) {
91 $sql = "select * from immunizations where id = ?";
92 $result = sqlQuery($sql, array($_GET['id']));
94 $administered_date = new DateTime($result['administered_date']);
95 $administered_date = $administered_date->format('Y-m-d H:i');
97 $immuniz_amt_adminstrd = $result['amount_administered'];
98 $drugunitselecteditem = $result['amount_administered_unit'];
99 $immunization_id = $result['immunization_id'];
100 $immuniz_exp_date = $result['expiration_date'];
102 $cvx_code = $result['cvx_code'];
104 if ( !(empty($cvx_code)) ) {
105 $query = "SELECT codes.code_text as `code_text`, codes.code as `code` " .
107 "LEFT JOIN code_types on codes.code_type = code_types.ct_id " .
108 "WHERE code_types.ct_key = 'CVX' AND codes.code = ?";
109 $result_code_text = sqlQuery($query, array($cvx_code));
110 $code_text = $result_code_text['code_text'];
112 $manufacturer = $result['manufacturer'];
113 $lot_number = $result['lot_number'];
114 $administered_by_id = ($result['administered_by_id'] ?
$result['administered_by_id'] : 0);
116 $administered_by = "";
117 if (!$result['administered_by'] && !$row['administered_by_id']) {
118 $stmt = "select concat(lname,', ',fname) as full_name ".
121 $user_result = sqlQuery($stmt, array($result['administered_by_id']));
122 $administered_by = $user_result['full_name'];
125 $education_date = $result['education_date'];
126 $vis_date = $result['vis_date'];
127 $immuniz_route = $result['route'];
128 $immuniz_admin_ste = $result['administration_site'];
129 $note = $result['note'];
130 $isAddedError = $result['added_erroneously'];
138 // Decide whether using the CVX list or the custom list in list_options
139 if ($GLOBALS['use_custom_immun_list']) {
140 // user forces the use of the custom list
144 if ($_GET['mode'] == "edit") {
145 //depends on if a cvx code is enterer already
146 if (empty($cvx_code)) {
153 else { // $_GET['mode'] == "add"
158 // set the default sort method for the list of past immunizations
159 $sortby = $_GET['sortby'];
160 if (!$sortby) { $sortby = 'vacc'; }
162 // set the default value of 'administered_by'
163 if (!$administered_by && !$administered_by_id) {
164 $stmt = "select concat(lname,', ',fname) as full_name ".
165 " from users where ".
167 $row = sqlQuery($stmt, array($_SESSION['authId']));
168 $administered_by = $row['full_name'];
174 <?php
html_header_show();?
>
176 <!-- supporting javascript code
-->
177 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
178 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script
>
179 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
183 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
190 background
-color
: white
;
194 <!-- pop up calendar
-->
195 <style type
="text/css">@import
url(<?php
echo $GLOBALS['webroot'] ?
>/library
/dynarch_calendar
.css
);</style
>
196 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script
>
197 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
198 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script
>
200 <script language
="JavaScript">
201 // required to validate date text boxes
202 var mypcc
= '<?php echo htmlspecialchars( $GLOBALS['phone_country_code
'], ENT_QUOTES); ?>';
207 <body
class="body_top">
209 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
210 <span
class="title"><?php
echo htmlspecialchars( xl('Immunizations'), ENT_NOQUOTES
); ?
></span
>
212 <a href
="patient_summary.php" target
="Main" onClick
="top.restoreSession()">
213 <span
class="title"><?php
echo htmlspecialchars( xl('Immunizations'), ENT_NOQUOTES
); ?
></span
>
214 <span
class=back
><?php
echo htmlspecialchars( $tback, ENT_NOQUOTES
); ?
></span
></a
>
217 <form action
="immunizations.php" name
="add_immunization" id
="add_immunization">
218 <input type
="hidden" name
="mode" id
="mode" value
="add">
219 <input type
="hidden" name
="id" id
="id" value
="<?php echo htmlspecialchars( $id, ENT_QUOTES); ?>">
220 <input type
="hidden" name
="pid" id
="pid" value
="<?php echo htmlspecialchars( $pid, ENT_QUOTES); ?>">
222 <table border
=0 cellpadding
=1 cellspacing
=1>
225 echo "<tr><font color='red'><b>" . xlt("Entered in Error") . "</b></font></tr>";
229 <?php
if (!($useCVX)) { ?
>
233 <?php
echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES
); ?
> </span
> </td
>
236 // Modified 7/2009 by BM to incorporate the immunization items into the list_options listings
237 generate_form_field(array('data_type'=>1,'field_id'=>'immunization_id','list_id'=>'immunizations','empty_title'=>'SKIP'), $immunization_id);
243 <td align
="right" valign
="top" style
="padding-top:4px;">
245 <?php
echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES
); ?
> (<?php
echo htmlspecialchars( xl('CVX Code'), ENT_NOQUOTES
); ?
>) </span
> </td
>
247 <input type
='text' size
='10' name
='cvx_code' id
='cvx_code'
248 value
='<?php echo htmlspecialchars($cvx_code,ENT_QUOTES); ?>' onclick
='sel_cvxcode(this)'
249 title
='<?php echo htmlspecialchars( xl('Click to select
or change CVX code
'), ENT_QUOTES); ?>'
251 <div id
='cvx_description' style
='display:inline; float:right; padding:3px; margin-left:3px; width:400px'>
252 <?php
echo htmlspecialchars( xl( $code_text ), ENT_QUOTES
); ?
> </div
> </td
>
259 <?php
echo htmlspecialchars( xl('Date & Time Administered'), ENT_NOQUOTES
); ?
> </span
> </td
>
260 <td
><table border
="0">
262 <td
><input type
='text' size
='14' name
="administered_date" id
="administered_date"
263 value
='<?php echo $administered_date ? htmlspecialchars( $administered_date, ENT_QUOTES) : date('Y
-m
-d H
:i
'); ?>'
264 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
Hours(24):minutes
'), ENT_QUOTES); ?>'
265 onKeyUp
='datekeyup(this,mypcc)' onBlur
='dateblur(this,mypcc);'
267 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
268 id
='img_administered_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
269 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
275 <td align
="right"><span
class="text"><?php
echo htmlspecialchars( xl('Amount Administered'), ENT_NOQUOTES
); ?
></span
></td
>
277 <input
class='text' type
='text' name
="immuniz_amt_adminstrd" size
="25" value
="<?php echo htmlspecialchars( $immuniz_amt_adminstrd, ENT_QUOTES); ?>">
278 <?php
echo generate_select_list("form_drug_units", "drug_units", $drugunitselecteditem,'Select Drug Unit',''); ?
>
282 <td align
="right"><span
class="text"><?php
echo htmlspecialchars( xl('Immunization Expiration Date'), ENT_NOQUOTES
); ?
></span
></td
>
283 <td
class='text'><input type
='text' size
='10' name
="immuniz_exp_date" id
="immuniz_exp_date"
284 value
='<?php echo $immuniz_exp_date ? htmlspecialchars( $immuniz_exp_date, ENT_QUOTES) : ''; ?>'
285 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
286 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
288 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
289 id
='img_immuniz_exp_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
290 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'></td
>
295 <?php
echo htmlspecialchars( xl('Immunization Manufacturer'), ENT_NOQUOTES
); ?
> </span
> </td
>
297 <input
class='text' type
='text' name
="manufacturer" size
="25" value
="<?php echo htmlspecialchars( $manufacturer, ENT_QUOTES); ?>"> </td
>
302 <?php
echo htmlspecialchars( xl('Immunization Lot Number'), ENT_NOQUOTES
); ?
> </span
> </td
>
304 <input
class='text' type
='text' name
="lot_number" size
="25" value
="<?php echo htmlspecialchars( $lot_number, ENT_QUOTES); ?>"> </td
>
309 <?php
echo htmlspecialchars( xl('Name and Title of Immunization Administrator'), ENT_NOQUOTES
); ?
> </span
> </td
>
311 <input type
="text" name
="administered_by" id
="administered_by" size
="25" value
="<?php echo htmlspecialchars( $administered_by, ENT_QUOTES); ?>">
312 <?php
echo htmlspecialchars( xl('or choose'), ENT_NOQUOTES
); ?
>
314 <select name
="administered_by_id" id
='administered_by_id'>
315 <option value
=""></option
>
317 $sql = "select id, concat(lname,', ',fname) as full_name " .
318 "from users where username != '' " .
319 "order by concat(lname,', ',fname)";
321 $result = sqlStatement($sql);
322 while($row = sqlFetchArray($result)){
323 echo '<OPTION VALUE=' . htmlspecialchars( $row{'id'}, ENT_QUOTES
);
324 echo (isset($administered_by_id) && $administered_by_id != "" ?
$administered_by_id : $_SESSION['authId']) == $row{'id'} ?
' selected>' : '>';
325 echo htmlspecialchars( $row{'full_name'}, ENT_NOQUOTES
) . '</OPTION>';
331 <td align
="right" class="text">
332 <?php
echo htmlspecialchars( xl('Date Immunization Information Statements Given'), ENT_NOQUOTES
); ?
> </td
>
334 <input type
='text' size
='10' name
="education_date" id
="education_date"
335 value
='<?php echo $education_date? htmlspecialchars( $education_date, ENT_QUOTES) : date('Y
-m
-d
'); ?>'
336 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
337 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
339 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
340 id
='img_education_date' border
='0' alt
='[?]' style
='cursor:pointer;'
341 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'
345 <td align
="right" class="text">
346 <?php
echo htmlspecialchars( xl('Date of VIS Statement'), ENT_NOQUOTES
); ?
>
347 (<a href
="http://www.cdc.gov/vaccines/pubs/vis/default.htm" title
="<?php echo htmlspecialchars( xl('Help'), ENT_QUOTES); ?>" target
="_blank">?
</a
>) </td
>
349 <input type
='text' size
='10' name
="vis_date" id
="vis_date"
350 value
='<?php echo $vis_date ? htmlspecialchars( $vis_date, ENT_QUOTES) : date('Y
-m
-d
'); ?>'
351 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
352 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
354 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
355 id
='img_vis_date' border
='0' alt
='[?]' style
='cursor:pointer;'
356 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'
360 <td align
="right" class='text'><?php
echo htmlspecialchars( xl('Route'), ENT_NOQUOTES
); ?
></td
>
362 <?php
echo generate_select_list('immuniz_route', 'drug_route', $immuniz_route, 'Select Route', '');?
>
366 <td align
="right" class='text'><?php
echo htmlspecialchars( xl('Administration Site'), ENT_NOQUOTES
); ?
></td
>
368 <?php
echo generate_select_list('immuniz_admin_ste', 'proc_body_site', $immuniz_admin_ste, 'Select Administration Site', ' ');?
>
372 <td align
="right" class='text'>
373 <?php
echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES
); ?
> </td
>
375 <textarea
class='text' name
="note" id
="note" rows
=5 cols
=25><?php
echo htmlspecialchars( $note, ENT_NOQUOTES
); ?
></textarea
> </td
>
378 <td colspan
="3" align
="center">
380 <input type
="button" name
="save" id
="save" value
="<?php echo htmlspecialchars( xl('Save Immunization'), ENT_QUOTES); ?>">
382 <input type
="button" name
="print" id
="print" value
="<?php echo htmlspecialchars( xl('Print Record') . xl('PDF','',' (',')'), ENT_QUOTES); ?>">
384 <input type
="button" name
="printHtml" id
="printHtml" value
="<?php echo htmlspecialchars( xl('Print Record') . xl('HTML','',' (',')'), ENT_QUOTES); ?>">
386 <input type
="reset" name
="clear" id
="clear" value
="<?php echo htmlspecialchars( xl('Clear'), ENT_QUOTES); ?>"> </td
>
391 <div id
="immunization_list">
393 <table border
=0 cellpadding
=3 cellspacing
=0>
395 <!-- some columns are sortable
-->
396 <tr
class='text bold'>
398 <a href
="javascript:top.restoreSession();location.href='immunizations.php?sortby=vacc';" title
='<?php echo htmlspecialchars( xl('Sort by vaccine
'), ENT_QUOTES); ?>'>
399 <?php
echo htmlspecialchars( xl('Vaccine'), ENT_NOQUOTES
); ?
></a
>
400 <span
class='small' style
='font-family:arial'><?php
if ($sortby == 'vacc') { echo 'v'; } ?
></span
>
403 <a href
="javascript:top.restoreSession();location.href='immunizations.php?sortby=date';" title
='<?php echo htmlspecialchars( xl('Sort by date
'), ENT_QUOTES); ?>'>
404 <?php
echo htmlspecialchars( xl('Date'), ENT_NOQUOTES
); ?
></a
>
405 <span
class='small' style
='font-family:arial'><?php
if ($sortby == 'date') { echo 'v'; } ?
></span
>
407 <th
><?php
echo htmlspecialchars( xl('Amount'), ENT_NOQUOTES
); ?
></th
>
408 <th
><?php
echo htmlspecialchars( xl('Manufacturer'), ENT_NOQUOTES
); ?
></th
>
409 <th
><?php
echo htmlspecialchars( xl('Lot Number'), ENT_NOQUOTES
); ?
></th
>
410 <th
><?php
echo htmlspecialchars( xl('Administered By'), ENT_NOQUOTES
); ?
></th
>
411 <th
><?php
echo htmlspecialchars( xl('Education Date'), ENT_NOQUOTES
); ?
></th
>
412 <th
><?php
echo htmlspecialchars( xl('Route'), ENT_NOQUOTES
); ?
></th
>
413 <th
><?php
echo htmlspecialchars( xl('Administered Site'), ENT_NOQUOTES
); ?
></th
>
414 <th
><?php
echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES
); ?
></th
>
415 <th
><?php
echo htmlspecialchars( xl('Error'), ENT_NOQUOTES
); ?
></th
>
420 $result = getImmunizationList($pid, $_GET['sortby'], true);
422 while($row = sqlFetchArray($result)) {
423 $isError = $row['added_erroneously'];
426 $tr_title = 'title="' . xla("Entered in Error") . '"';
431 if ($row["id"] == $id) {
432 echo "<tr " . $tr_title . " class='immrow text selected' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."'>";
435 echo "<tr " . $tr_title . " class='immrow text' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."'>";
438 // Figure out which name to use (ie. from cvx list or from the custom list)
439 if ($GLOBALS['use_custom_immun_list']) {
440 $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
443 if (!empty($row['code_text_short'])) {
444 $vaccine_display = htmlspecialchars( xl($row['code_text_short']), ENT_NOQUOTES
);
447 $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
452 $del_tag_open = "<del>";
453 $del_tag_close = "</del>";
459 echo "<td>" . $del_tag_open . $vaccine_display . $del_tag_close . "</td>";
461 if ($row["administered_date"]) {
462 $administered_date_summary = new DateTime($row['administered_date']);
463 $administered_date_summary = $administered_date_summary->format('Y-m-d H:i');
465 $administered_date_summary = "";
467 echo "<td>" . $del_tag_open . htmlspecialchars( $administered_date_summary, ENT_NOQUOTES
) . $del_tag_close . "</td>";
468 if ($row["amount_administered"] > 0) {
469 echo "<td>" . $del_tag_open . htmlspecialchars( $row["amount_administered"] . " " . generate_display_field(array('data_type'=>'1','list_id'=>'drug_units'), $row['amount_administered_unit']) , ENT_NOQUOTES
) . $del_tag_close . "</td>";
472 echo "<td> </td>";
474 echo "<td>" . $del_tag_open . htmlspecialchars( $row["manufacturer"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
475 echo "<td>" . $del_tag_open . htmlspecialchars( $row["lot_number"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
476 echo "<td>" . $del_tag_open . htmlspecialchars( $row["administered_by"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
477 echo "<td>" . $del_tag_open . htmlspecialchars( $row["education_date"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
478 echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'drug_route'), $row['route']) . $del_tag_close . "</td>";
479 echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'proc_body_site'), $row['administration_site']) . $del_tag_close . "</td>";
480 echo "<td>" . $del_tag_open . htmlspecialchars( $row["note"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
483 $checkbox = "checked";
488 echo "<td><input type='checkbox' class='error' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."' value='" . htmlspecialchars( xl('Error'), ENT_QUOTES
) . "' " . $checkbox . "></td>";
490 echo "<td><input type='button' class='delete' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."' value='" . htmlspecialchars( xl('Delete'), ENT_QUOTES
) . "'></td>";
497 </div
> <!-- end immunizations
-->
501 <script language
="javascript">
502 /* required for popup calendar */
503 Calendar
.setup({inputField
:"administered_date", ifFormat
:"%Y-%m-%d %H:%M", button
:"img_administered_date", showsTime
:true});
504 Calendar
.setup({inputField
:"immuniz_exp_date", ifFormat
:"%Y-%m-%d", button
:"img_immuniz_exp_date"});
505 Calendar
.setup({inputField
:"education_date", ifFormat
:"%Y-%m-%d", button
:"img_education_date"});
506 Calendar
.setup({inputField
:"vis_date", ifFormat
:"%Y-%m-%d", button
:"img_vis_date"});
508 // jQuery stuff to make the page a little easier to use
510 $
(document
).ready(function(){
511 <?php
if (!($useCVX)) { ?
>
512 $
("#save").click(function() { SaveForm(); });
514 $
("#save").click(function() {
515 if (validate_cvx()) {
523 $
("#print").click(function() { PrintForm("pdf"); });
524 $
("#printHtml").click(function() { PrintForm("html"); });
525 $
(".immrow").click(function() { EditImm(this
); });
526 $
(".error").click(function(event
) { ErrorImm(this
); event
.stopPropagation(); });
527 $
(".delete").click(function(event
) { DeleteImm(this
); event
.stopPropagation(); });
529 $
(".immrow").mouseover(function() { $
(this
).toggleClass("highlight"); });
530 $
(".immrow").mouseout(function() { $
(this
).toggleClass("highlight"); });
532 $
("#administered_by_id").change(function() { $
("#administered_by").val($
("#administered_by_id :selected").text()); });
534 $
("#form_immunization_id").change( function() {
535 if ( $
(this
).val() != "" ) {
536 $
("#cvx_code").val( "" );
537 $
("#cvx_description").text( "" );
538 $
("#cvx_code").change();
543 var PrintForm
= function(typ
) {
544 top
.restoreSession();
545 newURL
='shot_record.php?output='+typ+
'&sortby=<?php echo $sortby; ?>';
546 window
.open(newURL
, '_blank', "menubar=1,toolbar=1,scrollbars=1,resizable=1,width=600,height=450");
549 var SaveForm
= function() {
550 top
.restoreSession();
551 $
("#add_immunization").submit();
554 var EditImm
= function(imm
) {
555 top
.restoreSession();
556 location
.href
='immunizations.php?mode=edit&id='+imm
.id
;
559 var DeleteImm
= function(imm
) {
560 if (confirm("<?php echo htmlspecialchars( xl('This action cannot be undone.'), ENT_QUOTES); ?>" +
"\n" +
"<?php echo htmlspecialchars( xl('Do you wish to PERMANENTLY delete this immunization record?'), ENT_QUOTES); ?>")) {
561 top
.restoreSession();
562 location
.href
='immunizations.php?mode=delete&id='+imm
.id
;
566 var ErrorImm
= function(imm
) {
567 top
.restoreSession();
568 location
.href
='immunizations.php?mode=added_error&id='+imm
.id+
'&isError='+imm
.checked
;
571 //This is for callback by the find-code popup.
572 //Appends to or erases the current list of diagnoses.
573 function set_related(codetype
, code
, selector
, codedesc
) {
574 var f
= document
.forms
[0][current_sel_name
];
585 $
("#cvx_description").text( codedesc
);
586 $
("#form_immunization_id").attr( "value", "" );
587 $
("#form_immunization_id").change();
591 // This invokes the find-code popup.
592 function sel_cvxcode(e
) {
593 current_sel_name
= e
.name
;
594 dlgopen('../encounter/find_code_popup.php?codetype=CVX', '_blank', 500, 400);
597 // This ensures the cvx centric entry is filled.
598 function validate_cvx() {
599 if (document
.add_immunization
.cvx_code
.value
>0) {
603 document
.add_immunization
.cvx_code
.style
.backgroundColor
="red";
604 document
.add_immunization
.cvx_code
.focus();