From 99ffec7a570478d3dac66ae2c9ca5b7172e7e6f5 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Sat, 22 May 2021 16:08:12 +0530 Subject: [PATCH] Added Archive --- access.json | 9 +++++++++ lib/db.php | 9 ++++++++- www/archive.php | 31 +++++++++++++++++++++++++++++++ www/index.php | 5 +++-- www/treatment.php | 8 +++++++- www/view.php | 32 +++++++++++++++++++------------- 6 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 www/archive.php diff --git a/access.json b/access.json index a64b0b6..8136e38 100644 --- a/access.json +++ b/access.json @@ -1,4 +1,13 @@ { + "archive": { + "admin": "all", + "visiting": "all", + "resident": "all", + "nursing": "view", + "lab": "view", + "tech": "view", + "clerk": "view" + }, "info": { "admin": "all", "visiting": "all", diff --git a/lib/db.php b/lib/db.php index 8f7c4a8..df9589a 100644 --- a/lib/db.php +++ b/lib/db.php @@ -347,7 +347,14 @@ class DB extends SQLite3 { function getPatientList(){ global $log; if(!checkAccess("info", "dbGet")) return false; - $stmt=$this->prepare("SELECT pid,ward,bed,name,diagnosis FROM patients;"); + $stmt=$this->prepare("SELECT pid,ward,bed,name,diagnosis,status FROM patients;"); + $result=$stmt->execute(); + return($result); + } + function getAdmittedPatientList(){ + global $log; + if(!checkAccess("info", "dbGet")) return false; + $stmt=$this->prepare("SELECT pid,ward,bed,name,diagnosis FROM patients WHERE status='admitted';"); $result=$stmt->execute(); return($result); } diff --git a/www/archive.php b/www/archive.php new file mode 100644 index 0000000..1ebfe0a --- /dev/null +++ b/www/archive.php @@ -0,0 +1,31 @@ +getPatientList(); +$showList=""; +while($arr=$list->fetchArray()){ + $pid=$arr["pid"]; + $showList=$showList."".$pid."".$arr["name"]."".$arr["diagnosis"]."".$arr["status"].""; +} +?> + + + + + View Info + + +
+ +
+
+

Patient Archive

+ + + +
Patient IDNameDiagnosisStatus
+
+
+
+ + + diff --git a/www/index.php b/www/index.php index fdbe484..05d46f2 100644 --- a/www/index.php +++ b/www/index.php @@ -1,10 +1,10 @@ getPatientList(); +$list=$db->getAdmittedPatientList(); $showList=""; while($arr=$list->fetchArray()){ $pid=$arr["pid"]; - $showList=$showList."".$pid."".$arr["ward"]."-".$arr["bed"]."".$arr["name"]."".$arr["diagnosis"].""; + $showList=$showList."".$pid."".$arr["ward"]."-".$arr["bed"]."".$arr["name"]."".$arr["diagnosis"].""; } $reqs=$db->getRequisitionList(); $showReqs=""; @@ -41,6 +41,7 @@ while($arr=$reqs->fetchArray()){ Add New Patient + Archive
diff --git a/www/treatment.php b/www/treatment.php index 62e31c1..96e879c 100644 --- a/www/treatment.php +++ b/www/treatment.php @@ -45,6 +45,12 @@ if(!empty($_GET["pid"])){ } $view=$view.""; $form=schema2form("forms/drugs.schema.json"); + if(checkAccess("treatment")=="all" && $db->getStatus($pid)->fetchArray()["status"]=="admitted"){ + $hideForm=""; + } + else{ + $hideForm="style='display:none'"; + } } ?> @@ -73,7 +79,7 @@ if(!empty($_GET["pid"])){
-
> +
>
diff --git a/www/view.php b/www/view.php index 6361fc8..a83dfbf 100644 --- a/www/view.php +++ b/www/view.php @@ -22,6 +22,12 @@ if(isSet($_GET["pid"])){ } $status=$db->getStatus($pid)->fetchArray()["status"]; + if($status!="admitted"){ + $archive="disabled"; + } + else{ + $archive=""; + } $info=viewData($db->getAdmissionData($pid)->fetchArray()["data"]); $history=viewData($db->getHistory($pid)->fetchArray()["history"]); $physicianArray=$db->getAllData($pid, "physician"); @@ -60,33 +66,33 @@ if(isSet($_GET["pid"])){ Treatment
> - Add Physician Note + Add Physician Note
> - Add Nursing Note + Add Nursing Note
> - Add Requisition + Add Requisition
-
class="mb-2 col-md-2" id="discharge" > - Discharge + -
class="mb-2 col-md-2" id="death" > - Death +
> + Death
@@ -123,7 +129,7 @@ if(isSet($_GET["pid"])){
-

Transfer

+

Transfer

@@ -144,7 +150,7 @@ if(isSet($_GET["pid"])){
-

Print Data

+

Print Data

-- 2.39.5