]>
Softwares of Agnibho - simpleipd.git/blob - www/printdata.php
2 require(dirname(__DIR__
)."/require.php");
6 $treatments="<h4>Treatment Received</h4><ol>";
7 $discharge="<h4>Advice on Discharge</h4><ol>";
8 $death="<h4>Medical Cause of Death</h4>";
11 $status=$db->getStatus($pid)->fetchArray()["status"];
13 $history=viewData($db->getHistory($pid)->fetchArray()["history"]);
14 $physicianArray=$db->getAllData($pid, "physician");
15 while($c=$physicianArray->fetchArray()){
16 array_push($physician, viewData($c["data"]));
18 $nursingArray=$db->getAllData($pid, "nursing");
19 while($c=$nursingArray->fetchArray()){
20 array_push($nursing, viewData($c["data"]));
22 $reportsArray=$db->getAllData($pid, "reports");
23 while($r=$reportsArray->fetchArray()){
24 if(in_array($r["form"], ["report-as-grampos", "report-as-gramneg", "report-as-fungal"])){
25 array_push($reports, viewAntibiogram($r["data"]));
28 array_push($reports, viewData($r["data"]));
31 $treatmentArray=$db->getDrugs($pid);
32 while($t=$treatmentArray->fetchArray()){
34 if(!empty($t["start"])){
35 $start="from ".date("M j, Y", $t["start"]);
38 if(!empty($t["end"])){
39 $end="till ".date("M j, Y", $t["end"]);
42 if(!empty($t["addl"])){
43 $addl="(".$t["addl"].")";
45 $treatments=$treatments."<li>".$t["drug"]." ".$t["dose"]." ".$t["route"]." ".$t["frequency"]." ".$start." ".$end." ".$addl;
47 $dischargeArray=$db->getAdvice($pid);
48 while($t=$dischargeArray->fetchArray()){
49 $discharge=$discharge."<li>".$t["drug"]." ".$t["dose"]." ".$t["route"]." ".$t["frequency"]." for ".$t["duration"]." ".$t["addl"];
51 $deathArray=$db->getDeath($pid);
52 while($d=$deathArray->fetchArray()){
53 $death=$death.viewData($d["data"]);
56 $treatments=$treatments."</ol>";
57 $discharge=$discharge."</ol>";
62 <?php
include(CONFIG_LIB
."head.php");?
>
63 <title
>Print Data
</title
>
66 <div
class="container">
67 <h2
><?php
echo CONFIG_TITLE
;?
></h2
>
68 <h4
><?php
echo "Patient Record";?
></h4
>
70 <?php
echo "<p><strong>Status: </strong>".$status."</p>";?
>
71 <?php
echo $history;?
>
72 <?php
foreach($physician as $p) echo $p;?
>
73 <?php
foreach($nursing as $n) echo $n;?
>
74 <?php
foreach($reports as $r) echo $r;?
>
76 <?php
echo $treatments;?
>
78 <?php
if($status=="expired"){ echo $death; } else { echo $discharge; }?
>
80 <?php
echo "Retrieved on: ".date("M d, Y H:i T", time());?
>