4 * re_identification_input_screen.php
7 * @link http://www.open-emr.org
8 * @author Visolve <vicareplus_engg@visolve.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2010 ViCarePlus, Visolve <vicareplus_engg@visolve.com>
11 * @copyright Copyright (c) 2018-2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/lists.inc.php");
17 require_once("$srcdir/patient.inc.php");
18 require_once("$srcdir/options.inc.php");
20 use OpenEMR\Common\Acl\AclMain
;
21 use OpenEMR\Common\Csrf\CsrfUtils
;
22 use OpenEMR\Common\Twig\TwigContainer
;
23 use OpenEMR\Core\Header
;
25 if (!AclMain
::aclCheckCore('admin', 'super')) {
26 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Re Identification")]);
33 <title
><?php
echo xlt('Re Identification'); ?
></title
>
35 <?php Header
::setupHeader(); ?
>
43 function form_validate()
46 if(document
.forms
[0].re_id_code
.value
== "undefined" || document
.forms
[0].re_id_code
.value
== "")
48 alert(<?php
echo xlj('Enter the Re Identification code'); ?
>);
55 function download_file()
57 alert(<?php
echo xlj('Re-identification files will be saved in'); ?
> +
' `' +
<?php
echo js_escape($GLOBALS['temporary_files_dir']); ?
> +
'` ' +
<?php
echo xlj('location of the openemr machine and may contain sensitive data, so it is recommended to manually delete the files after its use'); ?
>);
58 document
.re_identification
.submit();
63 <body
class="body_top">
64 <strong
><?php
echo xlt('Re Identification'); ?
></strong
>
66 style
="position: absolute; visibility: hidden; z-index: 1000;"></div
>
67 <form name
="re_identification" enctype
="Re_identification_ip_single_code"
68 action
="re_identification_op_single_patient.php" method
="POST" onsubmit
="return form_validate();">
69 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
71 $row = sqlQuery("SHOW TABLES LIKE 'de_identification_status'");
74 <table
> <tr
> <td
> 
;</td
> <td
> 
;</td
> </tr
>
75 <tr
> <td
> 
;</td
> <td
> 
;</td
> </tr
>
77 <table
class="de_identification_status_message" align
="center" >
82 <?php
echo xlt('Please upgrade OpenEMR Database to include De Identification procedures, function, tables'); ?
>
83 <br
/><br
/><a target
="Blank" href
="../../contrib/util/de_identification_upgrade.php"><?php
echo xlt('Click here');?
></a
>
84 <?php
echo xlt('to run');
85 echo " de_identification_upgrade.php<br />";?
><br
/>
100 $query = "select status from re_identification_status";
101 $res = sqlStatement($query);
102 if ($row = sqlFetchArray($res)) {
103 $reIdentificationStatus = $row['status'];
104 /* $reIdentificationStatus:
105 * 0 - There is no Re Identification in progress. (start new Re Identification process)
106 * 1 - A Re Identification process is currently in progress.
107 * 2 - The Re Identification process completed and xls file is ready to download
111 if ($reIdentificationStatus == 1) {
112 //1 - A Re Identification process is currently in progress
124 <table
class="de_identification_status_message" align
="center">
127 <td rowspan
="3"><br
/>
128 <?php
echo xlt('Re Identification Process is ongoing');
130 echo xlt('Please visit Re Identification screen after some time');
131 echo "<br />"; ?
> <br
/>
145 } elseif ($reIdentificationStatus == 0) {
146 //0 - There is no Re Identification in progress. (start new Re Identification process)
150 <?php
echo xlt('Enter the Re Identification code'); ?
> <input
151 type
='text' size
='50' name
='re_id_code' id
='re_id_code'
152 title
='<?php echo xla('Enter the Re Identification code
'); ?>' /> <br
/>
154 <Input type
="Submit" Name
="Submit" Value
=<?php
echo xla("submit");?
>></center
>
156 } elseif ($reIdentificationStatus == 2) {
157 //2 - The Re Identification process completed and xls file is ready to download
158 $query = "SELECT count(*) as count FROM re_identified_data ";
159 $res = sqlStatement($query);
160 if ($row = sqlFetchArray($res)) {
161 $no_of_items = $row['count'];
164 if ($no_of_items <= 1) {
165 //start new search - no patient record fount
166 $query = "update re_identification_status set status = 0";
167 $res = sqlStatement($query);
179 <table
class="de_identification_status_message" align
="center">
182 <td rowspan
="3"><br
/>
183 <?php
echo xlt('No Patient record found for the given Re Identification code');
185 echo xlt('Please enter the correct Re Identification code');
186 echo "<br />"; ?
> <br
/>
199 <table align
="center">
219 <table
class="de_identification_status_message"" align="center
">
222 <td rowspan="3"><br />
223 <?php echo xlt('Re Identification Process is completed');
225 echo xlt('Please Click download button to download the Re Identified data');
226 echo "<br
/>"; ?> <br />
239 <table align="center
">
245 <td colspan="2" class="style1
"><input type="button
" name="Download
"
246 value=<?php echo xla("Download
"); ?> onclick="download_file()" ></td>