supporting data peculiar to ippf issue types
[openemr.git] / interface / patient_file / encounter / dbc_diagnose_as2.php
blobc4685f1203ee03fcfccd37a4d6ecb3f8f10412bd
1 <?php include_once("../../../interface/globals.php");?>
3 <html><head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <script type="text/javascript" src="../../../library/js/jquery.js"></script>
8 <script type="text/javascript">
9 function win() {
10 window.opener.location.reload(true);
11 self.close();
14 </script>
16 <script type="text/javascript">
17 $(document).ready(function(){
18 $('#box2').hide(); $('#box3').hide(); $('#box4').hide();
19 $('#box1').bind('change', function(){
20 $('#box2').html(
21 $.ajax({
22 type: 'POST',
23 url: 'as.php',
24 data: 'z=' + $('#box1').val() + '&lvl=2',
25 async: false
26 }).responseText
28 });
29 $('#box1').bind('focus', function(){
30 $('#box2').show(); $('#box3').hide(); $('#box4').hide(); $('#box5').hide();
31 });
34 $('#box2').bind('change', function(){
35 $('#box3').html(
36 $.ajax({
37 type: 'POST',
38 url: 'as.php',
39 data: 'z=' + $('#box2').val() + '&lvl=2',
40 async: false
41 }).responseText
43 });
44 // if empty box, prevent the next to show
45 $('#box2').bind('click', function(){
46 if ( $('#box2').val() != 0 ) {
47 $('#box3').show(); }
48 else {
49 $('#box3').hide();}
50 $('#box4').hide(); $('#box5').hide();
51 });
55 $('#box3').bind('change', function(){
56 $('#box4').html(
57 $.ajax({
58 type: 'POST',
59 url: 'as.php',
60 data: 'z=' + $('#box3').val() + '&lvl=2',
61 async: false
62 }).responseText
64 });
65 // if empty box, prevent the next to show
66 $('#box3').bind('click', function(){
67 if ( $('#box3').val() != 0 ) {
68 $('#box4').show(); }
69 else {
70 $('#box4').hide(); $('#box5').hide();
72 });
74 $('#box4').bind('change', function(){
75 $('#box5').html(
76 $.ajax({
77 type: 'POST',
78 url: 'as.php',
79 data: 'z=' + $('#box4').val() + '&lvl2',
80 async: false
81 }).responseText
83 });
84 // if empty box, prevent the next to show
85 $('#box4').bind('click', function(){
86 if ( $('#box4').val() != 0 ) {
87 $('#box5').show(); }
88 else {
89 $('#box5').hide();
91 });
94 });
95 </script>
97 <?php
98 if ( isset($_POST['saveas']) ) {
99 // same logic as in javascript validation
100 if ( $_POST['box5'] ) $as = $_POST['box5'];
101 elseif ( $_POST['box4']) $as = $_POST['box4'];
102 elseif ( $_POST['box3']) $as = $_POST['box3'];
103 elseif ( $_POST['box2']) $as = $_POST['box2'];
104 elseif ( $_POST['box1']) $as = $_POST['box1'];
106 $trekken = $_POST['partial'];
107 $arr_as = array('code' => $as, 'trekken' => $trekken);
109 if ( verify_code($as, 2)) {
110 $_SESSION['as2'][] = $arr_as;
111 } else {
112 echo '<script>alert("You must select again!")</script>';
115 // verify the limit for diagnoses
116 if ( count($_SESSION['as2']) == 3 )
117 echo '<script>window.close();</script>';
121 </head>
123 <body onunload="win();" bgcolor="#A4FF8B">
124 <p>Choose your AS II diagnose</p>
126 <form method="post" target="_self">
127 <table border=0 cellspacing=0 cellpadding=0 >
128 <tr>
129 <td width='1%' nowrap>
130 <select name="box1" id="box1">
131 <?php
132 $rlvone = records_level1('as2');
133 foreach ($rlvone as $rlv) {
134 echo '<option value=\'' .$rlv['cl_diagnose_code']. '\'>' .substr($rlv['cl_diagnose_element'], 0, 70). '</option>';
135 } ?>
136 </select>
137 </td></tr>
138 <tr><td>
139 <select id="box2" name="box2"></select>
140 </td></tr>
141 <tr><td>
142 <select id="box3" name="box3"></select>
143 </td></tr>
144 </tr>
145 <tr><td>
146 <select id="box4" name="box4"></select>
147 </td></tr>
148 <tr><td>
149 <select id="box5" name="box5"></select>
150 </td></tr>
151 <tr>
152 <td>Trekken van<input type="checkbox" name="partial" id="partial"/></td>
153 </tr>
155 </table>
156 <input type="submit" value="Choose" name="saveas"/>
157 <input type="button" value="Close" onclick="window.close();" />
158 </form>
161 </body>
162 </html>