]> Softwares of Agnibho - simpleipd.git/commitdiff
Bugfixes
authorAgnibho Mondal <mondal@agnibho.com>
Wed, 19 May 2021 15:40:24 +0000 (21:10 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Wed, 19 May 2021 15:40:24 +0000 (21:10 +0530)
lib/functions.php
lib/log.php
log.schema.sql
www/antibiogram.php
www/autocomplete/vitek.json
www/index.php
www/laboratory.php
www/requisition.php
www/res/script.js
www/vitek.php

index 2ee182aee48354a17c8f01a7b2b5bd63f25e4180..e9a78a978cdd21da50beb084e93236551d082b69 100644 (file)
@@ -136,6 +136,7 @@ function viewAntibiogram($data, $edit){
   $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)){
index dc339f1cb5e5b82a7ed95fa9823fa3aa9d4bcfff..955241611906d58ba2987212721a3ab4bf72c2a5 100644 (file)
@@ -4,9 +4,10 @@ class LG extends SQLite3 {
     $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);
index 1a6a775f53be4113580984e3afc2a39cf8a6f0e1..d2f1daf94c48018ab40daa2a403ab8c2cfe9bc88 100644 (file)
@@ -1,6 +1,7 @@
 CREATE TABLE log(
 pid int,
 user text,
+ip text,
 action text,
 time int,
 data text
index 418acd055659715da599d0113b6dedb4d325ab87..deaeaff5522a310ece5648628809a80893cc0c5c 100644 (file)
@@ -42,20 +42,24 @@ if(!empty($_GET["pid"]) && !empty($_GET["form"])){
   $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)){
@@ -66,7 +70,7 @@ if(!empty($_GET["pid"]) && !empty($_GET["form"])){
       $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."'";
index c61eb8a7b7815d27a72d5849dd052835a668b696..8ebe30383abea4ba7b8cf3fe582ae3d1cf31f5aa 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "gram_positive": {
+    "gram_negative": {
         "ampicillin": "Ampicillin",
         "amoxicillin_clavulinc_acid": "Amoxicillin/Clavulinic Acid",
         "piperacillin_tazobactum": "Piperacillin/tazobactum",
@@ -20,7 +20,7 @@
         "colistin": "Colistin",
         "trimethoprim_sulphamethoxazole": "Trimethoprim/Sulfamethoxazole"
     },
-    "gram_negative": {
+    "gram_positive": {
         "cefoxitin_screen": "Cefoxitin Screen",
         "benzylpenicillin": "Benzylpenicillin",
         "oxacillin": "Oxacillin",
index 1cda66fca9802ee64ad906ecd180ad44ef12ec63..9238ff98ffa943c9ee2b418f9dd7b37d0a67e39c 100644 (file)
@@ -12,10 +12,10 @@ while($arr=$reqs->fetchArray()){
   $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{
index 3f8b55d5c709fac3ccb1dff829ac163b08a31948..a3e5d5894623f27237c31a46368bb3516e33022a 100644 (file)
@@ -5,7 +5,12 @@ 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=".$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>";
+    }
   }
 }
 ?>
@@ -22,9 +27,6 @@ if(isSet($_GET["pid"])){
           <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>
index 3c9f7a85fdf8ac95e6f90aebf686a4602a02559a..6cc10d444a65e3c3888a7ae07f96e88a98156bea 100644 (file)
@@ -25,7 +25,6 @@ if(isSet($_GET["pid"])){
   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>";
index 0e7abad7ae61df438cdec1ec0cfb89ed4695addc..bb0ce4dfe89614cda7c577de172197be9f60c72e 100644 (file)
@@ -21,11 +21,12 @@ $(document).ready(function(){
       $(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});
       });
     });
   };
@@ -33,7 +34,7 @@ $(document).ready(function(){
     $(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});
       });
     });
   };
@@ -41,7 +42,7 @@ $(document).ready(function(){
     $(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});
       });
     });
   };
@@ -49,7 +50,7 @@ $(document).ready(function(){
     $(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});
       });
     });
   };
index 641e2349957768879eafb588391b1ff3e2156280..61d23fe66527811f055f3903d22df47ab0a33fbc 100644 (file)
@@ -1,12 +1,18 @@
 <?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";
 }
@@ -26,9 +32,9 @@ else{
         <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>