migrated ubiquitous libraries to composer autoloader (#421)
[openemr.git] / interface / forms / misc_billing_options / new.php
blob14ad5fe4b3557415dad6e2ac2c7cfa6b9a9c8f9f
1 <?php
2 /*
3 * new.php for the creation of the misc_billing_form
5 * This program creates the misc_billing_form
7 * Copyright (C) 2007 Bo Huynh
8 * Copyright (C) 2016 Terry Hill <terry@lillysystems.com>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see http://opensource.org/licenses/gpl-license.php.
21 * @package OpenEMR
22 * @author Terry Hill <terry@lilysystems.com>
23 * @author Brady Miller <brady.g.miller@gmail.com>
24 * @link http://www.open-emr.org
27 $fake_register_globals=false;
28 $sanitize_all_escapes=true;
30 require_once("../../globals.php");
31 require_once("$srcdir/options.inc.php");
32 require_once("$srcdir/api.inc");
33 require_once("date_qualifier_options.php");
36 if (! $encounter) { // comes from globals.php
37 die(xlt("Internal error: we do not seem to be in an encounter!"));
40 $formid = 0 + formData('id', 'G');
41 $obj = $formid ? formFetch("form_misc_billing_options", $formid) : array();
43 formHeader("Form: misc_billing_options");
44 function generateDateQualifierSelect($name,$options,$obj)
46 echo "<select name='".attr($name)."'>";
47 for($idx=0;$idx<count($options);$idx++)
49 echo "<option value='".attr($options[$idx][1])."'";
50 if($obj[$name]==$options[$idx][1]) echo " selected";
51 echo ">".text($options[$idx][0])."</option>";
53 echo "</select>";
56 function genProviderSelect($selname, $toptext, $default=0, $disabled=false) {
57 $query = "SELECT id, lname, fname FROM users WHERE " .
58 "( authorized = 1 OR info LIKE '%provider%' ) AND username != '' " .
59 "AND active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
60 "ORDER BY lname, fname";
61 $res = sqlStatement($query);
62 echo " <select name='" . attr($selname) . "'";
63 if ($disabled) echo " disabled";
64 echo ">\n";
65 echo " <option value=''>" . text($toptext) . "\n";
66 while ($row = sqlFetchArray($res)) {
67 $provid = $row['id'];
68 echo " <option value='" . attr($provid) . "'";
69 if ($provid == $default) echo " selected";
70 echo ">" . text($row['lname'] . ", " . $row['fname']) . "\n";
72 echo text($provid);
73 echo " </select>\n";
76 <html>
77 <head>
78 <?php html_header_show(); ?>
79 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-1/index.js"></script>
80 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
81 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
83 <!-- pop up calendar -->
84 <style type="text/css">@import url(<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css);</style>
85 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script>
86 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_en.js"></script>
87 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
89 </head>
90 <body class="body_top">
91 <form method=post <?php echo "name='my_form' " . "action='$rootdir/forms/misc_billing_options/save.php?id=" . attr($formid) . "'>\n";?>
93 <span class="title"><?php echo xlt('Misc Billing Options for HCFA-1500'); ?></span><br><br>
94 <span class=text><?php echo xlt('Checked box = yes , empty = no');?><br><br>
95 <label><span class=text><?php echo xlt('BOX 10 A. Employment related '); ?>: </span><input type=checkbox name="employment_related" value="1" <?php if ($obj['employment_related'] == "1") echo "checked";?>></label><br><br>
96 <label><span class=text><?php echo xlt('BOX 10 B. Auto Accident '); ?>: </span><input type=checkbox name="auto_accident" value="1" <?php if ($obj['auto_accident'] == "1") echo "checked";?>></label>
97 <span class=text><?php echo xlt('State'); ?>: </span><input type=entry name="accident_state" size=1 value="<?php echo attr($obj{"accident_state"});?>" ><br><br>
98 <label><span class=text><?php echo xlt('BOX 10 C. Other Accident '); ?>: </span><input type=checkbox name="other_accident" value="1" <?php if ($obj['other_accident'] == "1") echo "checked";?>></label><br><br>
99 <span class=text><?php echo xlt('BOX 10 D. EPSDT Referral Code');?> </span><input type=entry style="width: 25px;" size=2 name="medicaid_referral_code" value="<?php echo attr($obj{"medicaid_referral_code"});?>" >&nbsp;&nbsp;&nbsp;&nbsp;
100 <label><span class=text><?php echo xlt('EPSDT'); ?> : </span><input type=checkbox name="epsdt_flag" value="1" <?php if ($obj['epsdt_flag'] == "1") echo "checked";?>></label><br><br>
101 <span class="text" title="<?php echo xla("For HCFA 02/12 Onset date specified on the Encounter Form needs a qualifier");?>"></span>
102 <span class=text title="<?php echo xla('For HCFA 02/12 Box 15 is Other Date with a qualifier to specify what the date indicates');?>"></span>
103 <tr>
104 <td><span class=text><?php echo xlt('BOX 14. Is Populated from the Encounter Screen as the Onset Date');?>.</span></td>
105 </tr><br><br>
106 <tr>
107 <td><span class=text><?php echo xlt('BOX 16. Date unable to work from');?>:</span></td>
108 <td><?php $off_work_from = $obj{"off_work_from"}; ?>
109 <input type=text style="width: 70px;" size=10 name='off_work_from' id='off_work_from'
110 value='<?php echo attr($off_work_from); ?>'
111 title='<?php echo xla('yyyy-mm-dd'); ?>'
112 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
113 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
114 id='img_off_work_from' border='0' alt='[?]' style='cursor:pointer'
115 title='<?php echo xla("Click here to choose a date"); ?>'></td>
116 </tr>
117 &nbsp;&nbsp;
118 <tr>
119 <td><span class=text><?php echo xlt('BOX 16. Date unable to work to');?>:</span></td>
120 <td><?php $off_work_to = $obj{"off_work_to"}; ?>
121 <input type=text style="width: 70px;" size=10 name='off_work_to' id='off_work_to'
122 value='<?php echo attr($off_work_to); ?>'
123 title='<?php echo xla('yyyy-mm-dd'); ?>'
124 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
125 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
126 id='img_off_work_to' border='0' alt='[?]' style='cursor:pointer'
127 title='<?php echo xla("Click here to choose a date"); ?>'></td>
128 </tr>
129 <br><br>
131 <td class='label'><?php echo xlt('BOX 17. Provider') ?>:</td>
132 <td><?php # Build a drop-down list of providers. # Added (TLH)
133 genProviderSelect('provider_id', '-- '.xl("Please Select").' --',$obj{"provider_id"});
134 ?></td>&nbsp;&nbsp;
135 <td><span class=text><?php echo xlt('BOX 17. Provider Qualifier'); ?>: </span>
136 <tr><td><?php
137 echo generate_select_list('provider_qualifier_code', 'provider_qualifier_code',$obj{"provider_qualifier_code"}, 'Provider Qualifier Code');
138 ?></td>
139 </tr></td>
140 <br><br>
141 <tr>
142 <td><span class=text><?php echo xlt('BOX 18. Hospitalization date from');?>:</span></td>
143 <td><?php $hospitalization_date_from = $obj{"hospitalization_date_from"}; ?>
144 <input type=text style="width: 70px;" size=10 name='hospitalization_date_from' id='hospitalization_date_from'
145 value='<?php echo attr($hospitalization_date_from); ?>'
146 title='<?php echo xla('yyyy-mm-dd'); ?>'
147 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
148 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
149 id='img_hospitalization_date_from' border='0' alt='[?]' style='cursor:pointer'
150 title='<?php echo xla("Click here to choose a date"); ?>'></td>
151 </tr>
152 &nbsp;&nbsp;
153 <tr>
154 <td><span class=text><?php echo xlt('BOX 18. Hospitalization date to');?>:</span></td>
155 <td><?php $hospitalization_date_to = $obj{"hospitalization_date_to"}; ?>
156 <input type=text style="width: 70px;" size=10 name='hospitalization_date_to' id='hospitalization_date_to'
157 value='<?php echo attr($hospitalization_date_to); ?>'
158 title='<?php echo xla('yyyy-mm-dd'); ?>'
159 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
160 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
161 id='img_hospitalization_date_to' border='0' alt='[?]' style='cursor:pointer'
162 title='<?php echo xla("Click here to choose a date"); ?>'></td>
163 </tr>
164 <br><br>
165 <span class=text><?php echo xlt('BOX 20. Is Outside Lab used?'); ?>: </span><input type=checkbox name="outside_lab" value="1" <?php if ($obj['outside_lab'] == "1") echo "checked";?>>
166 <span class=text><?php echo xlt('Amount Charges'); ?>: </span><input type=entry size=7 align='right' name="lab_amount" value="<?php echo attr($obj{"lab_amount"});?>" ><br><br>
167 <span class=text><?php echo xlt('BOX 22. Medicaid Resubmission Code (ICD-9) ');?></span><input type=entry size=9 name="medicaid_resubmission_code" value="<?php echo attr($obj{"medicaid_resubmission_code"});?>" >
168 <span class=text><?php echo xlt(' Medicaid Original Reference No. ');?></span><input type=entry size=15 name="medicaid_original_reference" value="<?php echo attr($obj{"medicaid_original_reference"});?>" ><br><br>
169 <span class=text><?php echo xlt('BOX 23. Prior Authorization No. ');?></span><input type=entry size=15 name="prior_auth_number" value="<?php echo attr($obj{"prior_auth_number"});?>" ><br><br>
170 <label><span class=text><?php echo xlt('X12 only: Replacement Claim '); ?>: </span><input type=checkbox name="replacement_claim" value="1" <?php if ($obj['replacement_claim'] == "1") echo "checked";?>></label><br><br>
171 <span class=text><?php echo xlt('X12 only ICN resubmission No.');?> </span><input type=entry size=35 name="icn_resubmission_number" value="<?php echo attr($obj{"icn_resubmission_number"});?>" ><br><br>
173 <table>
174 <tr>
175 <td valign=top>
176 <span class=text><?php echo xlt('Additional Notes'); ?>: </span><br><textarea cols=40 rows=8 wrap=virtual name="comments" ><?php echo text($obj{"comments"});?></textarea><br>
177 </td>
178 </table>
179 <br>
180 </tr>
182 <div>
183 <!-- Save/Cancel buttons -->
184 <input type="button" class="save" value="<?php echo xla('Save'); ?>"> &nbsp &nbsp &nbsp &nbsp;
185 <input type="button" class="dontsave" value="<?php echo xla('Don\'t Save Changes'); ?>"> &nbsp;
186 </div>
187 </form>
188 <script language="javascript">
189 /* required for popup calendar */
190 Calendar.setup({inputField:"hospitalization_date_from", ifFormat:"%Y-%m-%d", button:"img_hospitalization_date_from"});
191 Calendar.setup({inputField:"hospitalization_date_to", ifFormat:"%Y-%m-%d", button:"img_hospitalization_date_to"});
192 Calendar.setup({inputField:"off_work_from", ifFormat:"%Y-%m-%d", button:"img_off_work_from"});
193 Calendar.setup({inputField:"off_work_to", ifFormat:"%Y-%m-%d", button:"img_off_work_to"});
195 // jQuery stuff to make the page a little easier to use
197 $(document).ready(function(){
198 $(".save").click(function() { top.restoreSession(); document.my_form.submit(); });
199 $(".dontsave").click(function() { location.href='<?php echo "$rootdir/patient_file/encounter/encounter_top.php";?>'; });
201 </script>
202 </body>
203 </html>