]>
Softwares of Agnibho - simpleipd.git/blob - www/printdata.php
60178f25d17892e83807b66657e84eef532170f6
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->getDischargeAdvice($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"]);
57 foreach(glob("data/attachments/".str_replace("/", "", $pid)."-*") as $attach){
58 if(pathinfo($attach, PATHINFO_EXTENSION
)=="pdf"){
59 $pdfs=$pdfs."<a href='".$attach."' target='_blank'>".pathinfo($attach, PATHINFO_BASENAME
)."</a><br>";
62 preg_match("/-([0-9]+)-/", pathinfo($attach, PATHINFO_FILENAME
), $orig);
63 $imgs=$imgs."<figure><img class='w-100' src='".$attach."'><figcaption>Uploaded on: ".date("M d, Y h:i a", $orig[1])."</figcaption></figure>";
67 $treatments=$treatments."</ol>";
68 $discharge=$discharge."</ol>";
73 <?php
include(CONFIG_LIB
."head.php");?
>
74 <title
>Print Data
</title
>
77 <div
class="container">
78 <h2
><?php
echo CONFIG_TITLE
;?
></h2
>
79 <h4
><?php
echo "Patient Record";?
></h4
>
81 <?php
echo "<p><strong>Status: </strong>".$status."</p>";?
>
82 <?php
echo $history;?
>
83 <?php
foreach($physician as $p) echo $p;?
>
84 <?php
foreach($nursing as $n) echo $n;?
>
85 <?php
foreach($reports as $r) echo $r;?
>
87 <?php
echo $treatments;?
>
89 <?php
if($status=="expired"){ echo $death; } elseif($status=="discharged") { echo $discharge; }?
>
90 <p
class="mt-5"><small
><?php
echo "Data Retrieved on ".date("M d, Y H:i T", time())." from ".CONFIG_URL
;?
></small
></p
>
91 <div style
="page-break-before: always" <?php
if($imgs=="") echo "class='d-none'";?
>>
92 <h2
>Attached Images
</h2
>
96 <div
class="d-print-none <?php if($pdfs=="") echo "d
-none
";?>">
97 <h2
>Open Attached PDFs
</h2
>