Highway to PSR2
[openemr.git] / interface / patient_file / summary / record_disclosure.php
blob6aa456692f1d17ef298517c6fb1a3a12a56fb33a
1 <?php
2 /**
4 * Patient disclosures main screen.
6 * Copyright (C) Visolve <vicareplus_engg@visolve.com>
7 * Copyright (C) 2017 Brady Miller <brady.g.miller@gmail.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Visolve <vicareplus_engg@visolve.com>
22 * @author Brady Miller <brady.g.miller@gmail.com>
23 * @link http://www.open-emr.org
30 require_once("../../globals.php");
31 require_once("$srcdir/options.inc.php");
33 //if the edit button for editing disclosure is set.
34 if (isset($_GET['editlid'])) {
35 $editlid=$_GET['editlid'];
38 <html>
39 <head>
40 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
41 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
43 <!-- supporting javascript code -->
44 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
45 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
47 <script type="text/javascript">
48 //function to validate fields in record disclosure page
49 function submitform()
51 if (document.forms[0].dates.value.length<=0)
53 {document.forms[0].dates.focus();document.forms[0].dates.style.backgroundColor="red";
55 else if (document.forms[0].recipient_name.value.length<=0)
57 document.forms[0].dates.style.backgroundColor="white";
58 document.forms[0].recipient_name.focus();document.forms[0].recipient_name.style.backgroundColor="red";
60 else if (document.forms[0].desc_disc.value.length<=0)
62 document.forms[0].recipient_name.style.backgroundColor="white";
63 document.forms[0].desc_disc.focus();document.forms[0].desc_disc.style.backgroundColor="red";
65 else if (document.forms[0].dates.value.length>0 && document.forms[0].recipient_name.value.length>0 && document.forms[0].desc_disc.value.length>0)
67 top.restoreSession();
68 document.forms[0].submit();
72 $(document).ready(function() {
73 $('.datepicker').datetimepicker({
74 <?php $datetimepicker_timepicker = true; ?>
75 <?php $datetimepicker_showseconds = false; ?>
76 <?php $datetimepicker_formatInput = false; ?>
77 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
78 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
79 });
80 });
82 </script>
83 </head>
84 <body class="body_top">
85 <div id="record-disclosure" style='float: left; margin-right: 10px' >
86 <div style='float: left; margin-right: 5px'><?php
87 if ($editlid) {
88 ?><!--Edit the disclosures-->
89 <span class="title"><?php echo htmlspecialchars(xl('Edit Disclosure'), ENT_NOQUOTES); ?></span><?php
90 } else { ?>
91 <span class="title"><?php echo htmlspecialchars(xl('Record Disclosure'), ENT_NOQUOTES); ?></span><?php
92 } ?>
93 </div>
94 <div><a onclick="return submitform()" class="css_button large_button"
95 name='form_save' id='form_save' href='#'> <span
96 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Save'), ENT_NOQUOTES);?></span>
97 </a></div>
98 <div><a class="css_button large_button" id='cancel'
99 href='disclosure_full.php' target='_parent' onclick='top.restoreSession()'> <span
100 class='css_button_span large_button_span'><?php echo htmlspecialchars(xl('Cancel'), ENT_NOQUOTES);?></span>
101 </a></div>
102 <br>
103 <form NAME="disclosure_form" METHOD="POST" ACTION="disclosure_full.php" target='_parent' onsubmit='return top.restoreSession()'>
104 <input type=hidden name=mode value="disclosure">
105 <table border=0 cellpadding=3 cellspacing=0 align='center'>
106 <br>
107 <tr>
108 <td><span class='text'><?php echo htmlspecialchars(xl('Date'), ENT_NOQUOTES); ?>:</span></td>
109 <td><!--retrieve disclosures from extended_log table for modifications-->
110 <?php
111 if ($editlid) {
112 $dres=sqlQuery("select date,recipient,description,event from extended_log where id=?", array($editlid));
113 $description=$dres{"description"};
114 $app_event=$dres{"event"};
115 $disc_date=$dres{"date"};
116 $recipient_name=$dres{"recipient"};
118 <input type=hidden name=disclosure_id value="<?php echo htmlspecialchars($editlid, ENT_QUOTES); ?>">
119 <input type=hidden name=updatemode value="disclosure_update">
120 <input type='entry' size='20' class='datepicker' name='dates' id='dates' value='<?php echo htmlspecialchars($disc_date, ENT_QUOTES);?>' style="background-color:white"/>&nbsp; <?php
121 } else {
122 ?> <input type='entry' size='20' class='datepicker' name='dates' id='dates' value='' style="background-color:white"/>&nbsp;<?php
123 } ?>
124 </tr>
125 <tr>
126 <td><span class=text><?php echo htmlspecialchars(xl('Type of Disclosure'), ENT_NOQUOTES); ?>: </span></TD>
127 <td><?php
128 if ($editlid) {
129 //To incorporate the disclosure types into the list_options listings
130 generate_form_field(array('data_type'=>1,'field_id'=>'disclosure_type','list_id'=>'disclosure_type','fld_length'=>'10','max_length'=>'63','empty_title'=>'SKIP'), $app_event);
131 } else {
132 //To incorporate the disclosure types into the list_options listings
133 generate_form_field(array('data_type'=>1,'field_id'=>'disclosure_type','list_id'=>'disclosure_type','fld_length'=>'10','max_length'=>'63','empty_title'=>'SKIP'), $title);
134 } ?>
135 </td>
136 </tr>
137 <tr>
138 <td><span class=text><?php echo htmlspecialchars(xl('Recipient of the Disclosure'), ENT_NOQUOTES); ?>:
139 </span></td>
140 <td class='text'>
141 <?php
142 if ($editlid) {
143 ?> <input type=entry name=recipient_name size=20 value="<?php echo htmlspecialchars($recipient_name, ENT_QUOTES); ?>"></td>
144 <?php
145 } else {?>
146 <input type=entry name=recipient_name size=20 value="">
147 </td>
148 <?php
150 </tr>
151 <tr>
152 <td>
153 <span class=text><?php echo htmlspecialchars(xl('Description of the Disclosure'), ENT_NOQUOTES); ?>:</span></td>
154 <?php if ($editlid) {
156 <td>
157 <textarea name=desc_disc wrap=auto rows=4 cols=30><?php echo htmlspecialchars($description, ENT_NOQUOTES); ?></textarea>
158 <?php } else {?>
159 <td><tex<?php }?>
160 </td>
161 </tr>
162 </table>
163 </form>
164 </body>