+++ /dev/null
-<?php
-require("lib/db.php");
-require("lib/functions.php");
-session_start();
-if(empty($_SESSION["user"])){
- header("Location: login.php");
- exit();
-}
-if(!empty($_GET["pid"])){
- $pid=$_GET["pid"];
- if(!empty($_POST["date"]) && !empty($_POST["time"])){
- if(!empty($_GET["id"])){
- $db->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");
- }
-}
-?>
-<!DOCTYPE html>
-<html>
- <head>
- <?php include("lib/head.php");?>
- <title>Clinical Notes</title>
- </head>
- <body>
- <div class="container">
- <?php echo getInfo($pid);?>
- <?php echo $form;?>
- </div>
- <?php include("lib/foot.php");?>
- </body>
-</html>
+++ /dev/null
-{
- "$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"]
-}
--- /dev/null
+{
+ "$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"]
+}
--- /dev/null
+{
+ "$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"]
+}
$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"]));
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{
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"){
--- /dev/null
+<?php
+require("lib/db.php");
+require("lib/functions.php");
+session_start();
+if(empty($_SESSION["user"])){
+ header("Location: login.php");
+ exit();
+}
+if(!empty($_GET["pid"])){
+ $pid=$_GET["pid"];
+ if(!empty($_POST["date"]) && !empty($_POST["time"])){
+ if(!empty($_GET["id"])){
+ $db->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");
+ }
+}
+?>
+<!DOCTYPE html>
+<html>
+ <head>
+ <?php include("lib/head.php");?>
+ <title>Nursing Notes</title>
+ </head>
+ <body>
+ <div class="container">
+ <?php echo getInfo($pid);?>
+ <?php echo $form;?>
+ </div>
+ <?php include("lib/foot.php");?>
+ </body>
+</html>
--- /dev/null
+<?php
+require("lib/db.php");
+require("lib/functions.php");
+session_start();
+if(empty($_SESSION["user"])){
+ header("Location: login.php");
+ exit();
+}
+if(!empty($_GET["pid"])){
+ $pid=$_GET["pid"];
+ if(!empty($_POST["date"]) && !empty($_POST["time"])){
+ if(!empty($_GET["id"])){
+ $db->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");
+ }
+}
+?>
+<!DOCTYPE html>
+<html>
+ <head>
+ <?php include("lib/head.php");?>
+ <title>Physician Notes</title>
+ </head>
+ <body>
+ <div class="container">
+ <?php echo getInfo($pid);?>
+ <?php echo $form;?>
+ </div>
+ <?php include("lib/foot.php");?>
+ </body>
+</html>
-CREATE TABLE clinical(
-pid int,
-time int,
-data text
-);
+
CREATE TABLE death(
pid int,
time int,
duration text,
addl text
);
+CREATE TABLE nursing(
+pid int,
+time int,
+data text
+);
CREATE TABLE patients(
pid int unique,
name text,
data text,
history text
);
+CREATE TABLE physician(
+pid int,
+time int,
+data text
+);
CREATE TABLE reports(
pid int,
time int,
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()){
<div class="card-body">
<a class="mb-3 btn btn-secondary" href="admission.php?pid=<?php echo $pid;?>">Edit Information</a>
<a class="mb-3 btn btn-secondary" href="history.php?pid=<?php echo $pid;?>">Edit History</a>
- <a class="mb-3 btn btn-secondary" href="clinical.php?pid=<?php echo $pid;?>">Add Clinical Note</a>
+ <a class="mb-3 btn btn-secondary" href="physician.php?pid=<?php echo $pid;?>">Add Physician Note</a>
+ <a class="mb-3 btn btn-secondary" href="nursing.php?pid=<?php echo $pid;?>">Add Nursing Note</a>
<a class="mb-3 btn btn-secondary" href="laboratory.php?pid=<?php echo $pid;?>">Add Laboratory Report</a>
</div>
</div>
<a class="nav-link" id="history-tab" data-toggle="tab" href="#history" role="tab" aria-controls="history" aria-selected="false">History</a>
</li>
<li class="nav-item" role="presentation">
- <a class="nav-link" id="clinical-tab" data-toggle="tab" href="#clinical" role="tab" aria-controls="clinical" aria-selected="false">Clinical Notes</a>
+ <a class="nav-link" id="physician-tab" data-toggle="tab" href="#physician" role="tab" aria-controls="physician" aria-selected="false">Physician Notes</a>
+ </li>
+ <li class="nav-item" role="presentation">
+ <a class="nav-link" id="nursing-tab" data-toggle="tab" href="#nursing" role="tab" aria-controls="clinical" aria-selected="false">Nursing Notes</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="report-tab" data-toggle="tab" href="#report" role="tab" aria-controls="report" aria-selected="false">Lab Reports</a>
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="history-tab">
<?php echo $history;?>
</div>
- <div class="tab-pane fade" id="clinical" role="tabpanel" aria-labelledby="clinical-tab">
- <?php foreach($clinical as $c) echo $c;?>
+ <div class="tab-pane fade" id="physician" role="tabpanel" aria-labelledby="physician-tab">
+ <?php foreach($physician as $p) echo $p;?>
+ </div>
+ <div class="tab-pane fade" id="nursing" role="tabpanel" aria-labelledby="nursing-tab">
+ <?php foreach($nursing as $n) echo $n;?>
</div>
<div class="tab-pane fade" id="report" role="tabpanel" aria-labelledby="report-tab">
<?php foreach($reports as $r) echo $r;?>