3 * find_immunization_popup.php
6 * @link http://www.open-emr.org
7 * @author Visolve <vicareplus_engg@visolve.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) ViCarePlus, Visolve <vicareplus_engg@visolve.com>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/patient.inc");
17 require_once("../../custom/code_types.inc.php");
20 $codetype = $_REQUEST['codetype'];
21 $form_code_type = $_POST['form_code_type'];
25 <?php
html_header_show(); ?
>
26 <title
><?php
echo xlt('Immunization'); ?
></title
>
27 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
29 td
{ font
-size
:10pt
; }
31 <script language
="JavaScript">
32 //pass value selected to the parent window
33 function window_submit(chk
)
37 if (len
==undefined
&& chk
.checked
==1)
46 for (pr
= 0; pr
< chk
.length
; pr++
)
48 if(chk
[pr
].checked
== 1)
53 str
= str+
"#"+chk
[pr
].value
;
58 alert('<?php echo xls("Select Immunizations");?>');
59 if (opener
.closed ||
! opener
.set_related
)
60 alert("<?php echo xls('The destination form was closed');?>");
62 opener
.set_related(str
,"immunizations");
68 function window_close(chk
)
73 function chkbox_select_none(chk
)
76 if (len
==undefined
) {chk
.checked
=false;}
79 for (pr
= 0; pr
< chk
.length
; pr++
)
81 chk
[pr
].checked
=false;
86 function chkbox_select_all(chk
)
89 if (len
==undefined
) {chk
.checked
=true;}
92 for (pr
= 0; pr
< chk
.length
; pr++
)
99 function check_search_str()
101 var search_str
= document
.getElementById('search_term').value
;
102 if(search_str
.length
< 3)
104 alert('<?php echo xls("Search string should have at least three characters");?>');
107 top
.restoreSession();
112 <body
class="body_top">
113 <form method
='post' name
='theform' action
='find_immunization_popup.php' onsubmit
="return check_search_str();">
114 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(collectCsrfToken()); ?>" />
117 <table border
='0' cellpadding
='5' cellspacing
='0'>
125 <?php
echo xlt('Search for'); ?
>
126 <input type
='text' name
='search_term' id
='search_term' size
='12' value
='<?php echo attr($_REQUEST['search_term
']); ?>'
127 title
='<?php echo xla('Any part of the immunization id
or immunization name
'); ?>' />
129 <input type
='submit' name
='bn_search' value
='<?php echo xla('Search
'); ?>' />
140 <form method
='post' name
='select_immunization'>
141 <?php
if ($_REQUEST['bn_search']) { ?
>
143 if (!verifyCsrfToken($_POST["csrf_token_form"])) {
152 $search_term = $_REQUEST['search_term'];
154 $query = "SELECT count(*) as count FROM list_options " .
155 "WHERE (list_id = 'immunizations' and title LIKE ? AND activity = 1) " ;
156 $res = sqlStatement($query, array('%'.$search_term.'%'));
157 if ($row = sqlFetchArray($res)) {
158 $no_of_items = $row['count'];
159 if ($no_of_items < 1) {
161 <script language
='JavaScript'>
162 alert("<?php echo xls('Search string does not match with list in database');
164 echo xls('Please enter new search string');?>");
165 document
.theform
.search_term
.value
=" ";
166 document
.theform
.search_term
.focus();
171 $query = "SELECT option_id,title FROM list_options " .
172 "WHERE (list_id = 'immunizations' and title LIKE ? AND activity = 1) " .
174 $res = sqlStatement($query, array('%'.$search_term.'%'));
176 while ($row = sqlFetchArray($res)) {
177 $row_count = $row_count +
1;
178 $itercode = $row['option_id'];
179 $itertext = ucfirst(strtolower(trim($row['title'])));
181 <input type
="checkbox" id
="chkbox" value
= "<?php echo attr($itercode) . "-" . attr($itertext); ?>" > <?php
echo text($itercode) . " " . text($itertext) . "</br>";
191 <input type
='button' name
='select_all' value
='<?php echo xla('Select All
'); ?>' onclick
="chkbox_select_all(document.select_immunization.chkbox);"/>
193 <input type
='button' name
='select_none' value
='<?php echo xla('Unselect All
'); ?>' onclick
="chkbox_select_none(document.select_immunization.chkbox);"/>
195 <input type
='button' name
='submit' value
='<?php echo xla('Submit
'); ?>' onclick
="window_submit(document.select_immunization.chkbox);"/>
197 <input type
='button' name
='cancel' value
='<?php echo xla('Cancel
'); ?>' onclick
="window_close();"/>