"nursing": "all",
"lab": "all",
"clerk": "view"
+ },
+ "vitek": {
+ "admin": "all",
+ "visiting": "all",
+ "resident": "all",
+ "nursing": "all",
+ "lab": "all",
+ "clerk": "view"
+ },
+
+ "antibiogram": {
+ "admin": "all",
+ "visiting": "all",
+ "resident": "all",
+ "nursing": "view",
+ "lab": "all",
+ "clerk": "view"
}
}
-
CREATE TABLE death(
pid int,
time int,
CREATE TABLE reports(
pid int,
time int,
+sample text,
form text,
data text
);
CREATE TABLE requisition(
pid int,
test text,
+sample text,
time int,
room text,
-sample text,
form text,
status text
);
if(!checkAccess("report", "dbSet")) return false;
$stmt=$this->prepare("INSERT INTO reports (pid, time, form, data) VALUES (:pid, :time, :form, :data);");
$stmt->bindValue(":pid", $pid);
- $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
+ if(!empty($post["time"])){
+ $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
+ }
+ else{
+ $stmt->bindValue(":time", strtotime($post["date"]));
+ }
$stmt->bindValue(":form", $post["form"]);
$stmt->bindValue(":data", json_encode($post));
$stmt->execute();
$stmt=$this->prepare("UPDATE reports SET time=:time,data=:data WHERE pid=:pid AND rowid=:id;");
$stmt->bindValue(":pid", $pid);
$stmt->bindValue(":id", $id);
- $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
+ if(!empty($post["time"])){
+ $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
+ }
+ else{
+ $stmt->bindValue(":time", strtotime($post["date"]));
+ }
$stmt->bindValue(":data", json_encode($post));
$stmt->execute();
$log->log($pid, "report_edited", json_encode($post));
$stmt->execute();
$log->log(null, "drug_omitted", $id);
}
- function addRequisition($pid, $test, $date, $time, $room, $form){
+ function addRequisition($pid, $test, $sample, $date, $time, $room, $form){
global $log;
if(!checkAccess("requisition", "dbSet")) return false;
- $stmt=$this->prepare("INSERT INTO requisition (pid, test, time, room, form, status) VALUES (:pid, :test, :time, :room, :form, :status);");
+ $stmt=$this->prepare("INSERT INTO requisition (pid, test, sample, time, room, form, status) VALUES (:pid, :test, :sample, :time, :room, :form, :status);");
$stmt->bindValue(":pid", $pid);
$stmt->bindValue(":test", $test);
+ $stmt->bindValue(":sample", $sample);
$stmt->bindValue(":time", strtotime($date." ".$time));
$stmt->bindValue(":room", $room);
$stmt->bindValue(":form", $form);
function getRequisitionList(){
global $log;
if(!checkAccess("requisition", "dbGet")) return false;
- $stmt=$this->prepare("SELECT rowid,pid,test,room,time,form FROM requisition WHERE status=:active;");
+ $stmt=$this->prepare("SELECT rowid,pid,test,sample,room,time,form FROM requisition WHERE status=:active;");
$stmt->bindValue(":active", "active");
$result=$stmt->execute();
return($result);
$stmt=$this->prepare("SELECT data FROM nursing WHERE pid=:pid AND rowid=:id ORDER BY time DESC;");
} elseif($cat=="reports"){
if(!checkAccess("report", "dbGet")) return false;
- $stmt=$this->prepare("SELECT data FROM reports WHERE pid=:pid AND rowid=:id ORDER BY time DESC;");
+ $stmt=$this->prepare("SELECT form,data FROM reports WHERE pid=:pid AND rowid=:id ORDER BY time DESC;");
} else{
return(false);
}
$stmt=$this->prepare("SELECT rowid,data FROM nursing WHERE pid=:pid ORDER BY time DESC;");
} elseif($cat=="reports"){
if(!checkAccess("report", "dbGet")) return false;
- $stmt=$this->prepare("SELECT rowid,data FROM reports WHERE pid=:pid ORDER BY time DESC;");
+ $stmt=$this->prepare("SELECT rowid,form,data FROM reports WHERE pid=:pid ORDER BY time DESC;");
} elseif($cat=="info"){
if(!checkAccess("info", "dbGet")) return false;
$stmt=$this->prepare("SELECT rowid,data FROM patients WHERE pid=:pid ORDER BY time DESC;");
}
unset($data->cat);
$view="<table class='table'>";
+ if(!empty($schema->description)){
+ $description=$schema->description;
+ }
+ else{
+ $description="";
+ }
+ if(!empty($data->date)){
+ if(!empty($data->time)){
+ $date=$data->date." ".$data->time;
+ }
+ $date=$data->date;
+ }
+ else{
+ $date="";
+ }
+ $view=$view."<tr><th>".$description."</th><th>".$date."</th></tr>";
foreach($data as $field=>$value){
- if(!empty($value) && $field!="form"){
+ if(!empty($value) && $field!="form" && $field!="date" && $field!="time"){
if(!empty($schema->properties->$field)){
$view=$view."<tr><td>".$schema->properties->$field->description."</td><td>".$value."</td></tr>";
}
}
}
if(!empty($edit)){
- $view=$view."<tr><td><a href='".$edit."'>Edit</a>";
+ $view=$view."<tr><td colspan='2'><a href='".$edit."'>Edit</a>";
}
$view=$view."</table>";
return $view;
}
}
+function viewAntibiogram($data, $edit){
+ $data=json_decode($data);
+ $view="<table class='table table-striped'>";
+ $view=$view."<tr><th>Vitek Report</th><th colspan='2'>".$data->date."</th></tr>";
+ $view=$view."<tr><td>Sample</td><td colspan='2'>".$data->sample."</td></tr>";
+ $view=$view."<tr><th>Antibiotic</th><th>MIC</th><th>Interpretation</th>";
+ foreach($data as $k=>$v){
+ if(is_object($v)){
+ $view=$view."<tr><td>".$v->name."</td><td>".$v->mic."</td><td>".$v->interpretation."</td></tr>";
+ }
+ }
+ if(!empty($data->note)){
+ $view=$view."<tr><td>Note</td><td colspan='2'>".$data->note."</td></tr>";
+ }
+ $view=$view."<tr><td colspan='2'><a href='".$edit."'>Edit</a></td></tr>";
+ $view=$view."</table>";
+ return $view;
+}
+
function view_drug($file){
if(is_file($file)){
$druglist=json_decode(file_get_contents($file));
}
if(!empty($_POST)){
foreach($_POST as $k=>$v){
- $_POST[$k]=htmlspecialchars($v);
+ if(is_array($v)){
+ foreach($v as $k2=>$v2){
+ $v[$k2]=htmlspecialchars($v2);
+ }
+ $_POST["k"]=$v;
+ }
+ else{
+ $_POST[$k]=htmlspecialchars($v);
+ }
}
}
?>
--- /dev/null
+<?php
+require(dirname(__DIR__)."/require.php");
+if(checkAccess("report")!="all"){
+ header("Location: error.php");
+ exit();
+}
+if(!empty($_GET["pid"]) && !empty($_GET["form"])){
+ $pid=$_GET["pid"];
+ if(!empty($_POST["date"])){
+ if(!empty($_GET["id"])){
+ $db->editReport($_POST, $pid, $_GET["id"], $_POST["form"]);
+ }
+ else{
+ $db->addReport($_POST, $pid, $_POST["form"]);
+ }
+ if(!empty($_GET["req"])){
+ $db->omitRequisition($_GET["req"]);
+ }
+ if(!empty($_GET["src"]) && $_GET["src"]=="index"){
+ header("Location: index.php");
+ exit();
+ }
+ else{
+ header("Location: view.php?pid=".$_GET["pid"]);
+ exit();
+ }
+ }
+ if(isSet($_GET["id"])){
+ $data=$db->getData($pid, $_GET["id"], "reports");
+ $data=json_decode($data->fetchArray()["data"]);
+ }
+ $abx=json_decode(file_get_contents(CONFIG_WWW."autocomplete/vitek.json"));
+ if($_GET["form"]=="report-as-grampos"){
+ $list=$abx->gram_positive;
+ }
+ elseif($_GET["form"]=="report-as-gramneg"){
+ $list=$abx->gram_negative;
+ }
+ elseif($_GET["form"]=="report-as-fungal"){
+ $list=$abx->fungal;
+ }
+ $form="<form method='post' id='antibiogram'><input type='hidden' name='form' value='".$_GET["form"]."'></form>";
+ $form=$form."<table class='table'>";
+ if(!empty($data)){
+ $date="value='".$data->date."'";
+ $sample="value'".$data->sample."'";
+ }
+ elseif(!empty($_GET["sample"])){
+ $date="";
+ $sample="value='".$_GET["sample"]."'";
+ }
+ else{
+ $date="";
+ $sample="";
+ }
+ $form=$form."<tr><td>Date</td><td colspan='3'><input type='date' class='form-control' name='date' ".$date." form='antibiogram'></td></tr>";
+ $form=$form."<tr><td>Sample</td><td colspan='3'><input type='text' class='form-control' name='sample' ".$sample." form='antibiogram' required></td></tr>";
+ $form=$form."<tr><td>Organism</td><td colspan='3'><input type='text' class='form-control' name='organism' ".$sample." form='antibiogram' required></td></tr>";
+ $form=$form."<tr><th>Antibiotic</th><th>MIC</th><th>Interpretation</th>";
+ foreach($list as $k=>$v){
+ if(!empty($data)){
+ $mic="value='".$data->$k->mic."'";
+ $interpretation="value='".$data->$k->interpretation."'";
+ }
+ else{
+ $mic="";
+ $interpretation="";
+ }
+ $form=$form."<tr><td><input type='hidden' name='".$k."[name]' value='".$v."' form='antibiogram'><input type='text' form='antibiogram' class='form-control' name='' value='".$v."' readonly></td><td><input type='text' form='antibiogram' class='form-control' name='".$k."[mic]' ".$mic."></td><td><input type='text' form='antibiogram' class='form-control abinter' name='".$k."[interpretation]' ".$interpretation." step='any'></td></tr>";
+ }
+ if(!empty($data)){
+ $name="value='".$data->other->name."'";
+ $mic="value='".$data->other->mic."'";
+ $interpretation="value='".$data->other->interpretation."'";
+ }
+ else{
+ $name="";
+ $mic="";
+ $interpretation="";
+ }
+ $form=$form."<tr><td><input type='text' form='antibiogram' class='form-control' placeholder='Any other' name='other[name]' ".$name."></td><td><input type='text' form='antibiogram' class='form-control' name='other[mic]' ".$mic."></td><td><input type='text' form='antibiogram' class='form-control abinter' step='any' name='other[interpretation]' ".$interpretation."></td></tr>";
+ if(!empty($data)){
+ $note=$data->note;
+ }
+ else{
+ $note="";
+ }
+ $form=$form."<tr><td colspan='3'><textarea class='w-100' name='note' form='antibiogram' placeholder='Notes' ".$note."></textarea></td></tr>";
+ $form=$form."<tr><td colspan='3'><button type='submit' form='antibiogram' class='btn btn-primary btn-lg'>Save</button></td></tr>";
+ $form=$form."</table>";
+}
+?>
+<!DOCTYPE html>
+<html>
+ <head>
+ <?php include(CONFIG_LIB."head.php");?>
+ <title>Antibiogram</title>
+ </head>
+ <body>
+ <div class="container">
+ <div class="card">
+ <div class="card-body">
+ <h4 class="card-title">Add New Report</h4>
+ <?php echo $form;?>
+ <a href="attachments.php?pid=<?php echo $pid;?>&name=vitek" target="_blank">Attach a PDF copy of report</a>
+ </div>
+ </div>
+ </div>
+ <?php include(CONFIG_LIB."foot.php");?>
+ </body>
+</html>
$pid=$_GET["pid"];
if(!empty($_FILES)){
if(in_array($_FILES["upload"]["type"], ["image/jpeg", "image/jpg", "image/png", "image/gif", "application/pdf"])){
- $fname=str_replace("/", "", $pid)."-".time()."-".rand(1000,9999).".".pathinfo($_FILES["upload"]["name"], PATHINFO_EXTENSION);
+ if(!empty($_GET["name"])){
+ $name=$_GET["name"]."-";
+ }
+ else{
+ $name="";
+ }
+ $fname=str_replace("/", "", $pid)."-".$name.time()."-".rand(1000,9999).".".pathinfo($_FILES["upload"]["name"], PATHINFO_EXTENSION);
move_uploaded_file($_FILES["upload"]["tmp_name"], "data/attachments/".$fname);
if(!empty($_GET["req"])){
$db->omitRequisition($_GET["req"]);
"mycology",
"parasitology",
"pathology"
- ]
+ ],
+ "sample": {
+ "blood": "blood",
+ "urine": "urine",
+ "sputum": "sputum",
+ "pus": "pus",
+ "discharge": "discharge",
+ "csf": "csf",
+ "ascitic_fluid": "ascitic_fluid",
+ "pleural_fluid": "pleural_fluid"
+ }
}
--- /dev/null
+{
+ "gram_positive": {
+ "ampicillin": "Ampicillin",
+ "amoxicillin_clavulinc_acid": "Amoxicillin/Clavulinic Acid",
+ "piperacillin_tazobactum": "Piperacillin/tazobactum",
+ "cefuroxime": "Cefuroxime",
+ "cefuroxime_axetil": "Cefuroxime Axetil",
+ "ceftriaxone": "Ceftriaxone",
+ "cefoperazone_sulbactum": "Cefoperazone/Sulbactam",
+ "cefepime": "Cefepime",
+ "ertapenem": "Ertapenem",
+ "imipenem": "Imipenem",
+ "meropenem": "Meropenem",
+ "amikacin": "Amikacin",
+ "gentamicin": "Gentamicin",
+ "nalidixic_acid": "Nalidixic Acid",
+ "ciprofloxacin": "Ciprofloxacin",
+ "tigecycline": "Tigecycline",
+ "nitrofurantoin": "Nitrofurantoin",
+ "colistin": "Colistin",
+ "trimethoprim_sulphamethoxazole": "Trimethoprim/Sulfamethoxazole"
+ },
+ "gram_negative": {
+ "cefoxitin_screen": "Cefoxitin Screen",
+ "benzylpenicillin": "Benzylpenicillin",
+ "oxacillin": "Oxacillin",
+ "gentamicin_high_level": "Gentamicin High Level (synergy)",
+ "gentamicin": "Gentamicin",
+ "ciprofloxacin": "Ciprofloxacin",
+ "levofloxacin": "Levofloxacin",
+ "inducible_clindamycin": "Inducible Clindamycin Resistance",
+ "erythromycin": "Erythromycin",
+ "clindamycin": "Clindamycin",
+ "linezolid": "Linezolid",
+ "daptomycin": "Daptomycin",
+ "teicoplanin": "Teicoplanin",
+ "vancomycin": "Vancomycin",
+ "tetracycline": "Tetracycline",
+ "tigecycline": "Tigecycline",
+ "nitrofurantoin": "Nitrofurantoin",
+ "rifampicin": "Rifampicin",
+ "trimethoprim_sulphamethoxazole": "Trimethoprim/Sulfamethoxazole"
+ },
+ "fungal": {
+ "fluconazole": "Fluconazole",
+ "voriconazole": "Voriconazole",
+ "caspofungin": "Caspofungin"
+ },
+ "interpretation": {
+ "S": "S",
+ "I": "S",
+ "R": "R",
+ "+": "+"
+ }
+}
$view=$view."<table class='table'>";
$view=$view."<tr><th>Drug</th><th>Dose</th><th>Route</th><th>Frequency</th><th>Duration</th><th>Note</th></tr>";
while($drug=$list->fetchArray()){
- var_dump($drug);
$view=$view."<tr><td>".$drug["drug"]."</td><td>".$drug["dose"]."</td><td>".$drug["route"]."</td><td>".$drug["frequency"]."</td><td>".$drug["duration"]."</td><td>".$drug["addl"]."</td><td><button class='btn btn-warning' name='delete' value='".$drug["rowid"]."' form='delete'>Delete</button></td></tr>";
}
$view=$view."</table>";
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"ph": {
"description": "pH",
"type": "number"
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "blood_cs",
- "description": "Blood CS",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "organism": {
- "description": "Organism",
- "type": "string"
- }
- },
- "required": ["date"]
-}
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"hb": {
"description": "Hemoglobin",
"type": "number"
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"ldh": {
"description": "CRP",
"type": "number"
--- /dev/null
+{
+ "$schema": "http://json-schema.org/draft/2020-12/schema",
+ "title": "culture_sensitivity",
+ "description": "Culture Sensitivity",
+ "type": "object",
+
+ "properties": {
+ "date": {
+ "description": "Date",
+ "type": "string",
+ "format": "date"
+ },
+ "time": {
+ "description": "Time",
+ "type": "string",
+ "format": "time"
+ },
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
+ "report": {
+ "description": "Report",
+ "type": "string",
+ "format": "textarea"
+ }
+ },
+ "required": ["date"]
+}
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"ddimer": {
"description": "D-Dimer",
"type": "number"
{
"$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "ascitic_fluid_study",
- "description": "Ascitic Fluid Study",
+ "title": "fluid_study",
+ "description": "Fluid Study",
"type": "object",
"properties": {
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"cellCount": {
"description": "Cell Count",
"type": "integer"
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "csf_fluid_study",
- "description": "CSF Fluid Study",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "cellCount": {
- "description": "Cell Count",
- "type": "integer"
- },
- "cellType": {
- "description": "Cell Type",
- "type": "string"
- },
- "protein": {
- "description": "Protein",
- "type": "integer"
- },
- "sugar": {
- "description": "Sugar",
- "type": "integer"
- },
- "ldh": {
- "description": "LDH",
- "type": "integer"
- },
- "gram": {
- "description": "Gram Stain",
- "type": "string"
- },
- "afb": {
- "description": "AFB Stain",
- "type": "string"
- },
- "fungal": {
- "description": "Fungal Stain",
- "type": "string"
- },
- "cs": {
- "description": "Culture/Sensitivity",
- "type": "string"
- },
- "cbnaat": {
- "description": "CBNAAT",
- "type": "string"
- }
- },
- "required": ["date"]
-}
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "pleural_fluid_study",
- "description": "Pleural Fluid Study",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "cellCount": {
- "description": "Cell Count",
- "type": "integer"
- },
- "cellType": {
- "description": "Cell Type",
- "type": "string"
- },
- "protein": {
- "description": "Protein",
- "type": "integer"
- },
- "sugar": {
- "description": "Sugar",
- "type": "integer"
- },
- "ldh": {
- "description": "LDH",
- "type": "integer"
- },
- "gram": {
- "description": "Gram Stain",
- "type": "string"
- },
- "afb": {
- "description": "AFB Stain",
- "type": "string"
- },
- "fungal": {
- "description": "Fungal Stain",
- "type": "string"
- },
- "cs": {
- "description": "Culture/Sensitivity",
- "type": "string"
- },
- "cbnaat": {
- "description": "CBNAAT",
- "type": "string"
- }
- },
- "required": ["date"]
-}
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "synovial_fluid_study",
- "description": "Synovial Fluid Study",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "cellCount": {
- "description": "Cell Count",
- "type": "integer"
- },
- "cellType": {
- "description": "Cell Type",
- "type": "string"
- },
- "protein": {
- "description": "Protein",
- "type": "integer"
- },
- "sugar": {
- "description": "Sugar",
- "type": "integer"
- },
- "ldh": {
- "description": "LDH",
- "type": "integer"
- },
- "gram": {
- "description": "Gram Stain",
- "type": "string"
- },
- "afb": {
- "description": "AFB Stain",
- "type": "string"
- },
- "fungal": {
- "description": "Fungal Stain",
- "type": "string"
- },
- "cs": {
- "description": "Culture/Sensitivity",
- "type": "string"
- },
- "cbnaat": {
- "description": "CBNAAT",
- "type": "string"
- }
- },
- "required": ["date"]
-}
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"fbs": {
"description": "FBS",
"type": "number"
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"ldh": {
"description": "LDH",
"type": "number"
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"tbr": {
"description": "Total Bilirubin",
"type": "number"
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"ldl": {
"description": "LDL",
"type": "number"
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"report": {
"description": "Report",
"type": "string",
"type": "string",
"format": "time"
},
-
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"urea": {
"description": "Urea",
"type": "number"
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "sputum_cs",
- "description": "Sputum CS",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "organism": {
- "description": "Organism",
- "type": "string"
- }
- },
- "required": ["date"]
-}
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"description": {
"description": "Description",
"type": "string"
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"description": {
"description": "Description",
"type": "string"
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"description": {
"description": "Description",
"type": "string"
+++ /dev/null
-{
- "$schema": "http://json-schema.org/draft/2020-12/schema",
- "title": "urine_cs",
- "description": "Urine CS",
- "type": "object",
-
- "properties": {
- "date": {
- "description": "Date",
- "type": "string",
- "format": "date"
- },
- "time": {
- "description": "Time",
- "type": "string",
- "format": "time"
- },
- "organism": {
- "description": "Organism",
- "type": "string"
- }
- },
- "required": ["date"]
-}
"type": "string",
"format": "time"
},
+ "sample": {
+ "description": "Sample",
+ "type": "string"
+ },
"description": {
"description": "Description",
"type": "string"
while($arr=$reqs->fetchArray()){
$pid=$arr["pid"];
if(!empty($arr["form"])){
- $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."'>".$arr["test"]."</a>";
+ if($arr["form"]=="report-cs"){
+ $test="<a href='vitek.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&src=index'>".$arr["test"]."</a>";
+ }
+ else{
+ $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&src=index'>".$arr["test"]."</a>";
+ }
}
else{
- $test="<a href='report.php?pid=".$pid."&form=report-other&req=".$arr["rowid"]."'>".$arr["test"]."</a>";
+ $test="<a href='report.php?pid=".$pid."&form=report-other&req=".$arr["rowid"]."&src=index'>".$arr["test"]."</a>";
}
- $showReqs=$showReqs."<tr><td>".$test."</td><td>".$arr["room"]."</td><td>".date("M j, Y", $arr["time"])."</td><td><a href='view.php?pid=".$pid."'>".$pid."</a></td></tr>";
+ $showReqs=$showReqs."<tr><td>".$test."</td><td>".$arr["sample"]."</td><td>".$arr["room"]."</td><td>".date("M j, Y", $arr["time"])."</td><td><a href='view.php?pid=".$pid."' target='_blank'>".$pid."</a></td></tr>";
}
?>
<!DOCTYPE html>
<div class="card-body">
<h4 class="card-title">Requisition List</h4>
<table class="table">
- <tr><th>Test Needed</th><th>Place</th><th>Date</th><th>Patient ID</th></tr>
+ <tr><th>Test Needed</th><th>Sample</th><th>Place</th><th>Date</th><th>Patient ID</th></tr>
<?php echo $showReqs;?>
</table>
</div>
$list="";
if(isSet($_GET["pid"])){
foreach(glob("forms/report*.json") as $file){
+ $pid=$_GET["pid"];
$form=json_decode(file_get_contents($file));
- $list=$list."<li class='list-group-item'><a href='report.php?pid=".$_GET["pid"]."&form=".str_replace(["forms/",".schema.json"], "", $file)."'>".$form->description."</a></li>";
+ $list=$list."<li class='list-group-item'><a href='report.php?pid=".$pid."&form=".str_replace(["forms/",".schema.json"], "", $file)."'>".$form->description."</a></li>";
}
}
?>
<h4 class="card-title">List of Tests</h4>
<ul class="list-group">
<?php echo $list;?>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-grampos">Vitek Report (Gram Positive)</a></li>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-gramneg">Vitek Report (Gram Negative)</a></li>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-fungal">Vitek Report (Fungal)</a></li>
</ul>
</div>
</div>
if(!empty($_GET["req"])){
$db->omitRequisition($_GET["req"]);
}
- header("Location: view.php?pid=".$_GET["pid"]);
- exit();
+ if(!empty($_GET["src"]) && $_GET["src"]=="index"){
+ header("Location: index.php");
+ exit();
+ }
+ else{
+ header("Location: view.php?pid=".$_GET["pid"]);
+ exit();
+ }
}
if(isSet($_GET["id"])){
$form=schema2form("forms/".$_GET["form"].".schema.json", $pid, $_GET["id"], "reports");
$test=$_POST["test"];
$form="";
}
- $db->addRequisition($pid, $test, $_POST["date"], $_POST["time"], $_POST["room"], $form);
+ $db->addRequisition($pid, $test, $_POST["sample"], $_POST["date"], $_POST["time"], $_POST["room"], $form);
}
$inv=json_decode(file_get_contents("autocomplete/investigation.json"));
$testList="";
foreach($inv->tests as $t){
$testList=$testList."<option>".$t."</option>";
}
+ $testList=$testList."<option value='culture_sensitivity'>Culture/Sensitivity</option>";
$roomList="";
foreach($inv->rooms as $r){
$roomList=$roomList."<option>".$r."</option>";
$reqList=$db->getRequisitions($pid);
$list="";
while($req=$reqList->fetchArray()){
- $list=$list."<tr><td>".$req["test"]."</td><td>".$req["room"]."</td><td>".date("M j, Y", $req["time"])."</td><td><button type='submit' class='btn btn-secondary' name='del' value='".$req["rowid"]."' form='delete' ".checkAccess("requisition","form").">Delete</button></td></tr>";
+ $list=$list."<tr><td>".$req["test"]."</td><td>".$req["sample"]."</td><td>".$req["room"]."</td><td>".date("M j, Y", $req["time"])."</td><td><button type='submit' class='btn btn-secondary' name='del' value='".$req["rowid"]."' form='delete' ".checkAccess("requisition","form").">Delete</button></td></tr>";
}
}
?>
<h4 class="card-title">List of Requisitions</h4>
<form method='post' id='delete'></form>
<table class="table">
- <tr><th>Test Name</th><th>Destination</th><th>Date</th><th></th></tr>
+ <tr><th>Test Name</th><th>Sample</th><th>Destination</th><th>Date</th><th></th></tr>
<?php echo $list;?>
</table>
+ <hr>
<form method="post" <?php echo checkAccess("requisition", "form");?>>
<div class="row">
<div class="col">
- <select name="test">
- <?php echo $testList;?>
- </select>
+ <select name="test">
+ <?php echo $testList;?>
+ </select>
</div>
<div class="col">
- <select name="room">
- <?php echo $roomList;?>
- </select>
+ <input type="text" class="form-control" name="sample" placeholder="Sample">
</div>
<div class="col">
- <input type="date" name="date" class="form-control">
+ <select name="room">
+ <?php echo $roomList;?>
+ </select>
</div>
<div class="col">
+ <input type="date" name="date" class="form-control">
<input type="time" name="time" class="form-control">
</div>
<div class="col">
- <button class="btn btn-primary" type="submit">Submit Requisition</button>
+ <button class="btn btn-primary" type="submit">Submit Requisition</button>
</div>
</form>
+ </div>
</div>
</div>
- </div>
- <?php include(CONFIG_LIB."foot.php");?>
+ <?php include(CONFIG_LIB."foot.php");?>
</body>
</html>
});
});
};
+ if($("[name='sample']").length){
+ $(this).prop("autocomplete","off");
+ $.get("autocomplete/investigation.json", function(data){
+ $("[name='sample']").each(function(){
+ $(this).autocomplete({source:data.sample, highlightClass:'text-danger',treshold:1});
+ });
+ });
+ };
+ if($(".abinter").length){
+ $(this).prop("autocomplete","off");
+ $.get("autocomplete/vitek.json", function(data){
+ $(".abinter").each(function(){
+ $(this).autocomplete({source:data.interpretation, highlightClass:'text-danger',treshold:0});
+ });
+ });
+ };
if($("#discharge-note").length){
$.get("autocomplete/discharge.json", function(data){
$("#discharge-note").val(data.note);
}
$reportsArray=$db->getAllData($pid, "reports");
while($r=$reportsArray->fetchArray()){
- array_push($reports, viewData($r["data"], "report.php?pid=".$pid."&id=".$r["rowid"]."&form=".$db->getForm($r["rowid"])->fetchArray()["form"]));
+ if(in_array($r["form"], ["report-as-grampos", "report-as-gramneg", "report-as-fungal"])){
+ array_push($reports, viewAntibiogram($r["data"], "antibiogram.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
+ }
+ else{
+ array_push($reports, viewData($r["data"], "report.php?pid=".$pid."&id=".$r["rowid"]."&form=".$r["form"]));
+ }
}
}
?>
--- /dev/null
+<?php
+require(dirname(__DIR__)."/require.php");
+$pid=$_GET["pid"];
+if($_GET["req"]){
+ $req="&req=".$_GET["req"];
+}
+else{
+ $req="";
+}
+if(!empty($_GET["src"]) && $_GET["src"]=="index"){
+ $src="&src=index";
+}
+else{
+ $src="";
+}
+?>
+<!DOCTYPE html>
+<html>
+ <head>
+ <?php include(CONFIG_LIB."head.php");?>
+ <title>Culture/Sensitivity</title>
+ </head>
+ <body>
+ <div class="container">
+ <div class="card">
+ <div class="card-body">
+ <h4 class="card-title">Type of Organism</h4>
+ <ul class="list-group">
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-grampos<?php echo $req;?><?php echo $src;?>">Vitek Report (Gram Positive)</a></li>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-gramneg<?php echo $req;?><?php echo $src;?>">Vitek Report (Gram Negative)</a></li>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-fungal<?php echo $req;?><?php echo $src;?>">Vitek Report (Fungal)</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <?php include(CONFIG_LIB."foot.php");?>
+ </body>
+</html>