]> Softwares of Agnibho - simpleipd.git/commitdiff
Additional column to requisition
authorAgnibho Mondal <mondal@agnibho.com>
Mon, 24 May 2021 12:33:46 +0000 (18:03 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Mon, 24 May 2021 12:33:46 +0000 (18:03 +0530)
data.schema.sql
lib/db.php
www/autocomplete/investigation.json
www/index.php
www/requisition.php
www/treatment.php

index 9875979b51171fe14d44097d9cde876f3e74ed0a..1be45728e8672274cf893cc8dda87dbab632ef0c 100644 (file)
@@ -52,7 +52,8 @@ sample text,
 time int,
 room text,
 form text,
-status text
+status text,
+addl text
 );
 CREATE TABLE treatment(
 pid int,
index f0f0489ddd38a8edc5187398f7d40c3a9b1916d5..66131e86c46bb259622b34483e5c2e4278ac4ff0 100644 (file)
@@ -182,10 +182,10 @@ class DB extends SQLite3 {
     $stmt->execute();
     $log->log(null, "drug_given", $id);
   }
-  function addRequisition($pid, $test, $sample, $date, $time, $room, $form){
+  function addRequisition($pid, $test, $sample, $date, $time, $room, $form, $addl){
     global $log;
     if(!checkAccess("requisition", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO requisition (pid, test, sample, time, room, form, status) VALUES (:pid, :test, :sample, :time, :room, :form, :status);");
+    $stmt=$this->prepare("INSERT INTO requisition (pid, test, sample, time, room, form, status, addl) VALUES (:pid, :test, :sample, :time, :room, :form, :status, :addl);");
     $stmt->bindValue(":pid", $pid);
     $stmt->bindValue(":test", $test);
     $stmt->bindValue(":sample", $sample);
@@ -193,6 +193,7 @@ class DB extends SQLite3 {
     $stmt->bindValue(":room", $room);
     $stmt->bindValue(":form", $form);
     $stmt->bindValue(":status", "active");
+    $stmt->bindValue(":addl", $addl);
     $stmt->execute();
     $log->log($pid, "requisition_added", json_encode([$test,$room,$form]));
   }
@@ -361,7 +362,7 @@ class DB extends SQLite3 {
   function getRequisitionList(){
     global $log;
     if(!checkAccess("requisition", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT rowid,pid,test,sample,room,time,form FROM requisition WHERE status=:active ORDER BY room,test;");
+    $stmt=$this->prepare("SELECT rowid,* FROM requisition WHERE status=:active ORDER BY room,test;");
     $stmt->bindValue(":active", "active");
     $result=$stmt->execute();
     return($result);
index 2e4928ce7e2b6d599703f1bde012d110c1a3817e..f26bf5a2a4038ba56ae3a67320cb21e891548526 100644 (file)
         "protozoology",
         "mycology",
         "parasitology",
-        "pathology"
+        "pathology",
+        "ictc",
+        "ccu_lab",
+        "other_govt_hospital",
+        "outside_lab"
     ],
     "sample": {
         "blood": "blood",
index 9900dbbd51dd40f95ac3493a2565d8287a1840b7..2813278e342336a56f93b3bcf956582216545693 100644 (file)
@@ -21,7 +21,7 @@ while($arr=$reqs->fetchArray()){
   else{
     $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["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>";
+  $showReqs=$showReqs."<tr><td>".$test."</td><td>".$arr["sample"]."</td><td>".$arr["room"]."</td><td>".date("M j", $arr["time"])."</td><td><a href='view.php?pid=".$pid."' target='_blank'>".$pid."</a></td></tr><tr><td></td><td colspan='4'>".$arr["addl"]."</td></tr>";
 }
 ?>
 <!DOCTYPE html>
@@ -47,7 +47,7 @@ while($arr=$reqs->fetchArray()){
       <div class="card">
         <div class="card-body">
           <h4 class="card-title">Requisition List</h4>
-          <table class="table">
+          <table class="table table-striped">
             <tr><th>Test Needed</th><th>Sample</th><th>Place</th><th>Date</th><th>Patient ID</th></tr>
             <?php echo $showReqs;?>
           </table>
index dd5634382b89c28380ae03848e02c53856289f44..f4f3e1eecf45386c93a116ade4238fdf28589bf5 100644 (file)
@@ -14,7 +14,7 @@ if(isSet($_GET["pid"])){
       $test=$_POST["test"];
       $form="";
     }
-    $db->addRequisition($pid, $test, $_POST["sample"], $_POST["date"], $_POST["time"], $_POST["room"], $form);
+    $db->addRequisition($pid, $test, $_POST["sample"], $_POST["date"], $_POST["time"], $_POST["room"], $form, $_POST["addl"]);
   }
   $inv=json_decode(file_get_contents("autocomplete/investigation.json"));
   $testList="";
@@ -26,15 +26,15 @@ if(isSet($_GET["pid"])){
     $testList=$testList."<option>".$t."</option>";
   }
   $roomList="";
+  $roomList=$roomList."<option hidden disabled selected value=''>--- Select Room ---</option>";
   foreach($inv->rooms as $r){
     $roomList=$roomList."<option>".$r."</option>";
   }
-  $roomList=$roomList."<option selected='selected'>other</option>";
-
+  $roomList=$roomList."<option>other</option>";
   $reqList=$db->getRequisitions($pid);
   $list="";
   while($req=$reqList->fetchArray()){
-    $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>";
+    $list=$list."<tr><td>".$req["test"]."</td><td>".$req["sample"]."</td><td>".$req["room"]."</td><td>".date("M j", $req["time"])."</td><td>".$req["addl"]."</td><td><button type='submit' class='btn btn-secondary confirm' name='del' value='".$req["rowid"]."' form='delete' ".checkAccess("requisition","form").">Delete</button></td></tr>";
   }
 }
 ?>
@@ -42,7 +42,7 @@ if(isSet($_GET["pid"])){
 <html>
   <head>
     <?php include(CONFIG_LIB."head.php");?>
-    <title>Laboratory</title>
+    <title>Requisitions</title>
   </head>
   <body>
     <div class="container">
@@ -52,14 +52,14 @@ if(isSet($_GET["pid"])){
           <h4 class="card-title">List of Requisitions</h4>
           <form method='post' id='delete'></form>
           <table class="table">
-            <tr><th>Test Name</th><th>Sample</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>Extra note</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">
+                <select name="test" required>
                   <?php echo $testList;?>
                 </select>
               </div>
@@ -67,7 +67,7 @@ if(isSet($_GET["pid"])){
                 <input type="text" class="form-control" name="sample" placeholder="Sample">
               </div>
               <div class="col">
-                <select name="room">
+                <select name="room" required>
                   <?php echo $roomList;?>
                 </select>
               </div>
@@ -75,13 +75,13 @@ if(isSet($_GET["pid"])){
                 <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>
-              </div>
-          </form>
             </div>
+            <textarea type="text" class="form-control" name="addl" placeholder="Extra note"></textarea>
+            <button class="btn btn-primary" type="submit">Submit Requisition</button>
+          </form>
         </div>
       </div>
-      <?php include(CONFIG_LIB."foot.php");?>
+    </div>
+    <?php include(CONFIG_LIB."foot.php");?>
   </body>
 </html>
index 96e879c02510fa1c6e4d771fd6a93c39122d2261..7239de81c10189453e9e52b9d269bfbb443354e3 100644 (file)
@@ -57,7 +57,7 @@ if(!empty($_GET["pid"])){
 <html>
   <head>
     <?php include(CONFIG_LIB."head.php");?>
-    <title>Clinical Notes</title>
+    <title>Treatment</title>
   </head>
   <body>
     <div class="container">