]> Softwares of Agnibho - simpleipd.git/commitdiff
Updated input field formats
authorAgnibho Mondal <mondal@agnibho.com>
Mon, 17 May 2021 07:08:27 +0000 (12:38 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Mon, 17 May 2021 07:08:27 +0000 (12:38 +0530)
forms/admission.schema.json
forms/history.schema.json
forms/nursing.schema.json
forms/report-other.schema.json
lib/functions.php
report.php

index 24a5bc0b4820231875e25afefc6d5725a0c69a49..f2d76f5deb68926e5ca7fa7572eed6a11b2b7c6e 100644 (file)
             "type": "string",
             "format": "date"
         },
+        "time": {
+            "description": "Time of Admission",
+            "type": "string",
+            "format": "time"
+        },
+        "vp": {
+            "description": "Visiting Physician",
+            "type": "string"
+        },
         "ward": {
             "description": "Ward",
             "type": "string"
@@ -49,7 +58,8 @@
         },
         "summary": {
             "description": "Summary",
-            "type": "string"
+            "type": "string",
+            "format": "textarea"
         }
     },
     "required": ["pid", "name", "age", "sex", "date"]
index 1349c66392649bcaefaa8cdf48f651475047a51f..5985145732cbf634bca5bf4b90f554e677d7e5e8 100644 (file)
         },
         "cc": {
             "description": "Chief complaint",
-            "type": "string"
+            "type": "string",
+            "format": "textarea"
         },
         "history": {
             "description": "History",
-            "type": "string"
+            "type": "string",
+            "format": "textarea"
         },
         "comorb": {
             "description": "Comorbidities",
@@ -29,7 +31,8 @@
         },
         "oe": {
             "description": "General Examination",
-            "type": "string"
+            "type": "string",
+            "format": "textarea"
         },
         "bp": {
             "description": "Blood Pressure",
index 03ddc374575dae247b8f7104892d241a15bb4734..83ea5850089b21901a6dd4875e9fefdc16fe7a2a 100644 (file)
         },
         "intake": {
             "description": "Intake",
-            "type": "string"
+            "type": "integer"
         },
         "output": {
             "description": "Output",
+            "type": "integer"
+        },
+        "bw": {
+            "description": "Body Weight",
             "type": "string"
         },
         "bp": {
index 57749cb679c18a87b086d7894920057775a3370d..c7906984f93c2c17b4106b204ec58b7425e2d601 100644 (file)
@@ -17,7 +17,8 @@
         },
         "report": {
             "description": "Report",
-            "type": "string"
+            "type": "string",
+            "format": "textarea"
         }
     },
     "required": ["date"]
index 3b8f7152159748a349322582e8ff370e42033e36..51c3cb3e130be5e04ea9b8cdb64d2be3b33b719c 100644 (file)
@@ -50,16 +50,19 @@ 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."'>".$value."</textarea>";
+    }
     elseif($field=="pid"){
-      $form=$form."<input class='form-control' ".$lockpid." ".$req." type='".$type."' name='".$field."' id='".$field."' ".$value.">";
+      $form=$form."<input class='form-control' ".$lockpid." ".$req." type='".$type."' step='any' name='".$field."' id='".$field."' ".$value.">";
     }
     else{
-      $form=$form."<input class='form-control' ".$req." type='".$type."' name='".$field."' id='".$field."' ".$value.">";
+      $form=$form."<input class='form-control' ".$req." type='".$type."' step='any' name='".$field."' id='".$field."' ".$value.">";
     }
     $form=$form."</div>";
 
   }
-  $form=$form."<div><label class='form-label' for='extra-note'>Notes</label><textarea class='form-control' name='extra-note' id='extra-note'></textarea></div>";
+  $form=$form."<div><label class='form-label' for='extra-note'>Extra Notes</label><textarea class='form-control' name='extra-note' id='extra-note'></textarea></div>";
   $form=$form."<button class='btn btn-primary mt-3' type='submit'>Save</button>";
   $form=$form."</form>";
   return $form;
@@ -91,6 +94,9 @@ function viewData($data, $edit=null){
         if(!empty($schema->properties->$field)){
           $view=$view."<tr><td>".$schema->properties->$field->description."</td><td>".$value."</td></tr>";
         }
+        elseif($field=="extra-note"){
+          $view=$view."<tr><td>Extra Notes</td><td>".$value."</td></tr>";
+        }
         else{
           $view=$view."<tr><td>".$field."</td><td>".$value."</td></tr>";
         }
index 004019c9cb4f5e5a9406e2c526089a49f0592265..571edab313ffcc909af86f7043d0283afda47104 100644 (file)
@@ -41,7 +41,7 @@ if(!empty($_GET["pid"]) && !empty($_GET["form"])){
         <div class="card-body">
           <h4 class="card-title">Add New Report</h4>
           <?php echo $form;?>
-          <p class="text-right"><a href="attachments.php?pid=<?php echo $pid;?>&req=<?php echo $_GET["req"];?>">Upload PDF instead</p>
+          <?php if(!empty($_GET["req"])){echo "<p class='text-right'><a href='attachments.php?pid=".$pid."&req=".$_GET["req"]."'>Upload PDF instead</a></p>";}?>
         </div>
       </div>
     </div>