Treatment Received
    "; $discharge="

    Advice on Discharge

      "; $death="

      Medical Cause of Death

      "; if($_GET["pid"]){ $pid=$_GET["pid"]; $status=$db->getStatus($pid)->fetchArray()["status"]; $departure=$db->getDeparture($pid)->fetchArray()["departure"]; $info=getInfo($pid); $history=viewData($db->getHistory($pid)->fetchArray()["history"]); $physicianArray=$db->getAllData($pid, "physician"); while($c=$physicianArray->fetchArray()){ array_push($physician, viewData($c["data"])); } $nursingArray=$db->getAllData($pid, "nursing"); while($c=$nursingArray->fetchArray()){ array_push($nursing, viewData($c["data"])); } $reportsArray=$db->getAllData($pid, "reports"); while($r=$reportsArray->fetchArray()){ if(in_array($r["form"], ["report-as-grampos", "report-as-gramneg", "report-as-fungal"])){ array_push($reports, viewAntibiogram($r["data"])); } else{ array_push($reports, viewData($r["data"])); } } $treatmentArray=$db->getDrugs($pid); while($t=$treatmentArray->fetchArray()){ $start=""; if(!empty($t["start"])){ $start="from ".date("M j, Y", $t["start"]); } $end=""; if(!empty($t["end"])){ $end="till ".date("M j, Y", $t["end"]); } $addl=""; if(!empty($t["addl"])){ $addl="(".$t["addl"].")"; } $treatments=$treatments."
    1. ".$t["drug"]." ".$t["dose"]." ".$t["route"]." ".$t["frequency"]." ".$start." ".$end." ".$addl; } $dischargeArray=$db->getDischargeAdvice($pid); while($t=$dischargeArray->fetchArray()){ $discharge=$discharge."
    2. ".$t["drug"]." ".$t["dose"]." ".$t["route"]." ".$t["frequency"]." for ".$t["duration"]." ".$t["addl"]; } $deathArray=$db->getDeath($pid); while($d=$deathArray->fetchArray()){ $death=$death.viewData($d["data"]); } $imgs=""; $pdfs=""; foreach(glob("data/attachments/".str_replace("/", "", $pid)."-*") as $attach){ if(pathinfo($attach, PATHINFO_EXTENSION)=="pdf"){ $pdfs=$pdfs."".pathinfo($attach, PATHINFO_BASENAME)."
      "; } else{ preg_match("/-([0-9]+)-/", pathinfo($attach, PATHINFO_FILENAME), $orig); $imgs=$imgs."
      Uploaded on: ".date("M d, Y h:i a", $orig[1])."
      "; } } } $treatments=$treatments."
    "; $discharge=$discharge."
"; ?> Print Data

Status: ".$status."
";?> "; ?>

>

Attached Images


">

Open Attached PDFs