2 require(dirname(__DIR__
)."/require.php");
8 if(isSet($_GET["pid"])){
11 if(!empty($_POST["shiftWard"]) && !empty($_POST["ward"]) && !empty($_POST["bed"])){
14 $oldward=$db->getWard($pid)->fetchArray()["ward"];
15 $oldbed=$db->getBed($pid)->fetchArray()["bed"];
16 $rec="Transfer: ".$oldward."-".$oldbed." -> ".$ward."-".$bed." @ ".$_POST["date"]." ".$_POST["time"];
17 $data=json_decode($db->getAdmissionData($pid)->fetchArray()["data"]);
20 $data->extra_note
=$data->extra_note
."\n".$rec;
21 $db->admit((array) $data);
24 $status=$db->getStatus($pid)->fetchArray()["status"];
25 $info=viewData($db->getAdmissionData($pid)->fetchArray()["data"]);
26 $history=viewData($db->getHistory($pid)->fetchArray()["history"]);
27 $physicianArray=$db->getAllData($pid, "physician");
28 while($c=$physicianArray->fetchArray()){
29 array_push($physician, viewData($c["data"], "physician.php?pid=".$pid."&id=".$c["rowid"]));
31 $nursingArray=$db->getAllData($pid, "nursing");
32 while($c=$nursingArray->fetchArray()){
33 array_push($nursing, viewData($c["data"], "nursing.php?pid=".$pid."&id=".$c["rowid"]));
35 $reportsArray=$db->getAllData($pid, "reports");
36 while($r=$reportsArray->fetchArray()){
37 if(in_array($r["form"], ["report-as-grampos", "report-as-gramneg", "report-as-fungal"])){
38 array_push($reports, viewAntibiogram($r["data"], "antibiogram.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
41 array_push($reports, viewData($r["data"], "report.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
49 <?php
include(CONFIG_LIB
."head.php");?
>
50 <title
>View Info
</title
>
53 <div
class="container">
56 <div
class="card-body">
58 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
59 <a
class="btn btn-success btn-lg btn-block" href
="treatment.php?pid=<?php echo $pid;?>">Treatment
</a
>
61 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
62 <a
class="mb-2 btn btn-primary btn-lg btn-block" href
="physician.php?pid=<?php echo $pid;?>">Add Physician Note
</a
>
64 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
65 <a
class="mb-2 btn btn-warning btn-lg btn-block" href
="nursing.php?pid=<?php echo $pid;?>">Add Nursing Note
</a
>
67 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
68 <a
class="mb-2 btn btn-danger btn-lg btn-block" href
="requisition.php?pid=<?php echo $pid;?>">Add Requisition
</a
>
72 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
73 <a
class="mb-2 btn btn-secondary" href
="admission.php?pid=<?php echo $pid;?>">Edit Information
</a
>
75 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
76 <a
class="mb-2 btn btn-secondary" href
="history.php?pid=<?php echo $pid;?>">Edit History
</a
>
78 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
79 <a
class="mb-2 btn btn-secondary" href
="laboratory.php?pid=<?php echo $pid;?>">Add Report
</a
>
81 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
82 <a
class="btn btn-secondary" href
="attachments.php?pid=<?php echo $pid;?>">Attachments
</a
>
84 <div
<?php
if($status!="admitted") echo "style='display:none'";?
> class="mb-2 col-md-2" id
="discharge" <?php
if($info=="") echo "style='display:none'";?
>>
85 <a
class="btn btn-secondary" href
="discharge.php?pid=<?php echo $pid;?>">Discharge
</a
>
87 <div
<?php
if($status!="admitted") echo "style='display:none'";?
> class="mb-2 col-md-2" id
="death" <?php
if($info=="") echo "style='display:none'";?
>>
88 <a
class="btn btn-secondary" href
="death.php?pid=<?php echo $pid;?>">Death
</a
>
93 <div
<?php
if(empty($pid)) echo "style='display:none'";?
>>
94 <ul
class="nav nav-tabs" id
="listtabs" role
="tablist">
95 <li
class="nav-item" role
="presentation">
96 <a
class="nav-link active" id
="info-tab" data
-toggle
="tab" href
="#info" role
="tab" aria
-controls
="info" aria
-selected
="true">Info
</a
>
98 <li
class="nav-item" role
="presentation">
99 <a
class="nav-link" id
="history-tab" data
-toggle
="tab" href
="#history" role
="tab" aria
-controls
="history" aria
-selected
="false">History
</a
>
101 <li
class="nav-item" role
="presentation">
102 <a
class="nav-link" id
="physician-tab" data
-toggle
="tab" href
="#physician" role
="tab" aria
-controls
="physician" aria
-selected
="false">Physician Notes
</a
>
104 <li
class="nav-item" role
="presentation">
105 <a
class="nav-link" id
="nursing-tab" data
-toggle
="tab" href
="#nursing" role
="tab" aria
-controls
="clinical" aria
-selected
="false">Nursing Notes
</a
>
107 <li
class="nav-item" role
="presentation">
108 <a
class="nav-link" id
="report-tab" data
-toggle
="tab" href
="#report" role
="tab" aria
-controls
="report" aria
-selected
="false">Lab Reports
</a
>
111 <div
class="tab-content" id
="viewtabs">
112 <div
class="tab-pane fade show active" id
="info" role
="tabpanel" aria
-labelledby
="info-tab">
113 <div
class='card'><div
class='card-body'>Status
: <?php
echo $status;?
></div
></div
>
115 <div
class="col-md-6">
118 <div
class="col-md-6">
119 <table
class="table">
120 <tr
><th
>Diagnosis
</th
><td
><?php
echo $db->getDiagnosis($pid)->fetchArray()["diagnosis"];?
></td
></tr
>
121 <tr
><th
>Summary
</th
><td
><?php
echo $db->getSummary($pid)->fetchArray()["summary"];?
></td
></tr
>
125 <a href
="#" id
="showtransfer">Transfer
</a
>
126 <form method
="post" id
="transfer" class="d-none">
127 <div
class="form-row">
128 <input type
="hidden" name
="shiftWard" value
="true">
130 <input type
="text" name
="ward" class="form-control" placeholder
="Ward">
133 <input type
="text" name
="bed" class="form-control" placeholder
="Bed">
136 <input type
="date" name
="date" class="form-control" placeholder
="Date">
139 <input type
="time" name
="time" class="form-control" placeholder
="Time">
142 <button type
="submit" class="btn btn-primary">Transfer
</button
>
147 <div
class="tab-pane fade" id
="history" role
="tabpanel" aria
-labelledby
="history-tab">
148 <?php
echo $history;?
>
150 <div
class="tab-pane fade" id
="physician" role
="tabpanel" aria
-labelledby
="physician-tab">
151 <?php
foreach($physician as $p) echo $p;?
>
153 <div
class="tab-pane fade" id
="nursing" role
="tabpanel" aria
-labelledby
="nursing-tab">
154 <?php
foreach($nursing as $n) echo $n;?
>
156 <div
class="tab-pane fade" id
="report" role
="tabpanel" aria
-labelledby
="report-tab">
157 <?php
foreach($reports as $r) echo $r;?
>
163 <div
<?php
if(!empty($pid)) echo "style='display:none'";?
>>
164 <h1
>Please enter a valid patient ID
</h1
>
166 <input
class="form-control" name
="pid">
167 <button
class="form-control" type
="submit">View
</button
>
170 <?php
include(CONFIG_LIB
."foot.php");?
>
172 $
(document
).ready(function(){
173 $
("#showtransfer").click(function(){
174 $
("#transfer").removeClass("d-none");