-
Notifications
You must be signed in to change notification settings - Fork 9
/
addendum-dictated.php
84 lines (72 loc) · 2.75 KB
/
addendum-dictated.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
############################################
# ThaiRIS (Thai Radiology Information System)
# Version: 1.0
# File last modified: 8 Nov 2016
# File name:
# Description :
# http://www.thairis.net
# Email : [email protected]
############################################
require_once './htmlpurifier/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', 'TIS-620'); // replace with your encoding
$config->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
$purifier = new HTMLPurifier($config);
include ("session.php");
include ("connectdb.php");
$ORDERID = $_POST['ORDERID'];
$RADID = $_POST['RADID'];
$TEXTREPORT = $_POST['TEXTREPORT'];
$OLDREPORT = $_POST['OLDREPORT'];
$ACCESSION = $_POST['ACCESSION'];
$BIRAD = $_POST['BIRAD'];
$COPYREPORT = $_POST['COPYREPORT'];
//HTMLPulrifier
$TEXTREPORT = "<b><u>Addendum</u></b> : <br />".$TEXTREPORT."<br /><center>---------------------------------------------------------------------------------</center><br /><b><u>Original Report</u></b><br />".$OLDREPORT;
$TEXTREPORT = $purifier->purify($TEXTREPORT);
if ($ACCESSION =="")
{
echo "Can't update something wrong";
exit;
}
if ($BIRAD !=='')
{
$sql ="select LEVEL,DESCRIPTION FROM xray_birad WHERE BIRAD='$BIRAD'";
$result = mysql_query($sql);
while ($row =mysql_fetch_array($result))
{
$BIRAD = $row['DESCRIPTION']."<br />";
$BIRAD_LEVEL = $row['LEVEL'];
}
}
////////////////Create HL7///////////////
if ($CREATEHL7ORU==1)
{
}
////////////////////////////////////////
//$sql = "Update xray_request_detail SET STATUS='APPROVED',REPORT_STATUS='1', PAGE='END' where ID='$ORDERID'";
$sql = "UPDATE xray_request_detail SET STATUS='APPROVED', REPORT_STATUS='1', PAGE='END', APPROVED_TIME=now() where ID='$ORDERID'";
mysql_query($sql);
$TEXTREPORT = $BIRAD.$TEXTREPORT;
//$sql2 = "INSERT INTO xray_report(ACCESSION,REPORT,BIRAD,APPROVE_BY) values ('$ACCESSION','$TEXTREPORT','$BIRAD_LEVEL','$userid')";
$sql2 = "INSERT INTO xray_report
(ACCESSION, REPORT, BIRAD, DICTATE_BY, DICTATE_DATE, DICTATE_TIME, APPROVE_BY, APPROVE_DATE, APPROVE_TIME)
values
('$ACCESSION', '$TEXTREPORT', '$BIRAD_LEVEL', '$userid', CURDATE(), NOW(), '$userid', CURDATE(), NOW())";
mysql_query($sql2);
//////////////////////////// For update in xray_request_detail
$last_id = (mysql_insert_id());
$sql = "UPDATE xray_request_detail SET LASTREPORT_ID='$last_id' WHERE ACCESSION='$ACCESSION'";
mysql_query($sql);
echo $TEXTREPORT."<br>";
echo $COPYREPORT[0]."<br>";
echo $COPYREPORT[1]."<br>";
echo "ORDERID=".$ORDERID."<br>";
echo "RADID=".$RADID;
echo(mysql_insert_id())."<br>";
echo "----".$last_id;
?>
<script type="text/javascript">
window.location="dictate-worklist.php";
</script>