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 completion_status = ?,
45 information_source = ?,
47 ordering_provider = ?";
48 $sqlBindArray = array(
50 trim($_GET['administered_date']), trim($_GET['administered_date']),
51 trim($_GET['form_immunization_id']),
52 trim($_GET['cvx_code']),
53 trim($_GET['manufacturer']),
54 trim($_GET['lot_number']),
55 trim($_GET['administered_by_id']), trim($_GET['administered_by_id']),
56 trim($_GET['administered_by']), trim($_GET['administered_by']),
57 trim($_GET['education_date']), trim($_GET['education_date']),
58 trim($_GET['vis_date']), trim($_GET['vis_date']),
63 trim($_GET['immuniz_amt_adminstrd']),
64 trim($_GET['form_drug_units']),
65 trim($_GET['immuniz_exp_date']), trim($_GET['immuniz_exp_date']),
66 trim($_GET['immuniz_route']),
67 trim($_GET['immuniz_admin_ste']),
68 trim($_GET['immuniz_completion_status']),
69 trim($_GET['immunization_informationsource']),
70 trim($_GET['immunization_refusal_reason']),
71 trim($_GET['ordered_by_id'])
73 $newid = sqlInsert($sql,$sqlBindArray);
74 $administered_date=date('Y-m-d H:i');
75 $education_date=date('Y-m-d');
76 $immunization_id=$cvx_code=$manufacturer=$lot_number=$administered_by_id=$note=$id=$ordered_by_id="";
77 $administered_by=$vis_date="";
78 $newid = $_GET['id'] ?
$_GET['id'] : $newid;
79 if($GLOBALS['observation_results_immunization']) {
80 saveImmunizationObservationResults($newid,$_GET);
84 elseif ($_GET['mode'] == "delete" ) {
86 newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "Immunization id ".$_GET['id']." deleted from pid ".$pid);
87 // delete the immunization
88 $sql="DELETE FROM immunizations WHERE id =? LIMIT 1";
89 sqlStatement($sql, array($_GET['id']));
92 elseif ($_GET['mode'] == "added_error" ) {
93 $sql = "UPDATE immunizations " .
94 "SET added_erroneously=? " .
96 $sql_arg_array = array(
97 ($_GET['isError'] === 'true'),
100 sqlStatement($sql, $sql_arg_array);
102 elseif ($_GET['mode'] == "edit" ) {
103 $sql = "select * from immunizations where id = ?";
104 $result = sqlQuery($sql, array($_GET['id']));
106 $administered_date = new DateTime($result['administered_date']);
107 $administered_date = $administered_date->format('Y-m-d H:i');
109 $immuniz_amt_adminstrd = $result['amount_administered'];
110 $drugunitselecteditem = $result['amount_administered_unit'];
111 $immunization_id = $result['immunization_id'];
112 $immuniz_exp_date = $result['expiration_date'];
114 $cvx_code = $result['cvx_code'];
116 if ( !(empty($cvx_code)) ) {
117 $query = "SELECT codes.code_text as `code_text`, codes.code as `code` " .
119 "LEFT JOIN code_types on codes.code_type = code_types.ct_id " .
120 "WHERE code_types.ct_key = 'CVX' AND codes.code = ?";
121 $result_code_text = sqlQuery($query, array($cvx_code));
122 $code_text = $result_code_text['code_text'];
124 $manufacturer = $result['manufacturer'];
125 $lot_number = $result['lot_number'];
126 $administered_by_id = ($result['administered_by_id'] ?
$result['administered_by_id'] : 0);
127 $ordered_by_id = ($result['ordering_provider'] ?
$result['ordering_provider'] : 0);
128 $entered_by_id = ($result['created_by'] ?
$result['created_by'] : 0);
130 $administered_by = "";
131 if (!$result['administered_by'] && !$row['administered_by_id']) {
132 $stmt = "select CONCAT(IFNULL(lname,''), ' ,',IFNULL(fname,'')) as full_name ".
135 $user_result = sqlQuery($stmt, array($result['administered_by_id']));
136 $administered_by = $user_result['full_name'];
139 $education_date = $result['education_date'];
140 $vis_date = $result['vis_date'];
141 $immuniz_route = $result['route'];
142 $immuniz_admin_ste = $result['administration_site'];
143 $note = $result['note'];
144 $isAddedError = $result['added_erroneously'];
146 $immuniz_completion_status = $result['completion_status'];
147 $immuniz_information_source = $result['information_source'];
148 $immuniz_refusal_reason = $result['refusal_reason'];
152 $imm_obs_data = getImmunizationObservationResults();
156 $observation_criteria = getImmunizationObservationLists('1');
157 $observation_criteria_value = getImmunizationObservationLists('2');
158 // Decide whether using the CVX list or the custom list in list_options
159 if ($GLOBALS['use_custom_immun_list']) {
160 // user forces the use of the custom list
164 if ($_GET['mode'] == "edit") {
165 //depends on if a cvx code is enterer already
166 if (empty($cvx_code)) {
173 else { // $_GET['mode'] == "add"
178 // set the default sort method for the list of past immunizations
179 $sortby = $_GET['sortby'];
180 if (!$sortby) { $sortby = 'vacc'; }
182 // set the default value of 'administered_by'
183 if (!$administered_by && !$administered_by_id) {
184 $stmt = "select CONCAT(IFNULL(lname,''), ' ,',IFNULL(fname,'')) as full_name ".
185 " from users where ".
187 $row = sqlQuery($stmt, array($_SESSION['authId']));
188 $administered_by = $row['full_name'];
191 // get the entered username
192 if ($entered_by_id) {
193 $stmt = "select CONCAT(IFNULL(lname,''), ' ,',IFNULL(fname,'')) as full_name ".
194 " from users where ".
196 $row = sqlQuery($stmt, array($entered_by_id));
197 $entered_by = $row['full_name'];
200 if($_POST['type'] == 'duplicate_row'){
201 $observation_criteria = getImmunizationObservationLists('1');
202 echo json_encode($observation_criteria);
205 if($_POST['type'] == 'duplicate_row_2'){
206 $observation_criteria_value = getImmunizationObservationLists('2');
207 echo json_encode($observation_criteria_value);
211 function getImmunizationObservationLists($k)
214 $observation_criteria_res = sqlStatement("SELECT * FROM list_options WHERE list_id = ? AND activity=1 ORDER BY seq, title", array('immunization_observation'));
215 for ($iter = 0; $row = sqlFetchArray($observation_criteria_res); $iter++
) {
216 $observation_criteria[0]['option_id'] = '';
217 $observation_criteria[0]['title'] = 'Unassigned';
218 $observation_criteria[++
$iter] = $row;
220 return $observation_criteria;
222 $observation_criteria_value_res = sqlStatement("SELECT * FROM list_options WHERE list_id = ? AND activity=1 ORDER BY seq, title", array('imm_vac_eligibility_results'));
223 for ($iter = 0; $row = sqlFetchArray($observation_criteria_value_res); $iter++
) {
224 $observation_criteria_value[0]['option_id'] = '';
225 $observation_criteria_value[0]['title'] = 'Unassigned';
226 $observation_criteria_value[++
$iter] = $row;
228 return $observation_criteria_value;
232 function getImmunizationObservationResults()
237 immunization_observation
240 $res = sqlStatement($obs_res_q, array($_SESSION["pid"],$_GET['id']));
241 for ($iter = 0; $row = sqlFetchArray($res); $iter++
)
242 $imm_obs_data[$iter] = $row;
243 return $imm_obs_data;
246 function saveImmunizationObservationResults($id,$immunizationdata)
248 $imm_obs_data = getImmunizationObservationResults();
249 if(count($imm_obs_data) > 0) {
250 foreach($imm_obs_data as $key=>$val) {
251 if($val['imo_id'] && $val['imo_id'] != 0 ) {
254 immunization_observation
257 $result2 = sqlQuery($sql2,array($val['imo_im_id'],$val['imo_pid']));
261 for($i = 0; $i < $immunizationdata['tr_count']; $i++
) {
262 if($immunizationdata['observation_criteria'][$i] == 'vaccine_type') {
263 $code = $immunizationdata['cvx_vac_type_code'][$i];
264 $code_text = $immunizationdata['code_text_hidden'][$i];
265 $code_type = $immunizationdata['code_type_hidden'][$i];
266 $vis_published_dateval = $immunizationdata['vis_published_date'][$i] ?
$immunizationdata['vis_published_date'][$i] : '';
267 $vis_presented_dateval = $immunizationdata['vis_presented_date'][$i] ?
$immunizationdata['vis_presented_date'][$i] : '';
268 $imo_criteria_value = '';
269 } else if($immunizationdata['observation_criteria'][$i] == 'disease_with_presumed_immunity') {
270 $code = $immunizationdata['sct_code'][$i];
271 $code_text = $immunizationdata['codetext'][$i];
272 $code_type = $immunizationdata['codetypehidden'][$i];
273 $imo_criteria_value = '';
274 $vis_published_dateval = '';
275 $vis_presented_dateval = '';
276 }else if($immunizationdata['observation_criteria'][$i] == 'funding_program_eligibility') {
277 $imo_criteria_value = $immunizationdata['observation_criteria_value'][$i];
281 $vis_published_dateval = '';
282 $vis_presented_dateval = '';
285 if($immunizationdata['observation_criteria'][$i] != '') {
286 $sql = " INSERT INTO immunization_observation (
295 imo_vis_date_published,
296 imo_vis_date_presented
299 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
300 $res = sqlQuery($sql, array($id,$_SESSION["pid"],$immunizationdata['observation_criteria'][$i],$imo_criteria_value,$_SESSION['authId'],$code, $code_text, $code_type,$vis_published_dateval,$vis_presented_dateval));
308 <?php
html_header_show();?
>
310 <!-- supporting javascript code
-->
311 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-1/index.js"></script
>
312 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script
>
313 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
317 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
324 background
-color
: white
;
328 <!-- pop up calendar
-->
329 <style type
="text/css">@import
url(<?php
echo $GLOBALS['webroot'] ?
>/library
/dynarch_calendar
.css
);</style
>
330 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script
>
331 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
332 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script
>
334 <script language
="JavaScript">
335 // required to validate date text boxes
336 var mypcc
= '<?php echo htmlspecialchars( $GLOBALS['phone_country_code
'], ENT_QUOTES); ?>';
341 <body
class="body_top">
343 <span
class="title"><?php
echo htmlspecialchars( xl('Immunizations'), ENT_NOQUOTES
); ?
></span
>
345 <form action
="immunizations.php" name
="add_immunization" id
="add_immunization">
346 <input type
="hidden" name
="mode" id
="mode" value
="add">
347 <input type
="hidden" name
="id" id
="id" value
="<?php echo htmlspecialchars( $id, ENT_QUOTES); ?>">
348 <input type
="hidden" name
="pid" id
="pid" value
="<?php echo htmlspecialchars( $pid, ENT_QUOTES); ?>">
350 <table border
=0 cellpadding
=1 cellspacing
=1>
353 echo "<tr><font color='red'><b>" . xlt("Entered in Error") . "</b></font></tr>";
357 <?php
if (!($useCVX)) { ?
>
361 <?php
echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES
); ?
> </span
> </td
>
364 // Modified 7/2009 by BM to incorporate the immunization items into the list_options listings
365 generate_form_field(array('data_type'=>1,'field_id'=>'immunization_id','list_id'=>'immunizations','empty_title'=>'SKIP'), $immunization_id);
371 <td align
="right" valign
="top" style
="padding-top:4px;">
373 <?php
echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES
); ?
> (<?php
echo htmlspecialchars( xl('CVX Code'), ENT_NOQUOTES
); ?
>) </span
> </td
>
375 <input type
='text' size
='10' name
='cvx_code' id
='cvx_code'
376 value
='<?php echo htmlspecialchars($cvx_code,ENT_QUOTES); ?>' onclick
='sel_cvxcode(this)'
377 title
='<?php echo htmlspecialchars( xl('Click to select
or change CVX code
'), ENT_QUOTES); ?>'
379 <div id
='cvx_description' style
='display:inline; float:right; padding:3px; margin-left:3px; width:400px'>
380 <?php
echo htmlspecialchars( xl( $code_text ), ENT_QUOTES
); ?
> </div
> </td
>
387 <?php
echo htmlspecialchars( xl('Date & Time Administered'), ENT_NOQUOTES
); ?
> </span
> </td
>
388 <td
><table border
="0">
390 <td
><input type
='text' size
='14' name
="administered_date" id
="administered_date"
391 value
='<?php echo $administered_date ? htmlspecialchars( $administered_date, ENT_QUOTES) : date('Y
-m
-d H
:i
'); ?>'
392 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
Hours(24):minutes
'), ENT_QUOTES); ?>'
393 onKeyUp
='datekeyup(this,mypcc)' onBlur
='dateblur(this,mypcc);'
395 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
396 id
='img_administered_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
397 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
403 <td align
="right"><span
class="text"><?php
echo htmlspecialchars( xl('Amount Administered'), ENT_NOQUOTES
); ?
></span
></td
>
405 <input
class='text' type
='text' name
="immuniz_amt_adminstrd" size
="25" value
="<?php echo htmlspecialchars( $immuniz_amt_adminstrd, ENT_QUOTES); ?>">
406 <?php
echo generate_select_list("form_drug_units", "drug_units", $drugunitselecteditem,'Select Drug Unit',''); ?
>
410 <td align
="right"><span
class="text"><?php
echo htmlspecialchars( xl('Immunization Expiration Date'), ENT_NOQUOTES
); ?
></span
></td
>
411 <td
class='text'><input type
='text' size
='10' name
="immuniz_exp_date" id
="immuniz_exp_date"
412 value
='<?php echo $immuniz_exp_date ? htmlspecialchars( $immuniz_exp_date, ENT_QUOTES) : ''; ?>'
413 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
414 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
416 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
417 id
='img_immuniz_exp_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
418 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'></td
>
423 <?php
echo htmlspecialchars( xl('Immunization Manufacturer'), ENT_NOQUOTES
); ?
> </span
> </td
>
425 <?php
echo generate_select_list('manufacturer', 'Immunization_Manufacturer', $manufacturer, 'Select Manufacturer', '');?
>
430 <?php
echo htmlspecialchars( xl('Immunization Lot Number'), ENT_NOQUOTES
); ?
> </span
> </td
>
432 <input
class='text' type
='text' name
="lot_number" size
="25" value
="<?php echo htmlspecialchars( $lot_number, ENT_QUOTES); ?>"> </td
>
437 <?php
echo htmlspecialchars( xl('Name and Title of Immunization Administrator'), ENT_NOQUOTES
); ?
> </span
> </td
>
439 <input type
="text" name
="administered_by" id
="administered_by" size
="25" value
="<?php echo htmlspecialchars( $administered_by, ENT_QUOTES); ?>">
440 <?php
echo htmlspecialchars( xl('or choose'), ENT_NOQUOTES
); ?
>
442 <select name
="administered_by_id" id
='administered_by_id'>
443 <option value
=""></option
>
445 $sql = "select id, CONCAT_WS(' ',lname,fname) as full_name " .
446 "from users where username != '' and password != 'NoLogin' " .
447 "order by full_name";
449 $result = sqlStatement($sql);
450 while($row = sqlFetchArray($result)){
451 echo '<OPTION VALUE=' . htmlspecialchars( $row{'id'}, ENT_QUOTES
);
452 echo (isset($administered_by_id) && $administered_by_id != "" ?
$administered_by_id : $_SESSION['authId']) == $row{'id'} ?
' selected>' : '>';
453 echo htmlspecialchars( $row{'full_name'}, ENT_NOQUOTES
) . '</OPTION>';
459 <td align
="right" class="text">
460 <?php
echo htmlspecialchars( xl('Date Immunization Information Statements Given'), ENT_NOQUOTES
); ?
> </td
>
462 <input type
='text' size
='10' name
="education_date" id
="education_date"
463 value
='<?php echo $education_date? htmlspecialchars( $education_date, ENT_QUOTES) : date('Y
-m
-d
'); ?>'
464 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
465 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
467 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
468 id
='img_education_date' border
='0' alt
='[?]' style
='cursor:pointer;'
469 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'
473 <td align
="right" class="text">
474 <?php
echo htmlspecialchars( xl('Date of VIS Statement'), ENT_NOQUOTES
); ?
>
475 (<a href
="http://www.cdc.gov/vaccines/pubs/vis/default.htm" title
="<?php echo htmlspecialchars( xl('Help'), ENT_QUOTES); ?>" target
="_blank">?
</a
>) </td
>
477 <input type
='text' size
='10' name
="vis_date" id
="vis_date"
478 value
='<?php echo $vis_date ? htmlspecialchars( $vis_date, ENT_QUOTES) : date('Y
-m
-d
'); ?>'
479 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>'
480 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);'
482 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
483 id
='img_vis_date' border
='0' alt
='[?]' style
='cursor:pointer;'
484 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'
488 <td align
="right" class='text'><?php
echo htmlspecialchars( xl('Route'), ENT_NOQUOTES
); ?
></td
>
490 <?php
echo generate_select_list('immuniz_route', 'drug_route', $immuniz_route, 'Select Route', '');?
>
494 <td align
="right" class='text'><?php
echo htmlspecialchars( xl('Administration Site'), ENT_NOQUOTES
); ?
></td
>
496 <?php
echo generate_select_list('immuniz_admin_ste', 'immunization_administered_site', $immuniz_admin_ste, 'Select Administration Site', ' ', '','','',null,false,'proc_body_site');?
>
500 <td align
="right" class='text'>
501 <?php
echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES
); ?
> </td
>
503 <textarea
class='text' name
="note" id
="note" rows
=5 cols
=25><?php
echo htmlspecialchars( $note, ENT_NOQUOTES
); ?
></textarea
> </td
>
506 <td align
="right" class='text'>
507 <?php
echo htmlspecialchars( xl('Information Source'), ENT_NOQUOTES
); ?
>
510 <?php
echo generate_select_list('immunization_informationsource', 'immunization_informationsource', $immuniz_information_source, 'Select Information Source', ' ');?
>
514 <td align
="right" class='text'>
515 <?php
echo htmlspecialchars( xl('Completion Status'), ENT_NOQUOTES
); ?
> </td
>
517 <?php
echo generate_select_list('immuniz_completion_status', 'Immunization_Completion_Status', $immuniz_completion_status, 'Select Completion Status', ' ');?
> </td
>
520 <td align
="right" class='text'>
521 <?php
echo htmlspecialchars( xl('Substance Refusal Reason'), ENT_NOQUOTES
); ?
>
524 <?php
echo generate_select_list('immunization_refusal_reason', 'immunization_refusal_reason', $immuniz_refusal_reason, 'Select Refusal Reason', ' ');?
>
528 <td align
="right" class='text'>
529 <?php
echo htmlspecialchars( xl('Immunization Ordering Provider'), ENT_NOQUOTES
); ?
>
532 <select name
="ordered_by_id" id
='ordered_by_id'>
533 <option value
=""></option
>
535 $sql = "select id, CONCAT(IFNULL(lname,''), ' ,',IFNULL(fname,'')) as full_name " .
536 "from users where username != '' and password != 'NoLogin' " .
537 "order by full_name";
539 $result = sqlStatement($sql);
540 while($row = sqlFetchArray($result)){
541 echo '<OPTION VALUE=' . htmlspecialchars( $row{'id'}, ENT_QUOTES
);
542 echo (isset($ordered_by_id) && $ordered_by_id != "" ?
$ordered_by_id : $_SESSION['authId']) == $row{'id'} ?
' selected>' : '>';
543 echo htmlspecialchars( $row{'full_name'}, ENT_NOQUOTES
) . '</OPTION>';
553 <td align
="right" class='text'>
554 <?php
echo htmlspecialchars( xl('Entered By'), ENT_NOQUOTES
); ?
>
557 <?php
echo htmlspecialchars( $entered_by, ENT_NOQUOTES
); ?
>
562 if($GLOBALS['observation_results_immunization']) {
565 <td colspan
="3" align
="center">
566 <img src
='../../pic/add.png' onclick
="showObservationResultSection();" align
='absbottom' width
='27' height
='24' border
='0' style
='cursor:pointer;cursor:hand' title
='<?php echo xla('Click here to see observation results
'); ?>'>
570 <td align
="center" colspan
="3">
571 <div
class="observation_results" style
="display:none;">
572 <fieldset
class="obs_res_head">
573 <legend
><?php
echo htmlspecialchars( xl('Observation Results'), ENT_QUOTES
); ?
></legend
>
574 <table
class="obs_res_table">
575 <?php
if(count($imm_obs_data) > 0) {
576 foreach($imm_obs_data as $key=>$value) {
577 $key_snomed = 0; $key_cvx = 0; $style= '';?
>
578 <tr id
="or_tr_<?php echo $key + 1 ;?>">
582 $style = 'display: table-cell;width:765px !important';
584 $style = 'display: none;width:765px !important';
587 $style = 'display : table-cell;width:765px !important';
589 <td id
="observation_criteria_td_<?php echo $key + 1 ;?>" style
="<?php echo $style;?>">
590 <label
><?php
echo htmlspecialchars( xl('Observation Criteria'), ENT_QUOTES
);?
></label
>
591 <select id
="observation_criteria_<?php echo $key + 1 ;?>" name
="observation_criteria[]" onchange
="selectCriteria(this.id,this.value);" style
="width: 220px;">
592 <?php
foreach ($observation_criteria as $keyo=> $valo) { ?
>
593 <option value
="<?php echo attr($valo['option_id']);?>" <?php
if($valo['option_id'] == $value['imo_criteria'] && $id !=0) echo 'selected = "selected"' ;?
> ><?php
echo text($valo['title']);?
></option
>
598 <td
<?php
if($value['imo_criteria'] != 'funding_program_eligibility' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="observation_criteria_value_td" id
="observation_criteria_value_td_<?php echo $key + 1 ;?>">
599 <label
><?php
echo htmlspecialchars( xl('Observation Criteria Value'), ENT_QUOTES
); ?
></label
>
600 <select name
="observation_criteria_value[]" id
="observation_criteria_value_<?php echo $key + 1 ;?>" style
="width: 220px;">
601 <?php
foreach ($observation_criteria_value as $keyoc=> $valoc) { ?
>
602 <option value
="<?php echo attr($valoc['option_id']);?>" <?php
if($valoc['option_id'] == $value['imo_criteria_value'] && $id != 0) echo 'selected = "selected"' ;?
>><?php
echo text($valoc['title']);?
></option
>
607 <td
<?php
if($value['imo_criteria'] != 'disease_with_presumed_immunity' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="code_serach_td" id
="code_search_td_<?php echo $key + 1 ;?>">
608 <?php
$key_snomed = ($key > 0) ?
(($key*2) +
2) : ($key +
2);?
>
609 <label
><?php
echo htmlspecialchars( xl('SNOMED-CT Code'), ENT_QUOTES
);?
></label
>
610 <input type
="text" id
="sct_code_<?php echo $key_snomed; ?>" style
="width:140px" name
="sct_code[]" class="code" value
="<?php if($id != 0 && $value['imo_criteria'] == 'disease_with_presumed_immunity') echo attr($value['imo_code']);?>" onclick
='sel_code(this.id);'><br
>
611 <span id
="displaytext_<?php echo $key_snomed; ?>" style
="width:210px !important;display: block;font-size:13px;color: blue;" class="displaytext"><?php
echo text($value['imo_codetext']);?
></span
>
612 <input type
="hidden" id
="codetext_<?php echo $key_snomed; ?>" name
="codetext[]" class="codetext" value
="<?php echo attr($value['imo_codetext']); ?>">
613 <input type
="hidden" value
="SNOMED-CT" name
="codetypehidden[]" id
="codetypehidden<?php echo $key_snomed; ?>" />
615 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="code_serach_vaccine_type_td" id
="code_serach_vaccine_type_td_<?php echo $key + 1 ;?>">
616 <label
><?php
echo htmlspecialchars( xl('CVX Code'), ENT_QUOTES
);?
></label
>
617 <?php
$key_cvx = ($key > 0) ?
(($key*2) +
3) : ($key +
3);?
>
618 <input type
="text" id
="cvx_code<?php echo $key_cvx ;?>" name
="cvx_vac_type_code[]" onclick
="sel_cvxcode(this);"
619 value
="<?php if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo attr($value['imo_code']);?>" style
="width:140px;" />
620 <div
class="imm-imm-add-12" id
="imm-imm-add-12<?php echo $key_cvx ;?>"><?php
if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo text($value['imo_codetext']);?
></div
>
621 <input type
="hidden" value
="CVX" name
="code_type_hidden[]" id
="code_type_hidden<?php echo $key_cvx ;?>" />
622 <input type
="hidden" class="code_text_hidden" name
="code_text_hidden[]" id
="code_text_hidden<?php echo $key_cvx ;?>" value
="<?php if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo attr($value['imo_codetext']);?>"/>
624 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="vis_published_date_td" id
="vis_published_date_td_<?php echo $key + 1 ;?>">
625 <label
><?php
echo htmlspecialchars( xl('Date VIS Published'), ENT_QUOTES
); ?
></label
>
627 $vis_published_dateval = $value['imo_vis_date_published'] ?
htmlspecialchars( $value['imo_vis_date_published'], ENT_QUOTES
) : '';
629 <input type
="text" name
="vis_published_date[]" value
="<?php if($id != 0 && $vis_published_dateval != 0) echo attr($vis_published_dateval);?>" id
="vis_published_date_<?php echo $key + 1 ;?>" autocomplete
="off" onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);' style
="width:140px">
630 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' id
='img_immuniz_vis_date_published_<?php echo $key + 1 ;?>' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand' title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
632 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="vis_presented_date_td" id
="vis_presented_date_td_<?php echo $key + 1 ;?>">
633 <label
><?php
echo htmlspecialchars( xl('Date VIS Presented'), ENT_QUOTES
); ?
></label
>
635 $vis_presented_dateval = $value['imo_vis_date_presented'] ?
htmlspecialchars( $value['imo_vis_date_presented'], ENT_QUOTES
) : '';
637 <input type
="text" name
="vis_presented_date[]" value
="<?php if($id != 0 && $vis_presented_dateval !=0) echo attr($vis_presented_dateval);?>" id
="vis_presented_date_<?php echo $key + 1 ;?>" autocomplete
="off" onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);' style
="width:140px">
638 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' id
='img_immuniz_vis_date_presented_<?php echo $key + 1 ;?>' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand' title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
640 <?php
if($key != 0 && $id != 0) {?
>
642 <img src
='../../pic/remove.png' id
="<?php echo $key +1;?>" onclick
="RemoveRow(this.id);" align
='absbottom' width
='24' height
='22' border
='0' style
='cursor:pointer;cursor:hand' title
='<?php echo xla('Click here to delete the row
'); ?>'>
649 <td id
="observation_criteria_td_1">
650 <label
><?php
echo htmlspecialchars( xl('Observation Criteria'), ENT_QUOTES
); ?
></label
>
651 <select id
="observation_criteria_1" name
="observation_criteria[]" onchange
="selectCriteria(this.id,this.value);" style
="width: 220px;">
652 <?php
foreach ($observation_criteria as $keyo=> $valo) { ?
>
653 <option value
="<?php echo attr($valo['option_id']);?>" <?php
if($valo['option_id'] == $value['imo_criteria'] && $id !=0) echo 'selected = "selected"' ;?
> ><?php
echo text($valo['title']);?
></option
>
658 <td
<?php
if($value['imo_criteria'] != 'funding_program_eligibility') { ?
> style
="display: none;" <?php
} ?
> class="observation_criteria_value_td" id
="observation_criteria_value_td_1">
659 <label
><?php
echo htmlspecialchars( xl('Observation Criteria Value'), ENT_QUOTES
); ?
></label
>
660 <select id
="observation_criteria_value_1" name
="observation_criteria_value[]" style
="width: 220px;">
661 <?php
foreach ($observation_criteria_value as $keyoc=> $valoc) { ?
>
662 <option value
="<?php echo attr($valoc['option_id']);?>" <?php
if($valoc['option_id'] == $value['imo_criteria_value'] && $id != 0) echo 'selected = "selected"' ;?
>><?php
echo text($valoc['title']);?
></option
>
667 <td
<?php
if($value['imo_criteria'] != 'disease_with_presumed_immunity' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="code_serach_td" id
="code_search_td_1">
668 <label
><?php
echo htmlspecialchars( xl('SNOMED-CT Code'), ENT_QUOTES
);?
></label
>
669 <input type
="text" id
="sct_code_2" style
="width:140px" name
="sct_code[]" class="code" value
="<?php if($id != 0 && $value['imo_criteria'] == 'disease_with_presumed_immunity') echo attr($value['imo_code']);?>" onclick
='sel_code(this.id);'><br
>
670 <span id
="displaytext_2" style
="width:210px !important;display: block;font-size:13px;color: blue;" class="displaytext"><?php
echo text($value['imo_codetext']);?
></span
>
671 <input type
="hidden" id
="codetext_2" name
="codetext[]" class="codetext" value
="<?php echo attr($value['imo_codetext']); ?>">
672 <input type
="hidden" value
="SNOMED-CT" name
="codetypehidden[]" id
="codetypehidden2" />
674 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="code_serach_vaccine_type_td" id
="code_serach_vaccine_type_td_1">
675 <label
><?php
echo htmlspecialchars( xl('CVX Code'), ENT_QUOTES
);?
></label
>
676 <input type
="text" id
="cvx_code3" name
="cvx_vac_type_code[]" onclick
="sel_cvxcode(this);"
677 value
="<?php if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo attr($value['imo_code']);?>" style
="width:140px;" />
678 <div
class="imm-imm-add-12" id
="imm-imm-add-123"><?php
if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo text($value['imo_codetext']);?
></div
>
679 <input type
="hidden" value
="CVX" name
="code_type_hidden[]" id
="code_type_hidden3"/>
680 <input type
="hidden" class="code_text_hidden" name
="code_text_hidden[]" id
="code_text_hidden3" value
="<?php if($id != 0 && $value['imo_criteria'] == 'vaccine_type') echo attr($value['imo_codetext']);?>"/>
682 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="vis_published_date_td" id
="vis_published_date_td_1">
683 <label
><?php
echo htmlspecialchars( xl('Date VIS Published'), ENT_QUOTES
); ?
></label
>
685 $vis_published_dateval = $value['imo_vis_date_published'] ?
htmlspecialchars( $value['imo_vis_date_published'], ENT_QUOTES
) : '';
687 <input type
="text" name
="vis_published_date[]" value
="<?php if($id != 0 && $vis_published_dateval != 0) echo attr($vis_published_dateval);?>" id
="vis_published_date_1" autocomplete
="off" onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);' style
="width:140px">
688 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' id
='img_immuniz_vis_date_published_1' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand' title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
690 <td
<?php
if($value['imo_criteria'] != 'vaccine_type' ||
$id == 0) { ?
> style
="display: none;" <?php
} ?
> class="vis_presented_date_td" id
="vis_presented_date_td_1">
691 <label
><?php
echo htmlspecialchars( xl('Date VIS Presented'), ENT_QUOTES
); ?
></label
>
693 $vis_presented_dateval = $value['imo_vis_date_presented'] ?
htmlspecialchars( $value['imo_vis_date_presented'], ENT_QUOTES
) : '';
695 <input type
="text" name
="vis_presented_date[]" value
="<?php if($id != 0 && $vis_presented_dateval !=0) echo attr($vis_presented_dateval);?>" id
="vis_presented_date_1" autocomplete
="off" onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc);' style
="width:140px">
696 <img src
='<?php echo $rootdir; ?>/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' id
='img_immuniz_vis_date_presented_1' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand' title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>'>
702 <center style
="cursor: pointer;">
703 <img src
='../../pic/add.png' onclick
="addNewRow();" align
='absbottom' width
='27' height
='24' border
='0' style
='cursor:pointer;cursor:hand' title
='<?php echo xla('Click here to add
new row
'); ?>'>
706 <input type
="hidden" name
="tr_count" id
="tr_count" value
="<?php echo (count($imm_obs_data)>0) ? count($imm_obs_data) : 1 ;?>">
707 <input type
="hidden" id
="clickId" value
="">
713 <td colspan
="3" align
="center">
715 <input type
="button" name
="save" id
="save" value
="<?php echo htmlspecialchars( xl('Save Immunization'), ENT_QUOTES); ?>">
717 <input type
="button" name
="print" id
="print" value
="<?php echo htmlspecialchars( xl('Print Record') . xl('PDF','',' (',')'), ENT_QUOTES); ?>">
719 <input type
="button" name
="printHtml" id
="printHtml" value
="<?php echo htmlspecialchars( xl('Print Record') . xl('HTML','',' (',')'), ENT_QUOTES); ?>">
721 <input type
="reset" name
="clear" id
="clear" value
="<?php echo htmlspecialchars( xl('Clear'), ENT_QUOTES); ?>"> </td
>
726 <div id
="immunization_list">
728 <table border
=0 cellpadding
=3 cellspacing
=0>
730 <!-- some columns are sortable
-->
731 <tr
class='text bold'>
733 <a href
="javascript:top.restoreSession();location.href='immunizations.php?sortby=vacc';" title
='<?php echo htmlspecialchars( xl('Sort by vaccine
'), ENT_QUOTES); ?>'>
734 <?php
echo htmlspecialchars( xl('Vaccine'), ENT_NOQUOTES
); ?
></a
>
735 <span
class='small' style
='font-family:arial'><?php
if ($sortby == 'vacc') { echo 'v'; } ?
></span
>
738 <a href
="javascript:top.restoreSession();location.href='immunizations.php?sortby=date';" title
='<?php echo htmlspecialchars( xl('Sort by date
'), ENT_QUOTES); ?>'>
739 <?php
echo htmlspecialchars( xl('Date'), ENT_NOQUOTES
); ?
></a
>
740 <span
class='small' style
='font-family:arial'><?php
if ($sortby == 'date') { echo 'v'; } ?
></span
>
742 <th
><?php
echo htmlspecialchars( xl('Amount'), ENT_NOQUOTES
); ?
></th
>
743 <th
><?php
echo xlt('Expiration'); ?
></th
>
744 <th
><?php
echo htmlspecialchars( xl('Manufacturer'), ENT_NOQUOTES
); ?
></th
>
745 <th
><?php
echo htmlspecialchars( xl('Lot Number'), ENT_NOQUOTES
); ?
></th
>
746 <th
><?php
echo htmlspecialchars( xl('Administered By'), ENT_NOQUOTES
); ?
></th
>
747 <th
><?php
echo htmlspecialchars( xl('Education Date'), ENT_NOQUOTES
); ?
></th
>
748 <th
><?php
echo htmlspecialchars( xl('Route'), ENT_NOQUOTES
); ?
></th
>
749 <th
><?php
echo htmlspecialchars( xl('Administered Site'), ENT_NOQUOTES
); ?
></th
>
750 <th
><?php
echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES
); ?
></th
>
751 <th
><?php
echo htmlspecialchars( xl('Completion Status'), ENT_NOQUOTES
); ?
></th
>
752 <th
><?php
echo htmlspecialchars( xl('Error'), ENT_NOQUOTES
); ?
></th
>
757 $result = getImmunizationList($pid, $_GET['sortby'], true);
759 while($row = sqlFetchArray($result)) {
760 $isError = $row['added_erroneously'];
763 $tr_title = 'title="' . xla("Entered in Error") . '"';
768 if ($row["id"] == $id) {
769 echo "<tr " . $tr_title . " class='immrow text selected' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."'>";
772 echo "<tr " . $tr_title . " class='immrow text' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."'>";
775 // Figure out which name to use (ie. from cvx list or from the custom list)
776 if ($GLOBALS['use_custom_immun_list']) {
777 $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
780 if (!empty($row['code_text_short'])) {
781 $vaccine_display = htmlspecialchars( xl($row['code_text_short']), ENT_NOQUOTES
);
784 $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
789 $del_tag_open = "<del>";
790 $del_tag_close = "</del>";
796 echo "<td>" . $del_tag_open . $vaccine_display . $del_tag_close . "</td>";
798 if ($row["administered_date"]) {
799 $administered_date_summary = new DateTime($row['administered_date']);
800 $administered_date_summary = $administered_date_summary->format('Y-m-d H:i');
802 $administered_date_summary = "";
804 echo "<td>" . $del_tag_open . htmlspecialchars( $administered_date_summary, ENT_NOQUOTES
) . $del_tag_close . "</td>";
805 if ($row["amount_administered"] > 0) {
806 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>";
809 echo "<td> </td>";
811 echo "<td>" . $del_tag_open . text($row["expiration_date"]) . $del_tag_close . "</td>";
812 echo "<td>" . $del_tag_open . htmlspecialchars( $row["manufacturer"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
813 echo "<td>" . $del_tag_open . htmlspecialchars( $row["lot_number"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
814 echo "<td>" . $del_tag_open . htmlspecialchars( $row["administered_by"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
815 echo "<td>" . $del_tag_open . htmlspecialchars( $row["education_date"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
816 echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'drug_route'), $row['route']) . $del_tag_close . "</td>";
817 echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'immunization_administered_site'), $row['administration_site']) . $del_tag_close . "</td>";
818 echo "<td>" . $del_tag_open . htmlspecialchars( $row["note"], ENT_NOQUOTES
) . $del_tag_close . "</td>";
819 echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'Immunization_Completion_Status'), $row['completion_status']) . $del_tag_close . "</td>";
822 $checkbox = "checked";
827 echo "<td><input type='checkbox' class='error' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."' value='" . htmlspecialchars( xl('Error'), ENT_QUOTES
) . "' " . $checkbox . "></td>";
829 echo "<td><input type='button' class='delete' id='".htmlspecialchars( $row["id"], ENT_QUOTES
)."' value='" . htmlspecialchars( xl('Delete'), ENT_QUOTES
) . "'></td>";
836 </div
> <!-- end immunizations
-->
840 <script language
="javascript">
841 var tr_count
= $
('#tr_count').val();
842 /* required for popup calendar */
843 Calendar
.setup({inputField
:"administered_date", ifFormat
:"%Y-%m-%d %H:%M", button
:"img_administered_date", showsTime
:true});
844 Calendar
.setup({inputField
:"immuniz_exp_date", ifFormat
:"%Y-%m-%d", button
:"img_immuniz_exp_date"});
845 Calendar
.setup({inputField
:"education_date", ifFormat
:"%Y-%m-%d", button
:"img_education_date"});
846 Calendar
.setup({inputField
:"vis_date", ifFormat
:"%Y-%m-%d", button
:"img_vis_date"});
847 Calendar
.setup({inputField
:"vis_published_date_"+tr_count
, ifFormat
:"%Y-%m-%d", button
:"img_immuniz_vis_date_published_"+tr_count
});
848 Calendar
.setup({inputField
:"vis_presented_date_"+tr_count
, ifFormat
:"%Y-%m-%d", button
:"img_immuniz_vis_date_presented_"+tr_count
});
850 // jQuery stuff to make the page a little easier to use
852 $
(document
).ready(function(){
853 <?php
if (!($useCVX)) { ?
>
854 $
("#save").click(function() { SaveForm(); });
856 $
("#save").click(function() {
857 if (validate_cvx()) {
865 $
("#print").click(function() { PrintForm("pdf"); });
866 $
("#printHtml").click(function() { PrintForm("html"); });
867 $
(".immrow").click(function() { EditImm(this
); });
868 $
(".error").click(function(event
) { ErrorImm(this
); event
.stopPropagation(); });
869 $
(".delete").click(function(event
) { DeleteImm(this
); event
.stopPropagation(); });
871 $
(".immrow").mouseover(function() { $
(this
).toggleClass("highlight"); });
872 $
(".immrow").mouseout(function() { $
(this
).toggleClass("highlight"); });
874 $
("#administered_by_id").change(function() { $
("#administered_by").val($
("#administered_by_id :selected").text()); });
876 $
("#form_immunization_id").change( function() {
877 if ( $
(this
).val() != "" ) {
878 $
("#cvx_code").val( "" );
879 $
("#cvx_description").text( "" );
880 $
("#cvx_code").change();
885 var PrintForm
= function(typ
) {
886 top
.restoreSession();
887 newURL
='shot_record.php?output='+typ+
'&sortby=<?php echo $sortby; ?>';
888 window
.open(newURL
, '_blank', "menubar=1,toolbar=1,scrollbars=1,resizable=1,width=600,height=450");
891 var SaveForm
= function() {
892 top
.restoreSession();
893 $
("#add_immunization").submit();
896 var EditImm
= function(imm
) {
897 top
.restoreSession();
898 location
.href
='immunizations.php?mode=edit&id='+imm
.id
;
901 var DeleteImm
= function(imm
) {
902 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); ?>")) {
903 top
.restoreSession();
904 location
.href
='immunizations.php?mode=delete&id='+imm
.id
;
908 var ErrorImm
= function(imm
) {
909 top
.restoreSession();
910 location
.href
='immunizations.php?mode=added_error&id='+imm
.id+
'&isError='+imm
.checked
;
913 //This is for callback by the find-code popup.
914 //Appends to or erases the current list of diagnoses.
915 function set_related(codetype
, code
, selector
, codedesc
) {
916 if(codetype
== 'CVX') {
917 var f
= document
.forms
[0][current_sel_name
];
929 if(f
.name
!= 'cvx_vac_type_code[]'){
930 $
("#cvx_description").text( codedesc
);
931 $
("#form_immunization_id").attr( "value", "" );
932 $
("#form_immunization_id").change();
934 id_arr
= f
.id
.split('cvx_code');
936 $
('#imm-imm-add-12'+counter
).html(codedesc
);
937 $
('#code_text_hidden'+counter
).val(codedesc
);
940 var index
= document
.forms
[0][current_sel_name
].length
-1;
941 var elem
= document
.forms
[0][current_sel_name
][index
];
951 arr
= elem
.id
.split('cvx_code');
953 $
('#imm-imm-add-12'+count
).html(codedesc
);
954 $
('#code_text_hidden'+count
).val(codedesc
);
957 var checkId
= $
('#clickId').val();
958 $
("#sct_code_" + checkId
).val(code
);
959 $
("#codetext_" + checkId
).val(codedesc
);
960 $
("#displaytext_" + checkId
).html(codedesc
);
964 // This invokes the find-code popup.
965 function sel_cvxcode(e
) {
966 current_sel_name
= e
.name
;
967 dlgopen('../encounter/find_code_popup.php?codetype=CVX', '_blank', 500, 400);
970 // This ensures the cvx centric entry is filled.
971 function validate_cvx() {
972 if (document
.add_immunization
.cvx_code
.value
>0) {
976 document
.add_immunization
.cvx_code
.style
.backgroundColor
="red";
977 document
.add_immunization
.cvx_code
.focus();
982 function showObservationResultSection()
984 $
('.observation_results').slideToggle();
987 function selectCriteria(id
,value
)
989 var arr
= id
.split('observation_criteria_');
991 if(value
== 'funding_program_eligibility') {
992 $
('.obs_res_table').css('width','50%');
994 var target
= $
("#observation_criteria_value_"+key
);
997 url
: "immunizations.php",
1000 type
: 'duplicate_row_2'
1002 success
: function(thedata
){
1003 $
.each(thedata
,function(i
,item
) {
1004 target
.append($
('<option />').val(item
.option_id
).text(item
.title
));
1006 $
('#observation_criteria_value_'+key+
' option[value=""]').attr('selected','selected');
1009 alert("ajax error");
1013 $
("#code_search_td_"+key
).hide();
1014 $
("#vis_published_date_td_"+key
).hide();
1015 $
("#vis_presented_date_td_"+key
).hide();
1016 $
("#code_serach_vaccine_type_td_"+key
).hide();
1017 $
("#observation_criteria_value_td_"+key
).show();
1019 if(value
== 'vaccine_type')
1021 $
("#observation_criteria_value_td_"+key
).hide();
1022 $
("#code_search_td_"+key
).hide();
1023 $
("#code_serach_vaccine_type_td_"+key
).show();
1024 $
("#vis_published_date_td_"+key
).show();
1025 $
("#vis_presented_date_td_"+key
).show();
1027 key
= parseInt(key
) +
2;
1030 key
= (parseInt(key
) * 2) +
1;
1032 $
("#cvx_code"+key
).css("background-color", "red");
1033 $
("#cvx_code"+key
).focus();
1036 if(value
== 'disease_with_presumed_immunity')
1038 $
('.obs_res_table').css('width','50%');
1039 $
("#observation_criteria_value_td_"+key
).hide();
1040 $
("#vis_published_date_td_"+key
).hide();
1041 $
("#vis_presented_date_td_"+key
).hide();
1042 $
("#code_serach_vaccine_type_td_"+key
).hide();
1043 $
("#code_search_td_"+key
).show();
1045 key
= parseInt(key
) +
1;
1048 key
= (parseInt(key
) * 2);
1050 $
("#sct_code_"+key
).css("background-color", "red");
1051 $
("#sct_code_"+key
).focus();
1056 $
("#observation_criteria_value_td_"+key
).hide();
1057 $
("#vis_published_date_td_"+key
).hide();
1058 $
("#vis_presented_date_td_"+key
).hide();
1059 $
("#code_serach_vaccine_type_td_"+key
).hide();
1060 $
("#code_search_td_"+key
).hide();
1064 function RemoveRow(id
)
1066 tr_count
= parseInt($
("#tr_count").val());
1067 new_tr_count
= tr_count
-1;
1068 $
("#tr_count").val(new_tr_count
);
1069 $
("#or_tr_"+id
).remove();
1072 function addNewRow()
1074 tr_count
= parseInt($
("#tr_count").val());
1075 new_tr_count
= tr_count+
1;
1076 new_tr_count_2
= (new_tr_count
* 2);
1077 new_tr_count_3
= (new_tr_count
*2) +
1;
1078 $
("#tr_count").val(new_tr_count
);
1079 label1
= "<?php echo htmlspecialchars( xl('Observation Criteria'), ENT_QUOTES); ?>";
1080 label2
= "<?php echo htmlspecialchars( xl('Observation Criteria Value'), ENT_QUOTES); ?>";
1081 label3
= "<?php echo htmlspecialchars( xl('SNOMED-CT Code'), ENT_QUOTES); ?>";
1082 label4
= "<?php echo htmlspecialchars( xl('CVX Code'), ENT_QUOTES); ?>";
1083 label5
= "<?php echo htmlspecialchars( xl('Date VIS Published'), ENT_QUOTES); ?>";
1084 label6
= "<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>";
1085 label7
= "<?php echo htmlspecialchars( xl('Date VIS Presented'), ENT_QUOTES); ?>";
1086 label8
= "<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>";
1087 label9
= "<?php echo htmlspecialchars( xl('Click here to delete the row'), ENT_QUOTES); ?>";
1088 str
= '<tr id ="or_tr_'+new_tr_count+
'">'+
1089 '<td id ="observation_criteria_td_'+new_tr_count+
'"><label>'+label1+
'</label><select id="observation_criteria_'+new_tr_count+
'" name="observation_criteria[]" onchange="selectCriteria(this.id,this.value);" style="width: 220px;"></select>'+
1091 '<td id="observation_criteria_value_td_'+new_tr_count+
'" class="observation_criteria_value_td" style="display: none;"><label>'+label2+
'</label><select name="observation_criteria_value[]" id="observation_criteria_value_'+new_tr_count+
'" style="width: 220px;"></select>'+
1093 '<td class="code_serach_td" id="code_search_td_'+new_tr_count+
'" style="display: none;"><label>'+label3+
'</label>'+
1094 '<input type="text" id="sct_code_'+new_tr_count_2+
'" style="width:140px" name="sct_code[]" class="code" onclick=sel_code(this.id) /><br>'+
1095 '<span id="displaytext_'+new_tr_count_2+
'" style="width:210px !important;display: block;font-size:13px;color: blue;" class="displaytext"></span>'+
1096 '<input type="hidden" id="codetext_'+new_tr_count_2+
'" name="codetext[]" class="codetext">'+
1097 '<input type="hidden" value="SNOMED-CT" name="codetypehidden[]" id="codetypehidden'+new_tr_count_2+
'" /> '+
1099 '<td class="code_serach_vaccine_type_td" id="code_serach_vaccine_type_td_'+new_tr_count+
'" style="display: none;"><label>'+label4+
'</label>'+
1100 '<input type="text" id="cvx_code'+new_tr_count_3+
'" name="cvx_vac_type_code[]" onclick=sel_cvxcode(this); style="width:140px;" />'+
1101 '<div class="imm-imm-add-12" id="imm-imm-add-12'+new_tr_count_3+
'"></div> '+
1102 '<input type="hidden" value="CVX" name="code_type_hidden[]" id="code_type_hidden'+new_tr_count_3+
'" /> '+
1103 '<input type="hidden" class="code_text_hidden" name="code_text_hidden[]" id="code_text_hidden'+new_tr_count_3+
'" value="" />'+
1105 '<td id="vis_published_date_td_'+new_tr_count+
'" class="vis_published_date_td" style="display: none;"><label>'+label5+
'</label><input type="text" name= "vis_published_date[]" id ="vis_published_date_'+new_tr_count+
'" autocomplete=off onkeyup="datekeyup(this,mypcc)" onblur="dateblur(this,mypcc);" style="width:140px">'+
1106 '<img src="../../pic/show_calendar.gif" align="absbottom" width="24" height="22" id="img_immuniz_vis_date_published_'+new_tr_count+
'" border="0" alt="[?]" style="cursor:pointer;cursor:hand" title="'+label6+
'"></td>'+
1107 '<td id="vis_presented_date_td_'+new_tr_count+
'" class="vis_presented_date_td" style="display: none;"><label>'+label7+
'</label><input type="text" name= "vis_presented_date[]" id ="vis_presented_date_'+new_tr_count+
'" autocomplete=off onkeyup="datekeyup(this,mypcc)" onblur="dateblur(this,mypcc);" style="width:140px">'+
1108 '<img src="../../pic/show_calendar.gif" align="absbottom" width="24" height="22" id="img_immuniz_vis_date_presented_'+new_tr_count+
'" border="0" alt="[?]" style="cursor:pointer;cursor:hand" title="'+label8+
'"></td>'+
1109 '<td><img src="../../pic/remove.png" id ="'+new_tr_count+
'" onclick="RemoveRow(this.id);" align="absbottom" width="24" height="22" border="0" style="cursor:pointer;cursor:hand" title="'+label9+
'"></td></tr>';
1111 $
(".obs_res_table").append(str
);
1113 var ajax_url
= 'immunizations.php';
1114 var target
= $
("#observation_criteria_"+new_tr_count
);
1120 type
: 'duplicate_row'
1122 success
: function(thedata
){
1123 $
.each(thedata
,function(i
,item
) {
1124 target
.append($
('<option></option>').val(item
.option_id
).text(item
.title
));
1126 $
('#observation_criteria_'+new_tr_count+
' option[value=""]').attr('selected','selected');
1129 alert("ajax error");
1133 Calendar
.setup({inputField
:"vis_published_date_"+new_tr_count
, ifFormat
:"%Y-%m-%d", button
:"img_immuniz_vis_date_published_"+new_tr_count
});
1134 Calendar
.setup({inputField
:"vis_presented_date_"+new_tr_count
, ifFormat
:"%Y-%m-%d", button
:"img_immuniz_vis_date_presented_"+new_tr_count
});
1137 function sel_code(id
)
1139 id
= id
.split('sct_code_');
1140 var checkId
= id
[1];
1141 $
('#clickId').val(checkId
);
1142 dlgopen('<?php echo $GLOBALS['webroot
'] . "/interface/patient_file/encounter/" ?>find_code_popup.php', '_blank', 700, 400);