From: Agnibho Mondal Date: Sun, 16 May 2021 10:23:02 +0000 (+0530) Subject: Added nursing note X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=e2cc472be81cfd7987f3c5cbd98bfd8d3b0b3424;p=simpleipd.git Added nursing note --- diff --git a/clinical.php b/clinical.php deleted file mode 100644 index 1e580d6..0000000 --- a/clinical.php +++ /dev/null @@ -1,42 +0,0 @@ -editClinical($_POST, $pid, $_GET["id"]); - } - else{ - $db->addClinical($_POST, $pid); - } - //header("Location: view.php?id=".$_GET["id"]); - //exit(); - } - if(isSet($_GET["id"])){ - $form=schema2form("forms/clinical.schema.json", $pid, $_GET["id"], "clinical"); - } - else{ - $form=schema2form("forms/clinical.schema.json"); - } -} -?> - - - - - Clinical Notes - - -
- - -
- - - diff --git a/forms/clinical.schema.json b/forms/clinical.schema.json deleted file mode 100644 index 6e91d7b..0000000 --- a/forms/clinical.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft/2020-12/schema", - "title": "Clinical Notes", - "description": "Clinical Notes", - "type": "object", - - "properties": { - "date": { - "description": "Date", - "type": "string", - "format": "date" - }, - "time": { - "description": "Time", - "type": "string", - "format": "time" - }, - "status": { - "description": "Status", - "type": "string" - }, - "bp": { - "description": "Blood Pressure", - "type": "string" - }, - "pr": { - "description": "Pulse", - "type": "integer" - }, - "rr": { - "description": "Respiratory Rate", - "type": "integer" - }, - "spo2": { - "description": "SpO2", - "type": "integer" - }, - "chest": { - "description": "Chest Findings", - "type": "string" - } - }, - "required": ["date","time"] -} diff --git a/forms/nursing.schema.json b/forms/nursing.schema.json new file mode 100644 index 0000000..f2687f4 --- /dev/null +++ b/forms/nursing.schema.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema", + "title": "Clinical Notes", + "description": "Clinical Notes", + "type": "object", + + "properties": { + "date": { + "description": "Date", + "type": "string", + "format": "date" + }, + "time": { + "description": "Time", + "type": "string", + "format": "time" + }, + "status": { + "description": "Status", + "type": "string" + }, + "intake": { + "description": "Intake", + "type": "string" + }, + "output": { + "description": "Output", + "type": "string" + }, + "bp": { + "description": "Blood Pressure", + "type": "string" + }, + "pr": { + "description": "Pulse", + "type": "integer" + }, + "rr": { + "description": "Respiratory Rate", + "type": "integer" + }, + "spo2": { + "description": "SpO2", + "type": "integer" + } + }, + "required": ["date","time"] +} diff --git a/forms/physician.schema.json b/forms/physician.schema.json new file mode 100644 index 0000000..6e91d7b --- /dev/null +++ b/forms/physician.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema", + "title": "Clinical Notes", + "description": "Clinical Notes", + "type": "object", + + "properties": { + "date": { + "description": "Date", + "type": "string", + "format": "date" + }, + "time": { + "description": "Time", + "type": "string", + "format": "time" + }, + "status": { + "description": "Status", + "type": "string" + }, + "bp": { + "description": "Blood Pressure", + "type": "string" + }, + "pr": { + "description": "Pulse", + "type": "integer" + }, + "rr": { + "description": "Respiratory Rate", + "type": "integer" + }, + "spo2": { + "description": "SpO2", + "type": "integer" + }, + "chest": { + "description": "Chest Findings", + "type": "string" + } + }, + "required": ["date","time"] +} diff --git a/lib/db.php b/lib/db.php index 67482ab..5c438b8 100644 --- a/lib/db.php +++ b/lib/db.php @@ -43,15 +43,30 @@ class DB extends SQLite3 { $stmt->bindValue(":pid", $pid); $stmt->execute(); } - function addClinical($post, $pid){ - $stmt=$this->prepare("INSERT INTO clinical (pid, time, data) VALUES (:pid, :time, :data);"); + function addPhysician($post, $pid){ + $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(); } - function editClinical($post, $pid, $id){ - $stmt=$this->prepare("UPDATE clinical SET time=:time,data=:data WHERE pid=:pid AND rowid=:id;"); + function editPhysician($post, $pid, $id){ + $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(); + } + function addNursing($post, $pid){ + $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(); + } + function editNursing($post, $pid, $id){ + $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"])); @@ -203,8 +218,10 @@ class DB extends SQLite3 { return($result); } function getData($pid, $id, $cat){ - if($cat=="clinical"){ - $stmt=$this->prepare("SELECT data FROM clinical WHERE pid=:pid AND rowid=:id;"); + if($cat=="physician"){ + $stmt=$this->prepare("SELECT data FROM physician WHERE pid=:pid AND rowid=:id;"); + } elseif($cat=="nursing"){ + $stmt=$this->prepare("SELECT data FROM nursing WHERE pid=:pid AND rowid=:id;"); } elseif($cat=="reports"){ $stmt=$this->prepare("SELECT data FROM reports WHERE pid=:pid AND rowid=:id;"); } else{ @@ -216,8 +233,10 @@ class DB extends SQLite3 { return($result); } function getAllData($pid, $cat){ - if($cat=="clinical"){ - $stmt=$this->prepare("SELECT rowid,data FROM clinical WHERE pid=:pid;"); + if($cat=="physician"){ + $stmt=$this->prepare("SELECT rowid,data FROM physician WHERE pid=:pid;"); + } elseif($cat=="nursing"){ + $stmt=$this->prepare("SELECT rowid,data FROM nursing WHERE pid=:pid;"); } elseif($cat=="reports"){ $stmt=$this->prepare("SELECT rowid,data FROM reports WHERE pid=:pid;"); } elseif($cat=="info"){ diff --git a/nursing.php b/nursing.php new file mode 100644 index 0000000..8955a19 --- /dev/null +++ b/nursing.php @@ -0,0 +1,42 @@ +editNursing($_POST, $pid, $_GET["id"]); + } + else{ + $db->addNursing($_POST, $pid); + } + //header("Location: view.php?id=".$_GET["id"]); + //exit(); + } + if(isSet($_GET["id"])){ + $form=schema2form("forms/nursing.schema.json", $pid, $_GET["id"], "clinical"); + } + else{ + $form=schema2form("forms/nursing.schema.json"); + } +} +?> + + + + + Nursing Notes + + +
+ + +
+ + + diff --git a/physician.php b/physician.php new file mode 100644 index 0000000..941c16d --- /dev/null +++ b/physician.php @@ -0,0 +1,42 @@ +editPhysician($_POST, $pid, $_GET["id"]); + } + else{ + $db->addPhysician($_POST, $pid); + } + //header("Location: view.php?id=".$_GET["id"]); + //exit(); + } + if(isSet($_GET["id"])){ + $form=schema2form("forms/physician.schema.json", $pid, $_GET["id"], "clinical"); + } + else{ + $form=schema2form("forms/physician.schema.json"); + } +} +?> + + + + + Physician Notes + + +
+ + +
+ + + diff --git a/schema.sql b/schema.sql index bf3dc2e..b745a8c 100644 --- a/schema.sql +++ b/schema.sql @@ -1,8 +1,4 @@ -CREATE TABLE clinical( -pid int, -time int, -data text -); + CREATE TABLE death( pid int, time int, @@ -17,6 +13,11 @@ frequency text, duration text, addl text ); +CREATE TABLE nursing( +pid int, +time int, +data text +); CREATE TABLE patients( pid int unique, name text, @@ -32,6 +33,11 @@ bed int, data text, history text ); +CREATE TABLE physician( +pid int, +time int, +data text +); CREATE TABLE reports( pid int, time int, diff --git a/view.php b/view.php index 1d26146..a107381 100644 --- a/view.php +++ b/view.php @@ -7,16 +7,21 @@ if(empty($_SESSION["user"])){ exit(); } $info=""; -$clinical=[]; +$physician=[]; +$nursing=[]; $reports=[]; if(isSet($_GET["pid"])){ $pid=$_GET["pid"]; $status=$db->getStatus($pid)->fetchArray()["status"]; $info=viewData($db->getAdmission($pid)->fetchArray()["data"]); $history=viewData($db->getHistory($pid)->fetchArray()["history"]); - $clinicalArray=$db->getAllData($pid, "clinical"); - while($c=$clinicalArray->fetchArray()){ - array_push($clinical, viewData($c["data"], "clinical.php?pid=".$pid."&id=".$c["rowid"])); + $physicianArray=$db->getAllData($pid, "physician"); + while($c=$physicianArray->fetchArray()){ + array_push($physician, viewData($c["data"], "physician.php?pid=".$pid."&id=".$c["rowid"])); + } + $nursingArray=$db->getAllData($pid, "nursing"); + while($c=$nursingArray->fetchArray()){ + array_push($nursing, viewData($c["data"], "nursing.php?pid=".$pid."&id=".$c["rowid"])); } $reportsArray=$db->getAllData($pid, "reports"); while($r=$reportsArray->fetchArray()){ @@ -37,7 +42,8 @@ if(isSet($_GET["pid"])){
Edit Information Edit History - Add Clinical Note + Add Physician Note + Add Nursing Note Add Laboratory Report
@@ -50,7 +56,10 @@ if(isSet($_GET["pid"])){ History +