3 * This file presents the PMSFH control panel.
4 * It uses ajax/javascript to add, delete or edit an issue.
6 * Originally culled from /interface/patient_file/summary and adapted...
9 * @link http://www.open-emr.org
10 * @author Rod Roark <rod@sunsetsystems.com>
11 * @author Ray Magauran <magauran@MedFetch.com>
12 * @author Brady Miller <brady.g.miller@gmail.com>
13 * @copyright Copyright (c) 2005-2011 Rod Roark <rod@sunsetsystems.com>
14 * @copyright Copyright (c) 2015-2016 Ray Magauran <magauran@MedFetch.com>
15 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
16 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
19 $form_folder= "eye_mag";
20 require_once('../../globals.php');
21 require_once($GLOBALS['srcdir'].'/lists.inc');
22 require_once($GLOBALS['srcdir'].'/patient.inc');
23 require_once($GLOBALS['srcdir'].'/acl.inc');
24 require_once($GLOBALS['srcdir'].'/options.inc.php');
25 require_once($GLOBALS['fileroot'].'/custom/code_types.inc.php');
26 require_once($GLOBALS['srcdir'].'/csv_like_join.php');
27 require_once($GLOBALS['srcdir'].'/log.inc');
28 require_once("../../forms/".$form_folder."/php/".$form_folder."_functions.php");
30 $pid = 0 +
(empty($_REQUEST['pid']) ?
$pid : $_REQUEST['pid']);
33 // A nonempty thisenc means we are to link the issue to the encounter.
34 // ie. we are going to use this as a billing issue?
35 // The Coding Engine does not look at encounters and issue linkage, yet. It could and perhaps should.
36 $encounter = 0 +
(empty($_REQUEST['encounter']) ?
$_SESSION['encounter'] : $_REQUEST['encounter']);
38 $issue = $_REQUEST['issue'];
39 $deletion = $_REQUEST['deletion'];
40 $form_save = $_REQUEST['form_save'];
42 $pid = $_SESSION['pid'];
45 $form_id = $_REQUEST['form_id'];
46 $form_type = $_REQUEST['form_type'];
47 $uniqueID = $_REQUEST['uniqueID'];
49 if ($issue && !acl_check('patients', 'med', '', 'write')) {
50 die(xlt("Edit is not authorized!"));
53 if (!acl_check('patients', 'med', '', array('write','addonly'))) {
54 die(xlt("Add is not authorized!"));
57 $PMSFH = build_PMSFH($pid);
58 $patient = getPatientData($pid, "*");
59 $providerID = findProvider($pid, $encounter);
60 if (!$_SESSION['providerID'] && $providerID) {
61 ($_SESSION['providerID'] = $providerID);
66 $irow = sqlQuery("SELECT * FROM lists WHERE id = ?", array($issue));
67 } else if ($thistype) {
68 $irow['type'] = $thistype;
69 $irow['subtype'] = $subtype;
72 if (!empty($irow['type'])) {
73 foreach ($ISSUE_TYPES as $key => $value) {
74 if ($key == $irow['type']) {
82 $given="ROSGENERAL,ROSHEENT,ROSCV,ROSPULM,ROSGI,ROSGU,ROSDERM,ROSNEURO,ROSPSYCH,ROSMUSCULO,ROSIMMUNO,ROSENDOCRINE";
83 $query="SELECT $given from form_eye_mag where id=? and pid=?";
84 $rres = sqlQuery($query, array($form_id,$pid));
85 foreach (explode(',', $given) as $item) {
86 $
$item = $rres[$item];
91 <title
><?php
echo xlt('Add New Issue'); ?
></title
>
92 <script language
="JavaScript">
93 <?php
require_once("$srcdir/restoreSession.php"); ?
>
95 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/interface/main/tabs/js/include_opener.js?v=<?php echo $v_js_includes; ?>"></script
>
96 <meta name
="viewport" content
="width=device-width, initial-scale=1" />
97 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
98 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
99 <script language
="JavaScript">
100 var aitypes
= new Array(); // issue type attributes
101 var aopts
= new Array(); // Option objects
103 //This builds the litle quick pick list in this section.
104 // If the provider has more 2 items already defined in the last month, they are collated
105 // and ranked by frequency, sort alphabetically and <=10 are listed.
106 // If not, we use the defaults from list_options/
109 foreach ($PMSFH[0] as $key => $value) {
110 echo " aopts['" . attr($key) . "'] = [];\n";
112 echo " aitypes['" . attr($key). "'] = '0';\n";
113 if ($key =="PMH") { // "0" = medical_problem_issue_list leave out Dental "4"
114 $qry = sqlStatement("SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE ? and
115 subtype = '' and pid in (select pid from form_encounter where provider_id =?
116 and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10", array("medical_problem",$_SESSION['providerID']));
118 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
119 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ? and subtype not like 'eye'", array("medical_problem_issue_list"));
121 } elseif ($key =="Medication") {
122 $qry = sqlStatement("SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE ? and
123 subtype = '' and pid in (select pid from form_encounter where provider_id =?
124 and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10", array("medication",$_SESSION['providerID']));
125 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
126 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ? and subtype not like 'eye'", array("medication_issue_list"));
128 } elseif ($key =="Surgery") {
129 $qry = sqlStatement("SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE ? and
130 subtype = '' and pid in (select pid from form_encounter where provider_id =?
131 and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10", array("surgery",$_SESSION['providerID']));
132 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
133 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ? and subtype not like 'eye'", array("surgery_issue_list"));
135 } elseif ($key =="Allergy") {
136 $qry = sqlStatement("SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE ? and
137 subtype = '' and pid in (select pid from form_encounter where provider_id =?
138 and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10", array("allergy",$_SESSION['providerID']));
139 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
140 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ? and subtype not like 'eye'", array("allergy_issue_list"));
142 } elseif ($key == "POH") { // POH medical group
143 $query = "SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE 'medical_problem' and subtype = 'eye' and pid in (select pid from form_encounter where provider_id =? and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10";
144 $qry = sqlStatement($query, array($_SESSION['providerID']));
145 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
146 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = 'medical_problem_issue_list' and subtype = 'eye'");
148 } elseif ($key == "POS") { // POS surgery group
149 $query = "SELECT title, title as option_id, diagnosis as codes, count(title) AS freq FROM `lists` WHERE `type` LIKE 'surgery' and subtype = 'eye' and pid in (select pid from form_encounter where provider_id =? and date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()) GROUP BY title order by freq desc limit 10";
150 $qry = sqlStatement($query, array($_SESSION['providerID']));
151 if (sqlNumRows($qry) < '4') { //if they are just starting out, use the list_options for all
152 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = 'surgery_issue_list' and subtype = 'eye'");
154 } elseif ($key == "FH") {
157 } elseif ($key == "SOCH") {
160 } elseif ($key == "ROS") {
165 if ($local =="1") { // leave FH/SocHx/ROS for later - done below separately
166 while ($res = sqlFetchArray($qry)) { //Should we take the top 10 and display alphabetically?
167 echo " aopts['" .attr($key). "'][aopts['" .attr($key). "'].length] = new Option('".attr(trim($res['option_id']))."', '".attr(xl_list_label(trim($res['title'])))."', false, false);\n";
169 echo " aopts['" .attr($key). "'][aopts['" .attr($key). "'].length-1].setAttribute('data-code','".attr(trim($res['codes']))."');\n";
179 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
181 function newtype(index
) {
182 var f
= document
.forms
[0];
183 var theopts
= f
.form_titles
.options
;
187 for (i
= 0; i
< aopts
[index
].length
; ++i
) {
188 theopts
[i
] = aopts
[index
][i
];
192 f
.form_type
.value
= index
;
193 f
.form_occur
.options
[0].selected
= true;
195 document
.getElementById('row_quick_picks' ).style
.display
= i ?
'' : 'none'; //select list of things
196 document
.getElementById('row_title' ).style
.display
= '';
197 document
.getElementById('row_diagnosis' ).style
.display
= 'none';
198 document
.getElementById('row_begindate' ).style
.display
= 'none';
199 document
.getElementById('row_enddate' ).style
.display
= 'none';
200 document
.getElementById('row_reaction' ).style
.display
= 'none';
201 document
.getElementById('row_referredby' ).style
.display
= 'none';
202 document
.getElementById('row_classification' ).style
.display
= 'none';
203 document
.getElementById('row_occurrence' ).style
.display
= 'none';
204 document
.getElementById('row_comments' ).style
.display
= 'none';
205 document
.getElementById('row_outcome' ).style
.display
= 'none';
206 document
.getElementById('row_destination' ).style
.display
= 'none';
207 document
.getElementById('row_social' ).style
.display
= 'none';
208 document
.getElementById('row_FH' ).style
.display
= 'none';
209 document
.getElementById('row_ROS' ).style
.display
= 'none';
210 document
.getElementById('row_PLACEHOLDER' ).style
.display
= 'none';
211 document
.getElementById('cancel_button' ).style
.display
= 'none';
212 document
.getElementById('row_eye_med' ).style
.display
= 'none';
215 if (index
== 'PMH') {
216 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('PMH Dx').":"; ?>";
217 document
.getElementById('row_diagnosis' ).style
.display
= '';
218 document
.getElementById('row_begindate' ).style
.display
= '';
219 document
.getElementById('row_enddate' ).style
.display
= '';
220 document
.getElementById('row_occurrence' ).style
.display
= '';
221 f
.form_occur
.options
[2].selected
= true;
222 document
.getElementById('row_comments' ).style
.display
= '';
224 } else if (index
== 'Allergy') {
225 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('Allergic to').":"; ?>";
226 document
.getElementById('row_reaction' ).style
.display
= '';
227 document
.getElementById('row_begindate' ).style
.display
= '';
228 document
.getElementById('row_comments' ).style
.display
= '';
230 } else if (index
== 'Medication') {
231 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('Medication').":"; ?>";
232 document
.getElementById('row_begindate' ).style
.display
= '';
233 document
.getElementById('row_enddate' ).style
.display
= '';
234 document
.getElementById('row_comments' ).style
.display
= '';
235 document
.getElementById('row_eye_med' ).style
.display
= '';
237 //change Onset to started
238 //change resolved to Completed
239 document
.getElementById('onset' ).textContent
= "<?php echo xlt('Start').':'; ?>";
240 document
.getElementById('resolved' ).textContent
= "<?php echo xlt('Finish').':'; ?>";
242 } else if ((index
== 'Surgery')||
(index
=='POS')) {
243 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('Procedure').':'; ?>";
244 document
.getElementById('row_diagnosis' ).style
.display
= '';
246 document
.getElementById('row_begindate' ).style
.display
= '';
247 document
.getElementById('row_referredby' ).style
.display
= '';
248 document
.getElementById('form_referredby' ).title
="<?php echo xla('Name of the Surgeon'); ?>";
249 document
.getElementById('by_whom' ).textContent
= "<?php echo xlt('Surgeon').':'; ?>";
250 document
.getElementById('onset' ).textContent
= "<?php echo xlt('Date').':'; ?>";
251 document
.getElementById('row_outcome' ).style
.display
= '';
252 document
.getElementById('row_comments' ).style
.display
= '';
254 } else if (index
== 4) { //Dental so skip it
255 } else if (index
== 'POH') {
256 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('Eye Dx{{eye diagnosis}}').":"; ?>";
257 document
.getElementById('row_diagnosis' ).style
.display
= '';
258 document
.getElementById('row_begindate' ).style
.display
= '';
259 document
.getElementById('row_referredby' ).style
.display
= '';
260 document
.getElementById('by_whom' ).textContent
="<?php echo xlt('Collaborator').":"; ?>";
261 document
.getElementById('form_referredby' ).title
="<?php echo xla('Co-managing/referring provider'); ?>";
262 document
.getElementById('onset' ).textContent
= "<?php echo xlt('Date').":"; ?>";
263 document
.getElementById('row_comments' ).style
.display
= '';
265 } else if (index
== 'FH') {
266 document
.getElementById('row_title' ).style
.display
= 'none';
267 document
.getElementById('row_FH' ).style
.display
= '';
269 } else if (index
== 'SOCH') {
270 document
.getElementById('row_title' ).style
.display
= 'none';
271 document
.getElementById('row_social' ).style
.display
= '';
272 document
.getElementById('cancel_button' ).style
.display
= '';
274 } else if (index
== 'ROS') {
275 document
.getElementById('row_title' ).style
.display
= 'none';
276 document
.getElementById('row_ROS' ).style
.display
= '';
279 document
.getElementById('title_diagnosis' ).textContent
="<?php echo xlt('Eye Dx{{eye diagnosis}}').":"; ?>";
280 document
.getElementById('row_diagnosis' ).style
.display
= '';
281 document
.getElementById('row_begindate' ).style
.display
= '';
282 document
.getElementById('row_referredby' ).style
.display
= '';
283 document
.getElementById('form_referredby' ).title
="<?php echo xla('Referring provider'); ?>";
284 document
.getElementById('by_whom' ).textContent
="<?php echo xlt('Collaborator').":"; ?>";
285 document
.getElementById('onset' ).textContent
= "<?php echo xlt('Date').":"; ?>";
286 document
.getElementById('row_comments' ).style
.display
= '';
287 document
.getElementById('row_PLACEHOLDER' ).style
.display
= '';
291 // If a clickoption title is selected, copy it to the title field.
292 // We also want to copy any other fields present in obj.PMSFH_options
293 // We need to build this object first. The base install options will need ICD-10 codes attached
294 // to make this work.
295 // f.form_title.diagnosis = f.form_titles.options[f.form_titles.selectedIndex].text;
296 function set_text() {
297 var f
= document
.forms
[0];
298 f
.form_title
.value
= f
.form_titles
.options
[f
.form_titles
.selectedIndex
].text
;
299 f
.form_diagnosis
.value
= f
.form_titles
.options
[f
.form_titles
.selectedIndex
].getAttribute('data-code');
300 f
.form_titles
.selectedIndex
= -1;
303 function refreshIssue() { parent
.refresh_page(); }
304 function submit_this_form() {
305 var url
= "../../forms/eye_mag/save.php?PMSFH_save=1&mode=update&form_save=1";
306 var formData
= $
("form#theform2").serialize();
307 var f
= document
.forms
[0];
308 top
.restoreSession();
310 type
: 'POST', // define the type of HTTP verb we want to use (POST for our form)
311 url
: url
, // the url where we want to POST
312 data
: formData
// our data object
313 }).done(function(result
){
314 f
.form_title
.value
= '';
315 f
.form_diagnosis
.value
= '';
316 f
.form_begin
.value
='';
317 f
.form_end
.value
='';
318 f
.form_referredby
.value
='';
319 f
.form_reaction
.value
='';
320 f
.form_classification
.value
='';
321 f
.form_comments
.value
='';
322 f
.form_outcome
.value
='';
323 f
.form_destination
.value
='';
325 parent
.populate_form(result
);
328 // Process click on Delete link.
329 function deleteme() {
330 var url
= "../../forms/eye_mag/save.php?PMSFH_save=1&mode=update&form_save=1";
331 var f
= document
.forms
[0];
332 top
.restoreSession();
336 pid
: <?php
echo attr($pid); ?
>,
337 issue
: f
.issue
.value
,
342 }).done(function (result
){
343 // CLEAR THE FORM TOO...
344 f
.form_title
.value
= '';
345 f
.form_diagnosis
.value
= '';
346 f
.form_begin
.value
='';
347 f
.form_end
.value
='';
348 f
.form_referredby
.value
='';
349 f
.form_reaction
.value
='';
350 f
.form_classification
.value
='';
351 f
.form_comments
.value
='';
352 f
.form_occur
.options
[0].selected
= true;
353 f
.form_outcome
.value
='';
354 f
.form_destination
.value
='';
356 parent
.populate_form(result
);
359 function imdeleted() { closeme(); }
361 negate_radio('radio_tobacco');
362 var f
= document
.forms
[0];
364 // f.radio_tobacco.value = '';
365 f
.form_diagnosis
.value
= '';
366 f
.form_begin
.value
='';
367 f
.form_end
.value
='';
368 f
.form_referredby
.value
='';
369 f
.form_reaction
.value
='';
370 f
.form_classification
.value
='';
371 f
.form_comments
.value
='';
372 f
.form_outcome
.value
='';
373 f
.form_destination
.value
='';
376 // Called when the Active checkbox is clicked. For consistency we
377 // use the existence of an end date to indicate inactivity, even
378 // though the simple verion of the form does not show an end date.
379 function resolvedClicked(cb
) {
380 var f
= document
.forms
[0];
382 f
.form_end
.value
= '';
383 f
.delete_button
.classList
.remove("nodisplay");
385 var today
= new Date();
386 f
.form_end
.value
= '' +
(today
.getYear() +
1900) +
'-' +
387 (today
.getMonth() +
1) +
'-' + today
.getDate();
388 f
.delete_button
.classList
.add("nodisplay");
391 // Called when resolved outcome is chosen and the end date is entered.
392 function outcomeClicked(cb
) {
393 var f
= document
.forms
[0];
394 if (cb
.value
== '1'){
395 var today
= new Date();
396 f
.form_end
.value
= '' +
(today
.getYear() +
1900) +
'-' +
397 ("0" +
(today
.getMonth() +
1)).slice(-2) +
'-' +
("0" + today
.getDate()).slice(-2);
400 // This is for callback by the find-code popup.
401 // Appends to or erases the current list of diagnoses.
402 function set_related(codetype
, code
, selector
, codedesc
) {
403 var f
= document
.forms
[0];
404 var s
= f
.form_diagnosis
.value
;
405 var title
= f
.form_title
.value
;
407 if (s
.length
> 0) s +
= ';';
408 s +
= codetype +
':' + code
;
412 f
.form_diagnosis
.value
= s
;
413 if(title
== '') f
.form_title
.value
= codedesc
;
416 // This invokes the find-code popup.
417 function sel_diagnosis() {
418 var f
= document
.forms
[0];
419 term
= f
.form_title
.value
;
421 if (($irow['type'] == 'PMH') ||
($irow['type'] == 'POH')) {
423 dlgopen('../../patient_file/encounter/find_code_popup.php?codetype=<?php echo attr(collect_codetypes("medical_problem", "csv")) ?>&search_term='+term
, '_blank', 500, 400);
427 dlgopen('../../patient_file/encounter/find_code_popup.php?codetype=<?php echo attr(collect_codetypes("diagnosis", "csv")) ?>&search_term='+term
, '_blank', 500, 400);
434 // Check for errors when the form is submitted.
435 function validate() {
436 var f
= document
.forms
[0];
437 if(f
.form_begin
.value
> f
.form_end
.value
&& (f
.form_end
.value
)) {
438 alert("<?php echo addslashes(xl('Please Enter End Date greater than Begin Date!')); ?>");
441 if (f
.form_type
.value
!= 'ROS' && f
.form_type
.value
!= 'FH' && f
.form_type
.value
!='SOCH') {
442 if (! f
.form_title
.value
) {
443 alert("<?php echo addslashes(xl('Please enter a title!')); ?>");
450 // Supports customizable forms (currently just for IPPF).
451 function divclick(cb
, divid
) {
452 var divstyle
= document
.getElementById(divid
).style
;
454 divstyle
.display
= 'block';
456 divstyle
.display
= 'none';
459 //function for selecting the smoking status in drop down list based on the selection in radio button.
460 function smoking_statusClicked(cb
) {
461 if (cb
.value
== 'currenttobacco')
463 document
.getElementById('form_tobacco').selectedIndex
= 1;
465 else if (cb
.value
== 'nevertobacco')
467 document
.getElementById('form_tobacco').selectedIndex
= 4;
469 else if (cb
.value
== 'quittobacco')
471 document
.getElementById('form_tobacco').selectedIndex
= 3;
473 else if (cb
.value
== 'not_applicabletobacco')
475 document
.getElementById('form_tobacco').selectedIndex
= 6;
477 radioChange(document
.getElementById('form_tobacco').value
); }
478 //function for selecting the smoking status in radio button based on the selection of drop down list.
479 function radioChange(rbutton
){
480 if (rbutton
== 1 || rbutton
== 2 || rbutton
== 15 || rbutton
== 16)
482 document
.getElementById('radio_tobacco[current]').checked
= true;
484 else if (rbutton
== 3)
486 document
.getElementById('radio_tobacco[quit]').checked
= true;
488 else if (rbutton
== 4)
490 document
.getElementById('radio_tobacco[never]').checked
= true;
492 else if (rbutton
== 5 || rbutton
== 9)
494 document
.getElementById('radio_tobacco[not_applicable]').checked
= true;
496 else if (rbutton
== '')
498 var radList
= document
.getElementsByName('radio_tobacco');
499 for (var i
= 0; i
< radList
.length
; i++
) {
500 if(radList
[i
].checked
) radList
[i
].checked
= false;
503 //Added on 5-jun-2k14 (regarding 'Smoking Status - display SNOMED code description')
505 if(code_options_js
[rbutton
]!="")
506 $
("#smoke_code").html(" ( "+code_options_js
[rbutton
]+
" )");
508 $
("#smoke_code").html("");
511 $
("#smoke_code").html("");
514 function setSelectBoxByText(eid
, etxt
) {
515 var eid
= document
.getElementById(eid
);
516 for (var i
= 0; i
< eid
.options
.length
; ++i
) {
517 if (eid
.options
[i
].text
=== etxt
)
518 eid
.options
[i
].selected
= true;
521 function clear_option(section
) {
522 //click the field, erase the Negative radio and input Y
523 var f
= document
.forms
[0];
524 var name
= 'radio_'+section
.name
;
525 var radio
= document
.getElementById(name
);
526 radio
.checked
= false;
527 if (section
.value
==''){
531 function negate_radio(section
) {
532 if (section
.checked
==true){
533 var rfield
= section
.name
.match(/radio_(.*)/);
534 document
.getElementById(rfield
[1]).value
='';
536 //Added on 5-jun-2k14 (regarding 'Smoking Status - display SNOMED code description')
537 var code_options_js
= Array();
540 $smoke_codes = getSmokeCodes();
542 foreach ($smoke_codes as $val => $code) {
543 echo "code_options_js"."['" . attr($val) . "']='" . attr($code) . "';\n";
548 <!-- Add Font stuff
for the look
and feel
. -->
550 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-3-3-4/dist/css/bootstrap.min.css">
551 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
552 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
553 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-ui-1-11-4/themes/excite-bike/jquery-ui.css">
554 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/pure-0-5-0/pure-min.css">
555 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/qtip2-2-2-1/jquery.qtip.min.css" />
556 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/font-awesome-4-6-3/css/font-awesome.min.css">
557 <link rel
="stylesheet" href
="../../forms/<?php echo $form_folder; ?>/css/style.css" type
="text/css">
559 td
, select
, textarea
, input
{
560 font
-family
: Fontawesome
, Arial
, Helvetica
, sans
-serif
;
564 input
[type
="text"],textarea
{
566 Xbackground
-color
: cornsilk
;
568 display
: inline
-block
;
569 border
: 1px solid
#CCC !important;
570 box
-shadow
: 0px
1px
3px
#DDD inset !important;
572 margin
:3px
3px
3px
5px
;
573 box
-sizing
: border
-box
;
580 border
-color
: #0000ff;
584 .ROS_class input
[type
="text"] {
596 border
: 1px solid
#CCC !important;
597 box
-shadow
: 0px
1px
3px
#DDD inset !important;
599 margin
:1px
3px
1px
5px
;
600 box
-sizing
: border
-box
;
603 background
-color
: navy
!important
;
611 <link rel
="shortcut icon" href
="<?php echo $GLOBALS['images_static_relative']; ?>/favicon.ico" />
612 <script src
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-min-1-11-3/index.js"></script
>
613 <script src
="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-3-3-4/dist/js/bootstrap.min.js"></script
>
614 <script src
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-ui-1-11-4/jquery-ui.min.js"></script
>
615 <script src
="<?php echo $GLOBALS['assets_static_relative'] ?>/qtip2-2-2-1/jquery.qtip.min.js"></script
>
616 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative'] ?>/manual-added-packages/shortcut.js-2-01-B/shortcut.js"></script
>
617 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
618 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/interface/forms/<?php echo $form_folder; ?>/js/eye_base.php?enc=<?php echo attr($encounter); ?>&providerID=<?php echo attr($providerID); ?>"></script
>
621 <div id
="page" style
="text-align: justify; text-justify: newspaper;">
622 <form method
='POST' name
='theform2' id
='theform2'
623 action
='a_issue.php?pid=<?php echo attr($pid); ?>&encounter=<?php echo attr($encounter); ?>'
624 onsubmit
='return validate();'
626 <input type
="hidden" name
="form_id" id
="form_id" value
= "<?php echo attr($form_id); ?>">
627 <input type
="hidden" name
="issue" id
="issue" value
= "<?php echo attr($issue); ?>">
628 <input type
="hidden" name
="uniqueID" id
="uniqueID" value
= "<?php echo attr($uniqueID); ?>">
632 global $counter_header;
635 foreach ($PMSFH[0] as $key => $value) {
638 $checked = " checked='checked' ";
641 $key_short_title = $key;
642 if ($key == "Medication") {
643 $key_short_title = "Meds";
644 $title = "Medications";
647 if ($key == "Problem") {
648 $key_short_title = "PMH";
649 $title = "Past Medical History";
652 if ($key == "Surgery") {
653 $key_short_title = "Surg";
654 $title = "Surgery History";
657 if ($key == "SOCH") {
658 $key_short_title = "Soc";
659 $title = "Social History";
662 $HELLO[attr($key)] = '<input type="radio" name="form_type" id="PMSFH_'.attr($key).'" value="'.attr($key).'" '.$checked.' onclick="top.restoreSession();newtype(\''.attr($key).'\');" /><span>'.
663 '<label class="input-helper input-helper--checkbox" for="PMSFH_'.attr($key).'" title="'.xla($title).'">' . xlt($key_short_title) . '</label></span> ';
666 //put them in the desired display order
667 echo $HELLO['POH'].$HELLO['POS'].$HELLO['PMH'].$HELLO['Medication'].$HELLO['Surgery'].$HELLO['Allergy'].$HELLO['FH'].$HELLO['SOCH'].$HELLO['ROS'];
670 <div
class="borderShadow" style
="text-align:left;margin-top:7px;width:95%;">
671 <table border
='0' width
='95%'>
672 <tr id
='row_quick_picks'>
673 <td valign
='top' nowrap
> 
;</td
>
674 <td valign
='top' colspan
="2">
675 <select name
='form_titles' size
='5' onchange
='top.restoreSession();set_text();'>
681 <td valign
='top' class="right" id
='title_diagnosis' nowrap style
="font-weight:bold;vertical-align:middle;"><?php
echo xlt('Title'); ?
>:</td
>
683 <input type
='text' size
='40' name
='form_title' id
='form_title' value
='<?php echo attr($irow['title
']) ?>' />
686 <tr id
="row_diagnosis">
687 <td valign
='top' class="right" nowrap style
="font-weight:bold;vertical-align:middle;"><b
><?php
echo xlt('Code'); ?
>:</b
></td
>
689 <input type
='text' size
='50' name
='form_diagnosis' id
='form_diagnosis'
690 value
='<?php echo attr($irow['diagnosis
']) ?>' onclick
='top.restoreSession();sel_diagnosis();'
691 title
='<?php echo xla('Click to select
or change diagnoses
'); ?>' />
694 <tr id
='row_begindate'>
695 <td nowrap
class="right"><b id
="onset"><?php
echo xlt('Onset'); ?
>:</b
></td
>
697 <input type
='text' class='datepicker' size
='10' name
='form_begin' id
='form_begin'
698 value
='<?php echo attr($irow['begdate
']) ?>'¸Â
700 title
='<?php echo xla('yyyy
-mm
-dd date of onset
, surgery
or start of medication
'); ?>' />
702 <td id
='row_enddate' nowrap
><input type
='checkbox' name
='form_active' id
='form_active' value
='1' <?php
echo attr($irow['enddate']) ?
"checked" : ""; ?
>
703 onclick
='top.restoreSession();resolvedClicked(this);'
704 title
='<?php echo xla('Indicates
if this issue is currently active
'); ?>' />
705 <b id
="resolved"><?php
echo xlt('Resolved'); ?
>:</b
> 
;<input type
='text' class='datepicker' size
='10' name
='form_end' id
='form_end'
707 value
='<?php echo attr($irow['enddate
']) ?>'
708 title
='<?php echo xla('yyyy
-mm
-dd date of recovery
or end of medication
'); ?>' />
712 <tr id
='row_occurrence'>
713 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Course'); ?
>:</b
></td
>
716 // Modified 6/2009 by BM to incorporate the occurrence items into the list_options listings
717 generate_form_field(array('data_type'=>1,'field_id'=>'occur','list_id'=>'occurrence','empty_title'=>'SKIP'), $irow['occurrence']);
718 ?
><a href
="<?php echo $GLOBALS['webroot']; ?>/interface/super/edit_list.php?list_id=occurrence" target
="RTop"
719 title
="<?php echo xla('Click here to Edit the Course/Occurrence List'); ?>" style
="color:black;"><i
class="fa fa-pencil fa-fw"></i
></a
>
723 <tr id
='row_classification'>
724 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Classification'); ?
>:</b
></td
>
726 <select name
='form_classification' id
='form_classification'>
728 foreach ($ISSUE_CLASSIFICATIONS as $key => $value) {
729 echo " <option value='".attr($key)."'";
730 if ($key == $irow['classification']) {
734 echo ">".text($value)."\n";
740 <tr id
='row_reaction'>
741 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Reaction'); ?
>:</b
></td
>
743 <input type
='text' size
='40' name
='form_reaction' id
='form_reaction' value
='<?php echo attr($irow['reaction
']) ?>'
744 title
='<?php echo xla('Allergy Reaction
'); ?>' />
747 <tr id
='row_referredby'>
748 <td
class="right" nowrap
><b id
="by_whom"><?php
echo xlt('Referred by'); ?
>:</b
></td
>
750 <input type
='text' size
='40' name
='form_referredby' id
='form_referredby' value
='<?php echo attr($irow['referredby
']) ?>'
751 title
='<?php echo xla('Referring physician
and practice
'); ?>' />
754 <tr id
='row_eye_med'>
755 <td
class="right" nowrap
><b id
="by_whom"><?php
echo xlt('Eye Med'); ?
>:</b
></td
>
756 <td colspan
="3"><?php
echo $irow['subtype']; ?
>
757 <input type
='checkbox' name
='form_eye_subtype' id
='form_eye_subtype' value
='1'
759 if ($irow['subtype'] =='eye') {
762 ?
> style
="margin:3px 3px 3px 5px;"
763 title
='<?php echo xla('Indicates
if this issue is an ophthalmic
-specific medication
'); ?>' />
767 <tr id
='row_comments'>
768 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Comments'); ?
>:</b
></td
>
770 <textarea name
='form_comments' id
='form_comments' cols
='40' wrap
='virtual'><?php
echo text($irow['comments']) ?
></textarea
>
773 <tr id
="row_outcome">
774 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Outcome'); ?
>:</b
></td
>
777 echo generate_select_list('form_outcome', 'outcome', $irow['outcome'], '', '', '', 'outcomeClicked(this);');
781 <tr id
="row_destination">
782 <td valign
='top' class="right" nowrap
><b
><?php
echo xlt('Destination'); ?
>:</b
></td
>
785 <input type
='text' size
='40' name
='form_destination' value
='<?php echo attr($irow['destination
']) ?>'
786 title
='GP, Secondary care specialist, etc.' />
787 <?php
} else { // leave this here for now, please -- Rod ?>
788 <?php
echo rbinput('form_destination', '1', 'GP', 'destination') ?
> 
;
789 <?php
echo rbinput('form_destination', '2', 'Secondary care spec', 'destination') ?
> 
;
790 <?php
echo rbinput('form_destination', '3', 'GP via physio', 'destination') ?
> 
;
791 <?php
echo rbinput('form_destination', '4', 'GP via podiatry', 'destination') ?
>
796 <table id
="row_social" width
="100%">
799 $dateStart=$_POST['dateState'];
800 $dateEnd=$_POST['dateEnd'];
801 if ($dateStart && $dateEnd) {
802 $result1 = sqlQuery("select $given from history_data where pid = ? and date >= ? and date <= ? order by date DESC limit 0,1", array($pid,$dateStart,$dateEnd));
803 } else if ($dateStart && !$dateEnd) {
804 $result1 = sqlQuery("select $given from history_data where pid = ? and date >= ? order by date DESC limit 0,1", array($pid,$dateStart));
805 } else if (!$dateStart && $dateEnd) {
806 $result1 = sqlQuery("select $given from history_data where pid = ? and date <= ? order by date DESC limit 0,1", array($pid,$dateEnd));
808 $result1 = sqlQuery("select $given from history_data where pid=? order by date DESC limit 0,1", array($pid));
811 $group_fields_query = sqlStatement("SELECT * FROM layout_options " .
812 "WHERE form_id = 'HIS' AND group_id = '4' AND uor > 0 " .
814 while ($group_fields = sqlFetchArray($group_fields_query)) {
815 $titlecols = $group_fields['titlecols'];
816 $datacols = $group_fields['datacols'];
817 $data_type = $group_fields['data_type'];
818 $field_id = $group_fields['field_id'];
819 $list_id = $group_fields['list_id'];
821 if (isset($result1[$field_id])) {
822 $currvalue = $result1[$field_id];
825 if ($data_type == 28 ||
$data_type == 32) {
826 $tmp = explode('|', $currvalue);
827 switch (count($tmp)) {
829 $result2[$field_id]['resnote'] = $tmp[0];
830 $result2[$field_id]['restype'] = $tmp[1];
831 $result2[$field_id]['resdate'] = $tmp[2];
832 $result2[$field_id]['reslist'] = $tmp[3];
835 $result2[$field_id]['resnote'] = $tmp[0];
836 $result2[$field_id]['restype'] = $tmp[1];
837 $result2[$field_id]['resdate'] = $tmp[2];
840 $result2[$field_id]['resnote'] = $tmp[0];
841 $result2[$field_id]['restype'] = $tmp[1];
842 $result2[$field_id]['resdate'] = "";
845 $result2[$field_id]['resnote'] = $tmp[0];
846 $result2[$field_id]['resdate'] = $result2[$field_id]['restype'] = "";
849 $result2[$field_id]['restype'] = $result2[$field_id]['resdate'] = $result2[$field_id]['resnote'] = "";
853 $fldlength = empty($frow['fld_length']) ?
20 : $frow['fld_length'];
854 $fldlength = htmlspecialchars($fldlength, ENT_QUOTES
);
855 $result2[$field_id]['resnote'] = htmlspecialchars($result2[$field_id]['resnote'], ENT_QUOTES
);
856 $result2[$field_id]['resdate'] = htmlspecialchars($result2[$field_id]['resdate'], ENT_QUOTES
);
857 } else if ($data_type == 2) {
858 $result2[$field_id]['resnote'] = nl2br(htmlspecialchars($currvalue, ENT_NOQUOTES
));
866 .data input
[type
="text"] {
876 <td
class="right" nowrap
><?php
echo xlt('Marital'); ?
>:</td
>
877 <td colspan
="3"><input type
="text" style
="width:75px;" name
="marital_status" id
="marital_status" value
="<?php echo attr($patient['status']); ?>">
878  
;<?php
echo xlt('Occupation'); ?
>: 
;<input type
="text" style
="width:175px;" name
="occupation" id
="occupation" value
="<?php echo attr($patient['occupation']); ?>"></td
>
883 <select name
="form_tobacco" id
="form_tobacco" onchange
="radioChange(this.options[this.selectedIndex].value)" title
="<?php xla('Tobacco use'); ?>">
884 <option value
="" <?php
if ($result2['tobacco']['reslist'] =='') {
886 } ?
>><?php
echo xlt('Unassigned'); ?
></option
>
887 <option value
="1" <?php
if ($result2['tobacco']['reslist'] =='1') {
889 } ?
>><?php
echo xlt('Current every day smoker'); ?
></option
>
890 <option value
="2" <?php
if ($result2['tobacco']['reslist'] =='2') {
892 } ?
>><?php
echo xlt('Current some day smoker'); ?
></option
>
893 <option value
="3" <?php
if ($result2['tobacco']['reslist'] =='3') {
895 } ?
>><?php
echo xlt('Former smoker'); ?
></option
>
896 <option value
="4" <?php
if ($result2['tobacco']['reslist'] =='4') {
898 } ?
>><?php
echo xlt('Never smoker'); ?
></option
>
899 <option value
="5" <?php
if ($result2['tobacco']['reslist'] =='5') {
901 } ?
>><?php
echo xlt('Smoker, current status unknown'); ?
></option
>
902 <option value
="9" <?php
if ($result2['tobacco']['reslist'] =='9') {
904 } ?
>><?php
echo xlt('Unknown if ever smoked'); ?
></option
>
905 <option value
="15" <?php
if ($result2['tobacco']['reslist'] =='15') {
907 } ?
>><?php
echo xlt('Heavy tobacco smoker'); ?
></option
>
908 <option value
="16" <?php
if ($result2['tobacco']['reslist'] =='16') {
910 } ?
>><?php
echo xlt('Light tobacco smoker'); ?
></option
>
913 <td nowrap
><span style
="text-decoration:underline;padding-right:3px;">Never
</span
></td
>
915 <span style
="text-decoration:underline;"><?php
echo xlt('N/A{{not applicable}}'); ?
></span
></td
>
919 <td
class="right" nowrap
><?php
echo xlt('Tobacco'); ?
>:</td
>
920 <td
class="text data" colspan
="4">
921 <table cellpadding
="0" cellspacing
="0">
923 <td
><input type
="text" name
="form_text_tobacco" id
="form_box" size
="20" value
="<?php echo attr($PMSFH[0]['SOCH']['tobacco']['resnote']); ?>"> 
;</td
>
924 <td
class="bold"> 
; 
;</td
>
926 <input type
="radio" name
="radio_tobacco" id
="radio_tobacco[current]" value
="currenttobacco" onclick
="smoking_statusClicked(this)" <?php
if ($result2['tobacco']['restype'] =='currenttobacco') {
928 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
929 <td
class="text"><input type
="radio" name
="radio_tobacco" id
="radio_tobacco[quit]" value
="quittobacco" onclick
="smoking_statusClicked(this)" <?php
if ($result2['tobacco']['restype'] =='quittobacco') {
931 } ?
>><?php
echo xlt('Quit'); ?
> 
;</td
>
932 <td
class="text" onclick
='top.restoreSession();resolvedClicked(this);'>
933 <input type
="text" class="datepicker" size
="6"
934 name
="date_tobacco" id
="date_tobacco"
935 value
="<?php echo attr($result2['tobacco']['resdate']); ?>"
936 title
="<?php echo xla('Tobacco use'); ?>">
939 <input type
="radio" name
="radio_tobacco" id
="radio_tobacco[never]" value
="nevertobacco" onclick
="smoking_statusClicked(this)" <?php
if ($result2['tobacco']['restype'] =='nevertobacco') {
941 } ?
>><?php
echo xlt('Never'); ?
> 
;
943 <td
><input name
="radio_tobacco" type
="radio" id
="radio_tobacco[not_applicable]" <?php
if ($PMSFH[0]['SOCH']['tobacco']['restype'] =='not_applicable') {
945 } ?
> value
="not_applicabletobacco">
946 <label
class="fa fa-history input-helper nodisplay" for="radio_tobacco[not_applicable]"></label
>
954 <td
class="right" nowrap
><?php
echo xlt('Coffee'); ?
>:</td
>
955 <td
class="text data" colspan
="4">
956 <table cellpadding
="0" cellspacing
="0">
959 <td
><input type
="text" name
="form_coffee" id
="form_box" size
="20" value
="<?php echo attr($result2['coffee']['resnote']); ?>"> 
;</td
>
960 <td
class="bold"> 
; 
;</td
>
961 <td
class="text"><input type
="radio" name
="radio_coffee" id
="radio_coffee[current]" value
="currentcoffee" <?php
if ($PMSFH[0]['SOCH']['coffee']['restype'] =='currentcoffee') {
963 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
964 <td
class="text"><input type
="radio" name
="radio_coffee" id
="radio_coffee[quit]" value
="quitcoffee" <?php
if ($PMSFH[0]['SOCH']['coffee']['restype'] =='quitcoffee') {
966 } ?
>><?php
echo xlt('Quit'); ?
> 
;</td
>
967 <td
class="text"><input type
="text" class="datepicker" size
="6" name
="date_coffee" id
="date_coffee" value
="" title
="<?php echo xla('Caffeine consumption'); ?>"> 
;</td
>
968 <td
class="text"><input type
="radio" name
="radio_coffee" id
="radio_coffee[never]" value
="nevercoffee" <?php
if ($PMSFH[0]['SOCH']['coffee']['restype'] =='nevercoffee') {
970 } ?
>><?php
echo xlt('Never'); ?
> 
;</td
>
971 <td
><input name
="radio_coffee" type
="radio" id
="radio_coffee[not_applicable]" <?php
if ($PMSFH[0]['SOCH']['coffee']['restype'] =='not_applicable') {
973 } ?
> value
="not_applicablecoffee">
974 <label
class="fa fa-history input-helper nodisplay" for="radio_coffee[not_applicable]"></label
>
983 <td
class="right" nowrap
><?php
echo xlt('Alcohol'); ?
>:</td
>
984 <td
class="text data" colspan
="4">
985 <table cellpadding
="0" cellspacing
="0">
987 <tr
><td
><input type
="text" name
="form_alcohol" id
="form_box" size
="20" value
="<?php echo attr($result2['alcohol']['resnote']); ?>"> 
;</td
><td
class="bold"> 
; 
;</td
><td
class="text"><input type
="radio" name
="radio_alcohol" id
="radio_alcohol[current]" value
="currentalcohol" <?php
if ($PMSFH[0]['SOCH']['alcohol']['restype'] =='currentalcohol') {
989 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
990 <td
class="text"><input type
="radio" name
="radio_alcohol" id
="radio_alcohol[quit]" value
="quitalcohol" <?php
if ($PMSFH[0]['SOCH']['alcohol']['restype'] =='quitalcohol') {
992 } ?
>><?php
echo xlt('Quit'); ?
> 
;</td
>
993 <td
class="text"><input type
="text" size
="6" class="datepicker" name
="date_alcohol" id
="date_alcohol" value
="" title
="<?php echo xla('Alcohol consumption'); ?>"> 
;</td
>
994 <td
class="text"><input type
="radio" name
="radio_alcohol" id
="radio_alcohol[never]" value
="neveralcohol" <?php
if ($PMSFH[0]['SOCH']['alcohol']['restype'] =='neveralcohol') {
996 } ?
>><?php
echo xlt('Never'); ?
> 
;</td
>
997 <td
><input name
="radio_alcohol" type
="radio" id
="radio_alcohol[not_applicable]" value
="not_applicablealcohol" <?php
if ($PMSFH[0]['SOCH']['alcohol']['restype'] =='not_applicable') {
1000 <label
class="fa fa-history input-helper nodisplay" for="radio_alcohol[not_applicable]"></label
>
1010 <td
class="right" nowrap
><?php
echo xlt('Drugs'); ?
>:</td
>
1011 <td
class="text data" colspan
="4">
1012 <table cellpadding
="0" cellspacing
="0">
1015 <td
><input type
="text" name
="form_recreational_drugs" id
="form_box" size
="20" value
="<?php echo attr($result2['recreational_drugs']['resnote']); ?>"> 
;</td
><td
class="bold"> 
; 
;</td
>
1016 <td
class="text"><input type
="radio" name
="radio_recreational_drugs" id
="radio_recreational_drugs[current]" value
="currentrecreational_drugs" <?php
if ($PMSFH[0]['SOCH']['recreational_drugs']['restype'] =='currentrecreational_drugs') {
1018 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
1019 <td
class="text"><input type
="radio" name
="radio_recreational_drugs" id
="radio_recreational_drugs[quit]" value
="quitrecreational_drugs" <?php
if ($PMSFH[0]['SOCH']['recreational_drugs']['restype'] =='quitrecreational_drugs') {
1021 } ?
>><?php
echo xlt('Quit'); ?
> 
;</td
>
1022 <td
class="text"><input type
="text" size
="6" class="datepicker" name
="date_recreational_drugs" id
="date_recreational_drugs" value
="" title
="<?php echo xla('Recreational drug use'); ?>"> 
;</td
>
1023 <td
class="text"><input type
="radio" name
="radio_recreational_drugs" id
="radio_recreational_drugs[never]" value
="neverrecreational_drugs" <?php
if ($PMSFH[0]['SOCH']['recreational_drugs']['restype'] =='neverrecreational_drugs') {
1025 } ?
>><?php
echo xlt('Never'); ?
> 
;</td
>
1026 <td
><input name
="radio_recreational_drugs" type
="radio" id
="radio_recreational_drugs[not_applicable]" <?php
if ($PMSFH[0]['SOCH']['recreational_drugs']['restype'] =='not_applicable') {
1028 } ?
> value
="not_applicablerecreational_drugs">
1029 <label
class="fa fa-history input-helper nodisplay" for="radio_recreational_drugs[not_applicable]"></label
>
1037 <tr
class="nodisplay" >
1038 <td
class="right" nowrap
><?php
echo xlt('Counseling'); ?
>:</td
>
1039 <td
class="text data" colspan
="4">
1040 <table cellpadding
="0" cellspacing
="0"><tbody
><tr
><td
><input type
="text" name
="form_counseling" id
="form_box" size
="20" value
="<?php echo attr($result2['counseling']['resnote']); ?>"> 
;</td
><td
class="bold"> 
; 
;</td
><td
class="text"><input type
="radio" name
="radio_counseling" id
="radio_counseling[current]" value
="currentcounseling" <?php
if ($PMSFH[0]['SOCH']['counseling']['restype'] =='currentcounseling') {
1042 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
1043 <td
class="text"><input type
="radio" name
="radio_counseling" id
="radio_counseling[quit]" value
="quitcounseling" <?php
if ($PMSFH[0]['SOCH']['counseling']['restype'] =='quitcounseling') {
1045 } ?
>><?php
echo xlt('Quit'); ?
> 
;</td
>
1046 <td
class="text"><input type
="text" size
="6" class="datepicker" name
="date_counseling" id
="date_counseling" value
="" title
="<?php echo xla('Counseling activities') ?>"> 
;</td
>
1047 <td
class="text"><input type
="radio" name
="radio_counseling" id
="radio_counseling[never]" value
="nevercounseling" <?php
if ($PMSFH[0]['SOCH']['counseling']['restype'] =='nevercounseling') {
1049 } ?
>><?php
echo xlt('Never'); ?
> 
;</td
>
1050 <td
><input name
="radio_counseling" type
="radio" id
="radio_counseling[not_applicable]" value
="not_applicablecounseling" <?php
if ($PMSFH[0]['SOCH']['counseling']['restype'] =='not_applicable') {
1053 <label
class="fa fa-history input-helper nodisplay" for="radio_counseling[not_applicable]"></label
>
1055 </tr
></tbody
></table
></td
></tr
>
1058 <td
class="right" nowrap
>
1059 <?php
echo xlt('Exercise'); ?
>:</td
>
1060 <td
class="text data" colspan
="4">
1061 <table cellpadding
="0" cellspacing
="0">
1062 <tbody
><tr
><td
><input type
="text" name
="form_exercise_patterns" id
="form_box" size
="20" value
="<?php echo attr($result2['exercise_patterns']['resnote']); ?>"> 
;</td
><td
class="bold"> 
; 
;</td
><td
class="text"><input type
="radio" name
="radio_exercise_patterns" id
="radio_exercise_patterns[current]" value
="currentexercise_patterns" <?php
if ($PMSFH[0]['SOCH']['exercise_patterns']['restype'] =='currentexercise_patterns') {
1064 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
1065 <td
class="text"><input type
="radio" name
="radio_exercise_patterns" id
="radio_exercise_patterns[quit]" value
="quitexercise_patterns" <?php
if ($PMSFH[0]['SOCH']['exercise_patterns']['restype'] =='quitexercise_patterns') {
1067 } ?
>><?php
echo xlt('Quit') ?
> 
;</td
>
1068 <td
class="text"><input type
="text" class="datepicker" name
="date_exercise_patterns" id
="date_exercise_patterns" value
="" title
="<?php echo xla('Exercise patterns') ?>"> 
;</td
>
1069 <td
class="text"><input type
="radio" name
="radio_exercise_patterns" id
="radio_exercise_patterns[never]" value
="neverexercise_patterns"<?php
if ($PMSFH[0]['SOCH']['exercise_patterns']['restype'] =='neverexercise_patterns') {
1071 } ?
>><?php
echo xlt('Never') ?
> 
;</td
>
1072 <td
><input name
="radio_exercise_patterns" type
="radio" id
="radio_exercise_patterns[not_applicable]" <?php
if ($PMSFH[0]['SOCH']['exercise_patterns']['restype'] =='not_applicable') {
1074 } ?
> value
="not_applicableexercise_patterns"><label
class="fa fa-history input-helper nodisplay" for="radio_exercise_patterns[not_applicable]"></label
>
1082 <tr
class="nodisplay">
1083 <td
class="right" nowrap
><?php
echo xlt('Hazardous Activities'); ?
>:</td
>
1084 <td
class="text data" colspan
="4">
1085 <table cellpadding
="0" cellspacing
="0">
1086 <tbody
><tr
><td
><input type
="text" name
="form_hazardous_activities" id
="form_box" size
="20" value
="<?php echo attr($result2['hazardous_activities']['resnote']); ?>"> 
;</td
><td
class="bold"> 
; 
;</td
><td
class="text"><input type
="radio" name
="radio_hazardous_activities" id
="radio_hazardous_activities[current]" value
="currenthazardous_activities" <?php
if ($PMSFH[0]['SOCH']['hazardous_activities']['restype'] =='currenthazardous_activities') {
1088 } ?
>><?php
echo xlt('Current'); ?
> 
;</td
>
1089 <td
class="text"><input type
="radio" name
="radio_hazardous_activities" id
="radio_hazardous_activities[quit]" value
="quithazardous_activities" <?php
if ($PMSFH[0]['SOCH']['hazardous_activities']['restype'] =='quithazardous_activities') {
1091 } ?
>><?php
echo xlt('Quit') ?
> 
;</td
>
1092 <td
class="text"><input type
="text" class="datepicker" name
="date_hazardous_activities" id
="date_hazardous_activities" value
="" title
="<?php echo xla('Hazardous activities') ?>"> 
;</td
>
1093 <td
class="text"><input type
="radio" name
="radio_hazardous_activities" id
="radio_hazardous_activities[never]" value
="neverhazardous_activities" <?php
if ($PMSFH[0]['SOCH']['hazardous_activities']['restype'] =='neverhazardous_activities') {
1095 } ?
>><?php
echo xlt('Never') ?
> 
;</td
>
1096 <td
><input name
="radio_hazardous_activities" type
="radio" id
="radio_hazardous_activities[not_applicable]" <?php
if ($PMSFH[0]['SOCH']['hazardous_activities']['restype'] =='not_applicable') {
1098 } ?
> value
="not_applicablehazardous_activities" onclick
="hazardous_activities_statusClicked(this)"><label
class="fa fa-history input-helper nodisplay" for="radio_hazardous_activities[not_applicable]"></label
>
1107 <td
class="right" nowrap
><?php
echo xlt('Sleep'); ?
>:</td
>
1108 <td
class="text data" colspan
="4">
1109 <table cellpadding
="0" cellspacing
="0">
1111 <tr
><td
><input type
="text" name
="form_sleep_patterns" id
="form_box" size
="20" title
="<?php echo xla('Sleep patterns'); ?>" value
="<?php echo attr($result2['sleep_patterns']['resnote']); ?>"></td
>
1112 <td
class="left" nowrap
><?php
echo xlt('Seatbelt'); ?
>:
1114 <td
><input type
="text" name
="form_seatbelt_use" id
="form_box" size
="20" title
="<?php echo xla('Seatbelt use'); ?>" value
="<?php echo attr($result2['seatbelt_use']['resnote']); ?>">
1123 <table id
="row_FH" name
="row_FH" width
="90%">
1125 <td
class="right" nowrap
><?php
echo xlt('Glaucoma'); ?
>:</td
>
1126 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext11" name
="radio_usertext11" <?php
if (!$result1['usertext11']) {
1127 echo "checked='checked'";
1129 <input type
="text" name
="usertext11" id
="usertext11" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext11']); ?>"></td
>
1130 <td
class="right" nowrap
><?php
echo xlt('Cataract'); ?
>:</td
>
1131 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext12" name
="radio_usertext12" <?php
if (!$result1['usertext12']) {
1132 echo "checked='checked'";
1134 <input type
="text" name
="usertext12" id
="usertext12" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext12']); ?>"></td
>
1137 <td
class="right" nowrap
><?php
echo xlt('AMD{{age related macular degeneration}}'); ?
>:</td
>
1138 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext13" name
="radio_usertext13" <?php
if (!$result1['usertext13']) {
1139 echo "checked='checked'";
1141 <input type
="text" name
="usertext13" id
="usertext13" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext13']); ?>"></td
>
1142 <td
class="right" nowrap
><?php
echo xlt('RD{{retinal detachment}}'); ?
>:</td
>
1143 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext14" name
="radio_usertext14" <?php
if (!$result1['usertext14']) {
1144 echo "checked='checked'";
1146 <input type
="text" name
="usertext14" id
="usertext14" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext14']); ?>"></td
>
1149 <td
class="right" nowrap
><?php
echo xlt('Blindness'); ?
>:</td
>
1150 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext15" name
="radio_usertext15" <?php
if (!$result1['usertext15']) {
1151 echo "checked='checked'";
1153 <input type
="text" name
="usertext15" id
="usertext15" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext15']); ?>"></td
>
1154 <td
class="right" nowrap
><?php
echo xlt('Amblyopia'); ?
>:</td
>
1155 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext16" name
="radio_usertext16" <?php
if (!$result1['usertext16']) {
1156 echo "checked='checked'";
1158 <input type
="text" name
="usertext16" id
="usertext16" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext16']); ?>"></td
>
1161 <td
class="right" nowrap
><?php
echo xlt('Strabismus'); ?
>:</td
>
1162 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext17" name
="radio_usertext17" <?php
if (!$result1['usertext17']) {
1163 echo "checked='checked'";
1165 <input type
="text" name
="usertext17" id
="usertext17" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext17']); ?>"></td
>
1166 <td
class="right" nowrap
><?php
echo xlt('Epilepsy'); ?
>:</td
>
1167 <td
class="text data">
1168 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_epilepsy" name
="radio_relatives_epilepsy" <?php
if (!$result1['relatives_epilepsy']) {
1169 echo "checked='checked'";
1171 <input type
="text" name
="relatives_epilepsy" id
="relatives_epilepsy" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_epilepsy']); ?>"></td
>
1174 <td
class="right" nowrap
><?php
echo xlt('Cancer'); ?
>:</td
>
1175 <td
class="text data">
1176 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_cancer" name
="radio_relatives_cancer" <?php
if (!$result1['relatives_cancer']) {
1177 echo "checked='checked'";
1179 <input type
="text" name
="relatives_cancer" id
="relatives_cancer" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_cancer']); ?>"></td
>
1180 <td
class="right" nowrap
><?php
echo xlt('Diabetes'); ?
>:</td
>
1181 <td
class="text data">
1182 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_diabetes" name
="radio_relatives_diabetes" <?php
if (!$result1['relatives_diabetes']) {
1183 echo "checked='checked'";
1185 <input type
="text" name
="relatives_diabetes" id
="relatives_diabetes" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_diabetes']); ?>"></td
>
1188 <td
class="right" nowrap
><?php
echo xlt('HTN{{hypertension}}'); ?
>:</td
>
1189 <td
class="text data">
1190 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_high_blood_pressure" name
="radio_relatives_high_blood_pressure" <?php
if (!$result1['relatives_high_blood_pressure']) {
1191 echo "checked='checked'";
1193 <input type
="text" name
="relatives_high_blood_pressure" id
="relatives_high_blood_pressure" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_high_blood_pressure']); ?>"></td
>
1194 <td
class="right" nowrap
><?php
echo xlt('Cardiac'); ?
>:</td
>
1195 <td
class="text data">
1196 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_heart_problems" name
="radio_relatives_heart_problems" <?php
if (!$result1['relatives_heart_problems']) {
1197 echo "checked='checked'";
1199 <input type
="text" name
="relatives_heart_problems" id
="relatives_heart_problems" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_heart_problems']); ?>"></td
>
1202 <td
class="right" nowrap
><?php
echo xlt('Stroke'); ?
>:</td
>
1203 <td
class="text data">
1204 <input type
="radio" onclick
='negate_radio(this);' id
="radio_relatives_stroke" name
="radio_relatives_stroke" <?php
if (!$result1['relatives_stroke']) {
1205 echo "checked='checked'";
1207 <input type
="text" name
="relatives_stroke" id
="relatives_stroke" onclick
='clear_option(this)' value
="<?php echo attr($result1['relatives_stroke']); ?>"></td
>
1208 <td
class="right" nowrap
><?php
echo xlt('Other'); ?
>:</td
>
1209 <td
class="text data"><input type
="radio" onclick
='negate_radio(this);' id
="radio_usertext18" name
="radio_usertext18" <?php
if (!$result1['usertext18']) {
1210 echo "checked='checked'";
1212 <input type
="text" name
="usertext18" id
="usertext18" onclick
='clear_option(this)' value
="<?php echo attr($result1['usertext18']); ?>"></td
>
1215 <table id
="row_ROS" name
="row_ROS" class="ROS_class">
1224 <span
class="underline"><?php
echo xlt('Neg{{negative}}'); ?
></span
><span
class="underline" style
="margin:30px;"><?php
echo xlt('Positive'); ?
></span
>
1227 <td
><span
class="underline"><?php
echo xlt('Neg{{negative}}'); ?
></span
><span
class="underline" style
="margin:30px;"><?php
echo xlt('Positive'); ?
></span
>
1231 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('General'); ?
>:</label
></td
>
1233 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSGENERAL" name
="radio_ROSGENERAL" <?php
if (!$ROSGENERAL) {
1234 echo "checked='checked'";
1236 <input type
="text" name
="ROSGENERAL" id
="ROSGENERAL" onclick
='clear_option(this)' value
="<?php echo attr($ROSGENERAL); ?>"></td
>
1237 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('HEENT'); ?
>:</td
>
1239 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSHEENT" name
="radio_ROSHEENT"<?php
if (!$ROSHEENT) {
1240 echo "checked='checked'";
1242 <input type
="text" name
="ROSHEENT" id
="ROSHEENT" onclick
='clear_option(this)' value
="<?php echo attr($ROSHEENT); ?>"></td
>
1245 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('CV{{Cardiovascular}}'); ?
>:</td
>
1247 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSCV" name
="radio_ROSCV"<?php
if (!$ROSCV) {
1248 echo "checked='checked'";
1250 <input type
="text" name
="ROSCV" id
="ROSCV" onclick
='clear_option(this)' value
="<?php echo attr($ROSCV); ?>"></td
>
1251 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Pulmonary'); ?
>:</td
>
1253 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSPULM" name
="radio_ROSPULM"<?php
if (!$ROSPULM) {
1254 echo "checked='checked'";
1256 <input type
="text" name
="ROSPULM" id
="ROSPULM" onclick
='clear_option(this)' value
="<?php echo attr($ROSPULM); ?>"></td
>
1259 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('GI{{Gastrointestinal}}'); ?
>:</td
>
1261 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSGI" name
="radio_ROSGI"<?php
if (!$ROSGI) {
1262 echo "checked='checked'";
1264 <input type
="text" name
="ROSGI" id
="ROSGI" onclick
='clear_option(this)' value
="<?php echo attr($ROSGI); ?>"></td
>
1265 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('GU{{Genitourinary}}'); ?
>:</td
>
1267 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSGU" name
="radio_ROSGU"<?php
if (!$ROSGU) {
1268 echo "checked='checked'";
1270 <input type
="text" name
="ROSGU" id
="ROSGU" onclick
='clear_option(this)' value
="<?php echo attr($ROSGU); ?>"></td
>
1273 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Derm{{dermatologic}}'); ?
>:</td
>
1275 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSDERM" name
="radio_ROSDERM"<?php
if (!$ROSDERM) {
1276 echo "checked='checked'";
1278 <input type
="text" name
="ROSDERM" id
="ROSDERM" onclick
='clear_option(this)' value
="<?php echo attr($ROSDERM); ?>"></td
>
1279 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Neuro{{neurologic}}'); ?
>:</td
>
1281 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSNEURO" name
="radio_ROSNEURO"<?php
if (!$ROSNEURO) {
1282 echo "checked='checked'";
1284 <input type
="text" name
="ROSNEURO" id
="ROSNEURO" onclick
='clear_option(this)' value
="<?php echo attr($ROSNEURO); ?>"></td
>
1287 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Psych{{psychiatric}}'); ?
>:</td
>
1289 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSPSYCH" name
="radio_ROSPSYCH"<?php
if (!$ROSPSYCH) {
1290 echo "checked='checked'";
1292 <input type
="text" name
="ROSPSYCH" id
="ROSPSYCH" onclick
='clear_option(this)' value
="<?php echo attr($ROSPSYCH); ?>"></td
>
1293 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Musculo{{musculoskeletal}}'); ?
>:</td
>
1295 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSMUSCULO" name
="radio_ROSMUSCULO"<?php
if (!$ROSMUSCULO) {
1296 echo "checked='checked'";
1298 <input type
="text" name
="ROSMUSCULO" id
="ROSMUSCULO" onclick
='clear_option(this)' value
="<?php echo attr($ROSMUSCULO); ?>"></td
>
1301 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Immuno{{immunologic}}'); ?
>:</td
>
1303 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSIMMUNO" name
="radio_ROSIMMUNO"<?php
if (!$ROSIMMUNO) {
1304 echo "checked='checked'";
1306 <input type
="text" name
="ROSIMMUNO" id
="ROSIMMUNO" onclick
='clear_option(this)' value
="<?php echo attr($ROSIMMUNO); ?>"></td
>
1307 <td
class="right" nowrap
><label
for="ROSGENERAL" class="input-helper input-helper--checkbox"><?php
echo xlt('Endocrine'); ?
>:</td
>
1309 <input type
="radio" onclick
='negate_radio(this);' id
="radio_ROSENDOCRINE" name
="radio_ROSENDOCRINE"<?php
if (!$ROSENDOCRINE) {
1310 echo "checked='checked'";
1312 <input type
="text" name
="ROSENDOCRINE" id
="ROSENDOCRINE" onclick
='clear_option(this)' value
="<?php echo attr($ROSENDOCRINE); ?>"></td
>
1316 <table id
="row_PLACEHOLDER" name
="row_PLACEHOLDER" width
="90%">
1324 <p style
="margin-top:10px;">
1325 <input type
="hidden" type
="text" id
="issue_js" name
="issue_js" value
="test">
1326 <input type
="hidden" type
="text" id
="pid" name
="pid" value
="<?php echo $pid; ?>">
1327 <input type
='button' id
='form_save' name
='form_save'
1328 class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only navy"
1329 onclick
='top.restoreSession();submit_this_form();' value
='<?php echo xla('Save
'); ?>' />
1331 $display_delete = "nodisplay";
1334 <input type
='button' name
='delete_button' id
='delete_button'
1335 class="<?php echo $display_delete; ?> ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only navy"
1336 onclick
='top.restoreSession();deleteme();' value
='<?php echo xla('Delete
'); ?>' />
1338 <input type
='button' name
='cancel_button' id
='cancel_button'
1339 class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only navy"
1340 value
='<?php echo xla('Cancel
'); ?>' onclick
='clearme();' />
1345 <script language
='JavaScript'>
1346 newtype('<?php if (!$form_index) {
1352 $
(document
).ready(function() {
1355 my
: 'top Right', // Position my top left...
1356 at
: 'bottom Left', // at the bottom right of...
1357 target
: 'mouse' // my target
1360 //$("textarea,text").css("background-color","#FFF8DC");
1362 $
('.datepicker').datetimepicker({
1363 <?php
$datetimepicker_timepicker = false; ?
>
1364 <?php
$datetimepicker_showseconds = false; ?
>
1365 <?php
$datetimepicker_formatInput = false; ?
>
1366 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
1367 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>