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 if($status!="admitted"){
31 $info=viewData($db->getAdmissionData($pid)->fetchArray()["data"]);
32 $history=viewData($db->getHistory($pid)->fetchArray()["history"]);
33 $physicianArray=$db->getAllData($pid, "physician");
34 while($c=$physicianArray->fetchArray()){
35 array_push($physician, viewData($c["data"], "physician.php?pid=".$pid."&id=".$c["rowid"]));
37 $nursingArray=$db->getAllData($pid, "nursing");
38 while($c=$nursingArray->fetchArray()){
39 array_push($nursing, viewData($c["data"], "nursing.php?pid=".$pid."&id=".$c["rowid"]));
41 $reportsArray=$db->getAllData($pid, "reports");
42 while($r=$reportsArray->fetchArray()){
43 if(in_array($r["form"], ["report-as-grampos", "report-as-gramneg", "report-as-fungal"])){
44 array_push($reports, viewAntibiogram($r["data"], "antibiogram.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
47 array_push($reports, viewData($r["data"], "report.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
55 <?php
include(CONFIG_LIB
."head.php");?
>
56 <title
>View Info
</title
>
59 <div
class="container">
60 <?php
include(CONFIG_LIB
."top.php");?
>
63 <div
class="card-body">
65 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
66 <a
class="btn btn-success btn-lg btn-block" href
="treatment.php?pid=<?php echo $pid;?>">Treatment
</a
>
68 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
69 <a
class="mb-2 btn btn-primary btn-lg btn-block <?php echo $archive;?>" href
="physician.php?pid=<?php echo $pid;?>">Add Physician Note
</a
>
71 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
72 <a
class="mb-2 btn btn-warning btn-lg btn-block <?php echo $archive;?>" href
="nursing.php?pid=<?php echo $pid;?>">Add Nursing Note
</a
>
74 <div
class="mb-2 col-md-3" <?php
if($info=="") echo "style='display:none'";?
>>
75 <a
class="mb-2 btn btn-danger btn-lg btn-block <?php echo $archive;?>" href
="requisition.php?pid=<?php echo $pid;?>">Add Requisition
</a
>
79 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
80 <a
class="mb-2 btn btn-secondary <?php echo $archive;?>" href
="admission.php?pid=<?php echo $pid;?>">Edit Information
</a
>
82 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
83 <a
class="mb-2 btn btn-secondary <?php echo $archive;?>" href
="history.php?pid=<?php echo $pid;?>">Add History
</a
>
85 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
86 <a
class="mb-2 btn btn-secondary <?php echo $archive;?>" href
="laboratory.php?pid=<?php echo $pid;?>">Add Report
</a
>
88 <div
class="mb-2 col-md-2" <?php
if($info=="") echo "style='display:none'";?
>>
89 <a
class="btn btn-secondary <?php echo $archive;?>" href
="attachments.php?pid=<?php echo $pid;?>">Attachments
</a
>
91 <div
class="mb-2 col-md-2" id
="discharge" <?php
if($info=="") echo "style='display:none'";?
>>
92 <a
class="btn btn-secondary <?php echo $archive;?>" href
="discharge.php?pid=<?php echo $pid;?>">Discharge
</a
>
94 <div
class="mb-2 col-md-2" id
="death" <?php
if($info=="") echo "style='display:none'";?
>>
95 <a
class="btn btn-secondary <?php echo $archive;?>" href
="death.php?pid=<?php echo $pid;?>">Death
</a
>
100 <div
<?php
if(empty($pid)) echo "style='display:none'";?
>>
101 <ul
class="nav nav-tabs" id
="listtabs" role
="tablist">
102 <li
class="nav-item" role
="presentation">
103 <a
class="nav-link active" id
="info-tab" data
-toggle
="tab" href
="#info" role
="tab" aria
-controls
="info" aria
-selected
="true">Info
</a
>
105 <li
class="nav-item" role
="presentation">
106 <a
class="nav-link" id
="history-tab" data
-toggle
="tab" href
="#history" role
="tab" aria
-controls
="history" aria
-selected
="false">History
</a
>
108 <li
class="nav-item" role
="presentation">
109 <a
class="nav-link" id
="physician-tab" data
-toggle
="tab" href
="#physician" role
="tab" aria
-controls
="physician" aria
-selected
="false">Physician Notes
</a
>
111 <li
class="nav-item" role
="presentation">
112 <a
class="nav-link" id
="nursing-tab" data
-toggle
="tab" href
="#nursing" role
="tab" aria
-controls
="clinical" aria
-selected
="false">Nursing Notes
</a
>
114 <li
class="nav-item" role
="presentation">
115 <a
class="nav-link" id
="report-tab" data
-toggle
="tab" href
="#report" role
="tab" aria
-controls
="report" aria
-selected
="false">Lab Reports
</a
>
117 <li
class="nav-item" role
="presentation">
118 <a
class="nav-link" href
="chart.php?pid=<?php echo $pid;?>">Charts
</a
>
121 <div
class="tab-content" id
="viewtabs">
122 <div
class="tab-pane fade show active" id
="info" role
="tabpanel" aria
-labelledby
="info-tab">
123 <div
class='card'><div
class='card-body'>Status
: <?php
echo $status;?
></div
></div
>
125 <div
class="col-md-6">
128 <div
class="col-md-6">
129 <table
class="table">
130 <tr
><th
>Diagnosis
</th
><td
><?php
echo $db->getDiagnosis($pid)->fetchArray()["diagnosis"];?
></td
></tr
>
131 <tr
><th
>Summary
</th
><td
><?php
echo $db->getSummary($pid)->fetchArray()["summary"];?
></td
></tr
>
135 <p
><a href
="#" class="btn btn-outline-primary <?php echo $archive;?>" id
="showtransfer">Transfer
</a
></p
>
136 <form method
="post" id
="transfer" class="d-none">
137 <div
class="form-row">
138 <input type
="hidden" name
="shiftWard" value
="true">
140 <input type
="text" name
="ward" class="form-control" placeholder
="Ward" required
>
143 <input type
="text" name
="bed" class="form-control" placeholder
="Bed" required
>
146 <input type
="date" name
="date" class="form-control" placeholder
="Date">
149 <input type
="time" name
="time" class="form-control" placeholder
="Time">
152 <button type
="submit" class="btn btn-primary">Transfer
</button
>
156 <p
><a href
="printdata.php?pid=<?php echo $pid;?>" class="btn btn-outline-success">Print Data
</a
></p
>
158 <div
class="tab-pane fade" id
="history" role
="tabpanel" aria
-labelledby
="history-tab">
159 <?php
echo $history;?
>
161 <div
class="tab-pane fade" id
="physician" role
="tabpanel" aria
-labelledby
="physician-tab">
162 <?php
foreach($physician as $p) echo $p;?
>
164 <div
class="tab-pane fade" id
="nursing" role
="tabpanel" aria
-labelledby
="nursing-tab">
165 <?php
foreach($nursing as $n) echo $n;?
>
167 <div
class="tab-pane fade" id
="report" role
="tabpanel" aria
-labelledby
="report-tab">
168 <?php
foreach($reports as $r) echo $r;?
>
174 <div
<?php
if(!empty($pid)) echo "style='display:none'";?
>>
175 <h1
>Please enter a valid patient ID
</h1
>
177 <input
class="form-control" name
="pid">
178 <button
class="form-control" type
="submit">View
</button
>
181 <?php
include(CONFIG_LIB
."foot.php");?
>
183 $
(document
).ready(function(){
184 $
("#showtransfer").click(function(){
185 $
("#transfer").removeClass("d-none");