forked from howardpchen/capricorn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
displayReport.php
75 lines (62 loc) · 2.73 KB
/
displayReport.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
<?php
/*
Capricorn - Open-source analytics tool for radiology residents.
Copyright (C) 2014 (Howard) Po-Hao Chen
This file is part of Capricorn.
Capricorn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include "capricornLib.php";
session_start();
?>
<body>
<link rel="stylesheet" href="css/style.css" />
<div id='main-wrapper' style="margin:2em">
<header class='login'>Accession <?php echo $_GET['acc']; ?></header>
<?php
if (!isset($_SESSION['traineeid'])) {
header('location:./');
}
$conn2 = sqlsrv_connect($RISName, $connectionInfo);
if (!$conn2) {
echo "Could not connect to 24-hour RIS mirror!\n";
die(print_r(sqlsrv_errors(), true));
}
$table1 = "vusrExamDiagnosticReportText";
$table2 = "vDxRptContributingResponsible";
if (!isset($_GET['acc'])) die (print_r("Falty parameters."));
$sql = "SELECT * FROM $table1 WHERE AccessionNumber='" . $_GET['acc'] . "'";
$result = sqlsrv_query($conn2, $sql); /** or die("Can't find answer in RIS"); **/
$sql2 = "SELECT * FROM $table2 WHERE AccessionNumber='" . $_GET['acc'] . "'";
$result2 = sqlsrv_query($conn2, $sql2); /** or die("Can't find answer in RIS"); **/
if ( $result ) {
$sqlarray = array();
$row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC);
$report = str_replace("\n", "<BR>", $row['ReportText']);
echo $report;
echo "<hr>";
echo "Contributing Provider(s):<br>";
$count = 0;
while ($row2 = sqlsrv_fetch_array($result2, SQLSRV_FETCH_ASSOC)) {
echo ++$count . ". " . $row2['ProviderFirst'] . " " . $row2['ProviderLast'] . ", " . $row2['ProviderTitle'] . "<br>";
// echo $row['ReportText'];
}
echo "<br>Responsible Provider: " . $row['Interp1FirstName'] . " " . $row['Interp1LastName'] . ", " . $row['Interp1TitleName'];
}
else {
echo "An error occurred while commmunicating / querying the radiology information system. Specific error message is as follows: <BR><BR>";
die( print_r( sqlsrv_errors(), true));
}
sqlsrv_free_stmt($result);
sqlsrv_close($conn2);
?>
</div>
</body>