$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><td>Organism</td><td colspan='2'>".$data->organism."</td></tr>";
$view=$view."<tr><th>Antibiotic</th><th>MIC</th><th>Interpretation</th>";
foreach($data as $k=>$v){
if(is_object($v)){
$this->open(CONFIG_LOG);
}
function log($pid, $action, $data){
- $stmt=$this->prepare("INSERT INTO log (pid, user, action, time, data) VALUES (:pid, :user, :action, :time, :data)");
+ $stmt=$this->prepare("INSERT INTO log (pid, user, ip, action, time, data) VALUES (:pid, :user, :ip, :action, :time, :data)");
$stmt->bindValue(":pid", $pid);
$stmt->bindValue(":user", $_SESSION["user"]);
+ $stmt->bindValue(":ip", $_SERVER["REMOTE_ADDR"]);
$stmt->bindValue(":action", $action);
$stmt->bindValue(":time", time());
$stmt->bindValue(":data", $data);
CREATE TABLE log(
pid int,
user text,
+ip text,
action text,
time int,
data text
$form="<form method='post' id='antibiogram'><input type='hidden' name='form' value='".$_GET["form"]."'></form>";
$form=$form."<table class='table'>";
if(!empty($data)){
+ var_dump($data->organism);
$date="value='".$data->date."'";
- $sample="value'".$data->sample."'";
+ $sample="value='".$data->sample."'";
+ $organism="value='".$data->organism."'";
}
elseif(!empty($_GET["sample"])){
$date="";
$sample="value='".$_GET["sample"]."'";
+ $organism="";
}
else{
$date="";
$sample="";
+ $organism="";
}
$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><td>Organism</td><td colspan='3'><input type='text' class='form-control' name='organism' ".$organism." 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="";
$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>";
+ $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."' title='".$v."' data-toggle='popover' 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."'";
{
- "gram_positive": {
+ "gram_negative": {
"ampicillin": "Ampicillin",
"amoxicillin_clavulinc_acid": "Amoxicillin/Clavulinic Acid",
"piperacillin_tazobactum": "Piperacillin/tazobactum",
"colistin": "Colistin",
"trimethoprim_sulphamethoxazole": "Trimethoprim/Sulfamethoxazole"
},
- "gram_negative": {
+ "gram_positive": {
"cefoxitin_screen": "Cefoxitin Screen",
"benzylpenicillin": "Benzylpenicillin",
"oxacillin": "Oxacillin",
$pid=$arr["pid"];
if(!empty($arr["form"])){
if($arr["form"]=="report-cs"){
- $test="<a href='vitek.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&src=index'>".$arr["test"]."</a>";
+ $test="<a href='vitek.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&src=index'>".$arr["test"]."</a>";
}
else{
- $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&src=index'>".$arr["test"]."</a>";
+ $test="<a href='report.php?pid=".$pid."&form=".$arr["form"]."&req=".$arr["rowid"]."&sample=".$arr["sample"]."&src=index'>".$arr["test"]."</a>";
}
}
else{
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=".$pid."&form=".str_replace(["forms/",".schema.json"], "", $file)."'>".$form->description."</a></li>";
+ if($form->title=="culture_sensitivity"){
+ $list=$list."<li class='list-group-item'><a href='vitek.php?pid=".$pid."'>".$form->description."</a></li>";
+ }
+ else{
+ $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>
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>";
$(this).val(moment().format("hh:mm"));
}
});
+ $("[data-toggle='popover']").popover({"placement": "top", "trigger": "focus"});
if($("[name='drug']").length){
$(this).prop("autocomplete","off");
$.get("autocomplete/drugs.json", function(data){
$("[name='drug']").each(function(){
- $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:2});
+ $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:1});
});
});
};
$(this).prop("autocomplete","off");
$.get("autocomplete/route.json", function(data){
$("[name='route']").each(function(){
- $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:1});
+ $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:0});
});
});
};
$(this).prop("autocomplete","off");
$.get("autocomplete/frequency.json", function(data){
$("[name='frequency']").each(function(){
- $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:1});
+ $(this).autocomplete({source:data, highlightClass:'text-danger',treshold:0});
});
});
};
$(this).prop("autocomplete","off");
$.get("autocomplete/investigation.json", function(data){
$("[name='sample']").each(function(){
- $(this).autocomplete({source:data.sample, highlightClass:'text-danger',treshold:1});
+ $(this).autocomplete({source:data.sample, highlightClass:'text-danger',treshold:0});
});
});
};
<?php
require(dirname(__DIR__)."/require.php");
$pid=$_GET["pid"];
-if($_GET["req"]){
+if(!empty($_GET["req"])){
$req="&req=".$_GET["req"];
}
else{
$req="";
}
+if(!empty($_GET["sample"])){
+ $sample="&sample=".$_GET["sample"];
+}
+else{
+ $sample="";
+}
if(!empty($_GET["src"]) && $_GET["src"]=="index"){
$src="&src=index";
}
<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>
+ <li class="list-group-item"><a href="antibiogram.php?pid=<?php echo $pid;?>&form=report-as-grampos<?php echo $req;?><?php echo $sample;?><?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 $sample;?><?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 $sample;?><?php echo $src;?>">Vitek Report (Fungal)</a></li>
</ul>
</div>
</div>