]> Softwares of Agnibho - simpleipd.git/commitdiff
Form edits
authorAgnibho Mondal <mondal@agnibho.com>
Mon, 17 May 2021 22:47:32 +0000 (04:17 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Mon, 17 May 2021 22:47:32 +0000 (04:17 +0530)
' [deleted file]
lib/db.php
lib/functions.php
www/forms/drugs.schema.json
www/forms/report-fluid-ascitic.schema.json [new file with mode: 0644]
www/forms/report-fluid-csf.schema.json [new file with mode: 0644]
www/forms/report-fluid-pleural.schema.json [new file with mode: 0644]
www/forms/report-fluid-synovial.schema.json [new file with mode: 0644]
www/forms/report-fluid.schema.json
www/view.php

diff --git a/' b/'
deleted file mode 100644 (file)
index 10da9c6..0000000
--- a/'
+++ /dev/null
@@ -1,419 +0,0 @@
-<?php
-class DB extends SQLite3 {
-  function __construct(){
-    $this->open(CONFIG_DB);
-  }
-  function checkUser($username, $password){
-    global $log;
-    $stmt=$this->prepare("SELECT hash FROM users WHERE user=:user");
-    $stmt->bindValue(":user", $username);
-    $result=$stmt->execute();
-    $hash=$result->fetchArray();
-    if($hash){
-      return(password_verify($password, $hash["hash"]));
-    }
-    else{
-      return(false);
-    }
-  }
-  function getGroup($username){
-    global $log;
-    $stmt=$this->prepare("SELECT usergroup FROM users WHERE user=:user");
-    $stmt->bindValue(":user", $username);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getDepartment($username){
-    global $log;
-    $stmt=$this->prepare("SELECT department FROM users WHERE user=:user");
-    $stmt->bindValue(":user", $username);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function admit($post){
-    global $log;
-    if(!checkAccess("admission", "dbSet")) return false;
-    $query=$this->prepare("SELECT count(rowid) FROM patients WHERE pid=:pid");
-    $query->bindValue(":pid", $post["pid"]);
-    $exist=$query->execute();
-    if($exist->fetchArray()[0]==0){
-      $stmt=$this->prepare("INSERT INTO patients (pid,name,age,sex,status,vp,ward,bed,data) VALUES (:pid,:name,:age,:sex,:status,:vp,:ward,:bed,:data);");
-    }
-    else{
-      $stmt=$this->prepare("UPDATE patients SET name=:name,age=:age,sex=:sex,ward=:ward,bed=:bed,vp=:vp,data=:data WHERE pid=:pid;");
-    }
-    $stmt->bindValue(":pid", $post["pid"]);
-    $stmt->bindValue(":name", $post["name"]);
-    $stmt->bindValue(":age", $post["age"]);
-    $stmt->bindValue(":sex", $post["sex"]);
-    $stmt->bindValue(":status", "admitted");
-    $stmt->bindValue(":ward", $post["ward"]);
-    $stmt->bindValue(":bed", $post["bed"]);
-    $stmt->bindValue(":vp", $post["vp"]);
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($post["pid"], "admit", json_encode($post));
-  }
-  function editCase($pid, $diagnosis, $summary){
-    global $log;
-    if(!checkAccess("history", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE patients SET diagnosis=:diagnosis,summary=:summary WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":diagnosis", $diagnosis);
-    $stmt->bindValue(":summary", $summary);
-    $stmt->execute();
-    $log->log($pid, "case_edit", json_encode([$diagnosis, $summary]));
-  }
-  function updateHistory($post, $pid){
-    global $log;
-    if(!checkAccess("history", "dbSet:")) return false;
-    $stmt=$this->prepare("UPDATE patients SET history=:history WHERE pid=:pid;");
-    $stmt->bindValue(":history", json_encode($post));
-    $stmt->bindValue(":pid", $pid);
-    $stmt->execute();
-    $log->log($pid, "history", json_encode($post));
-  }
-  function addPhysician($post, $pid){
-    global $log;
-    if(!checkAccess("physician", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO physician (pid, time, data) VALUES (:pid, :time, :data);");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "physician_note", json_encode($post));
-  }
-  function editPhysician($post, $pid, $id){
-    global $log;
-    if(!checkAccess("physician", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE physician 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"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "edit_physician_note", json_encode($post));
-  }
-  function addNursing($post, $pid){
-    global $log;
-    if(!checkAccess("nursing", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO nursing (pid, time, data) VALUES (:pid, :time, :data);");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "nursing_note", json_encode($post));
-  }
-  function editNursing($post, $pid, $id){
-    global $log;
-    if(!checkAccess("nursing", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE nursing 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"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "edit_nursing_note", json_encode($post));
-  }
-  function addReport($post, $pid, $form){
-    global $log;
-    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"]));
-    $stmt->bindValue(":form", $post["form"]);
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "report_added", json_encode($post));
-  }
-  function editReport($post, $pid, $id, $form){
-    global $log;
-    if(!checkAccess("report", "dbSet")) return false;
-    $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"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $log->log($pid, "report_edited", json_encode($post));
-  }
-  function addDrug($pid, $drug, $dose, $route, $frequency, $date, $time, $duration, $addl){
-    global $log;
-    if(!checkAccess("treatment", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO treatment (pid, drug, dose, route, frequency, start, duration, omit, addl) VALUES (:pid, :drug, :dose, :route, :frequency, :start, :duration, :omit, :addl);");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":drug", $drug);
-    $stmt->bindValue(":dose", $dose);
-    $stmt->bindValue(":route", $route);
-    $stmt->bindValue(":frequency", $frequency);
-    $stmt->bindValue(":start", strtotime($date." ".$time));
-    $stmt->bindValue(":duration", $duration);
-    $stmt->bindValue(":addl", $addl);
-    $stmt->bindValue(":omit", false);
-    $stmt->execute();
-    $log->log($post["pid"], "drug_added", json_encode([$drug,$dose,$route,$frequency,$date,$time,$duration,$addl]));
-  }
-  function omitDrug($id){
-    global $log;
-    if(!checkAccess("treatment", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE treatment SET end=:end,omit=:omit WHERE rowid=:id;");
-    $stmt->bindValue(":end", time());
-    $stmt->bindValue(":omit", true);
-    $stmt->bindValue(":id", $id);
-    $stmt->execute();
-    $log->log(null, "drug_omitted", $id);
-  }
-  function addRequisition($pid, $test, $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->bindValue(":pid", $pid);
-    $stmt->bindValue(":test", $test);
-    $stmt->bindValue(":time", strtotime($date." ".$time));
-    $stmt->bindValue(":room", $room);
-    $stmt->bindValue(":form", $form);
-    $stmt->bindValue(":status", "active");
-    $stmt->execute();
-    $log->log($pid, "requisition_added", json_encode([$test,$room,$form]));
-  }
-  function omitRequisition($id){
-    global $log;
-    if(!checkAccess("requisition", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE requisition SET status=:status WHERE rowid=:id;");
-    $stmt->bindValue(":status", "done");
-    $stmt->bindValue(":id", $id);
-    $stmt->execute();
-    $log->log(null, "requisition_removed", $id);
-  }
-  function addAdvice($pid, $drug, $dose, $route, $frequency, $duration, $addl){
-    global $log;
-    if(!checkAccess("discharge", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO discharge (pid, drug, dose, route, frequency, duration, addl) VALUES (:pid, :drug, :dose, :route, :frequency, :duration, :addl);");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":drug", $drug);
-    $stmt->bindValue(":dose", $dose);
-    $stmt->bindValue(":route", $route);
-    $stmt->bindValue(":frequency", $frequency);
-    $stmt->bindValue(":duration", $duration);
-    $stmt->bindValue(":addl", $addl);
-    $stmt->execute();
-  }
-  function deleteAdvice($id){
-    global $log;
-    if(!checkAccess("discharge", "dbSet")) return false;
-    $stmt=$this->prepare("DELETE FROM discharge WHERE rowid=:id;");
-    $stmt->bindValue(":id", $id);
-    $stmt->execute();
-  }
-  function setDischarged($pid){
-    global $log;
-    if(!checkAccess("discharge", "dbSet")) return false;
-    $stmt=$this->prepare("UPDATE patients SET status=:discharged WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":discharged", "discharged");
-    $stmt->execute();
-    $log->log($pid, "discharged", null);
-  }
-  function setDead($pid, $post){
-    global $log;
-    if(!checkAccess("death", "dbSet")) return false;
-    $stmt=$this->prepare("INSERT INTO death (pid, time, data) VALUES (:pid, :time, :data);");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":time", strtotime($post["date"].$post["time"]));
-    $stmt->bindValue(":data", json_encode($post));
-    $stmt->execute();
-    $stmt=$this->prepare("UPDATE patients SET status='expired' WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->execute();
-    $log->log($pid, "death_declare", json_encode($post));
-  }
-  function getDrugs($pid){
-    global $log;
-    if(!checkAccess("treatment", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT rowid,* FROM treatment WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getRequisitions($pid){
-    global $log;
-    if(!checkAccess("requisition", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT rowid,* FROM requisition WHERE pid=:pid AND status=:status;");
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":status", "active");
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getAdvice($pid){
-    global $log;
-    if(!checkAccess("discharge", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT rowid,* FROM discharge WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getName($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT name FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getAge($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT age FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getSex($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT sex FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getWard($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT ward FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getBed($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT bed FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getStatus($pid){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT status FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getDiagnosis($pid){
-    global $log;
-    if(!checkAccess("diagnosis", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT diagnosis FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getPatientList(){
-    global $log;
-    if(!checkAccess("info", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT pid,ward,bed,name,diagnosis FROM patients;");
-    $result=$stmt->execute();
-    return($result);
-  }
-  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->bindValue(":active", "active");
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getForm($id){
-    global $log;
-    if(!checkAccess("report", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT form FROM reports WHERE rowid=:id;");
-    $stmt->bindValue(":id", $id);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getAdmission($pid){
-    global $log;
-    if(!checkAccess("admission", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT admission FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getAdmissionData($pid){
-    global $log;
-    if(!checkAccess("admission", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT data FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getDeparture($pid){
-    global $log;
-    if(!checkAccess("admission", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT departure FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getSummary($pid){
-    global $log;
-    if(!checkAccess("summary", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT summary FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getHistory($pid){
-    global $log;
-    if(!checkAccess("history", "dbGet")) return false;
-    $stmt=$this->prepare("SELECT history FROM patients WHERE pid=:pid;");
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getData($pid, $id, $cat){
-    global $log;
-    if($cat=="physician"){
-      if(!checkAccess("physician", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT data FROM physician WHERE pid=:pid AND rowid=:id ORDER BY time DSC;");
-    } elseif($cat=="nursing"){
-      if(!checkAccess("nursing", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT data FROM nursing WHERE pid=:pid AND rowid=:id ORDER BY time DSC;");
-    } 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 DSC;");
-    } else{
-      return(false);
-    }
-    $stmt->bindValue(":pid", $pid);
-    $stmt->bindValue(":id", $id);
-    $result=$stmt->execute();
-    return($result);
-  }
-  function getAllData($pid, $cat){
-    global $log;
-    if($cat=="physician"){
-      if(!checkAccess("physician", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT rowid,data FROM physician WHERE pid=:pid ORDER BY time DSC;");
-    } elseif($cat=="nursing"){
-      if(!checkAccess("nursing", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT rowid,data FROM nursing WHERE pid=:pid ORDER BY time DSC;");
-    } elseif($cat=="reports"){
-      if(!checkAccess("report", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT rowid,data FROM reports WHERE pid=:pid ORDER BY time DSC;");
-    } elseif($cat=="info"){
-      if(!checkAccess("info", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT rowid,data FROM patients WHERE pid=:pid ORDER BY time DSC;");
-    } elseif($cat=="history"){
-      if(!checkAccess("history", "dbGet")) return false;
-      $stmt=$this->prepare("SELECT rowid,history FROM patients WHERE pid=:pid ORDER BY time DSC;");
-    } else{
-      return(false);
-    }
-    $stmt->bindValue(":pid", $pid);
-    $result=$stmt->execute();
-    return($result);
-  }
-}
-$db = new DB();
-?>
index 13329e708cf03e8c590e526a88a3d2811a32bb6c..c3228d716591f32049d22531eee71204c8b48e5b 100644 (file)
@@ -151,7 +151,7 @@ class DB extends SQLite3 {
     $stmt->bindValue(":addl", $addl);
     $stmt->bindValue(":omit", false);
     $stmt->execute();
-    $log->log($post["pid"], "drug_added", json_encode([$drug,$dose,$route,$frequency,$date,$time,$duration,$addl]));
+    $log->log($pid, "drug_added", json_encode([$drug,$dose,$route,$frequency,$date,$time,$duration,$addl]));
   }
   function omitDrug($id){
     global $log;
index 1aa6c465c93292e5354adf25fa2acd67eb5dedcf..ea2ff2d861ca01ae8194d24157d5921a25555243 100644 (file)
@@ -24,9 +24,11 @@ function schema2form($file, $pid=null, $id=null, $cat=null, $data=null){
     if($prop->type == "string") $prop->type="text";
     if(!empty($data->$field)){
       $value="value='".$data->$field."'";
+      $value2=$data->$field;
     }
     else{
       $value="";
+      $value2="";
     }
     if(in_array($field, $schema->required)){
       $req="required";
@@ -51,7 +53,7 @@ function schema2form($file, $pid=null, $id=null, $cat=null, $data=null){
       $form=$form."</select>";
     }
     elseif(isSet($prop->format) && $prop->format=="textarea"){
-      $form=$form."<textarea class='form-control' name='".$field."' id='".$field."'>".$data->$field."</textarea>";
+      $form=$form."<textarea class='form-control' name='".$field."' id='".$field."'>".$value2."</textarea>";
     }
     elseif($field=="pid"){
       $form=$form."<input class='form-control' ".$lockpid." ".$req." type='".$type."' step='any' name='".$field."' id='".$field."' ".$value.">";
index f3be49481508f5b120c970fd1111b0706397926d..734a80f7ec996279f4cb9b318afbc112d3a6b059 100644 (file)
@@ -36,5 +36,5 @@
             "type": "integer"
         }
     },
-    "required": ["date","name"]
+    "required": ["drug", "dose", "route", "frequency", "date", "time", "duration"]
 }
diff --git a/www/forms/report-fluid-ascitic.schema.json b/www/forms/report-fluid-ascitic.schema.json
new file mode 100644 (file)
index 0000000..24fff7c
--- /dev/null
@@ -0,0 +1,60 @@
+{
+    "$schema": "http://json-schema.org/draft/2020-12/schema",
+    "title": "fluid_study",
+    "description": "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"]
+}
diff --git a/www/forms/report-fluid-csf.schema.json b/www/forms/report-fluid-csf.schema.json
new file mode 100644 (file)
index 0000000..24fff7c
--- /dev/null
@@ -0,0 +1,60 @@
+{
+    "$schema": "http://json-schema.org/draft/2020-12/schema",
+    "title": "fluid_study",
+    "description": "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"]
+}
diff --git a/www/forms/report-fluid-pleural.schema.json b/www/forms/report-fluid-pleural.schema.json
new file mode 100644 (file)
index 0000000..24fff7c
--- /dev/null
@@ -0,0 +1,60 @@
+{
+    "$schema": "http://json-schema.org/draft/2020-12/schema",
+    "title": "fluid_study",
+    "description": "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"]
+}
diff --git a/www/forms/report-fluid-synovial.schema.json b/www/forms/report-fluid-synovial.schema.json
new file mode 100644 (file)
index 0000000..24fff7c
--- /dev/null
@@ -0,0 +1,60 @@
+{
+    "$schema": "http://json-schema.org/draft/2020-12/schema",
+    "title": "fluid_study",
+    "description": "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"]
+}
index 8b3f02d50003431b4b272d1fca29fccd57a66ba7..24fff7caa6c926fab6d214e39b86084dc3ee95da 100644 (file)
             "type": "string",
             "format": "time"
         },
-        "fluid": {
-            "description": "Fluid",
-            "type": "string",
-            "enum": ["pleural fluid", "ascitic fluid", "csf", "other"]
-        },
         "cellCount": {
             "description": "Cell Count",
             "type": "integer"
index fd074a2fa59ad807309ba764e06280c27765599a..c49027e47b2519298c42ccba36692e53e7f2221d 100644 (file)
@@ -35,16 +35,16 @@ if(isSet($_GET["pid"])){
       <div class="card">
         <div class="card-body">
           <div class="row">
-            <div class="mb-2 col-md-3" id="treatment" <?php if($info=="") echo "style='display:none'";?>>
+            <div class="mb-2 col-md-3" <?php if($info=="") echo "style='display:none'";?>>
               <a class="btn btn-success btn-lg btn-block" href="treatment.php?pid=<?php echo $pid;?>">Treatment</a>
             </div>
-            <div class="mb-2 col-md-3" id="physician" <?php if($info=="") echo "style='display:none'";?>>
+            <div class="mb-2 col-md-3" <?php if($info=="") echo "style='display:none'";?>>
               <a class="mb-2 btn btn-primary btn-lg btn-block" href="physician.php?pid=<?php echo $pid;?>">Add Physician Note</a>
             </div>
-            <div class="mb-2 col-md-3" id="nursing" <?php if($info=="") echo "style='display:none'";?>>
+            <div class="mb-2 col-md-3" <?php if($info=="") echo "style='display:none'";?>>
               <a class="mb-2 btn btn-warning btn-lg btn-block" href="nursing.php?pid=<?php echo $pid;?>">Add Nursing Note</a>
             </div>
-            <div class="mb-2 col-md-3" id="requisition" <?php if($info=="") echo "style='display:none'";?>>
+            <div class="mb-2 col-md-3" <?php if($info=="") echo "style='display:none'";?>>
               <a class="mb-2 btn btn-danger btn-lg btn-block" href="requisition.php?pid=<?php echo $pid;?>">Add Requisition</a>
             </div>
           </div>